The Image object

Every create, get, and update returns the same Image object; list and batch-update responses wrap it in an envelope, while batch delete wraps deletion tombstones. The two fields you’ll use most are url (the image’s direct CDN link) and sizes (ready-made responsive variants); the rest describe the image’s metadata and state.

On this page

Append query parameters to url (for example ?size=social for an OG card); the full list lives in Transformations.

json
{
  "id": "abc12345",
  "object": "image",
  "url": "https://test.src.img.pro/4j2/abc12345.jpg",
  "sizes": {
    "small": {
      "url": "https://test.src.img.pro/4j2/abc12345.jpg?size=s",
      "width": 426,
      "height": 320
    },
    "medium": {
      "url": "https://test.src.img.pro/4j2/abc12345.jpg?size=m",
      "width": 853,
      "height": 640
    },
    "large": {
      "url": "https://test.src.img.pro/4j2/abc12345.jpg?size=l",
      "width": 1440,
      "height": 1080
    }
  },
  "filename": "hero-shot.jpg",
  "format": "jpg",
  "width": 4000,
  "height": 3000,
  "bytes": 245678,
  "status": "ready",
  "published_at": "2024-01-01T00:00:00Z",
  "expires_at": null,
  "created_at": "2024-01-01T00:00:00Z",
  "caption": "Hero shot from launch day",
  "metadata": {},
  "labels": {},
  "nsfw": false
}

Fields

Every field is always present. When a value isn’t known or set, it’s null (or an empty {}), never omitted, so your code can read fields without existence checks.

id string
The image id (e.g. abc12345). Also its URL slug.
object "image"
Object type discriminator. Always "image".
url string
The image itself: a direct, embeddable CDN URL (e.g. https://test.src.img.pro/4j2/abc12345.jpg), and the link to use wherever you show or share the image. Anyone with it can load the image. Append transform parameters (format, w, h, q, …) to resize, convert, or otherwise change the served rendition.
sizes object
Responsive variants small, medium and large, aspect-preserved, each { url, width, height }. For a social/OG card, add ?size=social to url (see Transformations).
filename string
Original filename, for download UX; falls back to {id}.{format} when the upload had none.
format string
The output format, normalized: a stored HEIC serves as jpg, never heic. Useful for filenames or MIME-type guesses without an extra HEAD request.
width integer
Source width in pixels.
height integer
Source height in pixels.
bytes integer
Stored file size in bytes.
status "ready"
Every Image object is complete and servable. Creates return ready or fail in the request; blocked images are never returned as Image objects (see Lifecycle).
published_at string
Publish/display timestamp, ISO-8601 UTC (e.g. 2024-01-01T00:00:00Z). Never null: defaults to the upload time when omitted. Drives list ordering: GET /v1/images sorts by it, newest first, so it is backdatable (a 2024 photo uploaded later still sorts under 2024) and re-stamping moves the item to the head of the list. Set on create or PATCH via the published_at input (a unix timestamp or ISO-8601 date; inputs are lenient, output is always ISO-8601 UTC).
expires_at string|null
Auto-delete timestamp, ISO-8601 UTC. null = permanent.
created_at string
Upload timestamp, ISO-8601 UTC (e.g. 2024-01-01T00:00:00Z).
caption string|null
Your free-text caption / description. null when unset.
metadata object
Your custom fields, an open string→string map (author, license, source_url, tool, title, …), nested so they can never collide with a core field. May be {}. Limits: at most 50 keys, keys up to 64 chars, values up to 1024 chars (exceeding any → 422 validation_error).
labels object
Your selector labels, the queryable sibling of metadata: a small string→string map you filter a list on with ?label[key]=value, equality and IN (see the API reference). May be {}. Limits: at most 20 keys, key ^[a-z0-9_.-]{1,64}$, values up to 128 chars, no commas or surrounding whitespace (exceeding any → 422 validation_error). Written nested with merge and null-clear, exactly like metadata.
nsfw boolean
true when flagged as NSFW by the moderation pipeline, else false. Read-only.

sizes covers the common responsive cases. Apply params to url for exact dimensions, format conversion, color and filters, or the social/OG card (?size=social); see Transformations.

Lifecycle

Uploads return status: "ready" or fail in the same request. A rejected upload stores nothing.

Blocked images (moderation-locked) are never returned as Image objects: they are excluded from lists, and fetching one directly returns 403 media_blocked, with the coarse reason in the error message.

This keeps the object itself simple: if you hold an Image object, the image is servable. See the Error reference for the error shapes.