K8 HQ

Organizations — K8 HQ Setup API

Organizations operations for K8 HQ Setup API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

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

FieldTypeDescription
orgs requiredOrg[]

Responses

StatusBodyMeaning
200JSONTheir organizations, by ID.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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)

FieldTypeDescription
name requiredstring1 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)

FieldTypeDescription
org requiredOrg

Responses

StatusBodyMeaning
200JSONThe new organization.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonA new payer pays for 3 organizations already, the most while they're new (new_payer_orgs).
429application/problem+jsonToo many organizations (org_limit).
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringorgId resource identifier.
x-k8hq-delete-confirm (header)stringExact 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)stringRequired 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)

FieldTypeDescription
Alternative 1SessionDeleteOrgResourceInputSessionDeleteOrgResourceInput
Alternative 2AgentConfirmationInputAgentConfirmationInput
{"confirm":"Porter Design Studio"}

Response body (JSON)

FieldTypeDescription
Alternative 1SessionDeleteOrgResourceResultSessionDeleteOrgResourceResult
Alternative 2AgentOrganizationDeletionResultAgentOrganizationDeletionResult

Responses

StatusBodyMeaning
200JSONScheduled.
400application/problem+jsonThe name doesn't match (confirm_name), or its deletion is already scheduled.
401application/problem+jsonNo 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).
403application/problem+jsonOnly an owner can (owner_only).
404application/problem+jsonThe organization is outside this connection, or the target does not exist.
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonAn owner left, was removed or was demoted in the last 7 days (owner_left_recently): try again once 7 days have passed.
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringOrganization ID.

Request body (JSON)

FieldTypeDescription
icon requiredstringdata:image/png;base64, followed by a PNG of at most 64 KiB decoded; square, 1–256 pixels.

Response body (JSON)

FieldTypeDescription
icon requiredstring
orgId requiredstring

Responses

StatusBodyMeaning
200JSONThe saved icon, or an empty string after removal.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
402application/problem+jsonThe 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.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
410application/problem+jsonThe organization is being deleted or has been deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringOrganization ID.

Response body (JSON)

FieldTypeDescription
icon requiredstring
orgId requiredstring

Responses

StatusBodyMeaning
200JSONThe saved icon, or an empty string after removal.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
402application/problem+jsonThe 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.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
410application/problem+jsonThe organization is being deleted or has been deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
orgId (path) requiredstringOrganization ID.

Response body (JSON)

FieldTypeDescription
Alternative 1ServicesServices
Alternative 2AgentServiceViewAgentServiceView

Responses

StatusBodyMeaning
200JSONThe settings.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringOrganization ID.

Request body (JSON)

FieldTypeDescription
enableAllAvailableboolean
enabledboolean
serviceIdstringA service ID from the organization’s services catalog.
{"enabled":true,"serviceId":"boards"}

Response body (JSON)

FieldTypeDescription
catalog requiredobject[]
manageServices requiredboolean
services requiredobject

Responses

StatusBodyMeaning
200ServicesThe settings.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonMail can't be turned off while the organization has active email addresses (mail_has_addresses).
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
orgId (path) requiredstringOrganization ID.

Response body (JSON)

FieldTypeDescription
mayRename requiredbooleanThey may rename it (org.settings.change).
name requiredstringIts display name; empty if it has none.
orgId requiredstringThe organization (org_...). Pattern: ^org_.
role requiredmember | developer | admin | owner
status requiredactive | pending_deletionpending_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 requiredstringAn IANA time zone, such as America/New_York or UTC. UTC when unset.
you requiredstringA member (mem_...). Pattern: ^mem_.
agentPermissionGrowthAgentPermissionGrowthSettingsOwners only, while organization permission growth is available.
billingobjectWho pays (owners).
deleteAtstringWhen a pending deletion starts.
deleteReasonnonpaymentSet 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.
deleteRequestedBystringWho asked for the deletion: a member (mem_...), or sys_billing for a nonpayment deletion. Pattern: ^(mem_|sys_).
iconstringOptional organization icon as a normalized PNG data URL.
ownersstring[]The owners (owners see them, to hand billing over).
probationobjectSending 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).
sharedSpamReportsSharedSpamReportsSettingsOwners only.

Responses

StatusBodyMeaning
200SettingsThe settings.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringOrganization ID.

Request body (JSON)

FieldTypeDescription
namestring1 to 100 characters. It can't include K8 HQ (in any case, spaced or not), except in K8 HQ's own organizations.
timeZonestringAn IANA time zone, such as America/New_York or UTC. UTC when unset.
{"name":"Porter Design Studio"}

Response body (JSON)

FieldTypeDescription
orgId requiredstringThe organization (org_...). Pattern: ^org_.
namestring
timeZonestringAn IANA time zone, such as America/New_York or UTC. UTC when unset.

Responses

StatusBodyMeaning
200JSONThe settings changed, as stored.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
402application/problem+jsonThe 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.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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) requiredstringOrganization ID.

Request body (JSON)

FieldTypeDescription
enabled requiredbooleanAllow new shared Spam reports.

Response body (JSON)

FieldTypeDescription
available requiredbooleanWhether enabling shared reports is available. The app hides the setting while false.
enabled requiredbooleanWhether the organization allows new shared Spam reports.
withdrawalRequestedAtstringWhen the last request to withdraw shared reports was saved. A later opt-in does not cancel that request.

Responses

StatusBodyMeaning
200SharedSpamReportsSettingsThe saved setting and latest withdrawal request.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo 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).
402application/problem+jsonThe 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.
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonThe setting changed meanwhile. Reload and try again.
410application/problem+jsonThe organization is being deleted or has been deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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)

FieldTypeDescription
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"orgId":"org_01J..."}

Response body (JSON)

FieldTypeDescription
orgId requiredstringThe organization (org_...). Pattern: ^org_.

Responses

StatusBodyMeaning
200JSONCancelled.
400application/problem+jsonNo deletion is waiting to be cancelled.
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonOnly an owner can (owner_only).
409application/problem+jsonThe 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.
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA 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

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe 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)

FieldTypeDescription
createMembers requiredboolean
orgId requiredstringPattern: ^org_.

Response body (JSON)

FieldTypeDescription
createMembers requiredboolean

Responses

StatusBodyMeaning
200JSONWho may create tags.
400application/problem+jsonThe request could not be completed.
401application/problem+jsonThe request could not be completed.
403application/problem+jsonThe request could not be completed.
409application/problem+jsonThe request could not be completed.
503application/problem+jsonThe request could not be completed.