Files

Endpoints for uploading, listing, retrieving, downloading, moving, and deleting files in your team's media library.

List files

GET /files

List files in your team's media library.

Scope: files.lists

Description: Returns a paginated list of files for your team. API tokens are automatically scoped to their own team. Supports search and folder filtering.

Parameters

ParameterTypeDescription
limitnumberNumber of records per page
pagenumberPage number
sort_bystringField to sort by (default: created_at)
order_bystringSort direction (asc or desc)
qstringSearch query to filter files by name
folder_idstringUUID of a folder to filter files within

Request

curl "https://api.presscart.com/files?limit=20&page=1" \
  -H "Authorization: Bearer $PRESSCART_API_TOKEN"

Response

{
  "records": [
    {
      "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
      "name": "hero-banner.png",
      "file_key": "teams/11111111/hero-banner.png",
      "file_url": "https://cdn.presscart.com/teams/11111111/hero-banner.png?signed=...",
      "size": 245760,
      "mime_type": "image/png",
      "team_id": "11111111-1111-1111-1111-111111111111",
      "folder_id": null,
      "uploaded_by": "22222222-2222-2222-2222-222222222222",
      "created_at": "2026-03-15T10:00:00.000Z",
      "updated_at": "2026-03-15T10:00:00.000Z",
      "deleted_at": null
    }
  ],
  "total_records": 42,
  "total_pages": 3,
  "current_page": 1,
  "next_page": 2,
  "previous_page": null
}

Get file

GET /files/{file_id}

Retrieve a single file by ID.

Scope: files.read

Description: Returns a file record with a fresh signed URL for accessing the file. Accepts a UUID or a file key.

Path parameters

ParameterTypeDescription
file_idstringUUID or key of the file

Request

curl "https://api.presscart.com/files/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" \
  -H "Authorization: Bearer $PRESSCART_API_TOKEN"

Response

{
  "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
  "name": "hero-banner.png",
  "file_key": "teams/11111111/hero-banner.png",
  "file_url": "https://cdn.presscart.com/teams/11111111/hero-banner.png?signed=...",
  "size": 245760,
  "mime_type": "image/png",
  "team_id": "11111111-1111-1111-1111-111111111111",
  "folder_id": null,
  "uploaded_by": "22222222-2222-2222-2222-222222222222",
  "created_at": "2026-03-15T10:00:00.000Z",
  "updated_at": "2026-03-15T10:00:00.000Z",
  "deleted_at": null
}

Upload files

POST /files/upload

Upload one or more files to your team's media library.

Scope: files.create

Description: Upload 1–5 files via multipart/form-data. Accepted image types: jpg, jpeg, png, webp (max 5 MB). Accepted document types: docx, pdf, txt (max 25 MB). Optionally specify a folder_id to organize uploads.

Body (multipart/form-data)

FieldTypeRequiredDescription
filesFile or File[]YesOne or more files to upload
folder_idstringNoUUID of the folder to upload into

Request

curl -X POST "https://api.presscart.com/files/upload" \
  -H "Authorization: Bearer $PRESSCART_API_TOKEN" \
  -F "files=@hero-banner.png" \
  -F "files=@logo.jpg"

Response

{
  "files": [
    {
      "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
      "file_key": "teams/11111111/hero-banner.png",
      "file_url": "https://cdn.presscart.com/teams/11111111/hero-banner.png?signed=...",
      "name": "hero-banner.png",
      "size": 245760,
      "mime_type": "image/png",
      "folder_id": null
    },
    {
      "id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
      "file_key": "teams/11111111/logo.jpg",
      "file_url": "https://cdn.presscart.com/teams/11111111/logo.jpg?signed=...",
      "name": "logo.jpg",
      "size": 102400,
      "mime_type": "image/jpeg",
      "folder_id": null
    }
  ]
}

Download file

GET /files/{file_id}/download

Download a file's binary content.

Scope: files.read

Description: Returns the file binary with the appropriate Content-Type header. Use this to download files directly rather than using the signed URL.

Path parameters

ParameterTypeDescription
file_idstringUUID or key of the file

Request

curl -o hero-banner.png \
  "https://api.presscart.com/files/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/download" \
  -H "Authorization: Bearer $PRESSCART_API_TOKEN"

Response

Binary file content with the appropriate Content-Type header (e.g. image/png, application/pdf).


Move files

POST /files/move

Move one or more files to a folder (or back to root).

Scope: files.update

Description: Moves up to 50 files at once to a target folder. Set folder_id to null to move files back to the root level.

Body

FieldTypeRequiredDescription
file_idsstring[]YesArray of file UUIDs to move (1–50)
folder_idstring | nullYesTarget folder UUID, or null to move to root

Request

curl -X POST "https://api.presscart.com/files/move" \
  -H "Authorization: Bearer $PRESSCART_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "file_ids": [
      "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
      "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"
    ],
    "folder_id": "cccccccc-cccc-cccc-cccc-cccccccccccc"
  }'

Response

{
  "moved_count": 2
}

Delete file

DELETE /files/{file_id}

Delete a file from your team's media library.

Scope: files.delete

Description: Soft-deletes the file record. Accepts a UUID or file key.

Path parameters

ParameterTypeDescription
file_idstringUUID or key of the file

Request

curl -X DELETE "https://api.presscart.com/files/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" \
  -H "Authorization: Bearer $PRESSCART_API_TOKEN"

Response

{
  "success": true
}

On this page