Create Document from File

POST /documents/file

Create a document by uploading a file up to 100 MB in size.


Only these file types are allowed: txt, md, rtf, pdf, ppt, pptx, pptm, doc, docx, docm

application/json

Body

Responses

  • 200

    Request is accepted and a document will be created after the file is converted into readable format, which can take from couple minutes to up to an hour.

  • 422 application/json

    Request validation errors.

    Hide response attributes Show response attributes object
  • 429 application/json

    Reached limit for pending file imports. Try again after old imports are finished, or they timeout after an hour due to file conversion failures.

    Hide response attribute Show response attribute object
    • message string

      Default value is You have reached the limit of files that can be processed simultaneously. Please try again in few minutes..

POST /documents/file
curl \
 -X POST https://getcody.ai/api/v1/documents/file \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"folder_id":"string","key":"string"}'
Request example
{
  "folder_id": "string",
  "key": "string"
}
Response examples (422)
{
  "message": "string",
  "errors": {
    "folder_id": [
      "string"
    ],
    "key": [
      "string"
    ],
    "file_size": [
      "string"
    ],
    "file_name": [
      "string"
    ],
    "content_type": [
      "string"
    ]
  }
}
Response examples (429)
{
  "message": "You have reached the limit of files that can be processed simultaneously. Please try again in few minutes."
}