CharterOpsCharterOps

API reference

Client files

Keep a document on a client you sent once, to copy onto each of their trip requests, and list or remove it. A file is never read back through the API.

List a client's files

GET/v1/clients/{id}/files

Scope
read
Quota
Counts toward your allowance

Path parameters

  • idUUIDRequired

Response

200 OK

Returns an array of record file objects.

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 422 Unprocessable content
  • 429 Too many requests

Example request

curl "https://api.charterops.com/v1/clients/$ID/files" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY"

Add a file to a client

POST/v1/clients/{id}/files

Scope
write
Quota
Counts toward your allowance

Path parameters

  • idUUIDRequired

Headers

  • Idempotency-KeystringRequired

    1 to 200 characters.

Request body

  • filefileRequired

Response

201 Created

Returns the record file object.

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 409 Conflict
  • 413 Content too large
  • 415 Unsupported media type
  • 422 Unprocessable content
  • 429 Too many requests
  • 503 Service unavailable

Example request

curl --request POST "https://api.charterops.com/v1/clients/$ID/files" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY" \
  --header "Idempotency-Key: $(uuidgen)" \
  --form "file=@file.pdf"

Remove a client's file

DELETE/v1/clients/{id}/files/{file_id}

Scope
write
Quota
Counts toward your allowance

Path parameters

  • idUUIDRequired

  • file_idUUIDRequired

Response

204 No content

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 422 Unprocessable content
  • 429 Too many requests

Example request

curl --request DELETE "https://api.charterops.com/v1/clients/$ID/files/$FILE_ID" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY"

Objects

Record file

  • content_typestring

  • created_atdate-time

  • filenamestring

  • idUUID

  • size_bytesinteger

  • uploaded_byobjectCan be null

    3 fields in uploaded_by
    • avatar_urlstringCan be null

    • display_namestring

    • user_idUUIDCan be null

  • uploaded_by_key_namestringCan be null