Create a signature
const url = 'https://mail.work.optidata.cloud/api/mail/signatures';const form = new FormData();form.append('signature', '{ "content": "example", "name": "example" }');form.append('attachments', '[ { "file": "binary", "url": "example", "disposition": "inline", "type": "example" } ]');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://mail.work.optidata.cloud/api/mail/signatures \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form 'signature={ "content": "example", "name": "example" }' \ --form 'attachments=[ { "file": "binary", "url": "example", "disposition": "inline", "type": "example" } ]'Create a signature for the authenticated user. Send it as
multipart/form-data when it embeds images: each entry of attachments
carries the file plus the placeholder url used inside signature.content,
which is rewritten to the stored image.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
HTML content of the signature.
Images embedded in the signature, at up to 10 MB each.
object
The placeholder URL used inside signature.content.
object
object
HTML content of the signature.
Images embedded in the signature, at up to 10 MB each.
object
The placeholder URL used inside signature.content.
Examples
{ "signature": { "name": "Work", "content": "<div>Jane Doe — Acme</div>" }}Responses
Section titled “ Responses ”The created signature.
A signature block appended to outgoing mail.
object
Stable identifier, used to address the signature.
HTML content.
Example
{ "hash": "39922fe6-7060-4932-bc32-eaf484adfd7a"}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The request tried to read or write the signatures of another user, which only an administrator may do.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Only administrators can manage signatures for other users."}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The conversations field is required.", "errors": { "conversation_ids": [ "The conversations field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}