Skip to main content
POST
/
v1
/
files
Create a file
curl --request POST \
  --url https://api.sandbox.trycollate.ai/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fileName": "<string>",
  "contentType": "application/pdf",
  "purpose": "authorization_attachment"
}
'
{
  "file": {
    "id": "<string>",
    "status": "pending_upload",
    "fileName": "<string>",
    "contentType": "application/pdf",
    "purpose": "authorization_attachment",
    "createdAt": "2023-11-07T05:31:56Z",
    "sizeBytes": 123,
    "completedAt": "2023-11-07T05:31:56Z",
    "downloadUrl": "<string>"
  },
  "upload": {
    "url": "<string>",
    "strategy": "single_put",
    "method": "PUT",
    "headers": {}
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.trycollate.ai/llms.txt

Use this file to discover all available pages before exploring further.

Upload the raw bytes to upload.url using the returned method and headers, then call Complete a file to mark the file ready. Until the file is ready, you cannot attach it to an authorization. File creation does not link the file to anything. Attach a ready file to an authorization with Attach a file.

Returns

Returns the pending file and a single-use upload target.

Authorizations

Authorization
string
header
default:your-api-key
required

API key passed as Authorization: Bearer <API_KEY>.

Body

application/json
fileName
string
required

Name of the file you plan to upload.

contentType
enum<string>
required

MIME type of the file bytes.

Available options:
application/pdf,
image/jpeg,
image/png
purpose
enum<string>
required

Use authorization_attachment for prior-auth supporting documents.

Available options:
authorization_attachment

Response

Successful Response

file
FileDto · object
required

Created file resource.

upload
SinglePutUpload · object
required

Upload target for the file bytes.