Change a sandbox Connection's status as its platform would
Change a sandbox Connection's status as its platform would. invalid: the end user revokes the Connection's grant at the emulated platform. Koil finds out as in live mode, by asking the platform about the token, usually within a minute: the Connection becomes invalid, with the statusReason live mode gives for its issuer, and connection.updated is sent. The platform revokes this Connection's grant only: another Connection holding the same magic grant stays active. PUT /v1/connections/{connectionId}/credential with a magic grant makes it active again. An invalid Connection is refused with conflict. Sandbox keys only.
Authorization
bearerAuth 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
Koil Connection identifier.
1 <= lengthHeader Parameters
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.
"2026-12-08"Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
invalid: the end user revokes the Connection's grant at the platform.
"invalid"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/connections/string/status" \ -H "Koil-Version: 2026-12-08" \ -H "Content-Type: application/json" \ -d '{ "status": "invalid" }'{ "kind": "connection", "mode": "live", "id": "string", "issuerId": "string", "method": "oauth", "oauth": { "appId": "string" }, "key": { "config": { "property1": null, "property2": null } }, "clientUserId": "string", "subject": "string", "status": "active", "statusReason": "renewal_failed", "credential": { "scopes": [ "string" ], "reauthorizeBy": "2019-08-24T14:15:22Z" }, "metadata": { "property1": "string", "property2": "string" }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}{ "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" }}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.
Delete the Organization's sandbox data POST
Delete the Organization's sandbox data: every Connection and Profile, announced as `connection.deleted` and `profile.deleted`, and every publish request, backfill request, media item, Connect Session and idempotency record, and the emulated platform accounts with their content. Apps and Event Destinations are kept. Not atomic with requests that run beside it, so reset between test runs. Safe to repeat. Sandbox keys only: a live key is refused with `not_supported`.