Organizations — K8 HQ Setup API
Organizations operations for K8 HQ Setup API. Requests, permissions and responses.
Version 1OpenAPI description (JSON)
Before making requests, read the authentication and request requirements.
Create, list, rename and delete organizations, and choose which services each one offers.
Base URL
| Base URL | For |
https://api.k8hq.com/setup | The K8 HQ web app, and programs acting with a person's session |
Endpoints
Organizations
List my organizations
GET/v1/organizations
The organizations the person is in, with their names and what the person may set up in each.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Response body (JSON)
| Field | Type | Description |
orgs required | Org[] | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Their organizations, by ID. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Create an organization
POST/v1/organizations
Creates an organization with the person as its owner. A person may create 3 a day and 20 in all. A new organization starts with no credit: it can receive mail, and sending waits until it has some.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
Request body (JSON)
| Field | Type | Description |
name required | string | 1 to 100 characters, no control characters; spaces are tidied. It can't include K8 HQ (in any case, spaced or not). |
{"name":"Porter Design"}
Response body (JSON)
| Field | Type | Description |
org required | Org | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The new organization. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | A new payer pays for 3 organizations already, the most while they're new (new_payer_orgs). |
| 429 | application/problem+json | Too many organizations (org_limit). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Delete an organization
DELETE/v1/organizations/{orgId}
Schedules the organization's deletion, in 7 days (owners only; confirm is its name exactly as shown, or its ID if it has none). Until then mail keeps flowing and any owner can cancel; every owner is told at once and daily. Then K8 HQ stops its mail and sign-in and deletes everything in it for good, releases its domains and gives each owner a receipt. Bound to the action by per-action confirmation (org.delete) once that exists; a recent passkey until then.
Needs a passkey confirmation of this change (x-k8hq-confirm: org.delete). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.
Personal agent contract (conditional). Schedule organization deletion with the exact confirmation. This is an accepted scheduling decision, not purge completion. The system continues deletion after app disconnection; Owners can still cancel during the pending period. A recent Owner departure conflicts. The response contains the original accepted status and RFC 3339 deleteAt time. Required header: Idempotency-Key (16 to 128 visible ASCII characters). Success returns operation-id; keep the same key and input to retry. Current access is checked again on every retry. The service requires explicit operator activation. Action setup.deleteOrgResource. Permissions: org.delete. Unattended-risk acknowledgment: required. Receipt: organization-deletion-v1. Status fields: id, action, state, resources.organizationId, organization.status, organization.deleteAt. Agent input: AgentConfirmationInput. Agent result: AgentOrganizationDeletionResult.
For a person's own session (x-k8hq-token), or personal agent credentials (Authorization: Bearer) when enabled.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | orgId resource identifier. |
x-k8hq-delete-confirm (header) | string | Exact typed confirmation, UTF-8 percent-encoded (encodeURIComponent), decoded once; maximum 4096 encoded bytes. Use a bodyless DELETE. Input metadata, not authorization. Do not combine deletion headers with any body. JSON bodies remain supported for direct requests. |
Idempotency-Key (header) | string | Required for personal agent credentials: 16 to 128 visible ASCII characters. A session does not need this header. Keep the exact key and input when retrying after an unknown reply. |
Request body (JSON)
{"confirm":"Porter Design Studio"}
Response body (JSON)
Responses
| Status | Body | Meaning |
| 200 | JSON | Scheduled. |
| 400 | application/problem+json | The name doesn't match (confirm_name), or its deletion is already scheduled. |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required). |
| 403 | application/problem+json | Only an owner can (owner_only). |
| 404 | application/problem+json | The organization is outside this connection, or the target does not exist. |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | An owner left, was removed or was demoted in the last 7 days (owner_left_recently): try again once 7 days have passed. |
| 410 | application/problem+json | The organization is being deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Set organization icon
PUT/v1/organizations/{orgId}/icon
Changes the organization icon. Requires org.settings.change (owners by default) and a recent passkey. Icons are visible to organization members. The server validates and normalizes PNG images; audit events contain no image data.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | Organization ID. |
Request body (JSON)
| Field | Type | Description |
icon required | string | data:image/png;base64, followed by a PNG of at most 64 KiB decoded; square, 1–256 pixels. |
Response body (JSON)
| Field | Type | Description |
icon required | string | |
orgId required | string | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The saved icon, or an empty string after removal. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (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 this can't be changed until an owner adds credit. |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 410 | application/problem+json | The organization is being deleted or has been deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Remove organization icon
DELETE/v1/organizations/{orgId}/icon
Changes the organization icon. Requires org.settings.change (owners by default) and a recent passkey. Icons are visible to organization members. The server validates and normalizes PNG images; audit events contain no image data.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | Organization ID. |
Response body (JSON)
| Field | Type | Description |
icon required | string | |
orgId required | string | |
Responses
| Status | Body | Meaning |
| 200 | JSON | The saved icon, or an empty string after removal. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (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 this can't be changed until an owner adds credit. |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 410 | application/problem+json | The organization is being deleted or has been deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Organization services catalog and availability
GET/v1/organizations/{orgId}/services
Returns the services available for this organization and the value of each switch. Owners and admins manage switches independently of resource grants.
Independent program contract (conditional). When enabled, an independent program may read only its own organization’s services with Authorization: Bearer k8s1_... and current org.view authority. Do not combine credentials. This read checks the current credential, service identity, grant, app approval, publisher and organization state. It returns only catalog and services, without manageServices; it creates no receipt and needs no Idempotency-Key. No personal-agent credential is accepted here. This contract grants no permission to change services or read content. The service is off by default and requires explicit operator activation.
For a person's own session (x-k8hq-token), or independent program credentials (Authorization: Bearer) when enabled.
Parameters
| Name | Type | Description |
orgId (path) required | string | Organization ID. |
Response body (JSON)
Responses
| Status | Body | Meaning |
| 200 | JSON | The settings. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 410 | application/problem+json | The organization is being deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Change organization service availability
PATCH/v1/organizations/{orgId}/services
Owners and admins manage service availability independently of resource grants. Enable all available services affects stable services only. Choose a service ID from the organization’s catalog. Other IDs return service_unknown.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | Organization ID. |
Request body (JSON)
| Field | Type | Description |
enableAllAvailable | boolean | |
enabled | boolean | |
serviceId | string | A service ID from the organization’s services catalog. |
{"enabled":true,"serviceId":"boards"}
Response body (JSON)
| Field | Type | Description |
catalog required | object[] | |
manageServices required | boolean | |
services required | object | |
Responses
| Status | Body | Meaning |
| 200 | Services | The settings. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | Mail can't be turned off while the organization has active email addresses (mail_has_addresses). |
| 410 | application/problem+json | The organization is being deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
An organization's settings
GET/v1/organizations/{orgId}/settings
Its name, time zone and status, for any member; owners also see who pays, the payer's fallback and the sending probation.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Parameters
| Name | Type | Description |
orgId (path) required | string | Organization ID. |
Response body (JSON)
| Field | Type | Description |
mayRename required | boolean | They may rename it (org.settings.change). |
name required | string | Its display name; empty if it has none. |
orgId required | string | The organization (org_...). Pattern: ^org_. |
role required | member | developer | admin | owner | |
status required | active | pending_deletion | pending_deletion: its deletion is scheduled for deleteAt, and mail keeps flowing until then. An owner's own deletion can be cancelled by any owner; one with deleteReason nonpayment only by adding credit. |
timeZone required | string | An IANA time zone, such as America/New_York or UTC. UTC when unset. |
you required | string | A member (mem_...). Pattern: ^mem_. |
agentPermissionGrowth | AgentPermissionGrowthSettings | Owners only, while organization permission growth is available. |
billing | object | Who pays (owners). |
deleteAt | string | When a pending deletion starts. |
deleteReason | nonpayment | Set for a deletion K8 HQ scheduled because the organization stayed out of credit (design note 0024 step 5, day 180): owners can't cancel it; adding credit stops it, up to the moment it starts. |
deleteRequestedBy | string | Who asked for the deletion: a member (mem_...), or sys_billing for a nonpayment deletion. Pattern: ^(mem_|sys_). |
icon | string | Optional organization icon as a normalized PNG data URL. |
owners | string[] | The owners (owners see them, to hand billing over). |
probation | object | Sending probation (owners): new senders send to a few recipients a day, more as mail is delivered without complaints. The limit and history belong to the person who pays for the organization, shared by every organization they pay for (organizations without a payer have their own). |
sharedSpamReports | SharedSpamReportsSettings | Owners only. |
Responses
| Status | Body | Meaning |
| 200 | Settings | The settings. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 410 | application/problem+json | The organization is being deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Change organization settings
PATCH/v1/organizations/{orgId}/settings
Changes the organization's display name or time zone: owners (org.settings.change).
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | Organization ID. |
Request body (JSON)
| Field | Type | Description |
name | string | 1 to 100 characters. It can't include K8 HQ (in any case, spaced or not), except in K8 HQ's own organizations. |
timeZone | string | An IANA time zone, such as America/New_York or UTC. UTC when unset. |
{"name":"Porter Design Studio"}
Response body (JSON)
| Field | Type | Description |
orgId required | string | The organization (org_...). Pattern: ^org_. |
name | string | |
timeZone | string | An IANA time zone, such as America/New_York or UTC. UTC when unset. |
Responses
| Status | Body | Meaning |
| 200 | JSON | The settings changed, as stored. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (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 this can't be changed until an owner adds credit. |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Help improve spam filtering
PUT/v1/organizations/{orgId}/shared-spam-reports
Allows this organization's Spam reports to help other customers' filters. Off by default. Only an owner with a passkey used in the last five minutes can change it. Enabling is refused while unavailable (403 shared_spam_unavailable) or if any mail inbox is readable only with members' own keys (403 zero_access). Turning it off saves a withdrawal request in the same transaction, including when enabling is unavailable or the organization is read-only. Asking for the current value changes nothing. A later opt-in does not cancel an earlier withdrawal request or share old feedback. This changes contribution only; receiving shared scores does not require it.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
orgId (path) required | string | Organization ID. |
Request body (JSON)
| Field | Type | Description |
enabled required | boolean | Allow new shared Spam reports. |
Response body (JSON)
| Field | Type | Description |
available required | boolean | Whether enabling shared reports is available. The app hides the setting while false. |
enabled required | boolean | Whether the organization allows new shared Spam reports. |
withdrawalRequestedAt | string | When the last request to withdraw shared reports was saved. A later opt-in does not cancel that request. |
Responses
| Status | Body | Meaning |
| 200 | SharedSpamReportsSettings | The saved setting and latest withdrawal request. |
| 400 | application/problem+json | Malformed or invalid input (invalid). |
| 401 | application/problem+json | No session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (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 this can't be changed until an owner adds credit. |
| 403 | application/problem+json | They may not do this in the organization, or a browser origin other than the web app's (forbidden). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | The setting changed meanwhile. Reload and try again. |
| 410 | application/problem+json | The organization is being deleted or has been deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Cancel a deletion
POST/v1/orgs/delete/cancel
Cancels the organization's pending deletion (any owner; no passkey, so it's always quick): nothing is removed. Every owner is told. Not a deletion K8 HQ scheduled because the organization stayed out of credit (deleteReason nonpayment): adding credit stops that one.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
Request body (JSON)
| Field | Type | Description |
orgId required | string | The organization (org_...). Pattern: ^org_. |
{"orgId":"org_01J..."}
Response body (JSON)
| Field | Type | Description |
orgId required | string | The organization (org_...). Pattern: ^org_. |
Responses
| Status | Body | Meaning |
| 200 | JSON | Cancelled. |
| 400 | application/problem+json | No deletion is waiting to be cancelled. |
| 401 | application/problem+json | No session, it expired, or it isn't a person's own session (unauthenticated). |
| 403 | application/problem+json | Only an owner can (owner_only). |
| 409 | application/problem+json | The deletion is K8 HQ's, because the organization has been out of credit for months (nonpayment_deletion): adding credit on the Billing page stops it. |
| 410 | application/problem+json | The organization is being deleted (org_closed). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Choose who may create organization tags
POST/v1/tags/settings
Only an organization owner may change this setting. With createMembers true (the default), every member may create tags. With false, only owners and admins may create them. This does not change who may read or manage tags. Requires a person’s own signed-in session.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Parameters
| Name | Type | Description |
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). |
Request body (JSON)
| Field | Type | Description |
createMembers required | boolean | |
orgId required | string | Pattern: ^org_. |
Response body (JSON)
| Field | Type | Description |
createMembers required | boolean | |
Responses
| Status | Body | Meaning |
| 200 | JSON | Who may create tags. |
| 400 | application/problem+json | The request could not be completed. |
| 401 | application/problem+json | The request could not be completed. |
| 403 | application/problem+json | The request could not be completed. |
| 409 | application/problem+json | The request could not be completed. |
| 503 | application/problem+json | The request could not be completed. |