GitHub

API reference

Instances

Provision, retrieve, update and delete instances.

Provision an instance

POST/v1/instances

Creates an instance within the provisioner token's scope and returns its identity and credential. An instance credential cannot call this operation. Providers may also offer other credential issuance paths.

Retries with the same idempotency key and input return the original instance and issued credential, without creating another instance or renewing the credential. Keys are scoped to the provisioner and operation. Reusing a key with different input returns an idempotency conflict.

Optional delivery configures a webhook for the instance. The provisioner supplies a separate signing secret already installed on the receiver. Verification must succeed before creation commits or a credential is issued. Failure returns 422 with code webhook_verification_failed and creates no instance. Unsafe or unsupported delivery configuration returns 400. The signing secret is never returned. Successful retries do not repeat verification. Replaying creation after instance deletion returns 409 with code instance_deleted and must not recreate the instance.

The provider must retain the key and original result for at least seven days (168 hours) after instance creation. Retries do not extend this period. Failed verification can be attempted again with the same key and input. Concurrent same-key attempts must be coalesced and must not commit twice.

Authentication

Provisioner Token
An opaque token permitting instance management within its assigned scope. Cannot make approval requests.

Parameters

FieldTypeDescription
Idempotency-Keyrequiredheader · string

An opaque key for safely retrying this operation. Generate it before the first submission and reuse it only with the same input.

See idempotency and retries and retention periods.

Request body

application/json · required

Submit an empty object when neither a name nor delivery is supplied.

A recognisable name for the instance. The provider assigns one if omitted.

A complete proposed delivery configuration. Both initial setup and replacement require receiver verification. Only webhook delivery is defined. The event is independent of the transport. Registration and delivery must be rate limited per provisioning account and destination across instances, including aggregate host and address limits. Bound concurrency and request and response sizes. Document the provider's limits and apply them to verification and retries too.

View complete schema and constraints
json
{
  "type": "object",
  "additionalProperties": false,
  "description": "Submit an empty object when neither a name nor delivery is supplied.",
  "properties": {
    "instance_name": {
      "type": "string",
      "minLength": 1,
      "description": "A recognisable name for the instance. The provider assigns one if omitted.",
      "examples": [
        "codex-chris-laptop"
      ]
    },
    "delivery": {
      "$ref": "#/components/schemas/WebhookDeliveryInput"
    }
  }
}
polling
{
  "instance_name": "codex-chris-laptop"
}
Configure a receiver with an illustrative secret, never use this secret in a deployment
{
  "delivery": {
    "type": "webhook",
    "url": "https://harness.example.com/aap/events",
    "registration_id": "8246931c-4ce0-4c15-a94a-e9c078ad06e2",
    "signing_secret": "whsec_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8="
  }
}

Responses

StatusMeaningBody
200

The instance and credential from an earlier submission with the same key.

ProvisionInstanceResponse
201

The newly created instance and its issued credential.

ProvisionInstanceResponse
400

The request is malformed or a field is invalid. Code invalid_webhook_url identifies an unsafe or malformed receiver URL. Code unsupported_delivery_type identifies an unsupported transport, including webhook when the provider supports only synchronous mode.

ErrorResponse
401

The credential is missing, expired, revoked or otherwise invalid.

ErrorResponse
403

The credential does not permit the operation or access to this resource.

ErrorResponse
409

The operation conflicts with existing state. Code idempotency_conflict means the key was used with different input. Code already_terminal means the request was approved, denied or expired before cancellation. Code instance_deleted means a provisioning replay refers to a deleted instance.

ErrorResponse
422

The proposed receiver failed verification. No instance or configuration change is committed.

ErrorResponse
429

The caller must reduce its request rate. Respect Retry-After when present.

ErrorResponse
500

The provider could not complete the operation. This does not permit tool execution.

ErrorResponse
503

The provider is temporarily unable to serve the operation.

ErrorResponse

200 response

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

View complete schema and constraints
json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "instance",
    "credential"
  ],
  "properties": {
    "instance": {
      "$ref": "#/components/schemas/Instance"
    },
    "credential": {
      "$ref": "#/components/schemas/IssuedCredential"
    }
  }
}
An instance and its issued credential
{
  "instance": {
    "id": "b29a43a7-1949-4b9f-9d61-b7ae66f85d31",
    "name": "codex-chris-laptop"
  },
  "credential": {
    "token": "example-instance-credential",
    "expires_at": "2026-09-17T12:00:00Z"
  }
}

