Takes what the app sent back to the callback page (state and code, with installationId and setupAction from a GitHub App; state with no code from Kindgi’s connect step; or error, from any of them, when the connect didn’t happen). Only whoever started the request may finish it. Exchanges the code, learns the account, compares what was granted with what was asked and stores the connection; a run that waits goes on. A company connect that doesn’t name reconnects lands on the company’s connection of the account signed in to, when there is one, so one account never has two. reconnected says whether it landed on a connection that was already there, which keeps its name. A new connection whose name another connection took meanwhile is named the first free <name> 2, <name> 3 and so on, and labelTaken gives the name it was to get. A person who declined, or who granted less than asked, gets kind: 'declined' and the request’s missing permissions. A GitHub App’s attaches an installation only if the person’s GitHub account reaches it: the one GitHub sent back, the one they picked at the start, or the only one they reach. When they reach several and picked none, it answers kind: 'pick-installation': the request stays pending with its installations to pick from (start it again with installationId, or newInstallation). An app through Kindgi’s own app picks the account up from Kindgi’s connect step instead of exchanging a code; when the business shared several accounts that fit and none was picked, it answers kind: 'pick-account': the request stays pending with its accounts to pick from (start it again with accountId). A key or session limited to a project is refused, 403 permission-denied: a connection reaches every project.
Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the workspace is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1). A retry sent while the first request still runs is answered 409 idempotency-key-in-flight with Retry-After, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets 409 idempotency-key-replay-withheld, with the first request’s status and when it succeeded (from 0.1.5). A request whose key store can’t be read before it runs is answered 503 idempotency-store-unavailable with Retry-After: nothing ran, so retry with the same key (from 0.3.0).
declined: the person declined, or granted less than asked (request.missing). pick-installation: a GitHub App’s person reaches several installations and picked none; the request stays pending with its installations. pick-account: through Kindgi’s own app, the business shared several accounts that fit and none was picked; the request stays pending with its accounts.
A connect: the owner goes to connectUrl, consents at the app, and comes back. A run that needs a connection it lacks waits on one. An app connected without a browser (texts) has no such step: its request is connected from the start.
object
requestId
required
stringformat: uuid
envName
required
string
appId
required
stringformat: uuid
app
required
The app’s entry id.
string
owner
required
Who owns a connection: one member (kind: member, with their userId), or the company (kind: company, the workspace’s own account).
object
kind
required
string
Allowed values: membercompany
userId
The member. Present when kind is member.
string
permissions
required
The permissions asked for: the ones needed, and the ones already granted.
Array<string>
says
required
What each asks for, in plain words.
Array<string>
reconnects
The connection it connects again; the same account is required.
stringformat: uuid
label
The name asked for the connection it makes. A reconnect keeps the connection’s.
string
runId
The run that waits for it.
string
name
The tool’s name for the connection, when a run waits.
string
startedBy
Who started it last: <kind>:<id>. Only they may finish it.
Why it failed: account-mismatch, app-refused, store-write-failed.
string
missing
The permissions the app granted less than asked.
Array<string>
installations
A GitHub App’s, while it’s pending: the app’s installations the person’s GitHub account reaches, when the finish found several and none was picked. They pick one and start again with installationId, or install the app on another account with newInstallation.
Array<object>
A GitHub App installation the person can reach.
object
installationId
required
string
account
required
The account it’s on: its login, or the enterprise’s slug.
object
id
required
The account’s stable id at the app.
string
label
required
What people see: an email address, a login, a Page’s name.
string
accounts
For an app that connects through Kindgi’s own app, while the request is pending: the accounts the business shared that fit the app (Facebook Pages, or Instagram accounts), when the finish found several and none was picked. They pick one and start again with accountId.
Array<object>
Whose account a connection is at the app.
object
id
required
The account’s stable id at the app.
string
label
required
What people see: an email address, a login, a Page’s name.
string
connectionId
The connection it made, or the one it reconnected. A declined connect names it too when it kept what the app allowed; one that left the connection as it was names none.
stringformat: uuid
connectUrl
required
Where the owner starts. For an app connected without a browser (texts), the request comes back connected, with connectionId, and its page only shows it connected: there is nothing to open.
stringformat: uri
expiresAt
required
When a pending request expires; it ends no other.
stringformat: date-time
createdAt
required
stringformat: date-time
createdBy
required
string
connection
Present when kind is connected.
object
connectionId
required
stringformat: uuid
envName
required
string
appId
required
The registration it goes through.
stringformat: uuid
app
required
The app’s entry id.
string
owner
required
Who owns a connection: one member (kind: member, with their userId), or the company (kind: company, the workspace’s own account).
object
kind
required
string
Allowed values: membercompany
userId
The member. Present when kind is member.
string
account
required
Whose account a connection is at the app.
object
id
required
The account’s stable id at the app.
string
label
required
What people see: an email address, a login, a Page’s name.
string
label
The name people know it by: the one asked for at the connect, else the account’s label. Absent on a connection made before connections had names; show account.label then.
string
main
Only ever true: the person’s main connection through its registration in its env, the one their agents use when no choice names another. A person’s first connection has none; their second connection makes the first their main. The company’s has none.
boolean
permissions
required
The entry’s permission keys the app granted.
Array<string>
state
required
working: runs can use it. needs-reconnecting: the app no longer accepts it; connect again. removing: a disconnect is under way. removed: gone.
Why it’s in its state: invalid-grant (the app withdrew the grant), no-refresh-token (the app gave no way to renew it), token-missing (its stored token is gone), store-write-failed (its token couldn’t be stored at the connect), installation-missing (the GitHub App was uninstalled from the account), installation-permissions (an owner took permissions from the installation), suspended (the installation was suspended), sessions-revoked (Google revoked the person’s sessions), access-expired (the app gave no refresh token, and its access token ends within a minute, or has ended), credential-refused (the provider refused the registration’s credential: update the registration’s secret, then reconnect). Other values may be added; state says what to do.
string
installationId
A GitHub App’s installation.
string
accessEndsAt
When its access token ends, for a connection the app gave no refresh token. From one minute before then, it needs reconnecting (access-expired), and reads say so too. Absent for one that renews.
stringformat: date-time
connectedAt
required
When its current grant was stored: the connect, or the last reconnect.
stringformat: date-time
lastUsedAt
When a run last used it, to the hour.
stringformat: date-time
lastProvenInboundAt
A number’s (texts): when a text last arrived for it with a good signature. Absent for other apps, and until one has.
stringformat: date-time
textsThisMonth
A number’s (texts) texts in the current month, by UTC. Absent for other apps.
object
received
required
integer
sent
required
integer
unanswered
required
The texts received with nothing to answer them.
integer
createdAt
required
stringformat: date-time
createdBy
required
string
updatedAt
required
stringformat: date-time
removedAt
stringformat: date-time
removedBy
string
removedReason
Why it was removed: disconnected (someone disconnected it), revoked-at-app (the app said its access was withdrawn there), uninstalled (the app was uninstalled there), registration-removed (its app’s registration was removed), replaced (a new connection replaced it), owner-removed (the person who owned it was removed from the workspace).
What a removal did at the app. at-app: access was withdrawn there. app-failed: the app refused the revoke; the token is gone here all the same. kept-for-other-connection: another live connection uses the same grant. not-supported: the app has no revoke that would touch only this connection.
Present when kind is connected. true: the finish landed on a connection that was already there, the one reconnects named or the owner’s connection of the same account, the company’s or the person’s, and that connection keeps its name. false: it made a new one.
boolean
labelTaken
Present when kind is connected and the name the new connection was to get (the one asked for, else the account’s label after the name rules) was already another connection’s by the finish. The connection is then named the first free <name> 2, <name> 3 and so on, which connection.label holds.
string
reviewerSeat
On a server with approvals, for a member who connected: whether they have a reviewer seat, which approving a send from their own account needs.
boolean
main
Present when kind is connected, reconnected is false, and the person already had a connection through the registration in the env.
Malformed body, unknown field or no state; or neither code nor error from an app that doesn’t connect through Kindgi’s own app (bad-input, details.field).
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
string
message
required
string
details
Optional, kind-specific.
object
key
additional properties
any
requestId
required
Server-assigned request id; also echoed via X-Request-Id header.
Someone other than whoever started the request (connection-not-yours); or a GitHub App’s person whose GitHub account doesn’t reach the installation, or any (connection-installation-unreachable, with details.connectRequestId: start that request again with newInstallation to install the app on their account).
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
string
message
required
string
details
Optional, kind-specific.
object
key
additional properties
any
requestId
required
Server-assigned request id; also echoed via X-Request-Id header.
Idempotency-Key was reused with a different body; the request was finished already (connection-request-used); a reconnect signed in to another account (connection-account-mismatch); or the connection is still being disconnected: disconnect it again to finish, then connect (connection-removing). Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
string
message
required
string
details
Optional, kind-specific.
object
key
additional properties
any
requestId
required
Server-assigned request id; also echoed via X-Request-Id header.
rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
string
message
required
string
details
Optional, kind-specific.
object
key
additional properties
any
requestId
required
Server-assigned request id; also echoed via X-Request-Id header.
The connection couldn’t be stored just now (connection-store-failed), or the Idempotency-Key store couldn’t be read before the request ran (idempotency-store-unavailable, with Retry-After). Or the authorization store couldn’t be reached (authz-backend-unavailable, with Retry-After), or the database was too busy for the authorization check (database-busy, with Retry-After), so the request wasn’t run. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
string
message
required
string
details
Optional, kind-specific.
object
key
additional properties
any
requestId
required
Server-assigned request id; also echoed via X-Request-Id header.