K8 HQ

Connections — K8 HQ Content API

Connections operations for K8 HQ Content API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

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 URLFor
https://api.k8hq.com/v1API 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

NameTypeDescription
org (query)stringThe 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)

FieldTypeDescription
providers requiredConnectionProvider[]

Responses

StatusBodyMeaning
200ConnectionProviderListThe providers: integrated ones by name, then token.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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

NameTypeDescription
org (query)stringThe 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)

FieldTypeDescription
connections requiredConnection[]

Responses

StatusBodyMeaning
200ConnectionListThe connections.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
name requiredstring
provider requiredstringThe provider's kind, e.g. github. Pattern: ^[a-z][a-z0-9-]{1,31}$.
capabilitiesstring[]
ownershiporganization | personal
resourcesConnectionResource[]

Response body (JSON)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
201ConnectionThe connection.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNot signed in, or no passkey in the last five minutes (step_up_required).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
422application/problem+jsonThe organization has 200 connections (rejected).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
200ConnectionThe connection.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
version requiredinteger
capabilitiesstring[]
disabledbooleantrue turns it off: nobody uses it until it's turned on again.
namestring
resourcesConnectionResource[]

Response body (JSON)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
200ConnectionThe connection.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNot signed in, or no passkey in the last five minutes (step_up_required).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
412application/problem+jsonIt changed since that version (version_mismatch): read it again.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Responses

StatusBodyMeaning
204Deleted.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNot signed in, or no passkey in the last five minutes (step_up_required).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
412application/problem+jsonIt changed meanwhile (version_mismatch): try again.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
account requiredstringThe provider account to connect (GitHub: the installation_id it sent back).
code requiredstringThe authorization code the provider sent back.
state requiredstringThe state the provider sent back.
resourcesstring[]The resources to select (GitHub: repository IDs); none keeps the connection's.

Responses

StatusBodyMeaning
200JSONThe connection, connected (its credential referred to, never the secret); or, for a new connection with no repositories chosen, a pending choice.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonThe installation is suspended or won't grant the connection's capabilities (conflict), or the same request is in progress (in_progress).
412application/problem+jsonIt changed meanwhile (version_mismatch): try again.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
502application/problem+jsonThe provider didn't answer as expected: try again.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
pending requiredstringThe pending choice's ID (pcp_).
resources requiredstring[]The chosen repositories' IDs, from its list.

Response body (JSON)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
200ConnectionThe connection, connected (its credential referred to, never the secret).
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonThe installation is suspended or won't grant the connection's capabilities (conflict), or the same request is in progress (in_progress).
412application/problem+jsonIt changed meanwhile (version_mismatch): try again.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
502application/problem+jsonThe provider didn't answer as expected: try again.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Response body (JSON)

FieldTypeDescription
url requiredstringThe provider's page (GitHub: the App's installation page).

Responses