201 response

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

View complete schema and constraints
json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "instance",
    "credential"
  ],
  "properties": {
    "instance": {
      "$ref": "#/components/schemas/Instance"
    },
    "credential": {
      "$ref": "#/components/schemas/IssuedCredential"
    }
  }
}
An instance and its issued credential
{
  "instance": {
    "id": "b29a43a7-1949-4b9f-9d61-b7ae66f85d31",
    "name": "codex-chris-laptop"
  },
  "credential": {
    "token": "example-instance-credential",
    "expires_at": "2026-09-17T12:00:00Z"
  }
}
Error and retry response headers

400

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

401

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

403

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

409

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

422

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

429

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.

500

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

503

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.

Retrieve an instance

GET/v1/instances/{id}

Returns the current instance within the provisioner token's scope. Credentials and webhook signing secrets are never included. Deleted instances return 404.

Authentication

Provisioner Token
An opaque token permitting instance management within its assigned scope. Cannot make approval requests.

Parameters

FieldTypeDescription
idrequiredpath · Identifier

The instance's provider-assigned ID.

Responses

StatusMeaningBody
200

The instance configuration, or the original result on an update replay. Secrets are excluded.

Instance
401

The credential is missing, expired, revoked or otherwise invalid.

ErrorResponse
403

The credential does not permit the operation or access to this resource.

ErrorResponse
404

The resource is unavailable to the caller.

ErrorResponse
429

The caller must reduce its request rate. Respect Retry-After when present.

ErrorResponse
500

The provider could not complete the operation. This does not permit tool execution.

ErrorResponse
503

The provider is temporarily unable to serve the operation.

ErrorResponse

200 response

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

idIdentifierrequired
namestringrequired

The name assigned by the provider. A name is not proof of identity.

Absent when no receiver is configured. Instance reads never return credentials or signing secrets.

View complete schema and constraints
json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name"
  ],
  "properties": {
    "id": {
      "$ref": "#/components/schemas/Identifier"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "The name assigned by the provider. A name is not proof of identity."
    },
    "delivery": {
      "$ref": "#/components/schemas/WebhookDelivery",
      "description": "Absent when no receiver is configured. Instance reads never return credentials or signing secrets."
    }
  }
}
An instance with a verified receiver
{
  "id": "b29a43a7-1949-4b9f-9d61-b7ae66f85d31",
  "name": "codex-chris-laptop",
  "delivery": {
    "type": "webhook",
    "url": "https://harness.example.com/aap/events",
    "registration_id": "8246931c-4ce0-4c15-a94a-e9c078ad06e2"
  }
}
Error and retry response headers

401

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

403

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

404

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

429

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.

500

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

503

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.

Update an instance

PATCH/v1/instances/{id}

Updates fields within the provisioner token's scope. Omitted fields are unchanged. A supplied delivery object replaces the entire configuration, including its secret, after verification. A failed verification returns 422 with code webhook_verification_failed and changes nothing, including the name. Null delivery removes the receiver and ends outstanding delivery.

Once committed, future attempts for all queued notifications use the new URL and secret, including those for older requests. Notification IDs, bodies and retry deadlines do not change. An attempt already in flight can still reach the old receiver. Replacing delivery does not replay notifications whose delivery has already ended. Deletion must take precedence over an update still being verified.

Idempotency keys are scoped to the provisioner, instance ID and operation. Same-key, same-input retries return the original successful response without repeating verification or reapplying the update. Changed input returns 409. Retain the key and original result for at least seven days after the update commits. Retrying does not renew that period. A replay against a deleted instance returns 404 and cannot restore it. Failed verification can be attempted again with the same key and input. Concurrent same-key attempts must be coalesced and must not commit twice.

Authentication

Provisioner Token
An opaque token permitting instance management within its assigned scope. Cannot make approval requests.

Parameters

FieldTypeDescription
idrequiredpath · Identifier

The instance's provider-assigned ID.

Idempotency-Keyrequiredheader · string

An opaque key for safely retrying this operation. Generate it before the first submission and reuse it only with the same input.

See idempotency and retries and retention periods.

Request body

application/json · required

Omit to keep delivery unchanged, replace with a complete object, or use null to remove it.

