Create a credential
const url = 'https://integrador.avalisto.com/v1/credentials';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Production integration","scopes":["products:read","rental:read","rental:write"],"environment":"live","expiresInDays":365,"companyId":"company-id"}'};
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://integrador.avalisto.com/v1/credentials \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Production integration", "scopes": [ "products:read", "rental:read", "rental:write" ], "environment": "live", "expiresInDays": 365, "companyId": "company-id" }'Creates an API token for your company. The token field is returned only in this response; it cannot be retrieved later. Requires a platform session (not an API credential).
Authorizations
Sección titulada «Authorizations»Request Bodyrequired
Sección titulada «Request Bodyrequired»object
Name to recognise the credential in the list
Example
Production integrationPermissions granted to the credential. There is no wildcard scope.
Example
[ "products:read", "rental:read", "rental:write"]Credential environment. test credentials operate on the sandbox.
Days until expiry (default 365). Send null for a credential that never expires.
Example
365Only for servicer accounts: id of a managed fund the credential is created for. Ignored for any other account.
Example
company-idResponses
Sección titulada «Responses»object
Credential id
Name given by the user
First characters of the token, to recognise it in a list
Permissions granted to the credential
Credential status
Environment of the credential
ISO 8601 UTC
Null = never expires
Null = never used
Only for servicer accounts: name of the fund the credential belongs to
The token in clear text. Returned only once; store it now.
Example
{ "id": "9f2c5c0a7d1e4b6f", "name": "Production integration", "prefix": "ava_live_ab1", "scopes": [ "products:read" ], "status": "active", "environment": "live", "createdAt": "2026-10-26T09:14:00.000Z", "expiresAt": "2027-10-26T09:14:00.000Z", "lastUsedAt": null, "token": "ava_live_EXAMPLEEXAMPLEEXAMPLEEXAMPLE12"}Invalid request (validation_error, invalid_cursor, missing_idempotency_key)
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Missing, invalid, expired or revoked credential
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Missing scope (forbidden_scope) or product not available (product_not_available)
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Resource not found (not_found)
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}Rate limit or daily quota exceeded; see Retry-After
object
object
Stable error code. Part of the contract.
Developer-oriented message in English
Correlation id; the same value as the X-Request-Id response header
Only for validation_error: which fields failed
object
Field that failed validation
What is wrong with the field
Example
{ "error": { "code": "validation_error", "message": "Request validation failed", "requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11", "details": [ { "field": "monthlyRent", "issue": "must be a positive number" } ] }}