Answer a sandbox Connect Session's consent screen as its end user would, without a browser
Answer a sandbox Connect Session's consent screen as its end user would, without a browser: the session ends completed or failed as the browser flow ends it, with the same Connection and connection.* events. A session whose url was already opened 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 Connect Session identifier. Not a secret: only url can start the flow.
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.
What the end user does on the consent screen. approved grants every scope the issuer's platforms need, as opening the session's url does. partial_scopes grants only what listing their platform profiles needs, as a user who unticks permissions does. denied refuses, as a user who cancels does.
"approved" | "partial_scopes" | "denied"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/connect-sessions/string/complete" \ -H "Koil-Version: 2026-12-08" \ -H "Content-Type: application/json" \ -d '{ "outcome": "approved" }'{ "kind": "connect_session", "mode": "live", "id": "string", "appId": "string", "clientUserId": "string", "connectionId": "string", "returnUrl": "http://example.com", "status": "pending", "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 } }, "grantedScopes": [ "string" ], "missingScopes": [ "string" ], "expiresAt": "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" }}Get a Koil Connect Session GET
Get a Koil Connect Session. Once `completed`, it reports the scopes the end user granted (`grantedScopes`) and those requested that they declined (`missingScopes`): the session completes either way.
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`.