API reference
The API’s base URL is https://api.formatjet.com/v1. These pages are generated from the OpenAPI 3.1 document, which you can also feed to a client generator.
Authentication
Section titled “Authentication”Send an API key from the dashboard as a bearer token:
Authorization: Bearer fj_live_…Each key has scopes: convert makes uploads and jobs, read reads jobs, usage and the account, webhooks manages webhook endpoints. Each endpoint’s page says which it needs. The catalog (/v1/formats, /v1/operations, /v1/pricing) needs no key. Keep keys on your servers: anyone holding one can spend your credits.
Conventions
Section titled “Conventions”- JSON in and out, with
snake_casefields and times in ISO 8601 (UTC). - IDs carry a prefix:
job_,up_,file_,wh_,evt_,dlv_. - Errors are problem documents with a stable
code. - Request IDs: every answer has a
FormatJet-Request-Idheader. - Lists page with
limitandcursor: pass the answer’snext_cursorback ascursor; it’snullon the last page. - Retries:
POSTrequests take anIdempotency-Key(limits and retries). - Rate limits are stated in
RateLimit-Policyon every keyed answer. - Costs: answers about a job carry
FormatJet-CreditsandFormatJet-Engine. - Versions:
/v1only changes in ways that don’t break clients: new endpoints, fields and error codes may appear, so ignore what you don’t know.
Endpoints
Section titled “Endpoints”Catalog
Formats, conversions, options and credit weights. No key needed.
- List formats:
GET /v1/formats - List conversions:
GET /v1/operations - Get pricing:
GET /v1/pricing
Account
The account, limits and usage behind an API key.
- Get usage:
GET /v1/usage - Get the account:
GET /v1/account
Jobs
Convert files: in one request (POST /v1/convert), or as a job you upload to, wait on and download from.
- Make an upload:
POST /v1/uploads - Make a job:
POST /v1/jobs - List jobs:
GET /v1/jobs - Estimate a job:
POST /v1/estimate - Convert a file:
POST /v1/convert - Get a job:
GET /v1/jobs/{id} - Delete a job’s files:
DELETE /v1/jobs/{id} - Stream a job’s events:
GET /v1/jobs/{id}/events - Cancel a job:
POST /v1/jobs/{id}/cancel - Download an output:
GET /v1/jobs/{id}/outputs/{n}
Recipes
Saved steps and an output name, run on files with recipe on a job. Pro and the API plans.
- Save a recipe:
POST /v1/recipes - List recipes:
GET /v1/recipes - Get a recipe:
GET /v1/recipes/{id} - Change a recipe:
PATCH /v1/recipes/{id} - Delete a recipe:
DELETE /v1/recipes/{id}
Webhooks
Endpoints that receive signed events when jobs end.
- Add an endpoint:
POST /v1/webhooks - List endpoints:
GET /v1/webhooks - Get the job-webhook secret:
GET /v1/webhooks/job-secret - Get an endpoint:
GET /v1/webhooks/{id} - Change an endpoint:
PATCH /v1/webhooks/{id} - Delete an endpoint:
DELETE /v1/webhooks/{id} - Rotate a secret:
POST /v1/webhooks/{id}/rotate-secret - List deliveries:
GET /v1/webhooks/{id}/deliveries - Replay an event:
POST /v1/webhooks/{id}/replay