Ir al contenido

Upload a document to an operation

POST
/v1/rental/operations/{id}/documents
curl --request POST \
--url https://integrador.avalisto.com/v1/rental/operations/example/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "type": "payslip", "fileName": "payslip.pdf", "fileBase64": "JVBERi0xLjQK..." }'

PDF, DOC or DOCX up to 8 MB, base64. Accepted while the operation is under review, except the rental contract.

id
required
string

Operation id

Media typeapplication/json
object
type
required

One of product.requirements.documentTypes

string

Example

payslip
fileName
required

File name with extension (pdf, doc, docx)

string

Example

payslip.pdf
fileBase64
required

File content, base64. Max 8 MB

string

Example

JVBERi0xLjQK...
Media typeapplication/json
object
documents
required

Documents uploaded to the operation

Array<object>
object
id
required

Identifier

string
type
required

Document type

string
fileName
required

File name

string
uploadedAt
required

Upload date (ISO 8601, UTC)

string

Example

{
"documents": [
{
"type": "payslip",
"fileName": "payslip.pdf",
"uploadedAt": "2027-01-01T10:00:00.000Z"
}
]
}

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"
}
]
}
}