Skip to content
Start here

List container instances (deprecated)

Deprecated
GET/accounts/{account_id}/containers/applications/{application_id}/instances

Deprecated: use instances-v2 instead. Lists container instances belonging to an application.

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
Accepted Permissions (at least one required)
Workers Containers WriteWorkers Containers Read
Path ParametersExpand Collapse
account_id: string
application_id: string

An Application ID represents an identifier of an application.

Query ParametersExpand Collapse
name_prefix: optional string

Filter instances by a case-sensitive name prefix, falling back to the actor ID when no name is known. Keep the same prefix when using a page token.

page_token: optional string

Opaque token from a previous response to retrieve the next page.

per_page: optional number

Maximum number of instances to return per page. Defaults to all.

maximum1000
minimum1
state: optional "active" or "not-active"

Filters instances by lifecycle state. active includes provisioning, running, and stopping instances; not-active includes stopped and failed instances. When omitted, all instances are returned.

One of the following:
"active"
"not-active"
ReturnsExpand Collapse
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
result: object { instances }

Container instances belonging to an application.

instances: array of object { id, application_id, image, 5 more }
id: string

A container instance ID (64-character hex Durable Object actor ID).

maxLength64
minLength64
application_id: string

An Application ID represents an identifier of an application.

image: string

The image for the current container placement, when one is available.

status: object { state, updated_at, exit_code }

The latest known status of a container instance.

state: "provisioning" or "running" or "failed" or 5 more

The current lifecycle state of a container instance.

One of the following:
"provisioning"
"running"
"failed"
"stopping"
"stopped"
"unhealthy"
"inactive"
"unknown"
updated_at: string

UTC timestamp string in ISO 8601 format.

exit_code: optional number

The process exit code, when the runtime reports one.

configuration: optional object { disk, memory, vcpu }

The resources allocated to the container instance.

disk: number

Disk allocated to the container instance, in decimal MB.

minimum1
memory: number

Memory allocated to the container instance, in MiB.

minimum1
vcpu: number

Number of virtual CPUs allocated to the container instance.

exclusiveMinimum
minimum0
location: optional object { name, region }

The location of the instance’s current container placement.

name: string

Unique location code used to identify locations on a logical level.

region: string

Represents a group of datacenters. Choose one of “AFR”, “APAC”, “EEUR”, “ENAM”, “WNAM”, “ME”, “OC”, “SAM”, or “WEUR”.

name: optional string

The customer-provided instance name, when available. Its UTF-8 encoding uses at most 1,024 bytes.

started_at: optional string

The time at which the current container placement started, when one exists.

result_info: object { next_page_token, page_token, per_page }

Cursor pagination details for a v4 API list response.

next_page_token: optional string

The token to use to retrieve the next page of results.

page_token: optional string

The page token sent in the request.

per_page: optional number

The number of items per page requested.

success: boolean

Whether the API call was successful.

List container instances (deprecated)

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/containers/applications/$APPLICATION_ID/instances \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "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": {
    "instances": [
      {
        "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "application_id": "application_id",
        "image": "image",
        "status": {
          "state": "provisioning",
          "updated_at": "2021-04-01T12:32:41.488Z",
          "exit_code": 0
        },
        "configuration": {
          "disk": 1,
          "memory": 1,
          "vcpu": 1
        },
        "location": {
          "name": "name",
          "region": "WNAM"
        },
        "name": "name",
        "started_at": "2021-04-01T12:32:41.488Z"
      }
    ]
  },
  "result_info": {
    "next_page_token": "next_page_token",
    "page_token": "page_token",
    "per_page": 0
  },
  "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": {
    "instances": [
      {
        "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "application_id": "application_id",
        "image": "image",
        "status": {
          "state": "provisioning",
          "updated_at": "2021-04-01T12:32:41.488Z",
          "exit_code": 0
        },
        "configuration": {
          "disk": 1,
          "memory": 1,
          "vcpu": 1
        },
        "location": {
          "name": "name",
          "region": "WNAM"
        },
        "name": "name",
        "started_at": "2021-04-01T12:32:41.488Z"
      }
    ]
  },
  "result_info": {
    "next_page_token": "next_page_token",
    "page_token": "page_token",
    "per_page": 0
  },
  "success": true
}