# Make content arrive on a sandbox Profile

`POST https://api.koil.co/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

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.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `Koil-Version` | header | yes | `"2026-12-08"` | 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. |
| `profileId` | path | yes | string | Koil Profile identifier. |
| `collection` | path | yes | string | `{platform}.{surface}.{resource}`: `instagram.media.comments`. |
| `Idempotency-Key` | header | yes | 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. |

## Request body

`application/json`

- `fields` (object): 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.

Every named shape is in the [OpenAPI document](https://docs.koil.co/openapi.json) under `components.schemas`.

## Example

Have a viewer comment on the channel's newest video:

```bash
curl -X POST "https://api.koil.co/v1/sandbox/profiles/{profileId}/content/{collection}" \
  -H "Authorization: Bearer $KOIL_API_KEY" \
  -H "Koil-Version: 2026-12-08" \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{"fields":{"text":"Where can I buy this?"}}'
```

## Response 201

The item the emulated platform now holds.

The item the emulated platform changed. Koil finds the change the way it finds a real one, so its event follows.

- `collection` (string, required) (min length 1): `{platform}.{surface}.{resource}`: `instagram.media.comments`.
- `externalId` (string, required) (min length 1): The item's id on the emulated platform, as the collection's reads and events give it.

## Errors

Every error has the same shape: `{ "error": { "code", "message", "meta", "requestId" } }`. [Errors →](https://docs.koil.co/concepts/errors)

| Status | Meaning |
| --- | --- |
| 400 | `validation_error`: The request does not match the operation's input schema, fails an admission check, or the platform refused its content. `meta.violations` names every problem. `not_supported`: The platform, collection or resource does not offer this operation, such as exporting a `key` Connection's credential, which Koil never returns. |
| 401 | `unauthorized`: No API key, or a key Koil does not accept (unknown, revoked, or with a prefix that does not match its mode). |
| 404 | `not_found`: The resource does not exist in this Organization and mode. |
| 409 | `conflict`: The request collides with current state: an idempotency key reused with a different payload or still in flight, a run already in progress, a publish that has already started, or a resource that already exists (`meta.resourceType` and `meta.resourceId` name it). Retry only when the response carries `Retry-After` (the key's first request is still in flight, or a sandbox Profile's collection hasn't had its first poll), after that many seconds. |
| 429 | `rate_limit_exceeded`: Koil's own rate limit for the key, Organization, Profile, or client address is spent (`meta.budgets` names which); retry after `Retry-After` seconds. `platform_rate_limit`: The platform throttled the call or the platform quota is spent; retry after `Retry-After` seconds. |
| 500 | `internal`: Koil or the platform failed, and the status says which: 500 when Koil failed, including a platform refusing how Koil made the call; 502 when the platform failed or answered something Koil cannot use; 504 when Koil's call to the platform timed out. The message is generic; retry with backoff. |
| 503 | `service_unavailable`: A service Koil needs to accept the request (API key validation or rate limiting) is unavailable. Nothing was attempted; retry after `Retry-After` seconds. The hosting edge can deliver this as a `504` with neither this body nor `Retry-After`, so treat a `502`, `503` or `504` alike as retryable, with backoff. |
| default | Any other failure. `error.code` names it; the HTTP status follows from it. |
