Connections — K8 HQ Content API
Connections operations for K8 HQ Content API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Connect K8 HQ to outside providers such as GitHub, and choose who and which agents may act through each connection.
Provider connections (board item #180): K8 HQ's connections out to outside providers (a GitHub account; more later) that people and agents act through. A connection is the organization's (the default, for shared automation) or one member's (personal); its ownership never changes, so a personal connection never silently becomes the team's. Managing a connection (connections.manage for the organization's, connections.personal for one's own) is separate from using it. A connection is used only under an explicit authorization naming a member (signed in) or one token (an agent's; naming a member never names their tokens); a personal connection's owner uses theirs signed in without one. Using a connection never allows managing it, and never reveals, replaces or shares its credential. A connection is pending until one of its managers sets its credential, which is write-only: nobody reads it back. People signed in to the web app manage them; a token with connections:read only lists and reads the connections it's authorized to use, and K8 HQ acts through one for a token with connections:use.
Base URL
| Base URL | For |
https://api.k8hq.com/v1 | API tokens and the K8 HQ web app |
Endpoints
Connections
List the providers you can connect
GET/connection-providers
The providers a connection can be added for, for an Add a connection form: each provider K8 HQ connects itself, through the provider's own pages (integrated, e.g. github), then token, any other service, whose token or key a manager pastes and whose provider is a slug they choose (^[a-z][a-z0-9-]{1,31}$). A token needs connections:read (403 scope_missing otherwise).
For API tokens and the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
providers required | ConnectionProvider[] | |
Responses
| Status | Body | Meaning |
| 200 | ConnectionProviderList | The providers: integrated ones by name, then token. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
List connections
GET/connections
The organization's connections the caller may see: those they manage or are authorized to use, their own personal ones and, for holders of connections.manage for the whole organization, members' personal ones too (to stop one). A token needs connections:read (403 scope_missing otherwise) and sees only the connections it's authorized to use. Each says what the caller may do with it (access).
For API tokens and the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
connections required | Connection[] | |
Responses
| Status | Body | Meaning |
| 200 | ConnectionList | The connections. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Add a connection
POST/connections
Adds the organization's connection (ownership organization, the default: connections.manage for the whole organization) or a personal one of the caller's own (personal: connections.personal). It holds no credential yet. A person signed in. At most 200 per organization (422 rejected). Recorded as integration.connection.created. A GitHub connection is created without its installation, account or repository resources (409 otherwise): connecting it on GitHub (connect/start) sets them.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
name required | string | |
provider required | string | The provider's kind, e.g. github. Pattern: ^[a-z][a-z0-9-]{1,31}$. |
capabilities | string[] | |
ownership | organization | personal | |
resources | ConnectionResource[] | |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 201 | Connection | The connection. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | Not signed in, or no passkey in the last five minutes (step_up_required). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 422 | application/problem+json | The organization has 200 connections (rejected). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Read a connection
GET/connections/{connection}
One connection the caller may see (404 otherwise, the same as an unknown one); a token needs connections:read and sees only those it's authorized to use. access.use is whether the caller may act through it now: authorized, not turned off, and for a personal connection while its owner is a member, not suspended and holds connections.personal.
For API tokens and the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 200 | Connection | The connection. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Change a connection
PATCH/connections/{connection}
Changes its name, resources, capabilities or whether it's turned off (disabled), if it's still at version; fields left out stay as they are. Its provider, ownership and owner never change (400). For its managers: holders of connections.manage for the whole organization or for this connection, for the organization's; its owner while they hold connections.personal, for a personal one. Recorded as integration.connection.updated. A GitHub connection's installation, account and repositories are set only by connecting it on GitHub (connect/start): a change to them is refused (409); send them unchanged, or leave resources out.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
version required | integer | |
capabilities | string[] | |
disabled | boolean | true turns it off: nobody uses it until it's turned on again. |
name | string | |
resources | ConnectionResource[] | |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 200 | Connection | The connection. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | Not signed in, or no passkey in the last five minutes (step_up_required). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 412 | application/problem+json | It changed since that version (version_mismatch): read it again. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Delete a connection
DELETE/connections/{connection}
Deletes it, with every authorization to use it (usesRevoked in the event). For its managers, a personal connection's owner, or a holder of connections.manage for the whole organization (members' personal ones too). Allowed while the organization is read-only. Recorded as integration.connection.deleted.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Responses
| Status | Body | Meaning |
| 204 | | Deleted. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | Not signed in, or no passkey in the last five minutes (step_up_required). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 412 | application/problem+json | It changed meanwhile (version_mismatch): try again. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Finish connecting a connection
POST/connections/{connection}/connect
Finishes what POST /connections/{connection}/connect/start began, with what the provider sent back. For GitHub: the state, the OAuth code and the installation_id (as account). K8 HQ consumes the state, checks as the person (with their GitHub authorization, revoked at once and never kept) that they can see that installation and each selected repository, sets the connection's resources (the installation, its account and the repositories) and its first credential: an installation token for exactly those repositories and the connection's capabilities. resources are the repositories to select (GitHub's numeric repository IDs); none keeps those already selected. A connection with none yet, connected with none chosen, answers a pending choice instead (ConnectionPending, board item #251): the repositories the person can see in the installation and their own level on each (push or pull), kept 15 minutes for POST /connections/{connection}/connect/bind; nothing is bound or minted until then, and the person's GitHub authorization is revoked all the same. Connecting authorizes nobody to use the connection: that's still POST /connections/{connection}/uses. For its managers. 403 when the state expired, was used or was someone else's, or the person can't see the installation or a repository. 409 conflict when the installation is suspended, or won't grant the connection's capabilities. 502 when the provider didn't answer as expected. Recorded as integration.connection.updated and integration.connection.credential_set.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
account required | string | The provider account to connect (GitHub: the installation_id it sent back). |
code required | string | The authorization code the provider sent back. |
state required | string | The state the provider sent back. |
resources | string[] | The resources to select (GitHub: repository IDs); none keeps the connection's. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The connection, connected (its credential referred to, never the secret); or, for a new connection with no repositories chosen, a pending choice. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | The installation is suspended or won't grant the connection's capabilities (conflict), or the same request is in progress (in_progress). |
| 412 | application/problem+json | It changed meanwhile (version_mismatch): try again. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 502 | application/problem+json | The provider didn't answer as expected: try again. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Finish connecting with the repositories chosen
POST/connections/{connection}/connect/bind
Completes a pending choice (board item #251) that POST /connections/{connection}/connect answered: resources are chosen from its repositories. Only the person who connected, still one of its managers, before it expires. Each chosen repository must be on the list, and if the connection's capabilities include a write capability the person must have push on each. Then it's as connecting with resources: the connection's resources are set, the binding recorded, its first credential set (an installation token for exactly those repositories and its capabilities) and the pending choice deleted. 403 when the choice expired, was used or was someone else's, or a repository wasn't offered or needs push. 409 conflict when the installation is suspended, or won't grant the connection's capabilities. Retry-safe with an Idempotency-Key. Recorded as integration.connection.updated and integration.connection.credential_set.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
pending required | string | The pending choice's ID (pcp_). |
resources required | string[] | The chosen repositories' IDs, from its list. |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 200 | Connection | The connection, connected (its credential referred to, never the secret). |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | The installation is suspended or won't grant the connection's capabilities (conflict), or the same request is in progress (in_progress). |
| 412 | application/problem+json | It changed meanwhile (version_mismatch): try again. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 502 | application/problem+json | The provider didn't answer as expected: try again. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Start connecting a connection to its provider
POST/connections/{connection}/connect/start
For providers whose adapter connects its connections (GitHub: installing K8 HQ's GitHub App, or changing an installation's repositories). Answers the provider's page to send the person to, with a single-use state good for 15 minutes for this person and this connection. The provider then sends them back to the web app with the state and an authorization code, which it posts to POST /connections/{connection}/connect. For its managers: holders of connections.manage for the organization's, the owner for a personal one. A person signed in, not a token. 409 conflict when the provider can't be connected this way (set its credential instead) or connecting isn't configured yet.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Response body (JSON)
| Field | Type | Description |
url required | string | The provider's page (GitHub: the App's installation page). |
Responses
| Status | Body | Meaning |
| 200 | JSON | Where to send the person. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | Connecting isn't available for this provider (conflict), or the same request is in progress (in_progress). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Set a connection's credential
PUT/connections/{connection}/credential
Sets the credential the connection acts with (its first: pending to active) or replaces it, deleting the old version at once. The secret is write-only: it's kept sealed (KMS, bound to the organization, the connection and the credential), and no response, event or log carries it, so nobody, its managers included, can read it back. The answer is the connection, whose credential refers to it. For its managers: holders of connections.manage for the whole organization or for this connection, for the organization's; its owner while they hold connections.personal, for a personal one. Never a token. Recorded as integration.connection.credential_set. Send credentialVersion (0 for a first credential) to set it only if the current one is still the version you read.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
secret required | string | The credential, as text (a provider token, an app's private key): at most 16 KiB. Write-only. |
credentialVersion | integer | The version of the current credential (credential.version) as you read it, or 0 if it has none yet. If the credential has changed since (another set or rotation landed, or it was revoked), nothing is stored and the answer is 412 version_mismatch: read the connection again. Optional; the K8 HQ web app always sends it, so a retry after an uncertain answer can't replace or rotate a version it never saw (and end that version's grace period early). It isn't the connection's version, which other changes move too. |
expiresAt | string | When the provider stops accepting it, if it does: in the future. Its status shows expiring 7 days before, expired after. |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 200 | Connection | The connection, referring to its credential (never the secret). |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | Not signed in, or no passkey in the last five minutes (step_up_required). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 412 | application/problem+json | credentialVersion doesn't match the current credential's version, or it changed meanwhile (version_mismatch): nothing was stored; read the connection again. |
| 413 | application/problem+json | The request is too large. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Revoke a connection's credential
DELETE/connections/{connection}/credential
Revokes the connection's credential: every stored version, including one in its grace period, is deleted at once (crypto-shredded), and the connection shows revoked; nothing uses it until one of its managers sets a credential again, which is a new version. For its managers, a personal connection's owner, or a holder of connections.manage for the whole organization (members' personal connections too). A person signed in. Allowed while the organization is read-only. 409 conflict if it has no credential. Recorded as integration.connection.credential_revoked.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 200 | Connection | The connection, referring to its credential (never the secret). |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | It has no credential (conflict), or the same request is in progress (in_progress). |
| 412 | application/problem+json | It changed meanwhile (version_mismatch): try again. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Retire a rotated-out credential
POST/connections/{connection}/credential/retire
Ends the grace period of the version a rotation replaced (previous): it's deleted and can't be used again. For its managers, a personal connection's owner, or a holder of connections.manage for the whole organization. A person signed in. Allowed while the organization is read-only. 409 conflict if no replaced version is kept. Recorded as integration.connection.credential_retired.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 200 | Connection | The connection, referring to its credential (never the secret). |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | No replaced version is kept (conflict), or the same request is in progress (in_progress). |
| 412 | application/problem+json | It changed meanwhile (version_mismatch): try again. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Rotate a connection's credential
POST/connections/{connection}/credential/rotate
Stores a new version of the connection's credential as its current one, and keeps the one it replaces usable by reference (previous) for graceSeconds (default a day, at most 7 days; 0 retires it at once), so work still holding it finishes. Rotating again deletes any version already in its grace period. The secret is write-only, as when setting one. It needs a credential to rotate (400 otherwise: set one). For its managers, as setting a credential is. Recorded as integration.connection.credential_rotated. Send credentialVersion to rotate only if the current credential is still the version you read: a stale retry then gets 412 instead of rotating twice, which would delete the version in its grace period early. A retry with the same Idempotency-Key still gets the first answer back.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
secret required | string | The new credential, as text: at most 16 KiB. Write-only. |
credentialVersion | integer | The version of the current credential (credential.version) as you read it, or 0 if it has none yet. If the credential has changed since (another set or rotation landed, or it was revoked), nothing is stored and the answer is 412 version_mismatch: read the connection again. Optional; the K8 HQ web app always sends it, so a retry after an uncertain answer can't replace or rotate a version it never saw (and end that version's grace period early). It isn't the connection's version, which other changes move too. |
expiresAt | string | When the provider stops accepting it, if it does: in the future. Its status shows expiring 7 days before, expired after. |
graceSeconds | integer | How long the replaced version stays usable by reference: default 86400 (a day). |
Response body (JSON)
| Field | Type | Description |
access required | ConnectionAccess | |
capabilities required | string[] | The provider operations it may perform (provider-defined names). |
createdAt required | string | |
createdBy required | string | Who added it (mem_). |
credentials required | boolean | Whether this server keeps credentials for connections (PUT /connections/{connection}/credential and, where documented, rotating and revoking them). The explicit signal to offer credential management, rather than probing a route. Credentials are write-only: no response carries a secret. |
id required | string | The connection (pcn_). |
name required | string | Its display name. |
orgId required | string | |
ownership required | organization | personal | |
provider required | string | The provider's kind, e.g. github. |
resources required | ConnectionResource[] | |
status required | pending | active | expiring | expired | revoked | disabled | |
updatedAt required | string | |
version required | integer | Send it back to change it. |
createdAttribution | Attribution | What authorized its creation. Inferred from createdBy on legacy records when possible. |
credential | ConnectionCredential | |
fault | ConnectionFault | |
owner | string | A personal connection's member (mem_). |
previous | ConnectionCredential | The version a rotation replaced, while it's still usable by reference (until retiresAt). |
revoked | ConnectionRevocation | |
updatedAttribution | Attribution | What authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded. |
updatedBy | string | Who last changed it. Absent on connections last changed before it was kept. |
Responses
| Status | Body | Meaning |
| 200 | Connection | The connection, referring to its credential (never the secret). |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | Not signed in, or no passkey in the last five minutes (step_up_required). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 412 | application/problem+json | credentialVersion doesn't match the current credential's version, or it changed meanwhile (version_mismatch): nothing was stored; read the connection again. |
| 413 | application/problem+json | The request is too large. |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
List who may use a connection
GET/connections/{connection}/uses
Its authorizations to use it. For those who may change or delete it.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Response body (JSON)
| Field | Type | Description |
uses required | ConnectionUse[] | |
Responses
| Status | Body | Meaning |
| 200 | ConnectionUseList | The authorizations. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Authorize use of a connection
POST/connections/{connection}/uses
Authorizes one member of the organization (member: their sessions, signed in) or one live token of the organization (token: that token only, such as an agent's) to use the connection; exactly one. Naming a member never names their tokens. For its managers: holders of connections.manage for the whole organization or for this connection, for the organization's; only its owner, holding connections.personal, for a personal one, which only then serves anyone else or any token. It never lets them manage the connection or see its credential. A person signed in. At most 50 per connection (422 rejected). Recorded as integration.connection.use_authorized; an existing authorization for the same member or token is returned as it is (200).
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Request body (JSON)
| Field | Type | Description |
member | string | Pattern: ^mem_. |
token | string | Pattern: ^tok_. |
Response body (JSON)
| Field | Type | Description |
connection required | string | The connection (pcn_). |
createdAt required | string | |
grantedBy required | string | Who authorized it (mem_). |
id required | string | The authorization (pcu_). |
grantedAttribution | Attribution | What authorized granting this use. Inferred from grantedBy on legacy records when possible. |
member | string | The member (mem_) it authorizes, signed in. |
token | string | The token (tok_) it authorizes. |
Responses
| Status | Body | Meaning |
| 200 | ConnectionUse | Already authorized: the existing authorization. |
| 201 | ConnectionUse | Authorized. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | Not signed in, or no passkey in the last five minutes (step_up_required). |
| 402 | application/problem+json | The organization is read-only (read_only, design note 0024): it has been out of credit for 60 days, so nothing can be changed until an owner adds credit. |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 422 | application/problem+json | The connection has 50 authorizations (rejected). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |
Take away use of a connection
DELETE/connections/{connection}/uses/{use}
Ends one authorization: its member or token can't use the connection from then on. For its managers, a personal connection's owner, or a holder of connections.manage for the whole organization (members' personal connections too). A person signed in. Allowed while the organization is read-only. Recorded as integration.connection.use_revoked.
Needs a passkey confirmation of this change (x-k8hq-confirm: connection.manage). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
For the web app.
Parameters
| Name | Type | Description |
connection (path) required | string | The connection (pcn_). |
use (path) required | string | The authorization (pcu_). |
org (query) | string | The organization (org_). Required for a person signed in to the web app (any organization they're a member of); a token always answers for its own organization. |
Idempotency-Key (header) | string | Up to 255 characters; a retry with the same key gets the first response. |
Responses
| Status | Body | Meaning |
| 204 | | Taken away. |
| 400 | application/problem+json | The request is malformed (invalid). |
| 401 | application/problem+json | No token, or it expired: sign in again (unauthenticated). |
| 403 | application/problem+json | The token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden). |
| 404 | application/problem+json | Not found, or not yours (not_found). |
| 409 | application/problem+json | A request with this Idempotency-Key is still running (in_progress). |
| 426 | application/problem+json | K8 HQ has been updated. Reload this page. |
| 429 | application/problem+json | Too many requests (rate_limited). The token is paused until midnight UTC if it goes over its daily request or download limit, or reaches its daily recipient limit. A message with more recipients than the token has left today is refused. If the token has some recipients left, you can send to fewer. Too many attempts with a wrong token also return this response. |
| 503 | application/problem+json | Temporary failure; try again (unavailable). |