Documents

Upload a document

Changed on

Upload a document.<br /><br />Uploaded files must be linked to a service within 30 minutes or they will be automatically deleted.

post/documents

Request

  • Base URL: https://api.telnyx.com/v2
  • URL: https://api.telnyx.com/v2/documents
  • Auth: HTTP bearer

Request body

urlstring

If the file is already hosted publicly, you can provide a URL and have the documents service fetch it for you.

filestring byte

Alternatively, instead of the URL you can provide the Base64 encoded contents of the file you are uploading.

filenamestring

The filename of the document.

customer_referencestring

A customer reference string for customer look ups.

Example request

{
  "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "file": "ZXhhbXBsZSBvZiBlbmNvZGVkIGNvbnRlbnQ=",
  "filename": "test-document.pdf",
  "customer_reference": "MY REF 001"
}

Response

Successful response

Example response

{
  "data": {
    "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "record_type": "document",
    "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",
    "av_scan_status": "scanned"
  }
}

Changes

    • breaking

      the // response's property type changed from integer to string, and format from int32 to no format for status

    • breaking

      the // response's property type changed from integer to string, and format from int32 to no format for status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • breaking

      the // response's property type changed from string to integer, and format from no format to int32 for status

    • breaking

      the // response's property type changed from string to integer, and format from no format to int32 for status