Files
Request an upload URL
Returns a pre-signed URL and a `file_id`. Upload your file via HTTP PUT to the returned `file_url`. Then poll `GET /files/{file_id}/status` until processing is complete, and attach the `file_id` to a message.
GET
/v1/files/signed-urlAuthorization
APIKeyHeader api-key<token>
In: header
Query Parameters
filename*Filename
File name including its extension (e.g. report.pdf).
persist?Persist
If true (default), the file is kept for reuse. If false, it is removed after 24h.
Header Parameters
user-id*User-Id
ID of the end user the file belongs to.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/files/signed-url?filename=string" \ -H "user-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"expires_in": 600,
"file_id": "360d942f-d861-4611-b4b3-227278c9e709",
"file_limits": {
"allowed_types": [
"text/csv",
"text/plain",
"application/pdf",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
"max_size": 10485760
},
"file_url": "https://hg-ppi-s3-goatlab-dev-files..."
}{
"error_code": "attachment_document_raised_an_error",
"detail": "The file attachment service has raised an error. Please try again later"
}{
"error_code": "unauthorized",
"detail": "Missing or invalid API key"
}{
"error_code": "attachment_access_forbidden",
"detail": "You do not have permission to access this attachment."
}{
"error_code": "attachment_document_does_not_exist",
"detail": "Document with `file_id` is not available for the user with `user_id` on the document server."
}{
"error_code": "conflict",
"detail": "Conflict - File is infected with a virus or it's still being processed"
}{
"error_code": "attachment_url_invalid",
"detail": "The provided base_url is not valid."
}{
"message": "Rate limit exceeded!"
}{
"error_code": "internal_server_error",
"detail": "Internal Server Error"
}{
"error_code": "attachment_document_not_reachable",
"detail": "The file attachment service does not respond as expected. Please try again later."
}