Replace a Connection's credential with a new one of its own method, for the same platform account
Replace a Connection's credential with a new one of its own method, for the same platform account: a new key (method: "key", with key: its config and secret), or a fresh grant (method: "oauth"). The credential is first checked with the platform, and refused with connection_invalid if the platform rejects it; one for another account is refused with validation_error (subject_mismatch). Nothing is stored unless both pass. The Connection keeps its id, Profiles and metadata, becomes active again as a reconnect would (an invalid one included), and announces connection.updated.
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
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-01"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.
\S1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A fresh grant for an oauth Connection, from the same end user.
An end user's OAuth grant, issued to your own app.
The scopes (or, for a key, the roles) the credential holds: at least one, each once. Optional: omitted, Koil records what the platform reports; sent, Koil keeps these. An issuer that reports none needs them declared.
1 <= itemsA new key for a key Connection, for the same account, verified with the platform before anything is stored.
The key the brand gave you, in the two halves its issuer declares (GET /v1/issuers: methods.key).
The scopes (or, for a key, the roles) the credential holds: at least one, each once. Optional: omitted, Koil records what the platform reports; sent, Koil keeps these. An issuer that reports none needs them declared.
1 <= itemsResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/v1/connections/string/credential" \ -H "Koil-Version: 2026-12-01" \ -H "Content-Type: application/json" \ -d '{ "method": "key", "key": { "config": { "appleIssuerId": "57246542-96fe-1a63-e053-0824d011072a", "keyId": "8QL3N7Y2ZT" }, "secret": { "privateKey": "-----BEGIN PRIVATE KEY-----\\nMIGT..." } } }'{ "kind": "connection", "mode": "live", "id": "conn_789", "issuerId": "app_store_connect", "method": "key", "key": { "config": { "appleIssuerId": "57246542-96fe-1a63-e053-0824d011072a", "keyId": "8QL3N7Y2ZT" } }, "subject": "57246542-96fe-1a63-e053-0824d011072a", "clientUserId": "customer-user-123", "status": "active", "credential": { "scopes": [ "customer_support" ] }, "metadata": {}, "createdAt": "2026-07-01T09:30:00.000Z", "updatedAt": "2026-09-01T12:00:00.000Z"}{ "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" }}{ "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" }}Export an `oauth` Connection's current platform grant GET
Export an `oauth` Connection's current platform grant. Requires an API key with the `credentials:export` permission. Any other method is refused with `not_supported`: Koil exports only what a platform issued to an authorization it ran, never a key someone submitted.
Get a Koil Connection GET
Next Page