View complete schema and constraints
json
{
  "type": "object",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "instance_name": {
      "type": "string",
      "minLength": 1
    },
    "delivery": {
      "description": "Omit to keep delivery unchanged, replace with a complete object, or use null to remove it.",
      "oneOf": [
        {
          "$ref": "#/components/schemas/WebhookDeliveryInput"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
Configure a receiver with an illustrative secret, never use this secret in a deployment
{
  "delivery": {
    "type": "webhook",
    "url": "https://harness.example.com/aap/events",
    "registration_id": "8246931c-4ce0-4c15-a94a-e9c078ad06e2",
    "signing_secret": "whsec_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8="
  }
}
rename
{
  "instance_name": "codex-chris-desktop"
}

Responses

StatusMeaningBody
200

The instance configuration, or the original result on an update replay. Secrets are excluded.

Instance
400

The request is malformed or a field is invalid. Code invalid_webhook_url identifies an unsafe or malformed receiver URL. Code unsupported_delivery_type identifies an unsupported transport, including webhook when the provider supports only synchronous mode.

ErrorResponse
401

The credential is missing, expired, revoked or otherwise invalid.

ErrorResponse
403

The credential does not permit the operation or access to this resource.

ErrorResponse
404

The resource is unavailable to the caller.

ErrorResponse
409

The operation conflicts with existing state. Code idempotency_conflict means the key was used with different input. Code already_terminal means the request was approved, denied or expired before cancellation. Code instance_deleted means a provisioning replay refers to a deleted instance.

ErrorResponse
422

The proposed receiver failed verification. No instance or configuration change is committed.

ErrorResponse
429

The caller must reduce its request rate. Respect Retry-After when present.

ErrorResponse
500

The provider could not complete the operation. This does not permit tool execution.

ErrorResponse
503

The provider is temporarily unable to serve the operation.

ErrorResponse

200 response

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

idIdentifierrequired
namestringrequired

The name assigned by the provider. A name is not proof of identity.

Absent when no receiver is configured. Instance reads never return credentials or signing secrets.

View complete schema and constraints
json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name"
  ],
  "properties": {
    "id": {
      "$ref": "#/components/schemas/Identifier"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "The name assigned by the provider. A name is not proof of identity."
    },
    "delivery": {
      "$ref": "#/components/schemas/WebhookDelivery",
      "description": "Absent when no receiver is configured. Instance reads never return credentials or signing secrets."
    }
  }
}
An instance with a verified receiver
{
  "id": "b29a43a7-1949-4b9f-9d61-b7ae66f85d31",
  "name": "codex-chris-laptop",
  "delivery": {
    "type": "webhook",
    "url": "https://harness.example.com/aap/events",
    "registration_id": "8246931c-4ce0-4c15-a94a-e9c078ad06e2"
  }
}
Error and retry response headers

400

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

401

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

403

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

404

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

409

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

422

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

429

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.

500

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

503

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.

Delete an instance

DELETE/v1/instances/{id}

Retires an instance within the provisioner token's scope. Revokes all its credentials, cancels its pending requests and ends all webhook delivery. Existing terminal decisions stay unchanged. No cancellation notifications are sent for this operation. Attempts already in flight may still arrive. Deletion does not stop tool execution that has already begun.

The provider must serialize deletion with request creation, decisions and configuration updates so no pending work or active credential is left behind. Request and idempotency retention still apply. The provider keeps a deletion record for at least seven days; repeated deletion returns 204 whilst that record is retained. Unknown IDs return 404. No idempotency key is required. This operation never recreates an instance.

Authentication

Provisioner Token
An opaque token permitting instance management within its assigned scope. Cannot make approval requests.

Parameters

FieldTypeDescription
idrequiredpath · Identifier

The instance's provider-assigned ID.

Responses

StatusMeaningBody
204

The instance has been deleted, including on repeated deletion.

No body
401

The credential is missing, expired, revoked or otherwise invalid.

ErrorResponse
403

The credential does not permit the operation or access to this resource.

ErrorResponse
404

The resource is unavailable to the caller.

ErrorResponse
429

The caller must reduce its request rate. Respect Retry-After when present.

ErrorResponse
500

The provider could not complete the operation. This does not permit tool execution.

ErrorResponse
503

The provider is temporarily unable to serve the operation.

ErrorResponse

204 response

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Error and retry response headers

401

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

403

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

404

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

429

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.

500

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

503

HeaderTypeDescription
X-Request-IDrequiredheader · Identifier

Identifies this HTTP exchange. Matches error.request_id on errors.

Retry-Afterheader · string

The delay before retrying, in seconds or as an HTTP date.