K8 HQ

Forms — K8 HQ Setup API

Forms 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 form pages whose responses arrive like mail.

Forms (design note 0019): public form pages whose responses are stored like mail.

Base URL

Base URLFor
https://api.k8hq.com/setupThe K8 HQ web app, and programs acting with a person's session

Endpoints

Forms

Keep a form

POST/v1/forms/delete/cancel

Keeps a form whose removal hasn't purged it yet: any owner, no passkey (like keeping an inbox). It comes back with its responses and everyone's access, paused if it was live: its members resume or publish it. The owners and its members are told.

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
formId requiredstringThe board (frm_...). Pattern: ^frm_.
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"formId":"frm_01J...","orgId":"org_01J..."}

Response body (JSON)

FieldTypeDescription
formId requiredstringThe board (frm_...). Pattern: ^frm_.

Responses

StatusBodyMeaning
200JSONKept.
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+jsonOnly an owner can (owner_only), or not a member (forbidden).
404application/problem+jsonNo such form in the organization (not_found).
409application/problem+jsonIts purge has started, or it isn't being removed (removal_started).
503application/problem+jsonA temporary problem (unavailable); retry.

Create a form

POST/v1/organizations/{orgId}/forms

Creates a form (design note 0019) with the person as its first member: a draft with the folders New, Done, Spam, Trash and Held and a daily limit of 500 responses. Its fields are written in the browser, sealed (PUT /api/v1/forms/{form}/draft), and published through the content API (POST /api/v1/forms/{form}/publish). Needs forms.create; at most 200 forms an organization. Refused from day 7 out of credit, as new inboxes and domains are.

Personal agent contract (conditional). Create only an empty draft form with retentionDays zero and initial creator access. Positive retention, publication and sealed definitions are not accepted. 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.createFormResource. Permissions: forms.create. Unattended-risk acknowledgment: required. Receipt: atomic-draft-form-create-v1. Status fields: id, action, state, resources.organizationId, resources.formId. Agent input: AgentFormInput. Agent result: AgentFormResult.

For a person's own session (x-k8hq-token), or personal agent credentials (Authorization: Bearer) when enabled. 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.
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 1SessionCreateFormResourceInputSessionCreateFormResourceInput
Alternative 2AgentFormInputAgentFormInput

Response body (JSON)

FieldTypeDescription
Alternative 1SessionCreateFormResourceResultSessionCreateFormResourceResult
Alternative 2AgentFormResultAgentFormResult

Responses

StatusBodyMeaning
200JSONThe new form.
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+jsonOut of credit for 7 days or more, or read-only (design note 0024): nothing can be added 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).
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+jsonThe key names a different command, or current resource state prevents the change.
503application/problem+jsonA temporary problem (unavailable); retry.

List form removals

GET/v1/organizations/{orgId}/forms/removals

The organization's forms waiting for their purge, which an owner can still keep; for members with containers.delete (owners and admins).

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
orgId (path) requiredstringorgId resource identifier.

Response body (JSON)

FieldTypeDescription
removals requiredobject[]

Responses

StatusBodyMeaning
200JSONWaiting removals.
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.

Remove a form

DELETE/v1/organizations/{orgId}/forms/{formId}

Removes a form (design note 0019 section 11), for members with containers.delete (owners and admins), typing its name to confirm. It stops taking responses at once and nobody can open it. Its responses, definitions, settings, keys and everyone's access are deleted for good at purgeAt, 7 days later, or within minutes if it has no response; until then any owner can keep it (Keep a form). Its public address then answers that the form was removed (410, for 90 days). Copies of its responses already put in an inbox stay there. The owners and its members are told, and the owners are reminded daily until then. Copies of deleted content in backups can't be read and are gone after about 6 weeks. An organization removes at most 10 inboxes, boards, forms and domains a day (removal_limit). Bound to the action by per-action confirmation (form.delete) once that exists; a recent passkey until then.

Needs a passkey confirmation of this change (x-k8hq-confirm: container.delete). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

Personal agent contract (conditional). Schedule removal of the exact form. The committed receipt is scheduling acceptance, not current pending state or purge completion. The system continues after app disconnection; the existing human cancellation path remains available during the grace period. 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.deleteFormResource. Permissions: containers.delete. Unattended-risk acknowledgment: required. Receipt: form-removal-v1. Status fields: id, action, state, resources.formId. Agent input: AgentConfirmationInput. Agent result: AgentRemovalReceipt.

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.
formId (path) requiredstringformId 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 1SessionDeleteFormResourceInputSessionDeleteFormResourceInput
Alternative 2AgentConfirmationInputAgentConfirmationInput
{"confirm":"Development"}

Response body (JSON)

FieldTypeDescription
Alternative 1SessionDeleteFormResourceResultSessionDeleteFormResourceResult
Alternative 2AgentRemovalReceiptAgentRemovalReceipt

Responses

StatusBodyMeaning
200JSONClosed; its purge is scheduled.
400application/problem+jsonThe typed confirmation doesn't match (confirm_name), 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).
404application/problem+jsonNo such board in the organization (not_found).
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonAn item was added to the empty board meanwhile, so its removal needs the 7-day wait: ask again (board_changed).
410application/problem+jsonThe organization is being deleted (org_closed).
429application/problem+jsonThe organization removed 10 inboxes, boards and domains today (removal_limit).
503application/problem+jsonA temporary problem (unavailable); retry.