Forms — K8 HQ Setup API
Forms operations for K8 HQ Setup API. Requests, permissions and responses.
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 URL | For |
|---|---|
https://api.k8hq.com/setup | The K8 HQ web app, and programs acting with a person's session |
Endpoints
Forms
Keep a form
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
| 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 |
|---|---|---|
formId required | string | The board (frm_...). Pattern: ^frm_. |
orgId required | string | The organization (org_...). Pattern: ^org_. |
{"formId":"frm_01J...","orgId":"org_01J..."}
Response body (JSON)
| Field | Type | Description |
|---|---|---|
formId required | string | The board (frm_...). Pattern: ^frm_. |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | JSON | Kept. |
| 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 | Only an owner can (owner_only), or not a member (forbidden). |
| 404 | application/problem+json | No such form in the organization (not_found). |
| 409 | application/problem+json | Its purge has started, or it isn't being removed (removal_started). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
Create a form
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
| 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. |
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)
| Field | Type | Description |
|---|---|---|
Alternative 1 | SessionCreateFormResourceInput | SessionCreateFormResourceInput |
Alternative 2 | AgentFormInput | AgentFormInput |
Response body (JSON)
| Field | Type | Description |
|---|---|---|
Alternative 1 | SessionCreateFormResourceResult | SessionCreateFormResourceResult |
Alternative 2 | AgentFormResult | AgentFormResult |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | JSON | The new form. |
| 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 | Out of credit for 7 days or more, or read-only (design note 0024): nothing can be added 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). |
| 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 | The key names a different command, or current resource state prevents the change. |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |
List form 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
| Name | Type | Description |
|---|---|---|
orgId (path) required | string | orgId resource identifier. |
Response body (JSON)
| Field | Type | Description |
|---|---|---|
removals required | object[] |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | JSON | Waiting removals. |
| 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. |
Remove a form
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
| 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. |
formId (path) required | string | formId 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)
| Field | Type | Description |
|---|---|---|
Alternative 1 | SessionDeleteFormResourceInput | SessionDeleteFormResourceInput |
Alternative 2 | AgentConfirmationInput | AgentConfirmationInput |
{"confirm":"Development"}
Response body (JSON)
| Field | Type | Description |
|---|---|---|
Alternative 1 | SessionDeleteFormResourceResult | SessionDeleteFormResourceResult |
Alternative 2 | AgentRemovalReceipt | AgentRemovalReceipt |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | JSON | Closed; its purge is scheduled. |
| 400 | application/problem+json | The typed confirmation doesn't match (confirm_name), 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). |
| 404 | application/problem+json | No such board in the organization (not_found). |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | An item was added to the empty board meanwhile, so its removal needs the 7-day wait: ask again (board_changed). |
| 410 | application/problem+json | The organization is being deleted (org_closed). |
| 429 | application/problem+json | The organization removed 10 inboxes, boards and domains today (removal_limit). |
| 503 | application/problem+json | A temporary problem (unavailable); retry. |