aimldocs

Media

file uploads referenced from requests

POST
/v1/media
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/media" \  -H "Content-Type: application/json" \  -d '{    "media_type": "image/png",    "filename": "chart.png"  }'
{  "id": "file_01J9ZK2K4Q7Q3M3QX1V0F1MED1",  "media_type": "image/png",  "size_bytes": 0,  "status": "pending",  "filename": "chart.png",  "created_at": "2026-09-14T10:00:00Z",  "expires_at": "2026-09-15T10:00:00Z",  "upload": {    "url": "https://api.ai.ml/v1/media/file_01J9ZK2K4Q7Q3M3QX1V0F1MED1",    "method": "PUT",    "direct": false,    "max_size": 20971520  }}
GET
/v1/media/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/media/string"
{  "id": "file_01J9ZK2K4Q7Q3M3QX1V0F1MED1",  "media_type": "image/png",  "size_bytes": 20480,  "status": "ready",  "created_at": "2026-09-14T10:00:00Z",  "uploaded_at": "2026-09-14T10:00:05Z",  "expires_at": "2026-09-15T10:00:00Z"}
DELETE
/v1/media/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

curl -X DELETE "https://example.com/v1/media/string"
Empty
PUT
/v1/media/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/octet-stream

TypeScript Definitions

Use the request body type in TypeScript.

body?file
Formatbinary

Response Body

application/json

application/json

curl -X PUT "https://example.com/v1/media/string" \  -H "Content-Type: application/octet-stream" \  -d 'string'
{  "id": "file_01J9ZK2K4Q7Q3M3QX1V0F1MED1",  "media_type": "image/png",  "size_bytes": 20480,  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",  "status": "ready",  "created_at": "2026-09-14T10:00:00Z",  "uploaded_at": "2026-09-14T10:00:05Z",  "expires_at": "2026-09-15T10:00:00Z"}