Change sandbox content as the platform's user

PATCH
/v1/sandbox/profiles/{profileId}/content/{collection}/{externalId}

Change sandbox content as the platform's user. The item changes on the Profile's emulated platform account as if one of the platform's users had changed it, such as a person reacting to a DM, and Koil finds the change the way it finds a real one, as the collection's content.{collection}.updated event: through the platform's webhook, or through the collection's poll where it lists a changed item again (a Google review), whose next poll is due at once. Only a collection whose updated Koil observes takes one: for one that emits no updated, such as YouTube's comments, Koil can't observe an edit in live mode either, and the request answers not_supported. Where the poll finds the edit, the request answers conflict with Retry-After until the collection's first poll for the Profile has run. To edit content the Profile wrote, use PATCH /v1/profiles/{profileId}/content/{collection}/{externalId}. Sandbox keys only. Requires an Idempotency-Key: a retry with the same key delivers the same change, and its event has the same id.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key from the Koil admin console, sent as Authorization: Bearer <key>. A live key starts koil_live_ and a sandbox key koil_sandbox_; the key alone selects the Organization and mode. See https://docs.koil.co/concepts/authentication.

In: header

Path Parameters

profileId*string

Koil Profile identifier.

Length1 <= length
collection*string

{platform}.{surface}.{resource}: instagram.media.comments.

Length1 <= length
externalId*string

The item's externalId, as its reads and events give it.

Length1 <= length

Header Parameters

Koil-Version*string

The dated API version the request is written against; it fixes the request and response shapes. Every response echoes the version it is rendered in.

Value in"2026-12-08"
Idempotency-Key*string

A unique key for this request, scoped to the Organization and operation. Retrying with the same key and payload returns the first result instead of repeating the work, or runs a request that failed again; the same key with a different payload is refused with 409 conflict. Keys expire 24 hours after first use, and a request still in flight after 15 minutes releases its key to a retry with the same payload.

Match\S
Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

fields?

What the item is made of, in the platform's own terms, which differ by collection: for youtube.videos.comments, text, authorName, and the video it is on (containerId) or the comment it replies to (targetId); for instagram.dm.reactions, the emoji. Every field is optional, and one the collection does not take is refused with validation_error naming it.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/sandbox/profiles/string/content/string/string" \  -H "Koil-Version: 2026-12-08" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "fields": {      "emoji": "🔥"    }  }'
{  "collection": "string",  "externalId": "string"}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}
{  "error": {    "code": "validation_error",    "message": "string",    "meta": {      "violations": [        {          "code": "string",          "path": "string",          "message": "string"        }      ],      "budgets": [        "string"      ],      "profileIds": [        "string"      ],      "required": [        "string"      ],      "limit": 0,      "resourceType": "string",      "resourceId": "string",      "reason": "string",      "refusalReason": "messaging_window_closed",      "property1": null,      "property2": null    },    "requestId": "string"  }}

Make content arrive on a sandbox Profile POST

Make content arrive on a sandbox Profile. The item appears on the Profile's emulated platform account as one of the platform's users would post it: a viewer's comment, a video uploaded outside Koil. Koil then finds it the way it finds a real one, so it reaches your destinations as the collection's `content.{collection}.created` event, through the collection's own webhook or poll, and the collection's reads return it. A webhook-fed collection's delivery is the platform's own, signed with the App's secret and received by Koil as a real one; a polled collection's next poll is due at once. Sandbox keys only, for the collections the platform emulates; any other answers `not_supported`. Until a polled collection's first poll for the Profile has run, the request answers `conflict` with `Retry-After`, since that poll announces nothing it finds; retry with the same key after that many seconds. Requires an `Idempotency-Key`: a retry with the same key answers the same item, and its event has the same id.

Remove sandbox content as the platform's user DELETE

Remove sandbox content as the platform's user. The item leaves the Profile's emulated platform account as if one of the platform's users had removed it, such as a person taking back their reaction to a DM, and Koil finds the change the way it finds a real one, as the collection's `content.{collection}.deleted` event through the platform's webhook. Only a collection whose `deleted` Koil observes takes one: for one that emits no `deleted`, such as YouTube's comments, Koil can't observe a deletion in live mode either, and the request answers `not_supported`. To delete content as the Profile, use `DELETE /v1/profiles/{profileId}/content/{collection}/{externalId}`. Sandbox keys only. Requires an `Idempotency-Key`: a retry with the same key delivers the same change, and its event has the same id.