Authorizations API
This API allows managing authorizations in the system. It provides endpoints to create, read, update, and delete authorizations, as well as to handle signatures and attachments associated with the authorizations.
The Authorization Object
The Authorization object represents an authorization in the system.
Attributes
| Attribute | Description | Type |
|---|---|---|
| id | Unique identifier of the authorization | String |
| tenant | Tenant identifier | String |
| formId | Associated form ID (optional) | String |
| key | Key identifying the type of authorization | String |
| label | Descriptive label of the authorization | String |
| identityKey | Signer's identity key | String |
| identityValue | Signer's identity value | String |
| borrowerId | Associated borrower's ID (optional) | String |
| expiresAt | Expiration date and time | String (ISO 8601) |
| ipAddress | IP address from where the authorization was created | String |
| policyLink | Link to the associated policy (optional) | String |
| externalId | External identifier (optional) | String |
| tags | Tags associated with the authorization | Array of String |
| authorizedAt | Authorization date and time | String (ISO 8601) |
| createdAt | Creation date and time | String (ISO 8601) |
| updatedAt | Last update date and time | String (ISO 8601) |
| hasAttachments | Indicates if the authorization has attachments | Boolean |
| hasSignatures | Indicates if the authorization has signatures | Boolean |
| hasSignatureEvidences | Indicates if the authorization has signature evidence records (see Signature Evidence) | Boolean |
Signature Evidence
Signing an authorization leaves an evidence record on it, saying how it was signed and with what.
The records travel inside the Authorization object, in signatureEvidences, next to the hasSignatureEvidences flag. Anyone reading an authorization reads its evidence too, so treat it as you would any other personal data the object carries. They are also read by the public signature verification page, which compares the PDF against the stored hash and shows the evidence to whoever holds the signed file, and by Chat, on the authorization sheet.
evidenceType says which kind of record it is. An evidence saved before this field existed does not carry it, and is an OTP signature -- the only kind there was.
evidenceType | What it records |
|---|---|
otp (default) | OTP signature with QR through the AltScore provider (see Document Verifications): the PDF hash, the signing time, and the context from which the OTP was verified. |
verification | An identity verification -- liveness check or face match -- that the flow used to sign. It records that the verification happened, its provider, its type, its result and the similarity the provider reported. It deliberately carries no biometric image and no identity number. |
form_submission | Consent given by submitting a form, with the response id and the message it came in. |
A record looks like this:
Evidence Attributes
Context fields depend on the conversation channel. All of them are optional: a signature without context is recorded anyway, with those fields set to null.
| Attribute | Description | Web | |
|---|---|---|---|
| signatureId | Signature identifier (the same one stamped in the QR) | Yes | Yes |
| documentHash | Hash of the signed PDF, per hashAlgorithm (SHA-256) | Yes | Yes |
| otpProvider | Provider that delivered the code, per otpChannel: sendgrid (email), twilio (phone), meta (whatsapp) | Yes | Yes |
| otpChannel | How the code was delivered (email, phone, whatsapp) | Yes | Yes |
| signatureType | Signature type (simple) | Yes | Yes |
| signedAt | Signing date and time (ISO 8601 with UTC offset) | Yes | Yes |
| channel | Conversation channel at signing time (web, whatsapp, email) | web | whatsapp |
| ip | Customer's IP address at signing time | Yes | null |
| userAgent | Browser and operating system | Yes | null |
| device | Platform and screen size | Yes | null |
| timezone | Browser time zone | Yes | null |
| locale | Browser language | Yes | null |
| whatsappMessageId | ID of the WhatsApp message that verified the OTP | null | Yes |
| otpVerifiedFrom | Client context frozen when the OTP was verified | Object with ip, userAgent, acceptLanguage, timezone, locale, platform, screen, capturedAt | { "whatsappMessageId": "..." } |
| signerIdentity | key and value of the identity the signature was made with | Yes | Yes |
| consentVersion | Version of the accepted policy, if the authorization has one | If present | If present |
The SAT authorization (web forms) appends records to the same list with a different shape: evidence_type: form_submission, channel, message_id, form_response_id and captured_at. The table above describes the AltScore OTP signature only.
IP, user agent and device are the customer's personal data. They are stored on the authorization and shown in Chat and on the public signature verification page to whoever holds the signed PDF. The tenant handles them under its own data policy.
Available Operations
Create a New Authorization
Creates a new authorization in the system.
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| tenant | Tenant identifier | String | Yes |
| key | Key identifying the type of authorization | String | Yes |
| identityKey | Signer's identity key | String | Yes |
| identityValue | Signer's identity value | String | Yes |
| formId | Associated form ID | String | No |
| borrowerId | Associated borrower's ID | String | No |
| ipAddress | IP address from where the authorization is created | String | No |
| policyLink | Link to the associated policy | String | No |
| externalId | External identifier | String | No |
| tags | Tags associated with the authorization | Array of String | No |
Example Request:
Successful Response:
Retrieve an Authorization
Retrieves the information of a specific authorization.
Path Parameters:
| Parameter | Description |
|---|---|
| authorization_id | ID of the authorization to retrieve |
Successful Response:
The response will be a complete Authorization object, as described above.
Delete an Authorization
Deletes an authorization from the system.
Path Parameters:
| Parameter | Description |
|---|---|
| authorization_id | ID of the authorization to delete |
Successful Response:
Status code 204 (No Content) if the deletion was successful.
Sign an Authorization
Initiates the signing process of an authorization by sending an OTP.
Path Parameters:
| Parameter | Description |
|---|---|
| authorization_id | ID of the authorization to sign |
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| value | Contact value to send the OTP | String | Yes |
| contactMethod | Contact method (email, sms, etc.) | String | Yes |
| templateId | Template ID for the OTP message | String | Yes |
| codeSize | OTP code size | Integer | No |
| expiresIn | OTP expiration time in seconds | Integer | No |
| maxAttempts | Maximum number of allowed attempts | Integer | No |
Example Request:
Successful Response:
Verify Authorization Signature
Verifies the OTP code to complete the signing of an authorization.
Path Parameters:
| Parameter | Description |
|---|---|
| authorization_id | ID of the authorization to verify |
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| otpId | Previously received OTP ID | String | Yes |
| code | OTP code entered by the user | String | Yes |
Example Request:
Successful Response:
Status code 202 (Accepted) if the verification was successful.
List Authorizations
Retrieves a paginated list of authorizations with filtering and sorting options.
Query Parameters:
| Parameter | Description | Type |
|---|---|---|
| borrower-id | Borrower's ID to filter | String |
| search | Text to search in authorizations | String |
| page | Page number (default: 1) | Integer |
| per-page | Items per page (default: 10) | Integer |
| key | Filter by authorization key | String |
| sort-by | Field to sort by | String |
| sort-direction | Sorting direction (asc or desc) | String |
Successful Response:
The response will be a paginated list of Authorization objects.
Error Handling
The API may return the following error codes:
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Conflict |
| 500 | Internal Server Error |
Errors will include a descriptive message in the response body.