Amba

Media

Read media assets + upload user-owned media (avatars, user content).

Client uploads are scoped under <projectId>/user/<appUserId>/<ms>_<filename> in the storage path — they can't collide with admin-uploaded assets.

Source: apps/api/src/routes/client/media.ts.

Endpoints

MethodPathDescription
GET/client/media/:assetIdFetch a single asset (public columns).
GET/client/mediaPaginated asset list; optional ?folder_id=.
POST/client/media/uploadRegister an upload; returns upload_url.

GET /client/media/:assetId

Response 200

{
  "data": {
    "id": "…",
    "filename": "…",
    "mime_type": "image/png",
    "storage_url": "…",
    "thumbnail_url": null,
    "alt_text": null,
    "metadata": {}
  }
}

Errors

  • 404 NOT_FOUND.

Try it:

GET/client/media/%7B%7BassetId%7D%7D
client auth
curl -X GET 'https://api.amba.dev/client/media/%7B%7BassetId%7D%7D'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/media/{assetId}' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

GET /client/media

Query

ParamDefaultDescription
limit50
offset0
folder_idFilter.

Response 200

{
  "data": [{ "id": "…", "filename": "…", "storage_url": "…" }],
  "total": 42,
  "offset": 0,
  "limit": 50
}

Try it:

GET/client/media
client auth
curl -X GET 'https://api.amba.dev/client/media'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/media' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

POST /client/media/upload

Request

FieldTypeRequired
filenamestringyes
mime_typestringyes
size_bytesnumberno

Response 201

{
  "data": {
    "id": "…",
    "filename": "…",
    "storage_url": "https://storage.amba.dev/…",
    "uploaded_by": "<appUserId>"
  },
  "upload_url": "https://storage.amba.dev/…?upload=true"
}

Errors

  • 500 CREATE_FAILED.

Try it:

POST/client/media/upload
client auth
curl -X POST 'https://api.amba.dev/client/media/upload'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X POST '${BASE_URL}/client/media/upload' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

On this page