Ir al contenido

Create a credential

POST
/v1/credentials
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).

Media typeapplication/json
object
name
required

Name to recognise the credential in the list

string
>= 1 characters <= 64 characters

Example

Production integration
scopes
required

Permissions granted to the credential. There is no wildcard scope.

Array<string>
Allowed values: products:read rental:read rental:write home:read home:write community:read community:write portfolio:read account:read account:write

Example

[
"products:read",
"rental:read",
"rental:write"
]
environment

Credential environment. test credentials operate on the sandbox.

string
default: live
Allowed values: live test
expiresInDays

Days until expiry (default 365). Send null for a credential that never expires.

number
nullable

Example

365
companyId

Only for servicer accounts: id of a managed fund the credential is created for. Ignored for any other account.

string

Example

company-id
Media typeapplication/json
object
id
required

Credential id

string
name
required

Name given by the user

string
prefix
required

First characters of the token, to recognise it in a list

string
scopes
required

Permissions granted to the credential

Array<string>
Allowed values: products:read rental:read rental:write home:read home:write community:read community:write portfolio:read account:read account:write
status
required

Credential status

string
Allowed values: active revoked expired
environment
required

Environment of the credential

string
Allowed values: live test
createdAt
required

ISO 8601 UTC

string
expiresAt
required

Null = never expires

string
nullable
lastUsedAt
required

Null = never used

string
nullable
fundName

Only for servicer accounts: name of the fund the credential belongs to

string
nullable
token
required

The token in clear text. Returned only once; store it now.

string

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)

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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)

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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)

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

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

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Part of the contract.

string
message
required

Developer-oriented message in English

string
requestId
required

Correlation id; the same value as the X-Request-Id response header

string
details

Only for validation_error: which fields failed

Array<object>
object
field
required

Field that failed validation

string
issue
required

What is wrong with the field

string

Example

{
"error": {
"code": "validation_error",
"message": "Request validation failed",
"requestId": "3f6c2a0e-1b7d-4c55-9a52-2f6c1f0d9e11",
"details": [
{
"field": "monthlyRent",
"issue": "must be a positive number"
}
]
}
}