Make content arrive on a sandbox Profile

POST
/v1/sandbox/profiles/{profileId}/content/{collection}

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.

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

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 POST "https://example.com/v1/sandbox/profiles/string/content/string" \  -H "Koil-Version: 2026-12-08" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "fields": {      "text": "Where can I buy this?"    }  }'
{  "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"  }}

Start a scheduled publish request now instead of at its `scheduledAt`, so a test need not wait for it POST

Start a scheduled publish request now instead of at its `scheduledAt`, so a test need not wait for it. It runs exactly as it would have when due, with the same `publish_request.*` events, and answers with the request as it stands, which moves to `started` moments later. A request that was not scheduled, or has started, finished or been cancelled, answers `409 conflict` with its current status. Sandbox keys only: a live key is refused with `not_supported`.

Change sandbox content as the platform's user PATCH

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.