StatusBodyMeaning
200JSONWhere to send the person.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonConnecting isn't available for this provider (conflict), or the same request is in progress (in_progress).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
secret requiredstringThe credential, as text (a provider token, an app's private key): at most 16 KiB. Write-only.
credentialVersionintegerThe 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.
expiresAtstringWhen the provider stops accepting it, if it does: in the future. Its status shows expiring 7 days before, expired after.

Response body (JSON)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
200ConnectionThe connection, referring to its credential (never the secret).
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNot signed in, or no passkey in the last five minutes (step_up_required).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
412application/problem+jsoncredentialVersion doesn't match the current credential's version, or it changed meanwhile (version_mismatch): nothing was stored; read the connection again.
413application/problem+jsonThe request is too large.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Response body (JSON)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
200ConnectionThe connection, referring to its credential (never the secret).
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonIt has no credential (conflict), or the same request is in progress (in_progress).
412application/problem+jsonIt changed meanwhile (version_mismatch): try again.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Response body (JSON)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
200ConnectionThe connection, referring to its credential (never the secret).
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonNo replaced version is kept (conflict), or the same request is in progress (in_progress).
412application/problem+jsonIt changed meanwhile (version_mismatch): try again.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
secret requiredstringThe new credential, as text: at most 16 KiB. Write-only.
credentialVersionintegerThe 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.
expiresAtstringWhen the provider stops accepting it, if it does: in the future. Its status shows expiring 7 days before, expired after.
graceSecondsintegerHow long the replaced version stays usable by reference: default 86400 (a day).

Response body (JSON)

FieldTypeDescription
access requiredConnectionAccess
capabilities requiredstring[]The provider operations it may perform (provider-defined names).
createdAt requiredstring
createdBy requiredstringWho added it (mem_).
credentials requiredbooleanWhether 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 requiredstringThe connection (pcn_).
name requiredstringIts display name.
orgId requiredstring
ownership requiredorganization | personal
provider requiredstringThe provider's kind, e.g. github.
resources requiredConnectionResource[]
status requiredpending | active | expiring | expired | revoked | disabled
updatedAt requiredstring
version requiredintegerSend it back to change it.
createdAttributionAttributionWhat authorized its creation. Inferred from createdBy on legacy records when possible.
credentialConnectionCredential
faultConnectionFault
ownerstringA personal connection's member (mem_).
previousConnectionCredentialThe version a rotation replaced, while it's still usable by reference (until retiresAt).
revokedConnectionRevocation
updatedAttributionAttributionWhat authorized its latest change. Inferred from updatedBy on legacy records when possible; absent if unrecorded.
updatedBystringWho last changed it. Absent on connections last changed before it was kept.

Responses

StatusBodyMeaning
200ConnectionThe connection, referring to its credential (never the secret).
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNot signed in, or no passkey in the last five minutes (step_up_required).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
412application/problem+jsoncredentialVersion doesn't match the current credential's version, or it changed meanwhile (version_mismatch): nothing was stored; read the connection again.
413application/problem+jsonThe request is too large.
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)

FieldTypeDescription
uses requiredConnectionUse[]

Responses

StatusBodyMeaning
200ConnectionUseListThe authorizations.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Request body (JSON)

FieldTypeDescription
memberstringPattern: ^mem_.
tokenstringPattern: ^tok_.

Response body (JSON)

FieldTypeDescription
connection requiredstringThe connection (pcn_).
createdAt requiredstring
grantedBy requiredstringWho authorized it (mem_).
id requiredstringThe authorization (pcu_).
grantedAttributionAttributionWhat authorized granting this use. Inferred from grantedBy on legacy records when possible.
memberstringThe member (mem_) it authorizes, signed in.
tokenstringThe token (tok_) it authorizes.

Responses

StatusBodyMeaning
200ConnectionUseAlready authorized: the existing authorization.
201ConnectionUseAuthorized.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNot signed in, or no passkey in the last five minutes (step_up_required).
402application/problem+jsonThe 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.
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
422application/problem+jsonThe connection has 50 authorizations (rejected).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary 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

NameTypeDescription
connection (path) requiredstringThe connection (pcn_).
use (path) requiredstringThe authorization (pcu_).
org (query)stringThe 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)stringUp to 255 characters; a retry with the same key gets the first response.

Responses

StatusBodyMeaning
204Taken away.
400application/problem+jsonThe request is malformed (invalid).
401application/problem+jsonNo token, or it expired: sign in again (unauthenticated).
403application/problem+jsonThe token lacks the scope (scope_missing), the container is zero-access (zero_access), or the caller may not use this operation (forbidden).
404application/problem+jsonNot found, or not yours (not_found).
409application/problem+jsonA request with this Idempotency-Key is still running (in_progress).
426application/problem+jsonK8 HQ has been updated. Reload this page.
429application/problem+jsonToo 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.
503application/problem+jsonTemporary failure; try again (unavailable).