Mint a short-lived token for the signed upload lane
Get a token for the signed resumable upload lane used by browser and desktop uploaders, valid for about 30 minutes and optionally scoped to one project. API clients should use POST /v1/media for a presigned PUT instead.
API key auth. Prefix cf_live_ for production orgs, cf_test_ for sandbox.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/uploads/token" \ -H "Content-Type: application/json" \ -d '{}'{ "token": "string", "expiresAt": -9007199254740991}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "x402Version": 2, "accepts": [ {} ], "error": "string"}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}Initiate a direct upload (presigned PUT URL) POST
Reserve a media id and get a presigned URL for uploading a local video, audio, or image file of up to 5 GiB. PUT the raw bytes to that URL, then call POST /v1/media/{id}/finalize to start processing.
Delete a media item DELETE
Delete a media item that is no longer needed. Refused with media_in_use, naming the projects and sessions involved, while anything still references it, so remove those references first.