DEVELOPER GUIDE

Upload and download media through the API

Upload original JPEG/PNG images, videos or LinkedIn documents, and transfer files privately through MCP.

Prepare the file

API and MCP uploads accept original JPEG and PNG images, unchanged H.264 MP4 videos, and PDF, DOC, DOCX, PPT or PPTX documents for LinkedIn. Documents must be at most 100,000,000 bytes and 300 pages. They are stored unchanged, checked for format, and downloaded as attachments; they do not receive AI alt descriptions. Images are prepared automatically when the upload completes: orientation is corrected, proportions are preserved without enlargement, source metadata is removed, and the result is saved as JPEG. Transparent areas become white. Source images must be 20 MB or smaller and contain at most 100 million pixels, with no side longer than 12,000 pixels. Animated PNGs are not supported. MP4 size must be strictly below 10,000,000 bytes. Read GET /capabilities for current image defaults, platform constraints and storage limits. The saved image defaults control output dimensions and JPEG quality.

Use the Node upload helper with Node 22.14 or newer. It uploads the original JPEG or PNG; Crickets performs image preparation automatically. Attach the returned media ID after its status is ready.

Example
# Run from the unzipped helper directory.
npm install sharp@0.35.4
# Set CRICKETS_API_TOKEN securely in your environment.
export CRICKETS_WORKSPACE_ID='WORKSPACE_ID'
node --experimental-strip-types scripts/api-upload.mjs '/path/to/photo.png'

Use the multipart flow

  1. Call POST /media/uploads with name, type (choose a MIME type returned by get_capabilities) and byte size. Save its media ID and part size.
  2. Upload sequential binary parts with PUT /media/{id}/parts/{number}. Retain the returned part number and ETag for each part.
  3. Call POST /media/{id}/complete with the ordered parts array.
  4. Wait for confirmed ready status before using the media ID in a post. Save alt text with PATCH /media/{id} and an alt field.

Completion validates type, dimensions, metadata, actual size and storage allowance. Invalid completion removes the invalid item; correct the source and start again. Referenced attachments are protected from library deletion.

Private downloads and MCP

REST downloads require authentication through GET /media/{id}/file. Media stays private.

For MCP uploads, call begin_media_upload, then send each binary part with HTTP PUT to the returned part_url_template, replacing {partNumber} with 1, 2, and so on. Set Authorization: Bearer <upload_ticket> and Content-Type: application/octet-stream. The returned upload_url is a base URL, not an endpoint for PUT.

Collect each response’s data.partNumber and data.etag. Call the MCP complete_media_upload tool, or send HTTP POST to the returned complete_url with the same ticket and a JSON parts array. Wait for confirmed ready status.

Each ticket expires after 15 minutes and works only for its specified media item and permitted operations. It stops working if the integration is revoked or loses account access; upload tickets also stop working after completion. Start a new upload if its ticket expires. Keep tickets and private URLs out of public logs.

Something unclear? Tell us what would help.