Upload a document
POST/documents
Upload a document.
Uploaded files must be linked to a service within 30 minutes or they will be automatically deleted.
Request
- application/json
- multipart/form-data
Body
required
oneOf
Body
required
file binary
The file you are uploading.
customer_reference string
Optional reference string for customer tracking.
Responses
200: Successful response
- application/json
422: Unprocessable entity. Check the 'detail' field in response for details.
- application/json
default: Unexpected error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/documents' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
"filename": "test-document.pdf",
"customer_reference": "MY REF 001"
}'
Response samples
{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": true,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"content_type": "application/pdf",
"size": {
"unit": "bytes",
"amount": 123456
},
"status": "pending",
"sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
"filename": "test-document.pdf",
"customer_reference": "MY REF 001"
}
}
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}