Skip to content
Start here

Prepare a container image

client.containers.images.prepare(ImagePrepareParams { account_id, image } params, RequestOptionsoptions?): ImagePrepareResponse { image, status, artifact_digest, reason }
POST/accounts/{account_id}/containers/image-preparations

Idempotently starts or observes preparation of the runtime artifacts required to run one digest-pinned managed container image on Cloudflare’s network. Returns 202 while durable preparation continues and 200 when the image is ready or preparation has reached a terminal error.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
params: ImagePrepareParams { account_id, image }
account_id: string

Path param: Account identifier.

image: string

Body param: Image url.

ReturnsExpand Collapse
ImagePrepareResponse { image, status, artifact_digest, reason }

Durable preparation state for a container image.

image: string

Image url.

status: "pending" | "ready" | "error"

Current durable preparation state for a container image.

One of the following:
"pending"
"ready"
"error"
artifact_digest?: string

Digest of the prepared runtime artifact when status is ready.

reason?: string

Human-readable pending or terminal error detail.

Prepare a container image

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.containers.images.prepare({
  account_id: 'account-123',
  image: 'image',
});

console.log(response.image);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "image": "image",
    "status": "pending",
    "artifact_digest": "artifact_digest",
    "reason": "reason"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "image": "image",
    "status": "pending",
    "artifact_digest": "artifact_digest",
    "reason": "reason"
  },
  "success": true
}