Skip to main content

Callbacks REST

REST API · openapi/partner-api/openapi.yaml · 1 callback

JobStatusChangedCallback​

POST{$request.body#/callback_url}

Job Status Change Callback

Callback notification sent when a job status changes.

The callback payload contains the complete Job object with updated status information. Partners can use this callback to track the status of their jobs and get notified when the job is complete.

Callback Payload Authentication​

To protect the payload of the callback from tampering in transit, SASHA provides a signature of the request payload using the HMAC-SHA256 algorithm. The Callback Secret that the Partner receives from SASHA is a 64-character hex string; the key for the HMAC-SHA256 algorithm is the 32 bytes it decodes to, not the hex characters themselves.

The request signature is calculated over a few fields concatenated together:

HMAC-SHA256(request_method || request_url || request_id || request_payload)

Where || is the concatenation operator without any separator or padding.

  • The request method is the HTTP method of the request in uppercase, e.g. POST.
  • The request url is the URL of the request without the fragment and query parameters.
  • The request id is the value of the SASHA-Request-ID header.
  • The request payload is the JSON request body.

The request signature is included in the SASHA-Request-Signature header.

The Callback Secret used to sign the request payload is identified by its Callback Secret ID, returned in the SASHA-Callback-Secret-ID header. Use this header to look up the matching signing key when you have more than one Callback Secret configured (for example, during a key rotation). You can also pin a specific Callback Secret per job by passing callback_secret_id when submitting the job.

While validating the signature is not mandatory, SASHA recommends to do so to ensure the payload genuinely comes from SASHA and was not modified in transit.

Validating the request signature​

Your application should verify that the callback request is genuine and was sent by SASHA before responding to the request. This is important for securing sensitive data and protecting your application from abuse.

SASHA includes the request signature in the SASHA-Request-Signature HTTP header.

Example​

Here is an example of how to validate the request signature for the request below:

  • Callback Secret: 4f8a9b2c1d3e5f7081a2b3c4d5e6f7081928374655a6b7c8d9e0f1a2b3c4d5e6 (decode the hex to 32 bytes for the HMAC key)
  • Request method: POST
  • Request url: https://your-app.com/callbacks/sasha-job-update
  • Request id: aa-b-c-d-ee
  • Request payload: {"job_id":"44cab986-0385-470a-8e5c-c657b0543d19","type":"embed-signature","status":"completed","output_url":"https://storage.sasha.eu/1420f12bb0e7a31104f90311d6e","output_url_expires_at":"2026-01-01T13:00:00.000Z","signature_id":"340558932877813735","creator_id":1,"created_at":"2026-01-01T12:00:00.000Z","updated_at":"2026-01-01T12:00:02.000Z"}

The concatenated string would be:

POSThttps://your-app.com/callbacks/sasha-job-updateaa-b-c-d-ee{"job_id":"44cab986-0385-470a-8e5c-c657b0543d19","type":"embed-signature","status":"completed","output_url":"https://storage.sasha.eu/1420f12bb0e7a31104f90311d6e","output_url_expires_at":"2026-01-01T13:00:00.000Z","signature_id":"340558932877813735","creator_id":1,"created_at":"2026-01-01T12:00:00.000Z","updated_at":"2026-01-01T12:00:02.000Z"}

The request signature is 8c37da02969bcc8fc9392a1e4ffac332a0c7248df7301a2484f2d40d4822db2d.

Request Identification​

Each callback delivery includes a unique SASHA-Request-ID header that you can use for tracking, debugging, and ensuring idempotency.

Header notes

SASHA-Callback-Secret-ID

Identifier of the Callback Secret that was used to sign this callback request.

Use it to look up the matching signing key when validating the SASHA-Request-Signature. This is how SASHA tells you which of your configured Callback Secrets was selected — either the one you pinned via callback_secret_id on the original job, or the one SASHA chose automatically when no ID was provided.

A job with a callback needs an enabled Callback Secret, so the header names one of your Callback Secrets.

If you only have a single Callback Secret configured, you can ignore this header.

SASHA-Request-Signature

HMAC-SHA256 signature of the request payload.

See https://developer.sasha.eu/partner-api/api-reference/rest/Callbacks/#callback-payload-authentication

Authentication
No security scheme; see its headers

Headers

  • SASHA-Callback-Secret-IDstringrequired
    Identifier of the Callback Secret that was used to sign this callback request.
  • SASHA-Request-Signaturestringrequired
    HMAC-SHA256 signature of the request payload.
  • SASHA-Request-IDstringrequired
    Unique identifier for this callback delivery request

Request body

application/jsonJob
  • job_idstringrequired
    The ID of the job
  • typeJobTyperequired
  • statusJobStatusrequired
  • errorJobErroroptional
    The error that occurred while processing the job, if the job status is failed
  • output_urlstringoptional
    The URL of the result media file (only populated if job status is completed and type is embed-signature)
  • output_url_expires_atstring (date-time)optional
    The date and time the output URL will expire
  • signature_idSignatureID | nulloptionalnullable
    The Signature identifier (populated when job status is completed). Will be null if no signature was found in the media.
  • creator_idinteger (uint32)optional0..4294967295
    The CreatorID of the business entity that owns the signature in signature_id (populated exactly when signature_id holds a value). For an embed-signature job, this is the CreatorID of the Partner that submitted the job. For a lookup-signature job, this is the CreatorID of the found signature's owner.
  • guidanceGuidanceoptional
    SASHA-evaluated distribution guidance for the found signature (populated when job status is completed, type is lookup-signature, and an active signature was found). A signature without a Record yields guidance with the private share state.
  • recordRecordoptional
    A field-filtered Record for the found signature. Populated only when job status is completed, type is lookup-signature, an active signature was found, and the partner either owns the signature or has at least one field disclosed to it by the owner. The owning partner receives the full Record; any other partner receives only the fields the owner has granted to it or marked public. Absent for a partner with no such field, and never present for revoked signatures.
  • warningsarray<JobWarning>optional
    What the job left out of its result, or where the result differs from the input, without failing (only populated if job status is completed and type is embed-signature). Empty or absent when there is nothing to report. The protected media was still produced; each warning names what was left out or what differs from the input. A failed job reports its cause in error instead.
  • created_atstring (date-time)required
    The date and time the job was created
  • updated_atstring (date-time)required
    The date and time the job was last updated

Responses

What the receiving endpoint answers.

  • 200Callback received successfully
  • 201Callback received successfully
  • 202Callback received successfully
  • 204Callback received successfully
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 500Internal server error
  • 502Bad gateway
  • 503Service unavailable
  • 504Gateway timeout