{"openapi":"3.1.0","info":{"title":"Rokn API","version":"1"},"servers":[{"url":"/api/v1"}],"paths":{"/workspaces":{"get":{"operationId":"get_workspaces","summary":"List the caller's workspaces","description":"The workspaces this credential can address: exactly one for an API key (the workspace it was issued in), every active membership of the user for an OAuth token. Only active workspaces are listed; a closing workspace is not reachable over the API.","tags":["Meta"],"security":[{"apiKey":[]},{"oauth2":[]}],"x-rokn-scope":"any","parameters":[],"responses":{"200":{"description":"List the caller's workspaces","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"logoUrl":{"description":"The workspace logo's public link, or null when it has none.","type":["string","null"]},"role":{"description":"The caller's role in this workspace; null for an API key, which is not a person.","type":["string","null"]},"timezone":{"type":"string","description":"The workspace's IANA timezone (#162). A person's own timezone, when set, comes first: `GET /me`."}},"required":["slug","name","logoUrl","role","timezone"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/me":{"get":{"operationId":"get_workspaces_slug_me","summary":"Describe the caller","description":"Returns the kind of credential making the request, the workspace it is addressing, the scopes it can actually use there — an API key's own scopes, or an OAuth token's scopes intersected with what the acting member's role allows — and the workspace's own plan limits. `-1` on either limit means unlimited: on `apiRequestsPerMinute` it is also what a rate-limited response's `X-RateLimit-Limit`/`X-RateLimit-Remaining` headers report for an unlimited caller, rather than a made-up large number. A configured `apiRequestsPerMinute` of `0` means the workspace may make NO API requests — every call is 429 with the headers reporting limit 0; only a workspace whose plan and overrides configure no limit at all falls back to the 60-per-minute default.","tags":["Meta"],"security":[{"apiKey":[]},{"oauth2":[]}],"x-rokn-scope":"any","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Describe the caller","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["api_key","oauth"]},"workspace":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"],"additionalProperties":false},"scopes":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"apiRequestsPerMinute":{"type":"number"},"firstPartyRequestsPerMinute":{"type":"number","description":"Rokn's own app: a separate per-workspace budget on every plan (#142)."},"apiKeys":{"type":"number"}},"required":["apiRequestsPerMinute","firstPartyRequestsPerMinute","apiKeys"],"additionalProperties":false}},"required":["kind","workspace","scopes","limits"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/me":{"get":{"operationId":"get_me","summary":"Describe the signed-in person","description":"The person an OAuth token acts for: their id, name, email, picture and own timezone. Needs the `profile` scope, the OIDC scope for a person's own details. An API key is refused: it belongs to a workspace, not a person.","tags":["Meta"],"security":[{"apiKey":[]},{"oauth2":[]}],"x-rokn-scope":"any","parameters":[],"responses":{"200":{"description":"Describe the signed-in person","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"imageUrl":{"type":["string","null"]},"timezone":{"description":"The person's own IANA timezone, or null when they never set one; then use the workspace's.","type":["string","null"]}},"required":["userId","name","email","imageUrl","timezone"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients":{"get":{"operationId":"get_workspaces_slug_clients","summary":"List clients","description":"Newest-updated first unless `sort` says otherwise, keyset-paginated (`limit` 25, at most 100; pass `nextCursor` back as `cursor` until it is null). The cursor snapshots the boundary row, so an edit between pages repeats and skips nothing. Filter by `status`, `search`, `where` (field filters) and `updated_after` (exclusive at millisecond precision, so a record's own `updatedAt` excludes that record). Refusals: an invalid `cursor` or a malformed `where` is 422 `validation_failed`; an unknown `sort` key is 422 `unknown_field`; a bad filter operand is 422 `invalid_field_filter`.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:read"]}],"x-rokn-scope":"clients:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`.","type":"string","maxLength":10934},"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`."},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["active","archived"]}},{"in":"query","name":"search","schema":{"type":"string","maxLength":100}},{"in":"query","name":"where","schema":{"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`.","type":"string","maxLength":4000},"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`."},{"in":"query","name":"sort","schema":{"description":"One of name, type, email, lifecycle, created_at, updated_at, or a field key; a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`. A money field orders by currency, then amount.","type":"string","minLength":1,"maxLength":100},"description":"One of name, type, email, lifecycle, created_at, updated_at, or a field key; a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`. A money field orders by currency, then amount."}],"responses":{"200":{"description":"List clients","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["company","individual"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"street":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip":{"type":["string","null"]},"country":{"type":["string","null"]}},"required":["street","city","state","zip","country"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"currency":{"type":["string","null"]},"vatId":{"type":["string","null"]},"locale":{"type":["string","null"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"primaryContact":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","role","phone","email"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","type","email","phone","website","address","notes","currency","vatId","locale","archivedAt","fields","createdAt","updatedAt","primaryContact"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false},"description":"The client field definitions; each item's `fields` is keyed by their `key`."},"nextCursor":{"description":"Pass as `cursor` for the next page; null on the last page.","type":["string","null"]}},"required":["items","fields","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_clients","summary":"Create a client","description":"Creates a client in the addressed workspace, with `fields` by field key. `currency` defaults to the workspace currency and cannot be changed once set. Counts against the plan's client limit. A refused field value is 422 at `fields.<key>` (`unknown_field`, `unknown_field_option`, `invalid_field_value`, `field_required`); a value another client already holds in a unique field is 409 `field_unique_conflict`.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["company","individual"]},"email":{"type":"string"},"phone":{"type":"string"},"website":{"type":"string"},"address":{"type":"object","properties":{"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"}}},"notes":{"type":"string"},"currency":{"type":"string"},"vatId":{"type":"string"},"locale":{"type":"string"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["name","type"]}}}},"responses":{"201":{"description":"Create a client","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["company","individual"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"street":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip":{"type":["string","null"]},"country":{"type":["string","null"]}},"required":["street","city","state","zip","country"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"currency":{"type":["string","null"]},"vatId":{"type":["string","null"]},"locale":{"type":["string","null"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","email","phone","website","address","notes","currency","vatId","locale","archivedAt","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/contracts":{"get":{"operationId":"get_workspaces_slug_contracts","summary":"List contracts","description":"Canonical contract tracking, newest-updated first. Filter by client_id, project_id and exclusive updated_after; use nextCursor for pagination. Value is a lossless integer minor-unit string. Retained reads remain available in billing read-only mode.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:read"]}],"x-rokn-scope":"contracts:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"client_id","schema":{"type":"string"}},{"in":"query","name":"project_id","schema":{"type":"string"}}],"responses":{"200":{"description":"List contracts","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"currency":{"type":"string"},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"latestRequestId":{"type":["string","null"]},"state":{"type":"string","enum":["draft","sent","viewed","signed","rejected","expired","cancelled"]},"artifactState":{"anyOf":[{"type":"string","enum":["pending","ready","failed"]},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","documentId","revision","clientId","projectId","startDate","endDate","valueMinor","currency","renewalDate","latestRequestId","state","artifactState","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_contracts","summary":"Create a contract draft","description":"Classifies an existing canonical document and creates its contract tracking and all-required draft signer roster (1–20). Rejects an existing contract. No invitation or signing authority is issued.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:write"]}],"x-rokn-scope":"contracts:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string","minLength":1},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"expiresInDays":{"default":30,"type":"integer","minimum":1,"maximum":365},"signers":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"contactId":{"type":"string","minLength":1},"memberId":{"type":"string","minLength":1}},"required":["name","email"],"additionalProperties":false}}},"required":["documentId","startDate","endDate","valueMinor","renewalDate","signers"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a contract draft","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"currency":{"type":"string"},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"latestRequestId":{"type":["string","null"]},"state":{"type":"string","enum":["draft","sent","viewed","signed","rejected","expired","cancelled"]},"artifactState":{"anyOf":[{"type":"string","enum":["pending","ready","failed"]},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","documentId","revision","clientId","projectId","startDate","endDate","valueMinor","currency","renewalDate","latestRequestId","state","artifactState","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/contracts/{id}":{"get":{"operationId":"get_workspaces_slug_contracts_id","summary":"Get a contract","description":"Contract tracking, current draft roster and immutable request history. No invitation tokens, OTPs, proofs, storage capabilities, raw signatures or worker leases. Foreign contracts are not found.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:read"]}],"x-rokn-scope":"contracts:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a contract","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"currency":{"type":"string"},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"latestRequestId":{"type":["string","null"]},"state":{"type":"string","enum":["draft","sent","viewed","signed","rejected","expired","cancelled"]},"artifactState":{"anyOf":[{"type":"string","enum":["pending","ready","failed"]},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"documentName":{"type":"string"},"sourceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiresInDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"draftSigners":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"contactId":{"type":["string","null"]},"memberId":{"type":["string","null"]}},"required":["id","name","email","contactId","memberId"],"additionalProperties":false}},"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"viewedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"signedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"rejectedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"sourceVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"draftRevision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"frozenSha256":{"type":["string","null"]},"frozenBytes":{"type":["number","null"]},"snapshot":{"anyOf":[{"type":"object","properties":{"documentId":{"type":"string"},"documentName":{"type":"string"},"clientId":{"type":["string","null"]},"clientName":{"type":["string","null"]},"projectId":{"type":["string","null"]},"projectName":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"valueMinor":{"type":["string","null"]},"currency":{"type":"string"},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["documentId","documentName","clientId","clientName","projectId","projectName","startDate","endDate","valueMinor","currency","renewalDate"],"additionalProperties":false},{"type":"null"}]},"artifactState":{"anyOf":[{"type":"string","enum":["pending","ready","failed"]},{"type":"null"}]},"signers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"contactId":{"type":["string","null"]},"memberId":{"type":["string","null"]},"status":{"type":"string"},"signedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"rejectedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"invitationSentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deliveryState":{"type":"string","enum":["pending","sent","failed"]}},"required":["id","name","email","contactId","memberId","status","signedAt","rejectedAt","invitationSentAt","deliveryState"],"additionalProperties":false}}},"required":["id","status","sentAt","viewedAt","signedAt","rejectedAt","expiresAt","cancelledAt","sourceVersion","draftRevision","frozenSha256","frozenBytes","snapshot","artifactState","signers"],"additionalProperties":false}}},"required":["id","documentId","revision","clientId","projectId","startDate","endDate","valueMinor","currency","renewalDate","latestRequestId","state","artifactState","updatedAt","documentName","sourceVersion","expiresInDays","draftSigners","requests"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_contracts_id","summary":"Update a contract draft","description":"Replaces the draft metadata and roster with mandatory expectedRevision. documentId must belong to the addressed contract. Optional If-Match is checked under mutation locks. Frozen requests and accepted signatures are preserved.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:write"]}],"x-rokn-scope":"contracts:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string","minLength":1},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"expiresInDays":{"default":30,"type":"integer","minimum":1,"maximum":365},"signers":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"contactId":{"type":"string","minLength":1},"memberId":{"type":"string","minLength":1}},"required":["name","email"],"additionalProperties":false}}},"required":["documentId","startDate","endDate","valueMinor","renewalDate","signers"],"additionalProperties":false}}}},"responses":{"200":{"description":"Update a contract draft","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"currency":{"type":"string"},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"latestRequestId":{"type":["string","null"]},"state":{"type":"string","enum":["draft","sent","viewed","signed","rejected","expired","cancelled"]},"artifactState":{"anyOf":[{"type":"string","enum":["pending","ready","failed"]},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","documentId","revision","clientId","projectId","startDate","endDate","valueMinor","currency","renewalDate","latestRequestId","state","artifactState","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/contracts/{id}/send":{"post":{"operationId":"post_workspaces_slug_contracts_id_send","summary":"Send a contract","description":"Freezes the expected document version and draft revision, then atomically creates one all-required parallel signing request and queues invitations. Replaces only unfinished requests, preserving history. PDF/storage preparation occurs outside the mutation transaction. Idempotency-Key replays the committed response; email delivery is durable and best-effort after commit. Refused with 409 `contract_unfilled_placeholders` while an editor document still holds a template placeholder to fill in (bracketed, highlighted text such as `[Project start date]`); the detail names each one. This never accepts a human signature.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:write"]}],"x-rokn-scope":"contracts:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"expectedSourceVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["expectedRevision","expectedSourceVersion"],"additionalProperties":false}}}},"responses":{"200":{"description":"Send a contract","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"currency":{"type":"string"},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"latestRequestId":{"type":["string","null"]},"state":{"type":"string","enum":["draft","sent","viewed","signed","rejected","expired","cancelled"]},"artifactState":{"anyOf":[{"type":"string","enum":["pending","ready","failed"]},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","documentId","revision","clientId","projectId","startDate","endDate","valueMinor","currency","renewalDate","latestRequestId","state","artifactState","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/contracts/{id}/requests/{requestId}/cancel":{"post":{"operationId":"post_workspaces_slug_contracts_id_requests_requestId_cancel","summary":"Cancel a contract request","description":"Cancels an unfinished request belonging to this contract. Retains frozen documents and accepted evidence; revokes remaining signing authority. Terminal requests cannot be cancelled.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:write"]}],"x-rokn-scope":"contracts:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"requestId","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"responses":{"200":{"description":"Cancel a contract request","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"valueMinor":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"currency":{"type":"string"},"renewalDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"latestRequestId":{"type":["string","null"]},"state":{"type":"string","enum":["draft","sent","viewed","signed","rejected","expired","cancelled"]},"artifactState":{"anyOf":[{"type":"string","enum":["pending","ready","failed"]},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","documentId","revision","clientId","projectId","startDate","endDate","valueMinor","currency","renewalDate","latestRequestId","state","artifactState","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/contracts/{id}/signers/{signerId}/resend":{"post":{"operationId":"post_workspaces_slug_contracts_id_signers_signerId_resend","summary":"Resend a contract invitation","description":"Queues an invitation for a pending signer of this contract's live request. Does not exchange OTP, mint proof or sign. Delivery occurs after commit and may be retried by the durable mail worker.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:write"]}],"x-rokn-scope":"contracts:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"signerId","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"responses":{"200":{"description":"Resend a contract invitation","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"boolean","const":true}},"required":["queued"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/contracts/{id}/requests/{requestId}/retry-artifact":{"post":{"operationId":"post_workspaces_slug_contracts_id_requests_requestId_retry-artifact","summary":"Retry a contract's final artifact","description":"Queues another attempt at the final signed PDF for a SIGNED request of this contract whose artifact failed. Reuses the immutable accepted evidence; never reopens signing, contacts a signer or accepts a signature. Refused unless the artifact is failed and the workspace is active. Rendering happens after commit and is retried by the durable job worker.","tags":["Contracts"],"security":[{"apiKey":[]},{"oauth2":["contracts:write"]}],"x-rokn-scope":"contracts:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"requestId","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"responses":{"200":{"description":"Retry a contract's final artifact","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"boolean","const":true}},"required":["queued"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients/upsert":{"post":{"operationId":"post_workspaces_slug_clients_upsert","summary":"Create or update a client by a unique field","description":"Finds the client holding `match.value` in the unique field `match.field` and updates it from `client`, or creates one. Overlapping requests for one value make one client; the others return `created: false`. A field that is not unique is 409 `field_not_unique`; an unknown field is 422 `unknown_field`; an archived match is 409 like any edit of an archived client; the other refusals are those of create and update.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"match":{"type":"object","properties":{"field":{"type":"string","minLength":1,"description":"The key of a unique client field."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}],"description":"The value to look up in that field."}},"required":["field","value"]},"client":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["company","individual"]},"email":{"type":"string"},"phone":{"type":"string"},"website":{"type":"string"},"address":{"type":"object","properties":{"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"}}},"notes":{"type":"string"},"currency":{"type":"string"},"vatId":{"type":"string"},"locale":{"type":"string"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["name","type"],"description":"Creates the client with these values (the match value is stored in the match field), or updates the matched one."}},"required":["match","client"]}}}},"responses":{"200":{"description":"Create or update a client by a unique field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["company","individual"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"street":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip":{"type":["string","null"]},"country":{"type":["string","null"]}},"required":["street","city","state","zip","country"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"currency":{"type":["string","null"]},"vatId":{"type":["string","null"]},"locale":{"type":["string","null"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","email","phone","website","address","notes","currency","vatId","locale","archivedAt","fields","createdAt","updatedAt"],"additionalProperties":false},"created":{"type":"boolean"}},"required":["client","created"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients/{id}":{"get":{"operationId":"get_workspaces_slug_clients_id","summary":"Get a client","description":"One client by id. A client in another workspace is not found.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:read"]}],"x-rokn-scope":"clients:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a client","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["company","individual"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"street":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip":{"type":["string","null"]},"country":{"type":["string","null"]}},"required":["street","city","state","zip","country"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"currency":{"type":["string","null"]},"vatId":{"type":["string","null"]},"locale":{"type":["string","null"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","email","phone","website","address","notes","currency","vatId","locale","archivedAt","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_clients_id","summary":"Update a client","description":"Partial update; only the fields present are written (`fields` by field key, a key set to `null` is cleared). Field refusals are those of create. An archived client is read-only and answers 409 unless the request only restores it (`lifecycle`). Supports `If-Match` (Task 13): a mismatched value is 412 `precondition_failed` and the write does not run — checked atomically as part of the same UPDATE, never a separate read-compare-write.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["company","individual"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"}}},{"type":"null"}]},"notes":{"type":["string","null"]},"currency":{"type":["string","null"]},"lifecycle":{"type":"string","enum":["active","paused","archived"]},"vatId":{"type":["string","null"]},"locale":{"type":["string","null"]},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}}}}}},"responses":{"200":{"description":"Update a client","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["company","individual"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"street":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip":{"type":["string","null"]},"country":{"type":["string","null"]}},"required":["street","city","state","zip","country"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"currency":{"type":["string","null"]},"vatId":{"type":["string","null"]},"locale":{"type":["string","null"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","email","phone","website","address","notes","currency","vatId","locale","archivedAt","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients/{id}/delete-impact":{"get":{"operationId":"get_workspaces_slug_clients_id_delete-impact","summary":"What deleting a client would do","description":"Counts what deleting the client removes (`deleted`), detaches and keeps (`unlinked`) and what stops the delete (`blocked`, with the records in `blockedRecords`), and how many signed contracts it holds. Changes nothing. Needs `clients:write` and a role that may delete, as the delete itself does; `blockedByPermission` names the sections whose removed rows this caller may not delete, and the delete is then refused. A client in another workspace is not found.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"What deleting a client would do","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","count"],"additionalProperties":false}},"unlinked":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","count"],"additionalProperties":false}},"blocked":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","count"],"additionalProperties":false}},"signedContracts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blockedRecords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"blockedByPermission":{"type":"array","items":{"type":"string"}}},"required":["deleted","unlinked","blocked","signedContracts","blockedRecords","blockedByPermission"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients/{id}/archive":{"post":{"operationId":"post_workspaces_slug_clients_id_archive","summary":"Archive a client","description":"Marks the client archived and read-only; `archivedAt` is set on the response.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Archive a client","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["company","individual"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"street":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip":{"type":["string","null"]},"country":{"type":["string","null"]}},"required":["street","city","state","zip","country"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"currency":{"type":["string","null"]},"vatId":{"type":["string","null"]},"locale":{"type":["string","null"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","email","phone","website","address","notes","currency","vatId","locale","archivedAt","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients/{id}/contacts":{"get":{"operationId":"get_workspaces_slug_clients_id_contacts","summary":"List a client's contacts","description":"Every contact on the client, primary first unless `sort` says otherwise, filtered by `where` (contact field filters). Not paginated. A malformed `where` is 422 `validation_failed`; a bad filter operand is 422 `invalid_field_filter`.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:read"]}],"x-rokn-scope":"clients:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"where","schema":{"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`.","type":"string","maxLength":4000},"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`."},{"in":"query","name":"sort","schema":{"description":"`name`, `created_at` or a contact field key; a leading `-` sorts descending. Default: primary first, then oldest first. An unknown key is 422 `unknown_field`.","type":"string","minLength":1,"maxLength":100},"description":"`name`, `created_at` or a contact field key; a leading `-` sorts descending. Default: primary first, then oldest first. An unknown key is 422 `unknown_field`."}],"responses":{"200":{"description":"List a client's contacts","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","email","phone","role","isPrimary","fields","createdAt","updatedAt"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false},"description":"The contact field definitions; each item's `fields` is keyed by their `key`."}},"required":["items","fields"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_clients_id_contacts","summary":"Add a contact","description":"Adds a contact to the client, with `fields` by contact field key. `isPrimary: true` makes it the client's primary contact and clears the flag on the previous one. Field refusals are 422 at `fields.<key>`; a value another contact holds in a unique field is 409 `field_unique_conflict`; an archived client is 409.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string"},"phone":{"type":"string"},"role":{"type":"string"},"isPrimary":{"default":false,"type":"boolean"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["name"]}}}},"responses":{"201":{"description":"Add a contact","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","email","phone","role","isPrimary","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/contacts/upsert":{"post":{"operationId":"post_workspaces_slug_contacts_upsert","summary":"Create or update a contact by a unique field","description":"Finds the contact holding `match.value` in the unique contact field `match.field` and updates it from `contact`, or creates one under `contact.clientId`. Overlapping requests for one value make one contact; the others return `created: false`. A match under another client than `clientId` is 409 `contact_client_mismatch` and nothing moves; a field that is not unique is 409 `field_not_unique`; when no contact holds the value, a `contact.clientId` that is not a client of this workspace is 404 (a held value is `contact_client_mismatch` first); the other refusals are those of add and update.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"match":{"type":"object","properties":{"field":{"type":"string","minLength":1,"description":"The key of a unique contact field (unique across the workspace's contacts)."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}],"description":"The value to look up in that field."}},"required":["field","value"]},"contact":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string"},"phone":{"type":"string"},"role":{"type":"string"},"isPrimary":{"default":false,"type":"boolean"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}},"clientId":{"type":"string","minLength":1}},"required":["name","clientId"],"description":"Creates the contact under `clientId` with these values (the match value is stored in the match field), or updates the matched one."}},"required":["match","contact"]}}}},"responses":{"200":{"description":"Create or update a contact by a unique field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"contact":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","email","phone","role","isPrimary","fields","createdAt","updatedAt"],"additionalProperties":false},"created":{"type":"boolean"}},"required":["contact","created"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients/{id}/contacts/{contactId}":{"patch":{"operationId":"patch_workspaces_slug_clients_id_contacts_contactId","summary":"Update a contact","description":"Partial update of one contact under the client (`fields` by contact field key). Field refusals are those of add; an archived client is 409.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"contactId","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}}}}}},"responses":{"200":{"description":"Update a contact","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"role":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","email","phone","role","isPrimary","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_clients_id_contacts_contactId","summary":"Delete a contact","description":"Removes the contact. A contact that is not on this client, or not in this workspace, is not found.","tags":["Clients"],"security":[{"apiKey":[]},{"oauth2":["clients:write"]}],"x-rokn-scope":"clients:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"contactId","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a contact","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects":{"get":{"operationId":"get_workspaces_slug_projects","summary":"List projects","description":"Newest-updated first unless `sort` says otherwise, keyset-paginated (`limit` 25, at most 100; pass `nextCursor` back as `cursor` until it is null). The cursor snapshots the boundary row, so an edit between pages repeats and skips nothing. Filter by `status_id`, `class`, `client_id`, `due`, `search`, `where` (field filters) and `updated_after` (exclusive at millisecond precision, so a record's own `updatedAt` excludes that record). Refusals: an invalid `cursor`, `class` or `where` is 422 `validation_failed`; an unknown `sort` key is 422 `unknown_field`; a bad filter operand is 422 `invalid_field_filter`.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:read"]}],"x-rokn-scope":"projects:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`.","type":"string","maxLength":10934},"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`."},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status_id","schema":{"description":"One project status (`GET /statuses?record_type=project`).","type":"string","minLength":1,"maxLength":128},"description":"One project status (`GET /statuses?record_type=project`)."},{"in":"query","name":"class","schema":{"description":"Comma-separated status classes (draft, active, paused, done, cancelled): every status of those classes, whatever the workspace named them.","type":"string","maxLength":100},"description":"Comma-separated status classes (draft, active, paused, done, cancelled): every status of those classes, whatever the workspace named them."},{"in":"query","name":"client_id","schema":{"type":"string"}},{"in":"query","name":"due","schema":{"description":"overdue: the due date has passed; week / month: due within 7 / 30 days. A project in a done or cancelled status is never due.","type":"string","enum":["overdue","week","month"]},"description":"overdue: the due date has passed; week / month: due within 7 / 30 days. A project in a done or cancelled status is never due."},{"in":"query","name":"search","schema":{"description":"Case-insensitive substring over name, description and the text of field values.","type":"string","maxLength":100},"description":"Case-insensitive substring over name, description and the text of field values."},{"in":"query","name":"where","schema":{"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`.","type":"string","maxLength":4000},"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`."},{"in":"query","name":"sort","schema":{"description":"One of name, due_date, created_at, updated_at, status (the status list's order), or a field key; a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`.","type":"string","minLength":1,"maxLength":100},"description":"One of name, due_date, created_at, updated_at, status (the status list's order), or a field key; a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`."}],"responses":{"200":{"description":"List projects","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["draft","active","paused","done","cancelled"]}},"required":["id","name","class"],"additionalProperties":false},"clientId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"budget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"actualBudget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The client named beside `clientId` (#162); null when the project has none."},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false,"description":"Tasks whose status is done, of all its tasks."},"assignees":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"overdue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["userId","name","open","overdue"],"additionalProperties":false},"description":"People with open tasks on it, the most overdue first."},"health":{"type":"string","enum":["on_track","at_risk","overdue"],"description":"overdue: its due date passed with work open; at_risk: an overdue task, or due within 7 days with under 80% done; completed and cancelled projects are on_track."}},"required":["id","name","description","status","clientId","startDate","endDate","completedAt","fields","createdAt","updatedAt","client","progress","assignees","health"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false},"description":"The project field definitions; each item's `fields` is keyed by their `key`."},"nextCursor":{"description":"Pass as `cursor` for the next page; null on the last page.","type":["string","null"]}},"required":["items","fields","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_projects","summary":"Create a project","description":"Creates a project in the addressed workspace, in the status `statusId` names, or `status` by its name (any case; `GET /statuses?record_type=project`), else the workspace's initial status; an unknown status is 404. `fields` are field values by key: a refused value is 422 at `fields.<key>`, a value another project holds in a unique field 409 `field_unique_conflict`. `currency` defaults to the workspace currency and cannot be changed once set. Counts against the plan's project limit. A `clientId`/`templateId` naming a row in another workspace is not found.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"clientId":{"type":"string"},"description":{"type":"string"},"statusId":{"type":"string","minLength":1,"maxLength":128},"status":{"type":"string","minLength":1,"maxLength":60},"startDate":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"},"estimatedBudgetCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string"},"hourlyRateCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"templateId":{"type":"string"},"notes":{"type":"string"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["name"]}}}},"responses":{"201":{"description":"Create a project","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["draft","active","paused","done","cancelled"]}},"required":["id","name","class"],"additionalProperties":false},"clientId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"budget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"actualBudget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","clientId","startDate","endDate","completedAt","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/upsert":{"post":{"operationId":"post_workspaces_slug_projects_upsert","summary":"Create or update a project by a unique field","description":"Finds the project holding `match.value` in the unique field `match.field` and updates it from `project`, or creates one. Overlapping requests for one value make one project; the others return `created: false`. A field that is not unique is 409 `field_not_unique`; an unknown field is 422 `unknown_field`; the other refusals are those of create and update.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"match":{"type":"object","properties":{"field":{"type":"string","minLength":1,"description":"The key of a unique project field."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}],"description":"The value to look up in that field."}},"required":["field","value"]},"project":{"type":"object","properties":{"name":{"type":"string","minLength":1},"clientId":{"type":"string"},"description":{"type":"string"},"statusId":{"type":"string","minLength":1,"maxLength":128},"status":{"type":"string","minLength":1,"maxLength":60},"startDate":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"},"estimatedBudgetCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string"},"hourlyRateCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"templateId":{"type":"string"},"notes":{"type":"string"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["name"],"description":"Creates the project with these values (the match value is stored in the match field), or updates the matched one."}},"required":["match","project"]}}}},"responses":{"200":{"description":"Create or update a project by a unique field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["draft","active","paused","done","cancelled"]}},"required":["id","name","class"],"additionalProperties":false},"clientId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"budget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"actualBudget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","clientId","startDate","endDate","completedAt","fields","createdAt","updatedAt"],"additionalProperties":false},"created":{"type":"boolean"}},"required":["project","created"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/{id}":{"get":{"operationId":"get_workspaces_slug_projects_id","summary":"Get a project","description":"One project by id. `budget` and `actualBudget` are omitted when the caller can't read invoices. A project in another workspace is not found.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:read"]}],"x-rokn-scope":"projects:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a project","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["draft","active","paused","done","cancelled"]}},"required":["id","name","class"],"additionalProperties":false},"clientId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"budget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"actualBudget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The client named beside `clientId` (#162); null when the project has none."},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false,"description":"Tasks whose status is done, of all its tasks."},"assignees":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"overdue":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["userId","name","open","overdue"],"additionalProperties":false},"description":"People with open tasks on it, the most overdue first."},"health":{"type":"string","enum":["on_track","at_risk","overdue"],"description":"overdue: its due date passed with work open; at_risk: an overdue task, or due within 7 days with under 80% done; completed and cancelled projects are on_track."}},"required":["id","name","description","status","clientId","startDate","endDate","completedAt","fields","createdAt","updatedAt","client","progress","assignees","health"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_projects_id","summary":"Update a project","description":"Partial update; only the fields present are written, `fields` by key. A move to another status (`statusId`, or `status` by name) checks that status's required fields; entering a `done` status stamps `completedAt`, leaving one clears it. Supports `If-Match` (Task 13): a mismatched value is 412 `precondition_failed` and the write does not run — checked atomically as part of the same UPDATE, never a separate read-compare-write.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"clientId":{"type":["string","null"]},"description":{"type":["string","null"]},"statusId":{"type":"string","minLength":1,"maxLength":128},"status":{"type":"string","minLength":1,"maxLength":60},"startDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"estimatedBudgetCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string"},"hourlyRateCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"templateId":{"type":["string","null"]},"notes":{"type":["string","null"]},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}}}}}},"responses":{"200":{"description":"Update a project","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["draft","active","paused","done","cancelled"]}},"required":["id","name","class"],"additionalProperties":false},"clientId":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"budget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"actualBudget":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","clientId","startDate","endDate","completedAt","fields","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/{id}/delete-impact":{"get":{"operationId":"get_workspaces_slug_projects_id_delete-impact","summary":"What deleting a project would do","description":"Counts what deleting the project removes (`deleted`), detaches and keeps (`unlinked`) and what stops the delete (`blocked`, with the project in `blockedRecords`: a line of an approved supplier bill or an invoice of a closed retainer period names it), how many signed contracts it holds and how many tasks of other projects depend on its tasks. Changes nothing. Needs `projects:write` and a role that may delete, as the delete itself does; `blockedByPermission` names the sections whose removed rows this caller may not delete, and the delete is then refused. A project in another workspace is not found.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"What deleting a project would do","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","count"],"additionalProperties":false}},"unlinked":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","count"],"additionalProperties":false}},"blocked":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","count"],"additionalProperties":false}},"signedContracts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blockedRecords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"blockedByPermission":{"type":"array","items":{"type":"string"}},"crossProjectDependencies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["deleted","unlinked","blocked","signedContracts","blockedRecords","blockedByPermission","crossProjectDependencies"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tasks":{"get":{"operationId":"get_workspaces_slug_tasks","summary":"List tasks","description":"Newest-updated first unless `sort` says otherwise, keyset-paginated (`limit` 25, at most 100; pass `nextCursor` back as `cursor` until it is null). The cursor snapshots the boundary row, so an edit between pages repeats and skips nothing. Filter by `project_id` (or `none`), `assignee_user_id` (or `me`), `status_id` (`GET /statuses?record_type=task&project_id=`), `class`, `open`, `due`, `due_before`, `search`, `where` (field filters; `GET /fields?record_type=task`) and `updated_after` (exclusive at millisecond precision, so a record's own `updatedAt` excludes that record). Refusals: an invalid `cursor`, `class` or `where` is 422 `validation_failed`; an unknown `sort` key is 422 `unknown_field`; a bad filter operand is 422 `invalid_field_filter`.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:read"]}],"x-rokn-scope":"tasks:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`.","type":"string","maxLength":10934},"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`."},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"project_id","schema":{"description":"A project's tasks, or `none` for the tasks with no project. A lead's checklist tasks are never listed here: read them with `GET /leads/{id}/tasks`.","type":"string","minLength":1,"maxLength":128},"description":"A project's tasks, or `none` for the tasks with no project. A lead's checklist tasks are never listed here: read them with `GET /leads/{id}/tasks`."},{"in":"query","name":"status_id","schema":{"description":"One task status (`GET /statuses?record_type=task&project_id=`).","type":"string","minLength":1,"maxLength":128},"description":"One task status (`GET /statuses?record_type=task&project_id=`)."},{"in":"query","name":"class","schema":{"description":"Comma-separated status classes (todo, in_progress, done): every status of those classes, in any list, whatever the workspace named them.","type":"string","maxLength":100},"description":"Comma-separated status classes (todo, in_progress, done): every status of those classes, in any list, whatever the workspace named them."},{"in":"query","name":"assignee_user_id","schema":{"description":"A member's user id, or `me` for the person the token belongs to (an API key is not a person: refused).","type":"string","minLength":1,"maxLength":128},"description":"A member's user id, or `me` for the person the token belongs to (an API key is not a person: refused)."},{"in":"query","name":"due_before","schema":{"description":"Only tasks due before this instant (exclusive). A task's due date is a calendar day stored at its UTC midnight, so pass a UTC midnight (`2031-01-10T00:00:00Z`) to mean a day; with open=true, what is overdue or due soon (#132).","type":"string","format":"date-time"},"description":"Only tasks due before this instant (exclusive). A task's due date is a calendar day stored at its UTC midnight, so pass a UTC midnight (`2031-01-10T00:00:00Z`) to mean a day; with open=true, what is overdue or due soon (#132)."},{"in":"query","name":"due","schema":{"description":"overdue: the due date has passed; this_week: due inside the current week (Monday to Sunday in the workspace's time zone). A done task is never due.","type":"string","enum":["overdue","this_week"]},"description":"overdue: the due date has passed; this_week: due inside the current week (Monday to Sunday in the workspace's time zone). A done task is never due."},{"in":"query","name":"open","schema":{"description":"true: only tasks whose status is not done; false: only done ones.","type":"string","enum":["true","false"]},"description":"true: only tasks whose status is not done; false: only done ones."},{"in":"query","name":"search","schema":{"description":"Case-insensitive substring over title, description and the text of field values.","type":"string","maxLength":100},"description":"Case-insensitive substring over title, description and the text of field values."},{"in":"query","name":"where","schema":{"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`.","type":"string","maxLength":4000},"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`."},{"in":"query","name":"sort","schema":{"description":"One of title, due_date, created_at, updated_at, status (class, then the status list's order), or a field key (a select orders by its options' order); a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`.","type":"string","minLength":1,"maxLength":100},"description":"One of title, due_date, created_at, updated_at, status (class, then the status list's order), or a field key (a select orders by its options' order); a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`."}],"responses":{"200":{"description":"List tasks","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"projectId":{"type":["string","null"]},"statusId":{"type":"string"},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status, named (#162): group and label tasks without a second request."},"assigneeUserId":{"type":["string","null"]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","urgent"]},{"type":"null"}],"description":"The `priority` field's option key; null when the task holds no priority."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The task's field values by field key (#372); see list_fields with record_type task."},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"issueLink":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"repo":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"state":{"type":"string","enum":["linked","detached","gone"]}},"required":["provider","repo","number","url","state"],"additionalProperties":false},{"type":"null"}],"description":"The code-host issue this task was made from (#331), or null. `linked`: title, open/closed and assignee sync both ways; `detached`: the repo left the project; `gone`: the issue was deleted or moved."}},"required":["id","title","description","projectId","statusId","status","assigneeUserId","completedAt","priority","fields","dueDate","createdAt","updatedAt","issueLink"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false},"description":"The task field definitions; each item's `fields` is keyed by their `key`."},"nextCursor":{"description":"Pass as `cursor` for the next page; null on the last page.","type":["string","null"]}},"required":["items","fields","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_tasks","summary":"Create a task","description":"Creates a task in the addressed workspace, in the status `statusId` names or `status` by its name (any case), which must be in the list the task's project uses (its own list or the workspace's default one: `GET /statuses?record_type=task&project_id=`), else that list's initial status; an unknown status is 404. `fields` holds the task field values by key (`GET /fields?record_type=task&project_id=`; a select by option label): a refused value is 422 at `fields.<key>`, a value another task holds in a unique field 409 `field_unique_conflict`. The request body names the assignee `assigneeId` (the module's own validator) while the response names it `assigneeUserId` — both are the member's user id. A `projectId`/`assigneeId` naming a row (or member) in another workspace, or a status of another list, is not found.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string"},"title":{"type":"string","minLength":1},"description":{"type":"string"},"statusId":{"type":"string","minLength":1,"maxLength":128},"status":{"type":"string","minLength":1,"maxLength":60},"priority":{"description":"An option KEY of the `priority` field (low, medium, high, urgent), not a label. Strict for callers: a key whose option is archived (unless the task already holds it) is 422 `unknown_field_option` at `fields.priority`. `fields.priority` wins when both are given.","type":"string","enum":["low","medium","high","urgent"]},"assigneeId":{"type":"string"},"dueDate":{"type":"string","format":"date-time"},"startDate":{"type":"string","format":"date-time"},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["title"]}}}},"responses":{"201":{"description":"Create a task","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"projectId":{"type":["string","null"]},"statusId":{"type":"string"},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status, named (#162): group and label tasks without a second request."},"assigneeUserId":{"type":["string","null"]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","urgent"]},{"type":"null"}],"description":"The `priority` field's option key; null when the task holds no priority."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The task's field values by field key (#372); see list_fields with record_type task."},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"issueLink":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"repo":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"state":{"type":"string","enum":["linked","detached","gone"]}},"required":["provider","repo","number","url","state"],"additionalProperties":false},{"type":"null"}],"description":"The code-host issue this task was made from (#331), or null. `linked`: title, open/closed and assignee sync both ways; `detached`: the repo left the project; `gone`: the issue was deleted or moved."}},"required":["id","title","description","projectId","statusId","status","assigneeUserId","completedAt","priority","fields","dueDate","createdAt","updatedAt","issueLink"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tasks/bulk":{"post":{"operationId":"post_workspaces_slug_tasks_bulk","summary":"Create many tasks in one project","description":"Creates 1–100 tasks in ONE project, all or none: a refused task (an assignee who is not a member, a status outside the project's list) creates nothing and is named in `errors[].path` as `tasks.<index>`. `statusId` may be omitted per task; it then defaults to the initial status of the list the project uses. Each task is created exactly as the single create does, with its own audit row. Returns the created tasks in request order.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"tasks":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":"string"},"statusId":{"type":"string","minLength":1,"maxLength":128},"status":{"type":"string","minLength":1,"maxLength":60},"priority":{"description":"An option KEY of the `priority` field (low, medium, high, urgent), not a label. Strict for callers: a key whose option is archived (unless the task already holds it) is 422 `unknown_field_option` at `fields.priority`. `fields.priority` wins when both are given.","type":"string","enum":["low","medium","high","urgent"]},"assigneeId":{"type":"string"},"dueDate":{"type":"string","format":"date-time"},"startDate":{"type":"string","format":"date-time"},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["title"]}}},"required":["projectId","tasks"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create many tasks in one project","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"projectId":{"type":["string","null"]},"statusId":{"type":"string"},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status, named (#162): group and label tasks without a second request."},"assigneeUserId":{"type":["string","null"]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","urgent"]},{"type":"null"}],"description":"The `priority` field's option key; null when the task holds no priority."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The task's field values by field key (#372); see list_fields with record_type task."},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"issueLink":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"repo":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"state":{"type":"string","enum":["linked","detached","gone"]}},"required":["provider","repo","number","url","state"],"additionalProperties":false},{"type":"null"}],"description":"The code-host issue this task was made from (#331), or null. `linked`: title, open/closed and assignee sync both ways; `detached`: the repo left the project; `gone`: the issue was deleted or moved."}},"required":["id","title","description","projectId","statusId","status","assigneeUserId","completedAt","priority","fields","dueDate","createdAt","updatedAt","issueLink"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tasks/{id}":{"get":{"operationId":"get_workspaces_slug_tasks_id","summary":"Get a task","description":"One task by id. A task in another workspace is not found.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:read"]}],"x-rokn-scope":"tasks:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a task","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"projectId":{"type":["string","null"]},"statusId":{"type":"string"},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status, named (#162): group and label tasks without a second request."},"assigneeUserId":{"type":["string","null"]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","urgent"]},{"type":"null"}],"description":"The `priority` field's option key; null when the task holds no priority."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The task's field values by field key (#372); see list_fields with record_type task."},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"issueLink":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"repo":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"state":{"type":"string","enum":["linked","detached","gone"]}},"required":["provider","repo","number","url","state"],"additionalProperties":false},{"type":"null"}],"description":"The code-host issue this task was made from (#331), or null. `linked`: title, open/closed and assignee sync both ways; `detached`: the repo left the project; `gone`: the issue was deleted or moved."}},"required":["id","title","description","projectId","statusId","status","assigneeUserId","completedAt","priority","fields","dueDate","createdAt","updatedAt","issueLink"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_tasks_id","summary":"Update a task","description":"Partial update; only the fields present are written (`fields` by key: only the keys sent change; `null` clears one). A status (`statusId`, or `status` by name) must be in the list the task's project uses (another list's is not found); moving the task to another project lands it on that project's list's first status of the same class, else its initial status. Entering a done status stamps completion, and a status's required fields must hold a value (422 `stage_requirements_unmet`). The assignee is `assigneeId` in the body and `assigneeUserId` in the response. Supports `If-Match` (Task 13): a mismatched value is 412 `precondition_failed` and the write does not run — checked atomically as part of the same UPDATE, never a separate read-compare-write.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":["string","null"]},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"statusId":{"type":"string","minLength":1,"maxLength":128},"status":{"type":"string","minLength":1,"maxLength":60},"priority":{"description":"An option KEY of the `priority` field (low, medium, high, urgent), not a label. Strict for callers: a key whose option is archived (unless the task already holds it) is 422 `unknown_field_option` at `fields.priority`. `fields.priority` wins when both are given.","type":"string","enum":["low","medium","high","urgent"]},"assigneeId":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}}}}}},"responses":{"200":{"description":"Update a task","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"projectId":{"type":["string","null"]},"statusId":{"type":"string"},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status, named (#162): group and label tasks without a second request."},"assigneeUserId":{"type":["string","null"]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"priority":{"anyOf":[{"type":"string","enum":["low","medium","high","urgent"]},{"type":"null"}],"description":"The `priority` field's option key; null when the task holds no priority."},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The task's field values by field key (#372); see list_fields with record_type task."},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"issueLink":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github"]},"repo":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"},"state":{"type":"string","enum":["linked","detached","gone"]}},"required":["provider","repo","number","url","state"],"additionalProperties":false},{"type":"null"}],"description":"The code-host issue this task was made from (#331), or null. `linked`: title, open/closed and assignee sync both ways; `detached`: the repo left the project; `gone`: the issue was deleted or moved."}},"required":["id","title","description","projectId","statusId","status","assigneeUserId","completedAt","priority","fields","dueDate","createdAt","updatedAt","issueLink"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/time-entries":{"get":{"operationId":"get_workspaces_slug_time-entries","summary":"List time entries","description":"Newest-updated first, keyset-paginated. Filters: `project_id`, `task_id`, `user_id` (the member the entry is logged for), `billable`, and a `[from, to)` window on `startedAt` (`from` inclusive, `to` exclusive). `updated_after` is exclusive at millisecond precision. Billing and cost rates are not API-visible in v1.","tags":["Time entries"],"security":[{"apiKey":[]},{"oauth2":["time_tracking:read"]}],"x-rokn-scope":"time_tracking:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"project_id","schema":{"type":"string"}},{"in":"query","name":"task_id","schema":{"type":"string"}},{"in":"query","name":"user_id","schema":{"type":"string"}},{"in":"query","name":"from","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"billable","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List time entries","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":["string","null"]},"taskId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"userId":{"type":["string","null"]},"description":{"type":["string","null"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","taskId","clientId","serviceId","userId","description","startedAt","endedAt","durationMinutes","billable","invoiced","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_time-entries","summary":"Create a time entry","description":"Creates a time entry in the addressed workspace. `userId` names the member the entry is logged for: an API key must supply it (a key is not a person), a member's token may omit it (itself) and may not name anyone else, an owner's or admin's token may name any member. `durationMinutes` is derived from `startTime`/`endTime` when omitted. The body names the window `startTime`/`endTime` (the module's own validator) while the response names it `startedAt`/`endedAt`. A `projectId`/`taskId`/`clientId`/`serviceId` naming a row in another workspace is not found. Billing and cost rates are not API-visible in v1.","tags":["Time entries"],"security":[{"apiKey":[]},{"oauth2":["time_tracking:write"]}],"x-rokn-scope":"time_tracking:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"projectId":{"type":"string"},"taskId":{"type":"string"},"clientId":{"type":"string"},"serviceId":{"type":["string","null"]},"description":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991},"billable":{"default":true,"type":"boolean"},"rateOverrideCents":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["startTime"]}}}},"responses":{"201":{"description":"Create a time entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":["string","null"]},"taskId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"userId":{"type":["string","null"]},"description":{"type":["string","null"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","taskId","clientId","serviceId","userId","description","startedAt","endedAt","durationMinutes","billable","invoiced","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/time-entries/{id}":{"get":{"operationId":"get_workspaces_slug_time-entries_id","summary":"Get a time entry","description":"One time entry by id. An entry in another workspace is not found. Billing and cost rates are not API-visible in v1.","tags":["Time entries"],"security":[{"apiKey":[]},{"oauth2":["time_tracking:read"]}],"x-rokn-scope":"time_tracking:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a time entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":["string","null"]},"taskId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"userId":{"type":["string","null"]},"description":{"type":["string","null"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","taskId","clientId","serviceId","userId","description","startedAt","endedAt","durationMinutes","billable","invoiced","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_time-entries_id","summary":"Update a time entry","description":"Partial update; only the fields present are written. The window is `startTime`/`endTime` in the body and `startedAt`/`endedAt` in the response. A member's token reaches only its own entries (a colleague's is not found). An entry already on an invoice line is 409 `conflict`. Supports `If-Match` (Task 13): a mismatched value is 412 `precondition_failed` and the write does not run — checked atomically as part of the same UPDATE, never a separate read-compare-write.","tags":["Time entries"],"security":[{"apiKey":[]},{"oauth2":["time_tracking:write"]}],"x-rokn-scope":"time_tracking:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":["string","null"]},"taskId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"description":{"type":["string","null"]},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"durationMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991},"billable":{"type":"boolean"},"rateOverrideCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Update a time entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":["string","null"]},"taskId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"serviceId":{"type":["string","null"]},"userId":{"type":["string","null"]},"description":{"type":["string","null"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","taskId","clientId","serviceId","userId","description","startedAt","endedAt","durationMinutes","billable","invoiced","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_time-entries_id","summary":"Delete a time entry","description":"Removes the entry. A member's token reaches only its own entries (a colleague's is not found); an entry in another workspace is not found. An entry already on an invoice line is 409 `conflict`.","tags":["Time entries"],"security":[{"apiKey":[]},{"oauth2":["time_tracking:write"]}],"x-rokn-scope":"time_tracking:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a time entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/expenses":{"get":{"operationId":"get_workspaces_slug_expenses","summary":"List expenses","description":"Newest-updated first, keyset-paginated. Filters: `project_id`, `category_id`, `billable`, and a `[from, to)` window on `date` (`from` inclusive, `to` exclusive). `updated_after` is exclusive at millisecond precision. Receipt bytes are not retrievable through this API in v1 — only the stored file name, if any.","tags":["Expenses"],"security":[{"apiKey":[]},{"oauth2":["expenses:read"]}],"x-rokn-scope":"expenses:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"project_id","schema":{"type":"string"}},{"in":"query","name":"category_id","schema":{"type":"string"}},{"in":"query","name":"billable","schema":{"type":"string","enum":["true","false"]}},{"in":"query","name":"from","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List expenses","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"vendorId":{"type":["string","null"]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"receipt":{"anyOf":[{"type":"object","properties":{"fileName":{"type":"string"}},"required":["fileName"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","description","amount","date","categoryId","projectId","clientId","vendorId","billable","invoiced","receipt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_expenses","summary":"Create an expense","description":"Creates an expense in the addressed workspace. `currency` is optional and defaults to (and must otherwise match) the workspace's own currency. A `clientId`/`projectId`/`categoryId` naming a row in another workspace is not found; `vendorId` must name an ACTIVE vendor of this workspace. Receipt bytes are not retrievable through this API in v1.","tags":["Expenses"],"security":[{"apiKey":[]},{"oauth2":["expenses:write"]}],"x-rokn-scope":"expenses:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":1},"amountCents":{"type":"integer","minimum":1,"maximum":9007199254740991},"currency":{"type":"string"},"date":{"type":"string","format":"date-time"},"categoryId":{"type":"string"},"clientId":{"type":"string"},"projectId":{"type":"string"},"vendor":{"type":"string"},"vendorId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"notes":{"type":"string"},"recurring":{"default":false,"type":"boolean"},"recurringInterval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"receiptUrl":{"type":"string"},"receiptFileName":{"type":"string"},"billable":{"type":"boolean"}},"required":["description","amountCents","date"]}}}},"responses":{"201":{"description":"Create an expense","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"vendorId":{"type":["string","null"]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"receipt":{"anyOf":[{"type":"object","properties":{"fileName":{"type":"string"}},"required":["fileName"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","description","amount","date","categoryId","projectId","clientId","vendorId","billable","invoiced","receipt","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/expenses/{id}":{"get":{"operationId":"get_workspaces_slug_expenses_id","summary":"Get an expense","description":"One expense by id. An expense in another workspace is not found. Receipt bytes are not retrievable through this API in v1.","tags":["Expenses"],"security":[{"apiKey":[]},{"oauth2":["expenses:read"]}],"x-rokn-scope":"expenses:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get an expense","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"vendorId":{"type":["string","null"]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"receipt":{"anyOf":[{"type":"object","properties":{"fileName":{"type":"string"}},"required":["fileName"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","description","amount","date","categoryId","projectId","clientId","vendorId","billable","invoiced","receipt","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_expenses_id","summary":"Update an expense","description":"Partial update; only the fields present are written. An expense already claimed by an invoice line is 409 `conflict`. Supports `If-Match` (Task 13): a mismatched value is 412 `precondition_failed` and the write does not run — checked atomically as part of the same UPDATE, never a separate read-compare-write.","tags":["Expenses"],"security":[{"apiKey":[]},{"oauth2":["expenses:write"]}],"x-rokn-scope":"expenses:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":1},"amountCents":{"type":"integer","minimum":1,"maximum":9007199254740991},"currency":{"type":"string"},"date":{"type":"string","format":"date-time"},"categoryId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"vendor":{"type":["string","null"]},"vendorId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"notes":{"type":["string","null"]},"recurring":{"type":"boolean"},"recurringInterval":{"anyOf":[{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"receiptUrl":{"type":["string","null"]},"receiptFileName":{"type":["string","null"]},"billable":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Update an expense","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"vendorId":{"type":["string","null"]},"billable":{"type":"boolean"},"invoiced":{"type":"boolean"},"receipt":{"anyOf":[{"type":"object","properties":{"fileName":{"type":"string"}},"required":["fileName"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","description","amount","date","categoryId","projectId","clientId","vendorId","billable","invoiced","receipt","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/invoices":{"get":{"operationId":"get_workspaces_slug_invoices","summary":"List invoices","description":"Invoices only (`type = invoice`; quotes are their own resource), newest-updated first, keyset-paginated, each with its line items. Filters: `status`, `client_id`, and a `[from, to)` window on `issueDate` (`from` inclusive, `to` exclusive). `updated_after` is exclusive at millisecond precision.","tags":["Invoices"],"security":[{"apiKey":[]},{"oauth2":["invoices:read"]}],"x-rokn-scope":"invoices:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]}},{"in":"query","name":"client_id","schema":{"type":"string"}},{"in":"query","name":"from","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List invoices","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"type":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","recurringNoticeMonths","sendState"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_invoices","summary":"Create a draft invoice","description":"Creates a DRAFT invoice with its line items in the addressed workspace. A draft has no number (`number` is null): it takes the next one of the workspace's own sequence when it is sent. `type` must be `invoice` (quotes are read-only through this API; credit notes and deposits are not exposed) — anything else is 422. `currency` is optional and defaults to (and must otherwise match) the workspace's own currency. A `clientId`, `projectId`, `templateId`, or a line's `serviceId`/`packageId`/`projectId` naming a row in another workspace is not found. Money is in minor units (`unitPriceCents`).","tags":["Invoices"],"security":[{"apiKey":[]},{"oauth2":["invoices:write"]}],"x-rokn-scope":"invoices:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1},"templateId":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"invoice","type":"string","enum":["invoice","quote","credit_note","deposit"]},"issueDate":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"},"currency":{"type":"string"},"taxRate":{"type":"integer","minimum":0,"maximum":9007199254740991},"reverseCharge":{"type":"boolean"},"automaticRemindersEnabled":{"type":"boolean"},"notes":{"type":"string"},"terms":{"type":"string"},"legalMentions":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","minLength":1},"quantity":{"type":"number","minimum":0.01},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"serviceId":{"type":"string"},"packageId":{"type":"string"},"projectId":{"type":["string","null"]},"taxRateBps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantity","unitPriceCents"]}},"recurringInterval":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":12},{"type":"null"}]},"importTimeEntryIds":{"type":"array","items":{"type":"string","minLength":1}},"importGroupBy":{"default":"project","type":"string","enum":["project","task","entry"]},"locale":{"type":"string","minLength":2,"maxLength":10}},"required":["clientId","issueDate","lineItems"]}}}},"responses":{"201":{"description":"Create a draft invoice","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"type":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","recurringNoticeMonths","sendState"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/invoices/{id}":{"get":{"operationId":"get_workspaces_slug_invoices_id","summary":"Get an invoice","description":"One invoice by id, with its line items. An invoice in another workspace is not found.","tags":["Invoices"],"security":[{"apiKey":[]},{"oauth2":["invoices:read"]}],"x-rokn-scope":"invoices:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get an invoice","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"type":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","recurringNoticeMonths","sendState"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_invoices_id","summary":"Update a draft invoice","description":"Partial update of a DRAFT; only the fields present are written. When `lineItems` is present it REPLACES the set: a line carrying an `id` is updated in place, one without is created, and any existing line not named is deleted — totals are recomputed from the result. `taxRate: null` clears the invoice's own rate (lines without their own rate then carry no tax); an omitted `taxRate` leaves it as stored. A non-draft invoice is 409 `conflict`. Supports `If-Match` (Task 13): a mismatched value is 412 `precondition_failed` and the write does not run — checked atomically as part of the same UPDATE, never a separate read-compare-write.","tags":["Invoices"],"security":[{"apiKey":[]},{"oauth2":["invoices:write"]}],"x-rokn-scope":"invoices:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1},"templateId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"type":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"issueDate":{"type":"string","format":"date-time"},"dueDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"currency":{"type":"string"},"taxRate":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"reverseCharge":{"type":"boolean"},"automaticRemindersEnabled":{"type":"boolean"},"notes":{"type":["string","null"]},"terms":{"type":["string","null"]},"legalMentions":{"type":["string","null"]},"lineItems":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","minLength":1},"quantity":{"type":"number","minimum":0.01},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"serviceId":{"type":"string"},"packageId":{"type":"string"},"projectId":{"type":["string","null"]},"taxRateBps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantity","unitPriceCents"]}},"recurringInterval":{"anyOf":[{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":12},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Update a draft invoice","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"type":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","recurringNoticeMonths","sendState"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/invoices/{id}/send":{"post":{"operationId":"post_workspaces_slug_invoices_id_send","summary":"Send an invoice","description":"Queues the invoice to be sent and answers 202 Accepted at once with the send (#205). The worker then validates the workspace's payment gateway, renders and stores the PDF, gives it the next number of its sequence, dates it the workspace's today (the due date keeps its term in days), moves it to `sent` (locked, with its pay link) and emails the client the PDF. Read how it went with `GET …/invoices/{id}/sends/{sendId}`: `state` is `queued` or `working` meanwhile (the invoice's `sendState` says the same), then `sent` with `emailOutcome` (`sent`, `skipped` when the client has no address, `failed`), or `failed` with `failureReason`. A transient failure (`gateway_unavailable`, `pdf_unavailable`, `conflict`) is retried three times (no sooner than 15 s, 60 s and 5 min after each failure; the worker runs every minute) before the send fails; refused credentials (`gateway_rejected`) or a test-mode key in production (`gateway_test_mode`) fail it at once. The invoice stays a draft until the send commits. A second POST while a send is open is 409 `send_in_progress`; a non-draft invoice is 409 `invalid_status_transition`. Honours `Idempotency-Key`: a replay returns the same send.","tags":["Invoices"],"security":[{"apiKey":[]},{"oauth2":["invoices:write"]}],"x-rokn-scope":"invoices:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"responses":{"202":{"description":"Send an invoice","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"documentType":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"state":{"type":"string","enum":["queued","working","sent","failed"]},"failureReason":{"anyOf":[{"type":"string","enum":["gateway_test_mode","gateway_rejected","gateway_unavailable","pdf_unavailable","conflict","quote_expired","not_sendable","feature_locked","billing_read_only","interrupted","unexpected","requester_not_allowed","quote_has_no_client","credit_note_credits_nothing","credit_note_exceeds_invoice","number_taken"]},{"type":"null"}]},"emailOutcome":{"anyOf":[{"type":"string","enum":["sent","skipped","failed"]},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","documentId","documentType","state","failureReason","emailOutcome","attempts","createdAt","finishedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/invoices/{id}/sends/{sendId}":{"get":{"operationId":"get_workspaces_slug_invoices_id_sends_sendId","summary":"Read an invoice send","description":"One send of this invoice, as `POST …/send` answered it and as it stands now (#205). A send id of another invoice is 404.","tags":["Invoices"],"security":[{"apiKey":[]},{"oauth2":["invoices:read"]}],"x-rokn-scope":"invoices:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"sendId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Read an invoice send","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"documentType":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"state":{"type":"string","enum":["queued","working","sent","failed"]},"failureReason":{"anyOf":[{"type":"string","enum":["gateway_test_mode","gateway_rejected","gateway_unavailable","pdf_unavailable","conflict","quote_expired","not_sendable","feature_locked","billing_read_only","interrupted","unexpected","requester_not_allowed","quote_has_no_client","credit_note_credits_nothing","credit_note_exceeds_invoice","number_taken"]},{"type":"null"}]},"emailOutcome":{"anyOf":[{"type":"string","enum":["sent","skipped","failed"]},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","documentId","documentType","state","failureReason","emailOutcome","attempts","createdAt","finishedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/quotes":{"get":{"operationId":"get_workspaces_slug_quotes","summary":"List quotes","description":"Quotes only (`type = quote`; ordinary invoices are their own resource), newest-updated first, keyset-paginated, each with its line items. Filters: `status` and `client_id`. `updated_after` is exclusive at millisecond precision. Created, edited, sent and converted through the routes below; the client's approve/decline stays on the emailed link.","tags":["Quotes"],"security":[{"apiKey":[]},{"oauth2":["quotes:read"]}],"x-rokn-scope":"quotes:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]}},{"in":"query","name":"client_id","schema":{"type":"string"}}],"responses":{"200":{"description":"List quotes","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"type":{"type":"string","const":"quote"},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]},"leadId":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requiresSignature":{"type":"boolean"},"signerName":{"type":["string","null"]},"signedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"declineReason":{"type":["string","null"]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","sendState","leadId","validUntil","requiresSignature","signerName","signedAt","declineReason"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_quotes","summary":"Create a draft quote","description":"Creates a DRAFT quote with its line items, numbered from the workspace's quote sequence. Requires a plan with proposals: otherwise 403 `feature_locked`, as on the dashboard. `currency` defaults to (and must otherwise match) the workspace currency. A quote names a `clientId`, a `leadId` or both; neither is 422 at `clientId`. A quote with a lead and no client yet is drafted, priced and printed like any other but is never sent or converted until it has one (409 `quote_has_no_client`); give it a client with PATCH. A `leadId` needs leads:read. A `clientId`, `leadId`, `projectId`, `templateId` or a line's service/package/project in another workspace, or a lead the caller cannot read, is not found. Money is in minor units (`unitPriceCents`).","tags":["Quotes"],"security":[{"apiKey":[]},{"oauth2":["quotes:write"]}],"x-rokn-scope":"quotes:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1},"templateId":{"type":"string"},"projectId":{"type":"string"},"issueDate":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"},"currency":{"type":"string"},"taxRate":{"type":"integer","minimum":0,"maximum":9007199254740991},"reverseCharge":{"type":"boolean"},"notes":{"type":"string"},"terms":{"type":"string"},"legalMentions":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","minLength":1},"quantity":{"type":"number","minimum":0.01},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"serviceId":{"type":"string"},"packageId":{"type":"string"},"projectId":{"type":["string","null"]},"taxRateBps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantity","unitPriceCents"]}},"leadId":{"type":"string","minLength":1}},"required":["issueDate","lineItems"]}}}},"responses":{"201":{"description":"Create a draft quote","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"type":{"type":"string","const":"quote"},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]},"leadId":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requiresSignature":{"type":"boolean"},"signerName":{"type":["string","null"]},"signedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"declineReason":{"type":["string","null"]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","sendState","leadId","validUntil","requiresSignature","signerName","signedAt","declineReason"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/quotes/{id}":{"get":{"operationId":"get_workspaces_slug_quotes_id","summary":"Get a quote","description":"One quote by id, with its line items. A quote in another workspace — or an ordinary invoice's id — is not found. `signerIpPrefix`, the approval token and the checkout/pay-link columns are never exposed.","tags":["Quotes"],"security":[{"apiKey":[]},{"oauth2":["quotes:read"]}],"x-rokn-scope":"quotes:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a quote","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"type":{"type":"string","const":"quote"},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]},"leadId":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requiresSignature":{"type":"boolean"},"signerName":{"type":["string","null"]},"signedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"declineReason":{"type":["string","null"]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","sendState","leadId","validUntil","requiresSignature","signerName","signedAt","declineReason"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_quotes_id","summary":"Update a draft quote","description":"Partial update of a DRAFT quote; only the fields present are written, and `lineItems` replaces the lines. `taxRate: null` clears the quote's own rate; an omitted `taxRate` leaves it as stored. A sent quote is locked (409). An ordinary invoice's id is not found. `type` is read-only. A quote does not recur: a `recurringInterval` or `recurringNoticeMonths` value is 422 at that path. Supports `If-Match`.","tags":["Quotes"],"security":[{"apiKey":[]},{"oauth2":["quotes:write"]}],"x-rokn-scope":"quotes:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1},"templateId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"type":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"issueDate":{"type":"string","format":"date-time"},"dueDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"currency":{"type":"string"},"taxRate":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"reverseCharge":{"type":"boolean"},"automaticRemindersEnabled":{"type":"boolean"},"notes":{"type":["string","null"]},"terms":{"type":["string","null"]},"legalMentions":{"type":["string","null"]},"lineItems":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","minLength":1},"quantity":{"type":"number","minimum":0.01},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"serviceId":{"type":"string"},"packageId":{"type":"string"},"projectId":{"type":["string","null"]},"taxRateBps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantity","unitPriceCents"]}},"recurringInterval":{"anyOf":[{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":12},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Update a draft quote","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"type":{"type":"string","const":"quote"},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]},"leadId":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requiresSignature":{"type":"boolean"},"signerName":{"type":["string","null"]},"signedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"declineReason":{"type":["string","null"]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","sendState","leadId","validUntil","requiresSignature","signerName","signedAt","declineReason"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/quotes/{id}/send":{"post":{"operationId":"post_workspaces_slug_quotes_id_send","summary":"Send a quote","description":"Queues the quote to be sent and answers 202 Accepted at once with the send (#205). The worker then renders and stores the PDF, moves the quote to `sent` (locked, with the client's approval link) and emails the client. Read how it went with `GET …/quotes/{id}/sends/{sendId}` (the quote's `sendState` is `queued` or `working` meanwhile): `sent` with `emailOutcome`, or `failed` with `failureReason`. A PDF that cannot be generated (`pdf_unavailable`) is retried three times before the send fails. A quote with no client yet is 409 `quote_has_no_client`; a quote whose validity has passed is 409 `quote_expired`; a second POST while a send is open is 409 `send_in_progress`; a non-draft quote is 409 `invalid_status_transition`. Honours `Idempotency-Key`: a replay returns the same send.","tags":["Quotes"],"security":[{"apiKey":[]},{"oauth2":["quotes:write"]}],"x-rokn-scope":"quotes:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"responses":{"202":{"description":"Send a quote","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"documentType":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"state":{"type":"string","enum":["queued","working","sent","failed"]},"failureReason":{"anyOf":[{"type":"string","enum":["gateway_test_mode","gateway_rejected","gateway_unavailable","pdf_unavailable","conflict","quote_expired","not_sendable","feature_locked","billing_read_only","interrupted","unexpected","requester_not_allowed","quote_has_no_client","credit_note_credits_nothing","credit_note_exceeds_invoice","number_taken"]},{"type":"null"}]},"emailOutcome":{"anyOf":[{"type":"string","enum":["sent","skipped","failed"]},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","documentId","documentType","state","failureReason","emailOutcome","attempts","createdAt","finishedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/quotes/{id}/sends/{sendId}":{"get":{"operationId":"get_workspaces_slug_quotes_id_sends_sendId","summary":"Read a quote send","description":"One send of this quote, as `POST …/send` answered it and as it stands now (#205). A send id of another quote is 404.","tags":["Quotes"],"security":[{"apiKey":[]},{"oauth2":["quotes:read"]}],"x-rokn-scope":"quotes:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"sendId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Read a quote send","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"documentType":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"state":{"type":"string","enum":["queued","working","sent","failed"]},"failureReason":{"anyOf":[{"type":"string","enum":["gateway_test_mode","gateway_rejected","gateway_unavailable","pdf_unavailable","conflict","quote_expired","not_sendable","feature_locked","billing_read_only","interrupted","unexpected","requester_not_allowed","quote_has_no_client","credit_note_credits_nothing","credit_note_exceeds_invoice","number_taken"]},{"type":"null"}]},"emailOutcome":{"anyOf":[{"type":"string","enum":["sent","skipped","failed"]},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","documentId","documentType","state","failureReason","emailOutcome","attempts","createdAt","finishedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/quotes/{id}/convert":{"post":{"operationId":"post_workspaces_slug_quotes_id_convert","summary":"Convert an approved quote to an invoice","description":"Creates a DRAFT invoice from an APPROVED quote, carrying its lines, totals and tax flags, and returns it. A quote with no client yet is 409 `quote_has_no_client` (before any other check); a quote not yet approved is 409 `quote_not_approved`; a quote already converted is 409 `quote_already_converted` (so a retry never bills twice). Creating the invoice also needs `invoices:write`: a credential holding only `quotes:write` is 403.","tags":["Quotes"],"security":[{"apiKey":[]},{"oauth2":["quotes:write"]}],"x-rokn-scope":"quotes:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"201":{"description":"Convert an approved quote to an invoice","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"type":{"type":"string","enum":["invoice","quote","credit_note","deposit"]},"status":{"type":"string","enum":["draft","sent","viewed","paid","overdue","cancelled","written_off"]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"issueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"subtotal":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"tax":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"reverseCharge":{"type":"boolean"},"notes":{"type":["string","null"]},"lineItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"taxRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"projectId":{"type":["string","null"]},"serviceId":{"type":["string","null"]}},"required":["id","description","quantity","unitPrice","taxRate","total","projectId","serviceId"],"additionalProperties":false}},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paidAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recurringNoticeMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sendState":{"anyOf":[{"type":"string","enum":["queued","working"]},{"type":"null"}]}},"required":["id","number","type","status","clientId","projectId","issueDate","dueDate","currency","subtotal","tax","total","reverseCharge","notes","lineItems","sentAt","paidAt","createdAt","updatedAt","recurringNoticeMonths","sendState"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/project-templates":{"get":{"operationId":"get_workspaces_slug_project-templates","summary":"List project templates","description":"The six platform starters first (`platform: true`, id `starter:<name>`, in the workspace's language), then every project template the workspace created, by name. Not paginated. `content` is what applying one adds to a project. Starters are read-only: they cannot be updated (PATCH on a `starter:` id is 404), do not count toward the plan's template limit, and can be applied directly; to customise one, create a template with the same `content`.","tags":["Project templates"],"security":[{"apiKey":[]},{"oauth2":["projects:read"]}],"x-rokn-scope":"projects:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List project templates","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"content":{"type":"object","properties":{"tasks":{"default":[],"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"priority":{"description":"A key of the workspace's `priority` task field (`low`, `medium`, `high`, `urgent`; see list_fields with record_type task). Applying resolves it to that option, or to the field's default option when the option is archived.","type":"string","enum":["low","medium","high","urgent"]},"subtasks":{"type":"array","items":{"type":"string"}}},"required":["title"],"additionalProperties":false}},"milestones":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"dayOffset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","dayOffset"],"additionalProperties":false}},"deliverables":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}},"statuses":{"description":"A task status list. Applied to a project with no tasks by a caller with customization:write, it becomes the project's own task status list; otherwise the project keeps its list.","type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"statusClass":{"type":"string","enum":["todo","in_progress","done"]},"color":{"type":["string","null"]},"isInitial":{"type":"boolean"}},"required":["name","statusClass","color","isInitial"],"additionalProperties":false}}},"required":["tasks","milestones","deliverables"],"additionalProperties":false},"platform":{"type":"boolean","description":"True for a platform starter: read-only, its id is `starter:<name>`, and it is not a stored template."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","content","platform","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_project-templates","summary":"Create a project template","description":"Creates a reusable template: `defaultTasks.tasks` (each with optional `subtasks` titles and a `priority` key: `low`, `medium` (the default), `high` or `urgent`, an option of the workspace's `priority` task field), `defaultTasks.milestones` (`dayOffset` days after the project's start), `defaultTasks.deliverables` and optionally `defaultTasks.statuses`, a task status list (each `{ name, statusClass: todo | in_progress | done, color, isInitial }`). A status list keeps the status engine's rules, else 422 at `defaultTasks.statuses`: at most 30 statuses (`status_limit_reached`), at least one `done` and one initial status (`last_status_of_class`), exactly one initial status, of class `todo` or `in_progress` (`initial_status_class`). Counts against the plan's template limit (`maxProjectTemplates`, 1 on Free): past it, 403.","tags":["Project templates"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultTasks":{"type":"object","properties":{"tasks":{"default":[],"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":"string"},"priority":{"default":"medium","type":"string","enum":["low","medium","high","urgent"]},"subtasks":{"default":[],"type":"array","items":{"type":"string"}}},"required":["title"]}},"milestones":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"dayOffset":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["name","dayOffset"]}},"deliverables":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}},"statuses":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"statusClass":{"type":"string","enum":["todo","in_progress","done"]},"color":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"isInitial":{"default":false,"type":"boolean"}},"required":["name","statusClass"]}}}}},"required":["name","defaultTasks"]}}}},"responses":{"201":{"description":"Create a project template","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"content":{"type":"object","properties":{"tasks":{"default":[],"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"priority":{"description":"A key of the workspace's `priority` task field (`low`, `medium`, `high`, `urgent`; see list_fields with record_type task). Applying resolves it to that option, or to the field's default option when the option is archived.","type":"string","enum":["low","medium","high","urgent"]},"subtasks":{"type":"array","items":{"type":"string"}}},"required":["title"],"additionalProperties":false}},"milestones":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"dayOffset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","dayOffset"],"additionalProperties":false}},"deliverables":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}},"statuses":{"description":"A task status list. Applied to a project with no tasks by a caller with customization:write, it becomes the project's own task status list; otherwise the project keeps its list.","type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"statusClass":{"type":"string","enum":["todo","in_progress","done"]},"color":{"type":["string","null"]},"isInitial":{"type":"boolean"}},"required":["name","statusClass","color","isInitial"],"additionalProperties":false}}},"required":["tasks","milestones","deliverables"],"additionalProperties":false},"platform":{"type":"boolean","description":"True for a platform starter: read-only, its id is `starter:<name>`, and it is not a stored template."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","content","platform","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/project-templates/{id}":{"patch":{"operationId":"patch_workspaces_slug_project-templates_id","summary":"Update a project template","description":"Partial update: `name`, `description`, or the whole `defaultTasks` (replaced, not merged). Projects the template was applied to are not changed. A platform starter (`starter:<name>`) is not a stored template and is never found here.","tags":["Project templates"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultTasks":{"type":"object","properties":{"tasks":{"default":[],"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":"string"},"priority":{"default":"medium","type":"string","enum":["low","medium","high","urgent"]},"subtasks":{"default":[],"type":"array","items":{"type":"string"}}},"required":["title"]}},"milestones":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"dayOffset":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["name","dayOffset"]}},"deliverables":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}},"statuses":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"statusClass":{"type":"string","enum":["todo","in_progress","done"]},"color":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"isInitial":{"default":false,"type":"boolean"}},"required":["name","statusClass"]}}}}}}}}},"responses":{"200":{"description":"Update a project template","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"content":{"type":"object","properties":{"tasks":{"default":[],"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"priority":{"description":"A key of the workspace's `priority` task field (`low`, `medium`, `high`, `urgent`; see list_fields with record_type task). Applying resolves it to that option, or to the field's default option when the option is archived.","type":"string","enum":["low","medium","high","urgent"]},"subtasks":{"type":"array","items":{"type":"string"}}},"required":["title"],"additionalProperties":false}},"milestones":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"dayOffset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","dayOffset"],"additionalProperties":false}},"deliverables":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}},"statuses":{"description":"A task status list. Applied to a project with no tasks by a caller with customization:write, it becomes the project's own task status list; otherwise the project keeps its list.","type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"statusClass":{"type":"string","enum":["todo","in_progress","done"]},"color":{"type":["string","null"]},"isInitial":{"type":"boolean"}},"required":["name","statusClass","color","isInitial"],"additionalProperties":false}}},"required":["tasks","milestones","deliverables"],"additionalProperties":false},"platform":{"type":"boolean","description":"True for a platform starter: read-only, its id is `starter:<name>`, and it is not a stored template."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","content","platform","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/{id}/apply-template":{"post":{"operationId":"post_workspaces_slug_projects_id_apply-template","summary":"Apply a template to a project","description":"Adds the template's milestones (dated from the project's start date, or today), deliverables, and tasks with their subtasks to the project, in one transaction, and records the template on the project. When the template carries a task status list, the project has no tasks and the caller has `customization:write`, that list becomes the project's own (replacing any own list it had) and `statusesApplied` is true; otherwise the project keeps its list, the rest of the template still applies and `statusesApplied` is false. Each task starts in the initial status of the list the project's tasks use, with its `priority` key's option (the field's default when that option is archived); a required task field does not refuse it. A template with tasks needs `tasks:write` as well. Applying a template twice adds everything twice. `templateId` is a template's id or a platform starter's (`starter:<name>`); applying a starter creates no template, does not count toward the plan's limit, and leaves the project's recorded template unchanged. Returns how many of each were added.","tags":["Project templates"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string","minLength":1}},"required":["templateId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Apply a template to a project","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"milestones":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deliverables":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tasks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"statusesApplied":{"type":"boolean","description":"True when the template's task status list became the project's own; false when the template has none, the project already had tasks, or the caller lacks customization:write."}},"required":["milestones","deliverables","tasks","statusesApplied"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents":{"get":{"operationId":"get_workspaces_slug_documents","summary":"List documents","description":"Documents, folders and rich-text documents, newest-updated first, keyset-paginated. Filters: `project_id`, `parent_id` (a folder's contents), `root=true` (top level only), `type`, and `search` (name contains).","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:read"]}],"x-rokn-scope":"documents:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"project_id","schema":{"type":"string"}},{"in":"query","name":"parent_id","schema":{"type":"string"}},{"in":"query","name":"root","schema":{"type":"string","enum":["true","false"]}},{"in":"query","name":"type","schema":{"type":"string","enum":["file","folder","richtext"]}},{"in":"query","name":"search","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"List documents","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","folder","richtext"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","projectId","clientId","parentId","mimeType","fileSize","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_documents","summary":"Create a rich-text document","description":"Creates a rich-text document from markdown, optionally in a project and/or folder. It opens in the document editor, and `create_contract` can put it up for signature. A project, folder or category in another workspace is not found.","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"markdown":{"description":"The body, as markdown: headings, paragraphs, lists, **bold**, *italic*, [links](https://…).","type":"string","maxLength":200000},"projectId":{"type":"string","minLength":1},"parentId":{"description":"A folder to create it in.","type":"string","minLength":1},"categoryId":{"type":"string","minLength":1}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a rich-text document","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","folder","richtext"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","projectId","clientId","parentId","mimeType","fileSize","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents/{id}/text":{"get":{"operationId":"get_workspaces_slug_documents_id_text","summary":"Read a document as text","description":"A rich-text document as Markdown (`format: markdown`) with its `version`, which `PATCH …/content` expects back; what Markdown cannot express shows as a placeholder line such as `[signature block]`. An uploaded PDF, DOCX, TXT or Markdown file is its extracted text (`format: text`, `version: null`). Capped at 100,000 characters (`truncated` says when). A folder, another file type, or a file with no text layer (a scan) is 422 with the reason.","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:read"]}],"x-rokn-scope":"documents:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Read a document as text","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","richtext"]},"format":{"type":"string","enum":["markdown","text"]},"text":{"type":"string"},"truncated":{"type":"boolean"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","name","type","format","text","truncated","version"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents/folders":{"post":{"operationId":"post_workspaces_slug_documents_folders","summary":"Create a folder","description":"Creates a folder at the top level or inside another folder, optionally in a project. A folder or project in another workspace is not found.","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"parentId":{"description":"The folder to create it in; omit for the top level.","type":"string","minLength":1},"projectId":{"type":"string","minLength":1}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a folder","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","folder","richtext"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","projectId","clientId","parentId","mimeType","fileSize","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents/uploads":{"post":{"operationId":"post_workspaces_slug_documents_uploads","summary":"Start a file upload","description":"Reserves storage for one file and answers a presigned URL: PUT the bytes to `url` with exactly the returned `headers`, then call `…/uploads/{uploadId}/complete`. A `projectId` without a `folderId` means that project's folder (409 `project_has_no_folder` when it has none); a folder the caller cannot read is 404. 409 `storage_quota_exceeded`; 409 `upload_too_large_to_scan`. An API key is 403.","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255},"contentType":{"description":"The type the file claims; the stored type is sniffed from its bytes.","type":"string","maxLength":255},"sizeBytes":{"type":"integer","minimum":0,"maximum":5368709120},"projectId":{"description":"Without folderId the file goes in this project's folder.","type":"string","minLength":1},"folderId":{"type":"string","minLength":1}},"required":["fileName","sizeBytes"],"additionalProperties":false}}}},"responses":{"201":{"description":"Start a file upload","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string"},"documentId":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["uploadId","documentId","url","method","headers","expiresAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents/uploads/{uploadId}/complete":{"post":{"operationId":"post_workspaces_slug_documents_uploads_uploadId_complete","summary":"Complete a file upload","description":"Checks the stored bytes against the reservation (size, then the type sniffed from them) and creates the document, in the same project or folder the start named (repeat `projectId` and `folderId`). The file is scanned for viruses and readable only by its uploader until the scan clears it. Only the person who started the upload completes it (anyone else: 404). 409 `upload_expired`; 422 `upload_size_mismatch` or `upload_type_mismatch`, after which the reservation is discarded. A retry answers the document already made.","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"uploadId","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255},"projectId":{"type":"string","minLength":1},"folderId":{"type":"string","minLength":1}},"required":["fileName"],"additionalProperties":false}}}},"responses":{"200":{"description":"Complete a file upload","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","folder","richtext"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","projectId","clientId","parentId","mimeType","fileSize","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents/{id}/content":{"patch":{"operationId":"patch_workspaces_slug_documents_id_content","summary":"Edit a rich-text document","description":"Edits a rich-text document from Markdown: `replace_section` (from a heading to the next heading of the same or a higher level), `append_section` (after a section, or at the end), or `replace_all`. Everything outside the edited part is kept exactly. Saves a new version, restorable in the editor's history. 409 `version_conflict` when the document changed since `expectedVersion`; 409 `document_has_rich_content` when the replaced part holds formatting or blocks Markdown cannot express (a signature block, colour, alignment); 409 `section_not_found`; 422 for a file or a folder.","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version reading the document returned; a newer one refuses with version_conflict."},"operation":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","const":"replace_section"},"heading":{"type":"string","minLength":1,"maxLength":300},"markdown":{"type":"string","maxLength":200000}},"required":["op","heading","markdown"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"append_section"},"markdown":{"type":"string","minLength":1,"maxLength":200000},"afterHeading":{"type":"string","minLength":1,"maxLength":300}},"required":["op","markdown"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"replace_all"},"markdown":{"type":"string","maxLength":200000}},"required":["op","markdown"],"additionalProperties":false}],"type":"object"}},"required":["expectedVersion","operation"],"additionalProperties":false}}}},"responses":{"200":{"description":"Edit a rich-text document","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","folder","richtext"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","type","projectId","clientId","parentId","mimeType","fileSize","createdAt","updatedAt","version"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents/{id}/move":{"post":{"operationId":"post_workspaces_slug_documents_id_move","summary":"Move a document or folder","description":"Moves a document or folder into another folder (`parentId`) or to the top level (`null`). 409 `folder_cycle` for a folder moved into itself or a subfolder; 409 `storage_drive_mismatch` across drives; a contract's document is refused as on the screen.","tags":["Documents"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"parentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The folder to move it into; null for the top level."}},"required":["parentId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Move a document or folder","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","folder","richtext"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","projectId","clientId","parentId","mimeType","fileSize","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/document-templates":{"get":{"operationId":"get_workspaces_slug_document-templates","summary":"List document templates","description":"The workspace's templates, by name, and the three built-in starters (read one with `GET …/document-templates/starters/{starter}`). Not paginated.","tags":["Document templates"],"security":[{"apiKey":[]},{"oauth2":["documents:read"]}],"x-rokn-scope":"documents:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"locale","schema":{"description":"The language the starters' names are in (default en).","type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"description":"The language the starters' names are in (default en)."}],"responses":{"200":{"description":"List document templates","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"contract":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","locale","contract","updatedAt"],"additionalProperties":false}},"starters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["nda","service_agreement","proposal"]},"name":{"type":"string"},"contract":{"type":"boolean","description":"True when the New contract dialog offers this starter."}},"required":["id","name","contract"],"additionalProperties":false}}},"required":["items","starters"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_document-templates","summary":"Create a document template","description":"Creates a template from Markdown. Fields are written as {{tag}}; the tags are client.name, client.contact_name, client.email, client.address, client.vat_id, project.name, project.start_date, project.end_date, workspace.name, workspace.address, workspace.email, workspace.vat_id, date.today. An unknown field is 422 and names it.","tags":["Document templates"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"],"description":"The template's language: it sets the date format and the placeholders a missing field fills with."},"contract":{"description":"Offer this template in the New contract dialog (default false).","type":"boolean"},"markdown":{"type":"string","maxLength":200000,"description":"The body, as Markdown. Fields are written as {{tag}}; the tags are client.name, client.contact_name, client.email, client.address, client.vat_id, project.name, project.start_date, project.end_date, workspace.name, workspace.address, workspace.email, workspace.vat_id, date.today."}},"required":["name","locale","markdown"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a document template","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"contract":{"type":"boolean","description":"True when the New contract dialog offers this template."},"markdown":{"type":"string"},"fields":{"type":"array","items":{"type":"string","enum":["client.name","client.contact_name","client.email","client.address","client.vat_id","project.name","project.start_date","project.end_date","workspace.name","workspace.address","workspace.email","workspace.vat_id","date.today"]}},"hasRichContent":{"type":"boolean","description":"True when the template holds formatting Markdown cannot show; its body can then only be changed in the app."}},"required":["id","name","description","locale","contract","markdown","fields","hasRichContent"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/document-templates/starters/{starter}":{"get":{"operationId":"get_workspaces_slug_document-templates_starters_starter","summary":"Read a starter","description":"A built-in starter (`nda`, `service_agreement`, `proposal`) as Markdown, in the language asked for. Fields are written as {{tag}}; the tags are client.name, client.contact_name, client.email, client.address, client.vat_id, project.name, project.start_date, project.end_date, workspace.name, workspace.address, workspace.email, workspace.vat_id, date.today.","tags":["Document templates"],"security":[{"apiKey":[]},{"oauth2":["documents:read"]}],"x-rokn-scope":"documents:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"starter","schema":{"type":"string"},"required":true},{"in":"query","name":"locale","schema":{"description":"Default en.","type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"description":"Default en."}],"responses":{"200":{"description":"Read a starter","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","enum":["nda","service_agreement","proposal"]},"name":{"type":"string"},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"contract":{"type":"boolean","description":"True when the New contract dialog offers this template."},"markdown":{"type":"string"},"fields":{"type":"array","items":{"type":"string","enum":["client.name","client.contact_name","client.email","client.address","client.vat_id","project.name","project.start_date","project.end_date","workspace.name","workspace.address","workspace.email","workspace.vat_id","date.today"]}},"hasRichContent":{"type":"boolean","description":"True when the template holds formatting Markdown cannot show; its body can then only be changed in the app."}},"required":["id","name","locale","contract","markdown","fields","hasRichContent"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/document-templates/{id}":{"get":{"operationId":"get_workspaces_slug_document-templates_id","summary":"Read a document template","description":"A template as Markdown, with the fields it uses. Fields are written as {{tag}}; the tags are client.name, client.contact_name, client.email, client.address, client.vat_id, project.name, project.start_date, project.end_date, workspace.name, workspace.address, workspace.email, workspace.vat_id, date.today. What Markdown cannot express shows as a placeholder line such as `[signature block]`, and `hasRichContent` is then true.","tags":["Document templates"],"security":[{"apiKey":[]},{"oauth2":["documents:read"]}],"x-rokn-scope":"documents:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Read a document template","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"contract":{"type":"boolean","description":"True when the New contract dialog offers this template."},"markdown":{"type":"string"},"fields":{"type":"array","items":{"type":"string","enum":["client.name","client.contact_name","client.email","client.address","client.vat_id","project.name","project.start_date","project.end_date","workspace.name","workspace.address","workspace.email","workspace.vat_id","date.today"]}},"hasRichContent":{"type":"boolean","description":"True when the template holds formatting Markdown cannot show; its body can then only be changed in the app."}},"required":["id","name","description","locale","contract","markdown","fields","hasRichContent"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_document-templates_id","summary":"Update a document template","description":"Partial update: `name`, `description`, `locale`, `contract`, or the whole body as `markdown` (replaced, not merged). Documents already made from the template are not changed. Replacing the body of a template with `hasRichContent` is 409 `document_has_rich_content`: edit that one in the app.","tags":["Document templates"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"],"description":"The template's language: it sets the date format and the placeholders a missing field fills with."},"contract":{"description":"Offer this template in the New contract dialog (default false).","type":"boolean"},"markdown":{"type":"string","maxLength":200000,"description":"The body, as Markdown. Fields are written as {{tag}}; the tags are client.name, client.contact_name, client.email, client.address, client.vat_id, project.name, project.start_date, project.end_date, workspace.name, workspace.address, workspace.email, workspace.vat_id, date.today."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Update a document template","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"contract":{"type":"boolean","description":"True when the New contract dialog offers this template."},"markdown":{"type":"string"},"fields":{"type":"array","items":{"type":"string","enum":["client.name","client.contact_name","client.email","client.address","client.vat_id","project.name","project.start_date","project.end_date","workspace.name","workspace.address","workspace.email","workspace.vat_id","date.today"]}},"hasRichContent":{"type":"boolean","description":"True when the template holds formatting Markdown cannot show; its body can then only be changed in the app."}},"required":["id","name","description","locale","contract","markdown","fields","hasRichContent"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_document-templates_id","summary":"Delete a document template","description":"Deletes the template. Documents already made from it are kept.","tags":["Document templates"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a document template","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/documents/from-template":{"post":{"operationId":"post_workspaces_slug_documents_from-template","summary":"Create a document from a template","description":"Fills a template (`templateId`) or a starter (`starter` + `locale`) once for a client and/or project and creates an ordinary rich-text document from it; later changes to the template do not reach the document. Dates and placeholders follow the template's language. A field with no value becomes a highlighted placeholder such as `[Client address]`. A client, project or template in another workspace, or a project of another client, is not found.","tags":["Document templates"],"security":[{"apiKey":[]},{"oauth2":["documents:write"]}],"x-rokn-scope":"documents:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"description":"A workspace template. Give this, or `starter` with `locale`.","type":"string","minLength":1,"maxLength":64},"starter":{"description":"A built-in starter, with `locale`.","type":"string","enum":["nda","service_agreement","proposal"]},"locale":{"description":"The starter's language (required with `starter`).","type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]},"name":{"type":"string","minLength":1,"maxLength":200},"clientId":{"description":"The client the client fields fill from.","type":"string","minLength":1,"maxLength":64},"projectId":{"description":"The project the project fields fill from; it must belong to `clientId` when both are given.","type":"string","minLength":1,"maxLength":64},"parentId":{"description":"A folder to create it in.","type":"string","minLength":1,"maxLength":64}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a document from a template","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["file","folder","richtext"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"mimeType":{"type":["string","null"]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","type","projectId","clientId","parentId","mimeType","fileSize","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/members":{"get":{"operationId":"get_workspaces_slug_members","summary":"List team members","description":"The workspace's staff by name, with their role — the people a task can be assigned to (pass `userId` as a task's `assigneeId`). Client-portal users are not listed. No emails or rates. Not paginated.","tags":["Team"],"security":[{"apiKey":[]},{"oauth2":["projects:read"]}],"x-rokn-scope":"projects:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List team members","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","accountant","viewer"]}},"required":["userId","name","role"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/services":{"get":{"operationId":"get_workspaces_slug_services","summary":"List services and packages","description":"Active services (with their category, pricing type and rate — hourly or fixed) and active packages (with their price and the services they bundle, with quantities). Use a service's `id` as a quote line's `serviceId`. Not paginated.","tags":["Services"],"security":[{"apiKey":[]},{"oauth2":["services:read"]}],"x-rokn-scope":"services:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List services and packages","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"pricingType":{"type":"string","enum":["hourly","fixed"]},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false}},"required":["id","name","description","category","pricingType","rate"],"additionalProperties":false}},"packages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"services":{"type":"array","items":{"type":"object","properties":{"serviceId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["serviceId","name","quantity"],"additionalProperties":false}}},"required":["id","name","description","price","services"],"additionalProperties":false}}},"required":["services","packages"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_services","summary":"Create a service","description":"Adds a service to the catalogue: `name`, `pricingType` (hourly or fixed), `rateCents` in the workspace currency, optional `description` and `categoryId`. A `currency` other than the workspace's is 409 `currency_mismatch`; a category of another workspace is 404.","tags":["Services"],"security":[{"apiKey":[]},{"oauth2":["services:write"]}],"x-rokn-scope":"services:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"categoryId":{"type":["string","null"]},"pricingType":{"type":"string","enum":["hourly","fixed"]},"rateCents":{"type":"integer","minimum":1,"maximum":9007199254740991},"currency":{"type":"string"},"active":{"default":true,"type":"boolean"}},"required":["name","pricingType","rateCents"]}}}},"responses":{"201":{"description":"Create a service","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"categoryId":{"type":["string","null"]},"pricingType":{"type":"string","enum":["hourly","fixed"]},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","categoryId","pricingType","rate","active","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads":{"get":{"operationId":"get_workspaces_slug_leads","summary":"List leads","description":"Leads of one pipeline, most recently updated first, keyset-paginated (`limit` 25, at most 100; pass `nextCursor` back as `cursor` until it is null), OPEN ones by default (`class` for others), filtered by `status_id`, `search` or `where` (field filters), ordered by `sort`. `statuses` is the pipeline's flow, in order.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"pipeline_id","schema":{"description":"Default: the first active pipeline.","type":"string"},"description":"Default: the first active pipeline."},{"in":"query","name":"status_id","schema":{"type":"string"}},{"in":"query","name":"class","schema":{"description":"Comma-separated status classes (open, won, lost, not_pursued). Default open.","type":"string"},"description":"Comma-separated status classes (open, won, lost, not_pursued). Default open."},{"in":"query","name":"search","schema":{"description":"Name, company, email or a text field value contains.","type":"string","minLength":1,"maxLength":200},"description":"Name, company, email or a text field value contains."},{"in":"query","name":"owner","schema":{"description":"Only leads owned by this user id, or by the calling person with `me` (a key has no person: 422 at `owner`).","type":"string","minLength":1},"description":"Only leads owned by this user id, or by the calling person with `me` (a key has no person: 422 at `owner`)."},{"in":"query","name":"where","schema":{"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`.","type":"string","maxLength":4000},"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`."},{"in":"query","name":"sort","schema":{"description":"A field key, or one of name, value, created_at, updated_at, next_follow_up_at; a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`. A money field orders by currency, then amount.","type":"string","minLength":1,"maxLength":100},"description":"A field key, or one of name, value, created_at, updated_at, next_follow_up_at; a leading `-` sorts descending. Default: most recently updated first. An unknown key is 422 `unknown_field`. A money field orders by currency, then amount."},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`.","type":"string","maxLength":10934},"description":"The previous page's `nextCursor`, with the same filters and sort. An invalid cursor is 422 `validation_failed`."}],"responses":{"200":{"description":"List leads","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"status":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["open","won","lost","not_pursued"]}},"required":["id","key","name","class"],"additionalProperties":false},"value":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The lead's own probability; null means it reads its status's default."},"effectiveProbability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The probability the lead counts at: its own, else its status's default; null when neither is set."},"stalled":{"type":"boolean","description":"True when the lead is open, its status names a `stalledAfterDays`, and nothing has been added to its timeline for that many days (elapsed 24-hour days)."},"lastActivityAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest timeline item (log entry, field change, status change, checklist task change or quote) was logged; the lead's creation when it has none."},"notes":{"type":["string","null"]},"ownerId":{"description":"The staff member who owns the lead; null only for a lead whose owner's account was erased.","type":["string","null"]},"nextFollowUpAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"wonAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostReason":{"type":["string","null"]},"convertedClientId":{"type":["string","null"]},"convertedProjectId":{"type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"figures":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"`value`, `quote` or `field:<key>`, in the pipeline's order."},"amountCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Minor units; null when the lead holds none, or when hidden."},"currency":{"type":["string","null"]},"hidden":{"type":"boolean","description":"True for the Quote figure (the lead's latest live quote) when the caller cannot read quotes."},"quoteId":{"description":"The quote the Quote figure reads: the lead's latest live one (not declined, expired or cancelled; a draft counts). Null when hidden or when there is none.","type":["string","null"]}},"required":["key","amountCents","currency","hidden","quoteId"],"additionalProperties":false},"description":"The pipeline's value figures for this lead, in order; an archived money field's is left out."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","company","email","phone","pipeline","status","value","probability","effectiveProbability","stalled","lastActivityAt","notes","ownerId","nextFollowUpAt","wonAt","lostAt","lostReason","convertedClientId","convertedProjectId","fields","figures","createdAt","updatedAt"],"additionalProperties":false}},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","position"],"additionalProperties":false},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","position"],"additionalProperties":false}},"statuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]},"class":{"type":"string","enum":["open","won","lost","not_pursued"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isInitial":{"type":"boolean"}},"required":["id","key","name","color","class","position","isInitial"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false},"description":"The field definitions placed on the pipeline; record `fields` are keyed by their `key`."},"nextCursor":{"description":"Pass as `cursor` for the next page; null on the last page.","type":["string","null"]}},"required":["items","pipeline","pipelines","statuses","fields","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_leads","summary":"Create a lead","description":"Creates a lead in `statusId` or `statusKey` (the status's key in the pipeline; an unknown key is 404, and an id and key naming different statuses are 422 at `statusKey`), or the initial status of `pipelineId`, or of the first active pipeline. `valueCents` is in the workspace currency. A status of another workspace is 404; a plan without the pipeline is 403 `feature_locked`; a refused field write names its reason (`unknown_field_option`, `field_required`, `field_unique_conflict`, `stage_requirements_unmet`).","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string"},"phone":{"type":"string"},"company":{"type":"string"},"valueCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"probability":{"type":"integer","minimum":0,"maximum":100},"notes":{"type":"string"},"ownerId":{"description":"The owning staff member's user id (see list_team_members); another workspace's user or a portal client is 422 at `ownerId`. Default on create: the calling person, else the workspace owner.","type":"string","minLength":1},"nextFollowUpAt":{"type":"string","format":"date-time"},"pipelineId":{"type":"string"},"statusId":{"type":"string","minLength":1},"statusKey":{"description":"A status of the lead's pipeline by its key (see list_statuses); an unknown key is 404. With statusId too, both must name the same status (422 at statusKey).","type":"string","minLength":1},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["name"]}}}},"responses":{"201":{"description":"Create a lead","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"status":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["open","won","lost","not_pursued"]}},"required":["id","key","name","class"],"additionalProperties":false},"value":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The lead's own probability; null means it reads its status's default."},"effectiveProbability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The probability the lead counts at: its own, else its status's default; null when neither is set."},"stalled":{"type":"boolean","description":"True when the lead is open, its status names a `stalledAfterDays`, and nothing has been added to its timeline for that many days (elapsed 24-hour days)."},"lastActivityAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest timeline item (log entry, field change, status change, checklist task change or quote) was logged; the lead's creation when it has none."},"notes":{"type":["string","null"]},"ownerId":{"description":"The staff member who owns the lead; null only for a lead whose owner's account was erased.","type":["string","null"]},"nextFollowUpAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"wonAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostReason":{"type":["string","null"]},"convertedClientId":{"type":["string","null"]},"convertedProjectId":{"type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"figures":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"`value`, `quote` or `field:<key>`, in the pipeline's order."},"amountCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Minor units; null when the lead holds none, or when hidden."},"currency":{"type":["string","null"]},"hidden":{"type":"boolean","description":"True for the Quote figure (the lead's latest live quote) when the caller cannot read quotes."},"quoteId":{"description":"The quote the Quote figure reads: the lead's latest live one (not declined, expired or cancelled; a draft counts). Null when hidden or when there is none.","type":["string","null"]}},"required":["key","amountCents","currency","hidden","quoteId"],"additionalProperties":false},"description":"The pipeline's value figures for this lead, in order; an archived money field's is left out."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","company","email","phone","pipeline","status","value","probability","effectiveProbability","stalled","lastActivityAt","notes","ownerId","nextFollowUpAt","wonAt","lostAt","lostReason","convertedClientId","convertedProjectId","fields","figures","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/stats":{"get":{"operationId":"get_workspaces_slug_leads_stats","summary":"Lead statistics","description":"Win rate, leads per status, value won per currency, days to a status and a breakdown by a select field, for [from, to) read in the workspace timezone. Statuses match across pipelines by key. Each figure is measured over its own set: statusCounts is the CURRENT status of leads created in the period; winRate and valueWon cover leads whose current status class is won or lost and whose closing time (the latest move into a status of that class, else the lead's creation) is in the period, and not_pursued or open leads never count; daysToStatus covers leads whose FIRST entry into a status with status_key is in the period, measured from creation; breakdown applies the same sets per option. valueWon sums figure over the won leads, whether or not their pipeline lists it, one line per currency and never converted; it is null for Quote without the Quotes read. A from not before to, a period over 5 years, a bad date, a figure that is no money figure or a breakdown_field_key that is no select field is 422; an unknown pipeline is 404. A status key shared by pipelines with different classes shows the first pipeline's name and class; a lead counts under its current pipeline only.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"pipeline_id","schema":{"description":"One pipeline; omitted, every pipeline of the workspace (statuses are matched across pipelines by status key). An unknown pipeline is 404.","type":"string","minLength":1},"description":"One pipeline; omitted, every pipeline of the workspace (statuses are matched across pipelines by status key). An unknown pipeline is 404."},{"in":"query","name":"from","schema":{"type":"string","minLength":1,"maxLength":10,"description":"First day of the period, YYYY-MM-DD, read in the workspace timezone."},"required":true,"description":"First day of the period, YYYY-MM-DD, read in the workspace timezone."},{"in":"query","name":"to","schema":{"type":"string","minLength":1,"maxLength":10,"description":"The day the period ends before (exclusive), YYYY-MM-DD, workspace timezone. Not after `from`, and at most 5 years after it: 422 at `to`."},"required":true,"description":"The day the period ends before (exclusive), YYYY-MM-DD, workspace timezone. Not after `from`, and at most 5 years after it: 422 at `to`."},{"in":"query","name":"figure","schema":{"default":"value","description":"The value figure summed as value won: `value`, `quote` or `field:<money field key>`. Quote is hidden (valueWon null) without the Quotes read.","type":"string","minLength":1,"maxLength":100},"description":"The value figure summed as value won: `value`, `quote` or `field:<money field key>`. Quote is hidden (valueWon null) without the Quotes read."},{"in":"query","name":"status_key","schema":{"description":"A status key (see list_statuses): daysToStatus is the average days from creation to a lead's first entry into a status with this key. An unknown key reads as 0 leads.","type":"string","minLength":1,"maxLength":100},"description":"A status key (see list_statuses): daysToStatus is the average days from creation to a lead's first entry into a status with this key. An unknown key reads as 0 leads."},{"in":"query","name":"breakdown_field_key","schema":{"description":"A single- or multi-select lead field key: every figure is also given per option. Any other field is 422 at breakdownFieldKey.","type":"string","minLength":1,"maxLength":100},"description":"A single- or multi-select lead field key: every figure is also given per option. Any other field is 422 at breakdownFieldKey."}],"responses":{"200":{"description":"Lead statistics","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"statusCounts":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"statusClass":{"type":"string","enum":["open","won","lost","not_pursued"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","name","statusClass","count"],"additionalProperties":false},"description":"The CURRENT status of the leads created in the period, one row per status key (zero included), in pipeline order."},"winRate":{"type":"object","properties":{"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate":{"description":"won / (won + lost); null when both are 0.","type":["number","null"]}},"required":["won","lost","rate"],"additionalProperties":false},"valueWon":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor units of the currency."}},"required":["currency","amountMinor"],"additionalProperties":false}},{"type":"null"}],"description":"The chosen figure of the won leads, one line per currency, never converted; null when the figure is hidden from the caller."},"daysToStatus":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"averageDays":{"description":"One decimal; null when no lead entered the status in the period.","type":["number","null"]},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","averageDays","leads"],"additionalProperties":false},{"type":"null"}],"description":"Null without status_key."},"breakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"optionKey":{"description":"The option key; null is leads holding none.","type":["string","null"]},"label":{"description":"The option's label; null for the none row.","type":["string","null"]},"statusCounts":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"statusClass":{"type":"string","enum":["open","won","lost","not_pursued"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","name","statusClass","count"],"additionalProperties":false},"description":"The CURRENT status of the leads created in the period, one row per status key (zero included), in pipeline order."},"winRate":{"type":"object","properties":{"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate":{"description":"won / (won + lost); null when both are 0.","type":["number","null"]}},"required":["won","lost","rate"],"additionalProperties":false},"valueWon":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minor units of the currency."}},"required":["currency","amountMinor"],"additionalProperties":false}},{"type":"null"}],"description":"The chosen figure of the won leads, one line per currency, never converted; null when the figure is hidden from the caller."},"daysToStatus":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"averageDays":{"description":"One decimal; null when no lead entered the status in the period.","type":["number","null"]},"leads":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","averageDays","leads"],"additionalProperties":false},{"type":"null"}],"description":"Null without status_key."}},"required":["optionKey","label","statusCounts","winRate","valueWon","daysToStatus"],"additionalProperties":false}},{"type":"null"}],"description":"Every figure per option of breakdown_field_key (a multi-select counts a lead once per option); null without it."}},"required":["statusCounts","winRate","valueWon","daysToStatus","breakdown"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/due":{"get":{"operationId":"get_workspaces_slug_leads_due","summary":"What's due","description":"Every OPEN lead of one pipeline (`pipeline_id`), or of every pipeline, with its next date, not paginated (`limit`, 1 to 200, cuts the list). A lead's dates are the values of its date, datetime and calculated date fields that have a reminder and are available in its pipeline. Its next date is the most recent date within the last 14 days (overdue, `daysLeft` negative), else the earliest date from today on, with today read in the workspace zone and each date read in the zone its field shows (the workspace zone for a date field and a workspace-zone datetime, the field's own zone for a datetime shown in one). Overdue leads come first, oldest first, then upcoming ones, soonest first, then leads with no date by name. `owner` and `where` narrow the list exactly as they do `GET /leads` (a filter on a field a lead's pipeline does not place is dropped for that pipeline; an unknown field or a bad operand is 422 `invalid_field_filter`). Each row carries the owner, the checklist's done and total, `stalled` and `updated`.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"pipeline_id","schema":{"description":"One pipeline; omitted, every pipeline of the workspace. An unknown pipeline is 404.","type":"string","minLength":1},"description":"One pipeline; omitted, every pipeline of the workspace. An unknown pipeline is 404."},{"in":"query","name":"limit","schema":{"description":"Cut the list after this many rows (1 to 200). Omitted, every open lead is listed.","type":"integer","minimum":1,"maximum":200},"description":"Cut the list after this many rows (1 to 200). Omitted, every open lead is listed."},{"in":"query","name":"owner","schema":{"description":"Only leads owned by this user id, or by the calling person with `me` (a key has no person: 422 at `owner`).","type":"string","minLength":1},"description":"Only leads owned by this user id, or by the calling person with `me` (a key has no person: 422 at `owner`)."},{"in":"query","name":"where","schema":{"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`.","type":"string","maxLength":4000},"description":"A JSON-encoded array of field filters: [{ \"field\": \"<key>\", \"op\": \"eq|in|contains|before|after|between|lt|gt|empty|not_empty\", \"value\": ... }], all of which must hold. A bad operand is 422 `invalid_field_filter`. A range (`lt`, `gt`, `between`) on a money field matches only values in the operand's currency (never converted): an any-currency field takes `{ \"amountCents\": n, \"currency\": \"EUR\" }`, a fixed-currency field its own currency; a `between` naming two currencies is 422 `invalid_field_filter`."}],"responses":{"200":{"description":"What's due","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"name":{"type":"string"},"pipelineId":{"type":"string"},"statusId":{"type":"string"},"date":{"description":"The lead's next date, YYYY-MM-DD, in the zone the field shows (the workspace zone for a date field and a workspace-zone datetime, the field's own zone for a datetime shown in one); null when it has none.","type":["string","null"]},"daysLeft":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Whole days from today to `date`; negative when overdue; null without a date."},"overdue":{"type":"boolean","description":"The date passed within the last 14 days. An older date is never shown."},"fieldKey":{"description":"The date field the date comes from.","type":["string","null"]},"fieldLabel":{"type":["string","null"]},"checklist":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"ownerId":{"description":"The staff member who owns the lead.","type":["string","null"]},"stalled":{"type":"boolean"},"updated":{"type":"boolean","description":"Someone else (or an agent) changed the lead after the calling person last opened it. Always false for an API key."}},"required":["leadId","name","pipelineId","statusId","date","daysLeft","overdue","fieldKey","fieldLabel","checklist","ownerId","stalled","updated"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/views":{"get":{"operationId":"get_workspaces_slug_leads_views","summary":"List lead views","description":"The calling person's own saved views and every shared one, by name (not paginated); an API key lists the shared ones only. `params` holds the leads page's own URL keys, which the page opens as `?view=<surface>&pipeline=<id|all>&<params>`.","tags":["Lead views"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List lead views","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"surface":{"type":"string","enum":["table","board","due"]},"pipelineId":{"description":"null: every pipeline (What's due only).","type":["string","null"]},"shared":{"type":"boolean"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The leads page's own URL keys: where, sort, class, columns, group, owner, status and q."},"authorUserId":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean","description":"The calling person wrote it. Always false for an API key."},"canManage":{"type":"boolean","description":"The caller may rename, share or delete it."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","surface","pipelineId","shared","params","authorUserId","authorName","mine","canManage","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_leads_views","summary":"Create a lead view","description":"Saves a view for `surface` (`table`, `board` or `due`) in a pipeline (`pipelineId`; null for every pipeline, which only `due` may use), private unless `shared`. `params` may hold only where, sort, class, columns, group, owner, status and q, each a string; another key is 422 at `params.<key>`, and invalid parts of a value are dropped. A name (1 to 80 characters) is unique per person, surface and pipeline, ignoring case: a repeat is 409 `conflict`. An API key is 403.","tags":["Lead views"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"surface":{"type":"string","enum":["table","board","due"]},"pipelineId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"shared":{"type":"boolean"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["name","surface"],"additionalProperties":false}}}},"responses":{"201":{"description":"Create a lead view","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"surface":{"type":"string","enum":["table","board","due"]},"pipelineId":{"description":"null: every pipeline (What's due only).","type":["string","null"]},"shared":{"type":"boolean"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The leads page's own URL keys: where, sort, class, columns, group, owner, status and q."},"authorUserId":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean","description":"The calling person wrote it. Always false for an API key."},"canManage":{"type":"boolean","description":"The caller may rename, share or delete it."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","surface","pipelineId","shared","params","authorUserId","authorName","mine","canManage","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/views/{id}":{"patch":{"operationId":"patch_workspaces_slug_leads_views_id","summary":"Update a lead view","description":"Renames a view, shares or unshares it, or replaces its `params`. A shared view is changed by its author or by anyone with `customization:write` (another Leads writer is 403); another person's private view is 404. An API key is 403.","tags":["Lead views"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"shared":{"type":"boolean"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Update a lead view","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"surface":{"type":"string","enum":["table","board","due"]},"pipelineId":{"description":"null: every pipeline (What's due only).","type":["string","null"]},"shared":{"type":"boolean"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The leads page's own URL keys: where, sort, class, columns, group, owner, status and q."},"authorUserId":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean","description":"The calling person wrote it. Always false for an API key."},"canManage":{"type":"boolean","description":"The caller may rename, share or delete it."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","surface","pipelineId","shared","params","authorUserId","authorName","mine","canManage","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_leads_views_id","summary":"Delete a lead view","description":"Deletes a saved view: a person's setting, not a lead record, so the scope is `leads:write`. Its author, or anyone with `customization:write` for a shared view, may delete it; another person's private view is 404. An API key is 403.","tags":["Lead views"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a lead view","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/{id}":{"get":{"operationId":"get_workspaces_slug_leads_id","summary":"Get a lead","description":"One lead: its pipeline, status (with its key and class), owner, value, probability, follow-up and `fields` keyed by field key. A lead of another workspace, or one in the recycle bin, is 404. Its history is `GET /leads/{id}/timeline`.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a lead","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"status":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["open","won","lost","not_pursued"]}},"required":["id","key","name","class"],"additionalProperties":false},"value":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The lead's own probability; null means it reads its status's default."},"effectiveProbability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The probability the lead counts at: its own, else its status's default; null when neither is set."},"stalled":{"type":"boolean","description":"True when the lead is open, its status names a `stalledAfterDays`, and nothing has been added to its timeline for that many days (elapsed 24-hour days)."},"lastActivityAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest timeline item (log entry, field change, status change, checklist task change or quote) was logged; the lead's creation when it has none."},"notes":{"type":["string","null"]},"ownerId":{"description":"The staff member who owns the lead; null only for a lead whose owner's account was erased.","type":["string","null"]},"nextFollowUpAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"wonAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostReason":{"type":["string","null"]},"convertedClientId":{"type":["string","null"]},"convertedProjectId":{"type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"figures":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"`value`, `quote` or `field:<key>`, in the pipeline's order."},"amountCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Minor units; null when the lead holds none, or when hidden."},"currency":{"type":["string","null"]},"hidden":{"type":"boolean","description":"True for the Quote figure (the lead's latest live quote) when the caller cannot read quotes."},"quoteId":{"description":"The quote the Quote figure reads: the lead's latest live one (not declined, expired or cancelled; a draft counts). Null when hidden or when there is none.","type":["string","null"]}},"required":["key","amountCents","currency","hidden","quoteId"],"additionalProperties":false},"description":"The pipeline's value figures for this lead, in order; an archived money field's is left out."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","company","email","phone","pipeline","status","value","probability","effectiveProbability","stalled","lastActivityAt","notes","ownerId","nextFollowUpAt","wonAt","lostAt","lostReason","convertedClientId","convertedProjectId","fields","figures","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_leads_id","summary":"Update a lead","description":"Partial update; `null` clears a nullable field. `statusId` or `statusKey` moves it (a status of another pipeline or workspace, or an unknown key, is 404; an id and key naming different statuses are 422 at `statusKey`), `pipelineId` moves it to another pipeline. Entering a lost status takes an optional `lostReason`. A converted lead cannot leave its won status (409 `lead_already_converted`).","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"valueCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"notes":{"type":["string","null"]},"ownerId":{"anyOf":[{"description":"The owning staff member's user id (see list_team_members); another workspace's user or a portal client is 422 at `ownerId`. Default on create: the calling person, else the workspace owner.","type":"string","minLength":1},{"type":"null"}],"description":"Reassigns the lead to this staff member (user id). `null` is refused: 422 at `ownerId`, a lead always has an owner. A departed owner may be sent back unchanged."},"nextFollowUpAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pipelineId":{"description":"Moves the lead to another pipeline; its status is remapped unless statusId is given.","type":"string"},"statusId":{"type":"string","minLength":1},"statusKey":{"description":"A status of the lead's pipeline by its key (see list_statuses); an unknown key is 404. With statusId too, both must name the same status (422 at statusKey).","type":"string","minLength":1},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}},"lostReason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Update a lead","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"status":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["open","won","lost","not_pursued"]}},"required":["id","key","name","class"],"additionalProperties":false},"value":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The lead's own probability; null means it reads its status's default."},"effectiveProbability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The probability the lead counts at: its own, else its status's default; null when neither is set."},"stalled":{"type":"boolean","description":"True when the lead is open, its status names a `stalledAfterDays`, and nothing has been added to its timeline for that many days (elapsed 24-hour days)."},"lastActivityAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest timeline item (log entry, field change, status change, checklist task change or quote) was logged; the lead's creation when it has none."},"notes":{"type":["string","null"]},"ownerId":{"description":"The staff member who owns the lead; null only for a lead whose owner's account was erased.","type":["string","null"]},"nextFollowUpAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"wonAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostReason":{"type":["string","null"]},"convertedClientId":{"type":["string","null"]},"convertedProjectId":{"type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"figures":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"`value`, `quote` or `field:<key>`, in the pipeline's order."},"amountCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Minor units; null when the lead holds none, or when hidden."},"currency":{"type":["string","null"]},"hidden":{"type":"boolean","description":"True for the Quote figure (the lead's latest live quote) when the caller cannot read quotes."},"quoteId":{"description":"The quote the Quote figure reads: the lead's latest live one (not declined, expired or cancelled; a draft counts). Null when hidden or when there is none.","type":["string","null"]}},"required":["key","amountCents","currency","hidden","quoteId"],"additionalProperties":false},"description":"The pipeline's value figures for this lead, in order; an archived money field's is left out."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","company","email","phone","pipeline","status","value","probability","effectiveProbability","stalled","lastActivityAt","notes","ownerId","nextFollowUpAt","wonAt","lostAt","lostReason","convertedClientId","convertedProjectId","fields","figures","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/{id}/timeline":{"get":{"operationId":"get_workspaces_slug_leads_id_timeline","summary":"List a lead's timeline","description":"A lead's history, newest first: status moves (`status`), field changes (`field`), log entries (`entry`), checklist tasks done (`task_done`) and quotes made from it (`quote`, only for a caller who reads quotes; others get no quote items) and its conversion into a client (`conversion`, at `convertedAt`, naming the client and the project only for a caller who may see their names). Each item names its author: the person, or the connected app or API key with the person it acts for; null for the automation and for a conversion. `limit` 30 by default, at most 100; pass `nextCursor` back as `cursor` until it is null. A lead of another workspace is 404.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"cursor","schema":{"description":"The previous page's `nextCursor`. An invalid cursor is 422 `validation_failed`.","type":"string","maxLength":300},"description":"The previous page's `nextCursor`. An invalid cursor is 422 `validation_failed`."},{"in":"query","name":"limit","schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"List a lead's timeline","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"status"},"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},{"type":"null"}],"description":"Who did it: the person, and for an agent the connected app or API key it came through; null for the workspace's automation."},"from":{"anyOf":[{"type":"object","properties":{"name":{"description":"The status's name now; null once the status is deleted.","type":["string","null"]},"class":{"type":"string"}},"required":["name","class"],"additionalProperties":false},{"type":"null"}],"description":"null when the lead was created in `to`."},"to":{"type":"object","properties":{"name":{"description":"The status's name now; null once the status is deleted.","type":["string","null"]},"class":{"type":"string"}},"required":["name","class"],"additionalProperties":false},"fromPipeline":{"description":"The pipeline the lead left; present only when the move changed pipeline.","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"toPipeline":{"description":"The pipeline the lead entered; present only when the move changed pipeline.","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["kind","id","at","author","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"field"},"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},{"type":"null"}],"description":"Who did it: the person, and for an agent the connected app or API key it came through; null for the workspace's automation."},"field":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","description":"The field's label now; for a deleted field, its label when the change was made. A built-in field's label is English."},"builtIn":{"type":"boolean","description":"true for a built-in column (name, email, value, owner, ...), false for a workspace field."},"beforeText":{"type":["string","null"]},"afterText":{"description":"The value as printed when it was written; a related record's name only when you may see it.","type":["string","null"]}},"required":["key","label","builtIn","beforeText","afterText"],"additionalProperties":false}},"required":["kind","id","at","author","field"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"entry"},"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},{"type":"null"}],"description":"Who did it: the person, and for an agent the connected app or API key it came through; null for the workspace's automation."},"entry":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","key","name","color"],"additionalProperties":false},"title":{"type":"string"},"body":{"type":["string","null"]},"link":{"type":["string","null"]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The entry type's field values, keyed by field key."},"author":{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","leadId","type","title","body","link","occurredAt","fields","author","createdAt","updatedAt"],"additionalProperties":false}},"required":["kind","id","at","author","entry"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"task_done"},"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},{"type":"null"}],"description":"Who did it: the person, and for an agent the connected app or API key it came through; null for the workspace's automation."},"task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"required":["kind","id","at","author","task"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"quote"},"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},{"type":"null"}],"description":"Who did it: the person, and for an agent the connected app or API key it came through; null for the workspace's automation."},"quote":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"currency":{"type":"string"},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number","currency","totalCents"],"additionalProperties":false}},"required":["kind","id","at","author","quote"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"conversion"},"id":{"type":"string"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"author":{"anyOf":[{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},{"type":"null"}],"description":"Who did it: the person, and for an agent the connected app or API key it came through; null for the workspace's automation."},"conversion":{"type":"object","properties":{"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The client the lead became; null when you may not see its name."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The project the conversion created; null when there is none or you may not see its name."}},"required":["client","project"],"additionalProperties":false}},"required":["kind","id","at","author","conversion"],"additionalProperties":false}],"type":"object"}},"nextCursor":{"description":"Pass as `cursor` for the next page; null on the last page.","type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/{id}/convert":{"post":{"operationId":"post_workspaces_slug_leads_id_convert","summary":"Convert a lead","description":"Wins a lead and turns it into a client, in one transaction. Every choice is explicit: `client` is `{ mode: \"new\", name, type, contact: { name, email?, phone? } }` or `{ mode: \"existing\", clientId, contact | null }` (a client of this workspace that is not archived: a missing one is 404, an archived one 422 at `client.clientId`), `project` is `{ name }` or null, `contract` is `{ source: { templateId } | { starter, locale }, name }` or null (a draft contract in the new project, filled with the client and project; it needs a project, else 422 at `contract`; a template that is not a contract one is 409 `contract_template_not_contract`), and `recurringInvoice` is `{ quoteId, lineIds, firstRunFieldKey, noticeMonths }` or null (a yearly recurring draft invoice for the client and project, of the ticked lines of one of the lead's quotes, first issued on the lead date field's value: a datetime gives its calendar day in the workspace zone; a quote of another lead or a line of another quote is 422 at `recurringInvoice.lineIds`, an unknown or empty date field 422 at `recurringInvoice.firstRunFieldKey`); all four keys are required. Lead field values are copied by key onto the client and the project; a value the target refuses is listed in `skipped` with its reason, and an existing client's own value is never overwritten. With a project, the lead's open tasks and its quotes without a project move to it; a quote with no client takes the client. Each part needs its own write scope (`clients`; `projects` for a project; `tasks` when open tasks move; `quotes` when quotes change; `contracts` and `documents` for a contract; `invoices` and `quotes:read` for a recurring invoice), else 403. A refusal at any part leaves nothing written. 409 `lead_lost` for a lost lead, 409 `lead_already_converted` for a second conversion, 403 `plan_limit_reached` when a new client would pass the plan's client limit (the lead stays as it was). Publishes the webhook event `lead.converted`.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"client":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"new"},"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["company","individual"]},"contact":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]}},"required":["mode","name","type","contact"],"description":"A new client, with its primary contact."},{"type":"object","properties":{"mode":{"type":"string","const":"existing"},"clientId":{"type":"string","minLength":1,"maxLength":128},"contact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]},{"type":"null"}],"description":"A contact to add to the client, or null for none."}},"required":["mode","clientId","contact"],"description":"A client the workspace already has (not archived)."}],"description":"Who the lead becomes: { mode: \"new\", ... } or { mode: \"existing\", clientId, contact }.","type":"object"},"project":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]},{"type":"null"}],"description":"A project to create for the client, or null for none."},"contract":{"anyOf":[{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}],"description":"A workspace contract template { templateId } or a contract starter { starter, locale }."},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["source","name"],"additionalProperties":false},{"type":"null"}],"description":"A contract draft to create in the new project from a contract template or starter, or null for none. Needs a project."},"recurringInvoice":{"anyOf":[{"type":"object","properties":{"quoteId":{"type":"string","minLength":1,"maxLength":128,"description":"One of the lead's quotes, whose lines the invoice copies."},"lineIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"description":"The quote's lines to copy (at least one)."},"firstRunFieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$","description":"The key of the lead date, datetime or calculated date field whose value is the first issue date."},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}],"description":"Months before each renewal to send the notice reminder (1 to 11: the draft is yearly), or null for none."}},"required":["quoteId","lineIds","firstRunFieldKey","noticeMonths"],"additionalProperties":false},{"type":"null"}],"description":"A yearly recurring draft invoice for the client and project, or null for none."}},"required":["client","project","contract","recurringInvoice"]}}}},"responses":{"200":{"description":"Convert a lead","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"clientCreated":{"type":"boolean"},"contactId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"copied":{"type":"object","properties":{"client":{"type":"array","items":{"type":"string"}},"project":{"type":"array","items":{"type":"string"}}},"required":["client","project"],"additionalProperties":false,"description":"The field keys written on the client and on the project."},"skipped":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string","enum":["client","project"]},"key":{"type":"string"},"reason":{"type":"string","enum":["no_field","type_mismatch","target_has_value","unknown_option","unique_taken","invalid"]}},"required":["target","key","reason"],"additionalProperties":false},"description":"Every lead field holding a value that was not copied, with the reason."},"movedTaskIds":{"type":"array","items":{"type":"string"},"description":"The open lead tasks that moved to the project."},"movedQuoteIds":{"type":"array","items":{"type":"string"},"description":"The linked quotes that took the client or the project."},"contractDocumentId":{"description":"The contract draft's document in the new project, or null.","type":["string","null"]},"recurringInvoiceId":{"description":"The yearly recurring draft invoice, or null.","type":["string","null"]}},"required":["clientId","clientCreated","contactId","projectId","copied","skipped","movedTaskIds","movedQuoteIds","contractDocumentId","recurringInvoiceId"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/{id}/conversion-preview":{"get":{"operationId":"get_workspaces_slug_leads_id_conversion-preview","summary":"Preview a lead's conversion","description":"What `POST …/convert` would do, writing nothing: the clients that already match the lead, the fields that would be copied or skipped, the pipeline's conversion defaults, the lead's quotes with their lines and its date fields. Needs `leads:read`; suggestions, `copy.client`, `copy.project` and quotes follow `clients:read`, `projects:read` and `quotes:read` (null or empty without them). A lead of another workspace is 404.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"client_id","schema":{"description":"Preview converting onto this existing client (needs `clients:read`; 404 when missing, 422 when archived): its own values are kept and named in `copy.client.skipped` as `target_has_value`. Omitted, the client is a new one.","type":"string","minLength":1,"maxLength":200},"description":"Preview converting onto this existing client (needs `clients:read`; 404 when missing, 422 when archived): its own values are kept and named in `copy.client.skipped` as `target_has_value`. Omitted, the client is a new one."}],"responses":{"200":{"description":"Preview a lead's conversion","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string"},"name":{"type":"string"},"matchedBy":{"type":"string","enum":["unique_field","name"]},"fieldKey":{"type":"string"},"fieldLabel":{"description":"The label of the shared unique field.","type":"string"}},"required":["clientId","name","matchedBy"],"additionalProperties":false},"description":"Active clients that already match the lead, at most 5: by a unique field both hold, then by name. Empty without `clients:read`."},"copy":{"type":"object","properties":{"client":{"anyOf":[{"type":"object","properties":{"copied":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false},"description":"The lead fields that would be written, by key and label."},"skipped":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"reason":{"type":"string","enum":["no_field","type_mismatch","target_has_value","unknown_option","unique_taken","invalid"]}},"required":["key","label","reason"],"additionalProperties":false}}},"required":["copied","skipped"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"copied":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false},"description":"The lead fields that would be written, by key and label."},"skipped":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"reason":{"type":"string","enum":["no_field","type_mismatch","target_has_value","unknown_option","unique_taken","invalid"]}},"required":["key","label","reason"],"additionalProperties":false}}},"required":["copied","skipped"],"additionalProperties":false},{"type":"null"}]}},"required":["client","project"],"additionalProperties":false,"description":"What `convert` would copy by field key. `client` needs `clients:read` and `project` needs `projects:read`, else null: a refusal such as `unique_taken` would show that a record holds a value."},"defaults":{"type":"object","properties":{"createProject":{"type":"boolean"},"contract":{"type":"object","properties":{"enabled":{"type":"boolean"},"source":{"anyOf":[{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}]},{"type":"null"}]}},"required":["enabled","source"],"additionalProperties":false},"recurringInvoice":{"type":"object","properties":{"enabled":{"type":"boolean"},"firstRunFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}]}},"required":["enabled","firstRunFieldKey","noticeMonths"],"additionalProperties":false}},"required":["createProject","contract","recurringInvoice"],"additionalProperties":false,"description":"The pipeline's conversion defaults; a contract template that no longer exists reads as `source: null`."},"quotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"currency":{"type":"string"},"usable":{"type":"boolean","description":"Whether `convert` takes this quote for `recurringInvoice`: live (draft, pending or approved; not declined or expired) and in the workspace currency. Any other is refused there with 422 at `recurringInvoice.quoteId`."},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","totalCents"],"additionalProperties":false}}},"required":["id","number","currency","usable","lines"],"additionalProperties":false},"description":"The lead's quotes with their lines, newest first, cancelled ones left out. Empty without `quotes:read`."},"dateFields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value":{"type":["string","null"]}},"required":["key","label","value"],"additionalProperties":false},"description":"The lead's date, datetime and calculated date fields with its current value; the first-run date of a recurring invoice is one of them."}},"required":["suggestions","copy","defaults","quotes","dateFields"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/upsert":{"post":{"operationId":"post_workspaces_slug_leads_upsert","summary":"Create or update a lead by a unique field","description":"Finds the lead holding `match.value` in the unique field `match.field` and updates it from `lead`, or creates one. Overlapping requests for one value make one lead; the others return `created: false`. With `onMatch: fill_empty` a match only fills what is empty and `filled` names the keys. A field that is not unique is 409 `field_not_unique`; the other refusals are those of create and update.","tags":["Leads"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"match":{"type":"object","properties":{"field":{"type":"string","minLength":1,"description":"The key of a unique field."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}],"description":"The value to look up in that field."}},"required":["field","value"]},"lead":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string"},"phone":{"type":"string"},"company":{"type":"string"},"valueCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"probability":{"type":"integer","minimum":0,"maximum":100},"notes":{"type":"string"},"ownerId":{"description":"The owning staff member's user id (see list_team_members); another workspace's user or a portal client is 422 at `ownerId`. Default on create: the calling person, else the workspace owner.","type":"string","minLength":1},"nextFollowUpAt":{"type":"string","format":"date-time"},"pipelineId":{"type":"string"},"statusId":{"type":"string","minLength":1},"statusKey":{"description":"A status of the lead's pipeline by its key (see list_statuses); an unknown key is 404. With statusId too, both must name the same status (422 at statusKey).","type":"string","minLength":1},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["name"],"description":"Creates the lead with these values (the match value is stored in the match field), or updates the matched one."},"onMatch":{"description":"What a match does (default `update`: every value in `lead` is written). `fill_empty` writes only the values the lead holds empty and ignores `statusId`, `statusKey`, `pipelineId` and `ownerId`, so the lead keeps its status and owner and every filled value.","type":"string","enum":["update","fill_empty"]}},"required":["match","lead"]}}}},"responses":{"200":{"description":"Create or update a lead by a unique field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"lead":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"company":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"status":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["open","won","lost","not_pursued"]}},"required":["id","key","name","class"],"additionalProperties":false},"value":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The lead's own probability; null means it reads its status's default."},"effectiveProbability":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The probability the lead counts at: its own, else its status's default; null when neither is set."},"stalled":{"type":"boolean","description":"True when the lead is open, its status names a `stalledAfterDays`, and nothing has been added to its timeline for that many days (elapsed 24-hour days)."},"lastActivityAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest timeline item (log entry, field change, status change, checklist task change or quote) was logged; the lead's creation when it has none."},"notes":{"type":["string","null"]},"ownerId":{"description":"The staff member who owns the lead; null only for a lead whose owner's account was erased.","type":["string","null"]},"nextFollowUpAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"wonAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lostReason":{"type":["string","null"]},"convertedClientId":{"type":["string","null"]},"convertedProjectId":{"type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]}},"figures":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"`value`, `quote` or `field:<key>`, in the pipeline's order."},"amountCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Minor units; null when the lead holds none, or when hidden."},"currency":{"type":["string","null"]},"hidden":{"type":"boolean","description":"True for the Quote figure (the lead's latest live quote) when the caller cannot read quotes."},"quoteId":{"description":"The quote the Quote figure reads: the lead's latest live one (not declined, expired or cancelled; a draft counts). Null when hidden or when there is none.","type":["string","null"]}},"required":["key","amountCents","currency","hidden","quoteId"],"additionalProperties":false},"description":"The pipeline's value figures for this lead, in order; an archived money field's is left out."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","company","email","phone","pipeline","status","value","probability","effectiveProbability","stalled","lastActivityAt","notes","ownerId","nextFollowUpAt","wonAt","lostAt","lostReason","convertedClientId","convertedProjectId","fields","figures","createdAt","updatedAt"],"additionalProperties":false},"created":{"type":"boolean"},"filled":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"With `fill_empty` on a match: the keys written, in the order given (built-in columns, then fields); null otherwise."}},"required":["lead","created","filled"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields":{"get":{"operationId":"get_workspaces_slug_fields","summary":"List fields","description":"The workspace's field definitions for a record type (`lead`, `client`, `contact`, `project`, `task` or `lead_entry`), in display order, with their options (not paginated). Archived ones only with `include_archived=true`. Reading needs the read scope of the record type's section: `leads:read` for `lead`, `clients:read` for `client` and `contact`, `projects:read` for `project`, `tasks:read` for `task`, `leads:read` for `lead_entry`; any other is 403 `insufficient_scope`.","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":[]}],"x-rokn-scope":"any","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"record_type","schema":{"type":"string","enum":["lead","client","contact","project","task","lead_entry"],"description":"The record type whose fields to list."},"required":true,"description":"The record type whose fields to list."},{"in":"query","name":"pipeline_id","schema":{"description":"Only the fields placed on this pipeline.","type":"string"},"description":"Only the fields placed on this pipeline."},{"in":"query","name":"project_id","schema":{"description":"Only the task fields placed on this project (every field placed on all projects, and those listing it).","type":"string"},"description":"Only the task fields placed on this project (every field placed on all projects, and those listing it)."},{"in":"query","name":"entry_type_id","schema":{"description":"Only the lead entry fields placed on this entry type (every field placed on all types, and those listing it).","type":"string"},"description":"Only the lead entry fields placed on this entry type (every field placed on all types, and those listing it)."},{"in":"query","name":"include_archived","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List fields","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_fields","summary":"Create a field","description":"Creates a field; its `key` is derived from the label and never changes. Only select types take `options`; only text, url, email, phone and number can be `unique`. A `lead_entry` field (placed in entry types with `placement: { entryTypeIds }`) is never unique and has no reminders: either is 422 `validation_failed` at `unique` / `reminders`. A lead or lead entry field on a plan without the pipeline is 403 `feature_locked`; client, contact, project and task fields have no plan gate. A refused value names its reason: `field_unique_conflict` (409), `unknown_field_option`, `invalid_field_value` (422).","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"recordType":{"type":"string","enum":["lead","client","contact","project","task","lead_entry"]},"label":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["text","long_text","number","percent","money","date","datetime","checkbox","single_select","multi_select","url","email","phone","member","relation","calculated_date"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"offsets":{"maxItems":5,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value, each 0..525600 (0 = at the time), at most 5, all different. On a date or a date-resulting calculated date, whole days only: multiples of 1440."},"notifyField":{"description":"The KEY of an active member field of the record type whose person is reminded; omitted: owners and admins. A PATCH that sends reminders replaces the whole object, so repeat notifyField to keep it.","type":"string"}},"required":["offsets"],"additionalProperties":false}]}},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean","const":true}},"required":["all"],"additionalProperties":false},{"type":"object","properties":{"pipelineIds":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","minLength":1}}},"required":["pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"projectIds":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","minLength":1}}},"required":["projectIds"],"additionalProperties":false},{"type":"object","properties":{"entryTypeIds":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","minLength":1}}},"required":["entryTypeIds"],"additionalProperties":false}]},"options":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["label"]}}},"required":["recordType","label","type"]}}}},"responses":{"201":{"description":"Create a field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields/{id}":{"patch":{"operationId":"patch_workspaces_slug_fields_id","summary":"Update a field","description":"Partial update: label, description, flags, config, placement. Reminders in config replace the stored reminders whole: send notifyField again to keep it. A system field refuses config, placement and unique edits (409 `field_system`). Turning on `unique` while records share a value is 409 `field_unique_conflict`. A refused value names its reason: `field_unique_conflict` (409), `unknown_field_option`, `invalid_field_value` (422).","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"offsets":{"maxItems":5,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value, each 0..525600 (0 = at the time), at most 5, all different. On a date or a date-resulting calculated date, whole days only: multiples of 1440."},"notifyField":{"description":"The KEY of an active member field of the record type whose person is reminded; omitted: owners and admins. A PATCH that sends reminders replaces the whole object, so repeat notifyField to keep it.","type":"string"}},"required":["offsets"],"additionalProperties":false}]}},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean","const":true}},"required":["all"],"additionalProperties":false},{"type":"object","properties":{"pipelineIds":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","minLength":1}}},"required":["pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"projectIds":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","minLength":1}}},"required":["projectIds"],"additionalProperties":false},{"type":"object","properties":{"entryTypeIds":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","minLength":1}}},"required":["entryTypeIds"],"additionalProperties":false}]}}}}}},"responses":{"200":{"description":"Update a field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_fields_id","summary":"Delete a field","description":"Permanently deletes an ARCHIVED field and every value it holds (409 `field_not_archived` otherwise; system fields refuse with 409 `field_system`).","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields/{id}/convert":{"post":{"operationId":"post_workspaces_slug_fields_id_convert","summary":"Convert a field's type","description":"Converts every stored value to `toType`. The whole conversion is refused when any value does not fit the target type (409), and nothing changes.","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"toType":{"type":"string","enum":["text","long_text","number","percent","money","date","datetime","checkbox","single_select","multi_select","url","email","phone","member","relation","calculated_date"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"offsets":{"maxItems":5,"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value, each 0..525600 (0 = at the time), at most 5, all different. On a date or a date-resulting calculated date, whole days only: multiples of 1440."},"notifyField":{"description":"The KEY of an active member field of the record type whose person is reminded; omitted: owners and admins. A PATCH that sends reminders replaces the whole object, so repeat notifyField to keep it.","type":"string"}},"required":["offsets"],"additionalProperties":false}]}}},"required":["toType"]}}}},"responses":{"200":{"description":"Convert a field's type","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields/{id}/archive":{"post":{"operationId":"post_workspaces_slug_fields_id_archive","summary":"Archive a field","description":"Hides the field from records and forms; its values are kept and come back on restore.","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Archive a field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields/{id}/restore":{"post":{"operationId":"post_workspaces_slug_fields_id_restore","summary":"Restore a field","description":"Brings an archived field back with the values it held.","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Restore a field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The slug a record's `fields` object is keyed by. Immutable."},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"offsets":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Minutes before the value; a multiple of 1440 counts calendar days."},"notifyField":{"description":"The key of the member field whose person is reminded; absent: owners and admins.","type":"string"}},"required":["offsets"],"additionalProperties":false}]},"description":"The type's settings (`type`, currency, decimals, default option, ...): scalars, and `reminders` ({ offsets, notifyField }) on a date, datetime or calculated date. A calculated date's `baseField` is a field key and its `resultType` (`date` | `datetime`) is output only."},"required":{"type":"boolean"},"unique":{"type":"boolean"},"personalData":{"type":"boolean"},"clientVisible":{"type":"boolean"},"showOnCard":{"type":"boolean"},"placement":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean"},"pipelineIds":{"type":"array","items":{"type":"string"}}},"required":["all","pipelineIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"projectIds":{"type":"array","items":{"type":"string"}}},"required":["all","projectIds"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean"},"entryTypeIds":{"type":"array","items":{"type":"string"}}},"required":["all","entryTypeIds"],"additionalProperties":false}],"description":"`all`: the field is on every pipeline (a lead field), every project (a task field) or every entry type (a lead entry field); otherwise the listed `pipelineIds` (lead fields), `projectIds` (task fields) or `entryTypeIds` (lead entry fields). Client, contact and project fields are always `{ all: true, pipelineIds: [] }`."},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"system":{"type":"boolean"},"archived":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}},"required":["id","key","label","description","type","config","required","unique","personalData","clientVisible","showOnCard","placement","position","system","archived","options"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields/{id}/options":{"post":{"operationId":"post_workspaces_slug_fields_id_options","summary":"Add an option to a select field","description":"Adds a choice, or returns the existing one with the same label. A caller with `customization:write` may add to any field; any other may add only to a field that allows inline options and only with the write scope of the field's record type's section (`leads:write` for a lead field, `clients:write` for a client or contact field, `projects:write` for a project field, `tasks:write` for a task field), else 403.","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":[]}],"x-rokn-scope":"any","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["label"]}}}},"responses":{"201":{"description":"Add an option to a select field","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields/{id}/options/merge":{"post":{"operationId":"post_workspaces_slug_fields_id_options_merge","summary":"Merge two options","description":"Moves every record from `sourceId` to `targetId` and deletes the source option. `moved` is the number of records changed. A system field's options (the task `priority` four) are never merged away: 409 `field_system`.","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sourceId":{"type":"string","minLength":1},"targetId":{"type":"string","minLength":1}},"required":["sourceId","targetId"]}}}},"responses":{"200":{"description":"Merge two options","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"moved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["moved"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/fields/{id}/options/{optionId}":{"patch":{"operationId":"patch_workspaces_slug_fields_id_options_optionId","summary":"Rename or recolor an option","description":"The option's `key` never changes, so stored values and filters keep working.","tags":["Fields"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"optionId","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Rename or recolor an option","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","key","label","color","position","archived"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/statuses":{"get":{"operationId":"get_workspaces_slug_statuses","summary":"List statuses","description":"A lead pipeline's statuses (`record_type=lead&pipeline_id=…`), the workspace's project statuses (`record_type=project`), or the task statuses a project's tasks take (`record_type=task&project_id=…`: the project's own list when it has one, else the workspace's default task list, which `record_type=task` alone lists), in flow order (not paginated). Reading needs `leads:read`, `projects:read` or `tasks:read`; any other is 403 `insufficient_scope`. A pipeline or project of another workspace is 404.","tags":["Statuses"],"security":[{"apiKey":[]},{"oauth2":[]}],"x-rokn-scope":"any","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"record_type","schema":{"type":"string","enum":["lead","project","task"]},"required":true},{"in":"query","name":"pipeline_id","schema":{"description":"The pipeline of a lead list; required for `lead`, ignored otherwise.","type":"string","minLength":1},"description":"The pipeline of a lead list; required for `lead`, ignored otherwise."},{"in":"query","name":"project_id","schema":{"description":"For `task`: the project whose tasks' statuses to list (its own list, or the default list it uses). Omitted: the workspace's default task list.","type":"string","minLength":1},"description":"For `task`: the project whose tasks' statuses to list (its own list, or the default list it uses). Omitted: the workspace's default task list."}],"responses":{"200":{"description":"List statuses","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Immutable, unique within the status's list; a lead can be given a status by it (statusKey)."},"pipelineId":{"type":["string","null"]},"projectId":{"description":"A task status in a project's own list: that project. Null for the default task list and every lead or project status.","type":["string","null"]},"name":{"type":"string"},"color":{"type":["string","null"]},"class":{"type":"string","enum":["open","won","lost","not_pursued","draft","active","paused","done","cancelled","todo","in_progress"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isInitial":{"type":"boolean"},"requiredFields":{"type":"array","items":{"type":"string"},"description":"Field keys a record must hold to enter this status (`stage_requirements_unmet`)."},"requiresChecklist":{"description":"A lead status: a move into it is refused (`checklist_incomplete`, 422) while the lead has an open required checklist task. Absent on other statuses.","type":"boolean"},"defaultProbability":{"description":"A lead status: the probability (0-100) a lead reads while it holds none of its own; null for none. Absent on other statuses.","anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"stalledAfterDays":{"description":"A lead status: its open leads are stalled once nothing has happened on them for this many days (1-365); null for never. Absent on other statuses.","anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"tasks":{"description":"A lead status's checklist: a lead entering the status gets these tasks once. Absent on other statuses.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"required":{"type":"boolean"},"dueFieldKey":{"description":"The lead date, datetime or calculated date field the task's due date follows; null for none.","type":["string","null"]},"dueOffsetDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Signed calendar days from that field's value (negative = before)."}},"required":["id","title","description","required","dueFieldKey","dueOffsetDays"],"additionalProperties":false}}},"required":["id","key","pipelineId","projectId","name","color","class","position","isInitial","requiredFields"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_statuses","summary":"Create a status","description":"Adds a status: `recordType: lead` to a pipeline (open, won, lost or not_pursued), `recordType: project` to the workspace's project list (draft, active, paused, done or cancelled), or `recordType: task` (todo, in_progress or done) to the workspace's default task list or, with `projectId`, to that project's own list; a project still on the default list is 409 `task_list_not_own` (its own list is made on the screen). `key` (optional) names the status's immutable key, else it is derived from the name; a key already used in the list is 409 `key_taken`. 409 `status_limit_reached` at 30 statuses.","tags":["Statuses"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"recordType":{"type":"string","const":"lead"},"pipelineId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":60},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"statusClass":{"type":"string","enum":["open","won","lost","not_pursued"]},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["recordType","pipelineId","name","statusClass"]},{"type":"object","properties":{"recordType":{"type":"string","const":"project"},"name":{"type":"string","minLength":1,"maxLength":60},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"statusClass":{"type":"string","enum":["draft","active","paused","done","cancelled"]},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["recordType","name","statusClass"]},{"type":"object","properties":{"recordType":{"type":"string","const":"task"},"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":60},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"statusClass":{"type":"string","enum":["todo","in_progress","done"]},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["recordType","name","statusClass"]}],"type":"object"}}}},"responses":{"201":{"description":"Create a status","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Immutable, unique within the status's list; a lead can be given a status by it (statusKey)."},"pipelineId":{"type":["string","null"]},"projectId":{"description":"A task status in a project's own list: that project. Null for the default task list and every lead or project status.","type":["string","null"]},"name":{"type":"string"},"color":{"type":["string","null"]},"class":{"type":"string","enum":["open","won","lost","not_pursued","draft","active","paused","done","cancelled","todo","in_progress"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isInitial":{"type":"boolean"},"requiredFields":{"type":"array","items":{"type":"string"},"description":"Field keys a record must hold to enter this status (`stage_requirements_unmet`)."},"requiresChecklist":{"description":"A lead status: a move into it is refused (`checklist_incomplete`, 422) while the lead has an open required checklist task. Absent on other statuses.","type":"boolean"},"defaultProbability":{"description":"A lead status: the probability (0-100) a lead reads while it holds none of its own; null for none. Absent on other statuses.","anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"stalledAfterDays":{"description":"A lead status: its open leads are stalled once nothing has happened on them for this many days (1-365); null for never. Absent on other statuses.","anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"tasks":{"description":"A lead status's checklist: a lead entering the status gets these tasks once. Absent on other statuses.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"required":{"type":"boolean"},"dueFieldKey":{"description":"The lead date, datetime or calculated date field the task's due date follows; null for none.","type":["string","null"]},"dueOffsetDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Signed calendar days from that field's value (negative = before)."}},"required":["id","title","description","required","dueFieldKey","dueOffsetDays"],"additionalProperties":false}}},"required":["id","key","pipelineId","projectId","name","color","class","position","isInitial","requiredFields"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/statuses/{id}":{"patch":{"operationId":"patch_workspaces_slug_statuses_id","summary":"Update a status","description":"Partial update: name, a `key` (only the status's own: a different key is 422 at `key`), class, color, `isInitial` (only ever set to true; the flag leaves the previous initial status) and `requiredFields` (field keys; an unknown key is 404). A lead status also takes `tasks` (its checklist, replacing the stored list; each `dueFieldKey` must be an active lead date, datetime or calculated date field available in the pipeline, else 422 `invalid_due_anchor` at `tasks.<i>.dueFieldKey`), `requiresChecklist`, `defaultProbability` (0-100 or null, the probability its leads read until they hold their own) and `stalledAfterDays` (1-365 or null: its open leads read as stalled once nothing has happened on them for that many days; changing it needs `customization:write`, 0 is 422); any of them on a project or task status is 422. Changing the class of a status that holds records is refused (409 `status_class_in_use`), and so is the last status of a required class (409 `last_status_of_class`); a class of another record type is 422 at `statusClass`.","tags":["Statuses"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"statusClass":{"type":"string","enum":["open","won","lost","not_pursued","draft","active","paused","done","cancelled","todo","in_progress"]},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"isInitial":{"type":"boolean","const":true},"tasks":{"description":"A lead status's checklist, replacing the stored list: each lead entering the status gets these tasks once.","maxItems":50,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"required":{"type":"boolean"},"dueFieldKey":{"description":"A lead date, datetime or calculated date field key the due date follows.","type":"string","minLength":1,"maxLength":63},"dueOffsetDays":{"description":"Signed calendar days from the field's value (negative = before).","type":"integer","minimum":-3650,"maximum":3650}},"required":["title"],"additionalProperties":false}},"requiresChecklist":{"description":"A lead status: a move into it is refused (checklist_incomplete) while the lead has an open required checklist task.","type":"boolean"},"defaultProbability":{"description":"A lead status: the probability (0-100) its leads read until they hold their own; null for none.","anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"stalledAfterDays":{"description":"A lead status: its open leads are stalled once nothing has happened on them for this many days (1-365); null for never.","anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"requiredFields":{"description":"Field keys a record must hold to enter this status.","maxItems":150,"type":"array","items":{"type":"string","minLength":1}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Update a status","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Immutable, unique within the status's list; a lead can be given a status by it (statusKey)."},"pipelineId":{"type":["string","null"]},"projectId":{"description":"A task status in a project's own list: that project. Null for the default task list and every lead or project status.","type":["string","null"]},"name":{"type":"string"},"color":{"type":["string","null"]},"class":{"type":"string","enum":["open","won","lost","not_pursued","draft","active","paused","done","cancelled","todo","in_progress"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isInitial":{"type":"boolean"},"requiredFields":{"type":"array","items":{"type":"string"},"description":"Field keys a record must hold to enter this status (`stage_requirements_unmet`)."},"requiresChecklist":{"description":"A lead status: a move into it is refused (`checklist_incomplete`, 422) while the lead has an open required checklist task. Absent on other statuses.","type":"boolean"},"defaultProbability":{"description":"A lead status: the probability (0-100) a lead reads while it holds none of its own; null for none. Absent on other statuses.","anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"stalledAfterDays":{"description":"A lead status: its open leads are stalled once nothing has happened on them for this many days (1-365); null for never. Absent on other statuses.","anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"tasks":{"description":"A lead status's checklist: a lead entering the status gets these tasks once. Absent on other statuses.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"required":{"type":"boolean"},"dueFieldKey":{"description":"The lead date, datetime or calculated date field the task's due date follows; null for none.","type":["string","null"]},"dueOffsetDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Signed calendar days from that field's value (negative = before)."}},"required":["id","title","description","required","dueFieldKey","dueOffsetDays"],"additionalProperties":false}}},"required":["id","key","pipelineId","projectId","name","color","class","position","isInitial","requiredFields"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_statuses_id","summary":"Delete a status","description":"Deletes the status; its leads, projects or tasks move to `move_to` in the same transaction (a project or task entering or leaving a done status gains or loses its `completedAt`). A target of another list or workspace is 404; the target being the status itself is 409 `same_status`. A status holding converted leads (a lead that already has its client) can only move them to a won status: any other target is 409 `lead_already_converted`. Leaving a lost status clears the lead's lost reason.","tags":["Statuses"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"move_to","schema":{"type":"string","minLength":1,"description":"The status of the same list that takes the deleted status's records."},"required":true,"description":"The status of the same list that takes the deleted status's records."}],"responses":{"204":{"description":"Delete a status","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/pipelines":{"get":{"operationId":"get_workspaces_slug_pipelines","summary":"List pipelines","description":"The workspace's lead pipelines in display order (not paginated). Archived ones only with `include_archived=true`; a workspace with none answers an empty list.","tags":["Pipelines"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"include_archived","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List pipelines","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"},"templateKey":{"description":"The starter template that made the pipeline (for example `sales` or `public_tenders_fr`); null for a blank or hand-made one.","type":["string","null"]},"valueFigures":{"type":"array","items":{"type":"string"},"description":"The value figures its leads show, in order: `value`, `quote` and `field:<key>` of a money field (an archived one stays listed and is not shown)."},"conversionDefaults":{"type":"object","properties":{"createProject":{"type":"boolean"},"contract":{"type":"object","properties":{"enabled":{"type":"boolean"},"source":{"anyOf":[{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}]},{"type":"null"}]}},"required":["enabled","source"],"additionalProperties":false},"recurringInvoice":{"type":"object","properties":{"enabled":{"type":"boolean"},"firstRunFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}]}},"required":["enabled","firstRunFieldKey","noticeMonths"],"additionalProperties":false}},"required":["createProject","contract","recurringInvoice"],"additionalProperties":false,"description":"What the conversion dialog pre-fills for a lead of this pipeline; every conversion still names its own choices."}},"required":["id","name","position","archived","templateKey","valueFigures","conversionDefaults"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_pipelines","summary":"Create a pipeline","description":"Creates a pipeline from a template (`blank`: four statuses; `sales`: the Sales flow with its fields; `public_tenders_fr`: French public tenders, with its fields, bid checklist and log entry types), with status names in the workspace's language. 409 `pipeline_limit_reached` at 30 active pipelines; a plan without the pipeline is 403 `feature_locked`.","tags":["Pipelines"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"template":{"default":"blank","type":"string","enum":["blank","sales","public_tenders_fr"]}},"required":["name"]}}}},"responses":{"201":{"description":"Create a pipeline","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"},"templateKey":{"description":"The starter template that made the pipeline (for example `sales` or `public_tenders_fr`); null for a blank or hand-made one.","type":["string","null"]},"valueFigures":{"type":"array","items":{"type":"string"},"description":"The value figures its leads show, in order: `value`, `quote` and `field:<key>` of a money field (an archived one stays listed and is not shown)."},"conversionDefaults":{"type":"object","properties":{"createProject":{"type":"boolean"},"contract":{"type":"object","properties":{"enabled":{"type":"boolean"},"source":{"anyOf":[{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}]},{"type":"null"}]}},"required":["enabled","source"],"additionalProperties":false},"recurringInvoice":{"type":"object","properties":{"enabled":{"type":"boolean"},"firstRunFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}]}},"required":["enabled","firstRunFieldKey","noticeMonths"],"additionalProperties":false}},"required":["createProject","contract","recurringInvoice"],"additionalProperties":false,"description":"What the conversion dialog pre-fills for a lead of this pipeline; every conversion still names its own choices."},"skippedEntryTypes":{"type":"array","items":{"type":"string"},"description":"Keys of the template's entry types left out because the workspace already holds 30 active ones; empty otherwise."}},"required":["id","name","position","archived","templateKey","valueFigures","conversionDefaults","skippedEntryTypes"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/pipelines/{id}":{"patch":{"operationId":"patch_workspaces_slug_pipelines_id","summary":"Update a pipeline","description":"Partial update of one pipeline: its name, `valueFigures` (replaces the list; each key once, 1 to 10, a field only an active money field placed in the pipeline, else 422 `validation_failed` at `valueFigures.<i>`) and `conversionDefaults` (replaces the whole object; `recurringInvoice.firstRunFieldKey` must be an active lead date, datetime or calculated date field placed in the pipeline, and a workspace contract template source an existing contract template, else 422 `validation_failed` at `conversionDefaults.recurringInvoice.firstRunFieldKey` / `conversionDefaults.contract.source`).","tags":["Pipelines"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"valueFigures":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^(value|quote|field:[a-z][a-z0-9_]{0,62})$"},"description":"The pipeline's value figures in order: `value`, `quote` and `field:<key>` of a money field placed in the pipeline; 1 to 10, each once."},"conversionDefaults":{"description":"Replaces the pipeline's conversion defaults.","type":"object","properties":{"createProject":{"type":"boolean"},"contract":{"type":"object","properties":{"enabled":{"type":"boolean"},"source":{"anyOf":[{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}]},{"type":"null"}]}},"required":["enabled","source"],"additionalProperties":false},"recurringInvoice":{"type":"object","properties":{"enabled":{"type":"boolean"},"firstRunFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}]}},"required":["enabled","firstRunFieldKey","noticeMonths"],"additionalProperties":false}},"required":["createProject","contract","recurringInvoice"],"additionalProperties":false}}}}}},"responses":{"200":{"description":"Update a pipeline","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"},"templateKey":{"description":"The starter template that made the pipeline (for example `sales` or `public_tenders_fr`); null for a blank or hand-made one.","type":["string","null"]},"valueFigures":{"type":"array","items":{"type":"string"},"description":"The value figures its leads show, in order: `value`, `quote` and `field:<key>` of a money field (an archived one stays listed and is not shown)."},"conversionDefaults":{"type":"object","properties":{"createProject":{"type":"boolean"},"contract":{"type":"object","properties":{"enabled":{"type":"boolean"},"source":{"anyOf":[{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}]},{"type":"null"}]}},"required":["enabled","source"],"additionalProperties":false},"recurringInvoice":{"type":"object","properties":{"enabled":{"type":"boolean"},"firstRunFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}]}},"required":["enabled","firstRunFieldKey","noticeMonths"],"additionalProperties":false}},"required":["createProject","contract","recurringInvoice"],"additionalProperties":false,"description":"What the conversion dialog pre-fills for a lead of this pipeline; every conversion still names its own choices."}},"required":["id","name","position","archived","templateKey","valueFigures","conversionDefaults"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/pipelines/{id}/archive":{"post":{"operationId":"post_workspaces_slug_pipelines_id_archive","summary":"Archive a pipeline","description":"Hides the pipeline; its leads are kept. A pipeline that still holds open leads is refused (409 `pipeline_has_open_leads`, the message gives the count: move or close them first), and so is the last active one (409 `last_pipeline`).","tags":["Pipelines"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Archive a pipeline","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"},"templateKey":{"description":"The starter template that made the pipeline (for example `sales` or `public_tenders_fr`); null for a blank or hand-made one.","type":["string","null"]},"valueFigures":{"type":"array","items":{"type":"string"},"description":"The value figures its leads show, in order: `value`, `quote` and `field:<key>` of a money field (an archived one stays listed and is not shown)."},"conversionDefaults":{"type":"object","properties":{"createProject":{"type":"boolean"},"contract":{"type":"object","properties":{"enabled":{"type":"boolean"},"source":{"anyOf":[{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}]},{"type":"null"}]}},"required":["enabled","source"],"additionalProperties":false},"recurringInvoice":{"type":"object","properties":{"enabled":{"type":"boolean"},"firstRunFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}]}},"required":["enabled","firstRunFieldKey","noticeMonths"],"additionalProperties":false}},"required":["createProject","contract","recurringInvoice"],"additionalProperties":false,"description":"What the conversion dialog pre-fills for a lead of this pipeline; every conversion still names its own choices."}},"required":["id","name","position","archived","templateKey","valueFigures","conversionDefaults"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/pipelines/{id}/restore":{"post":{"operationId":"post_workspaces_slug_pipelines_id_restore","summary":"Restore a pipeline","description":"Brings an archived pipeline back. 409 `pipeline_limit_reached` at 30 active pipelines.","tags":["Pipelines"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Restore a pipeline","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"},"templateKey":{"description":"The starter template that made the pipeline (for example `sales` or `public_tenders_fr`); null for a blank or hand-made one.","type":["string","null"]},"valueFigures":{"type":"array","items":{"type":"string"},"description":"The value figures its leads show, in order: `value`, `quote` and `field:<key>` of a money field (an archived one stays listed and is not shown)."},"conversionDefaults":{"type":"object","properties":{"createProject":{"type":"boolean"},"contract":{"type":"object","properties":{"enabled":{"type":"boolean"},"source":{"anyOf":[{"anyOf":[{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},{"type":"object","properties":{"starter":{"type":"string","enum":["nda","service_agreement"]},"locale":{"type":"string","enum":["en","zh","es","ar","fr","pt","hi","de"]}},"required":["starter","locale"],"additionalProperties":false}]},{"type":"null"}]}},"required":["enabled","source"],"additionalProperties":false},"recurringInvoice":{"type":"object","properties":{"enabled":{"type":"boolean"},"firstRunFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"noticeMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"null"}]}},"required":["enabled","firstRunFieldKey","noticeMonths"],"additionalProperties":false}},"required":["createProject","contract","recurringInvoice"],"additionalProperties":false,"description":"What the conversion dialog pre-fills for a lead of this pipeline; every conversion still names its own choices."}},"required":["id","name","position","archived","templateKey","valueFigures","conversionDefaults"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/lead-entry-types":{"get":{"operationId":"get_workspaces_slug_lead-entry-types","summary":"List lead entry types","description":"The workspace's kinds of lead log entry (Email, Call, Meeting and Note by default, plus its own) in display order (not paginated). Archived ones only with `include_archived=true`. A type's fields are listed by `GET /fields?record_type=lead_entry&entry_type_id=`.","tags":["Lead entry types"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"include_archived","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"List lead entry types","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The type's immutable key, unique in the workspace: how an entry names its type."},"name":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean","description":"An archived type is offered for no new entry; its entries keep it."}},"required":["id","key","name","color","position","archived"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_lead-entry-types","summary":"Create a lead entry type","description":"Adds a kind of lead log entry. `key` (optional) names its immutable key, else it is derived from the name; a key the workspace already uses is 409 `key_taken`. 409 `entry_type_limit_reached` at 30 active entry types; a plan without the pipeline is 403 `feature_locked`.","tags":["Lead entry types"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"key":{"description":"The entry type key, unique in the workspace and never changed afterwards; omitted, it is derived from the name.","type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"Create a lead entry type","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The type's immutable key, unique in the workspace: how an entry names its type."},"name":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean","description":"An archived type is offered for no new entry; its entries keep it."}},"required":["id","key","name","color","position","archived"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/lead-entry-types/{id}":{"patch":{"operationId":"patch_workspaces_slug_lead-entry-types_id","summary":"Update a lead entry type","description":"Partial update: name, color, position, and `archived` (true archives the type, false restores it). The key never changes: a different `key` is 422 at `key`. Restoring (`archived: false`) is 409 `entry_type_limit_reached` at 30 active entry types.","tags":["Lead entry types"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"key":{"description":"Never changes: when given it must be the type's own key (422 at `key` otherwise).","type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"color":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}]},"position":{"type":"integer","minimum":0,"maximum":10000},"archived":{"description":"true archives the type, false restores it.","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Update a lead entry type","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The type's immutable key, unique in the workspace: how an entry names its type."},"name":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean","description":"An archived type is offered for no new entry; its entries keep it."}},"required":["id","key","name","color","position","archived"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_lead-entry-types_id","summary":"Delete a lead entry type","description":"Deletes an ARCHIVED entry type for good (409 `entry_type_not_archived` otherwise) that no entry uses: while entries of the type exist it is 409 `entry_type_in_use`, the message giving their count.","tags":["Lead entry types"],"security":[{"apiKey":[]},{"oauth2":["customization:write"]}],"x-rokn-scope":"customization:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a lead entry type","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/{id}/entries":{"post":{"operationId":"post_workspaces_slug_leads_id_entries","summary":"Log an entry on a lead","description":"Logs an entry (\"Q&A published\", \"Question to buyer\", \"Call\"...) on the lead. Name its type by `typeKey` or `typeId` (see `GET /lead-entry-types`; an archived or unknown type is 404, neither is 422 at `typeKey`). `fields` are the type's own fields by key (`GET /fields?record_type=lead_entry&entry_type_id=`); a field placed in another type is 422 `field_not_available`. The entry names its author: the calling person, or for a token or key the connected app or key with the person it acts for. Publishes `lead_entry.created`.","tags":["Lead entries"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"typeKey":{"description":"The entry type by its key (see list_lead_entry_types).","type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"typeId":{"description":"The entry type by its id; with typeKey too, both must name the same type.","type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"link":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]},"occurredAt":{"description":"When it happened, an ISO 8601 date-time with its offset; default now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}},"required":["title"]}}}},"responses":{"201":{"description":"Log an entry on a lead","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","key","name","color"],"additionalProperties":false},"title":{"type":"string"},"body":{"type":["string","null"]},"link":{"type":["string","null"]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The entry type's field values, keyed by field key."},"author":{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","leadId","type","title","body","link","occurredAt","fields","author","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/lead-entries/{id}":{"patch":{"operationId":"patch_workspaces_slug_lead-entries_id","summary":"Update a lead entry","description":"Partial update: title, body, link, occurredAt and `fields` by key (`null` clears body, link or a field). The type never changes: a `typeKey` or `typeId` other than the entry's own is 422. The author stays the entry's.","tags":["Lead entries"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"typeKey":{"description":"The entry type by its key (see list_lead_entry_types).","type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"typeId":{"description":"The entry type by its id; with typeKey too, both must name the same type.","type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":300},"body":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"link":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]},"occurredAt":{"description":"When it happened, an ISO 8601 date-time with its offset; default now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"fields":{"description":"Field values by field key. An unknown option label is refused (unknown_field_option).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}]}}]}}}}}}},"responses":{"200":{"description":"Update a lead entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","key","name","color"],"additionalProperties":false},"title":{"type":"string"},"body":{"type":["string","null"]},"link":{"type":["string","null"]},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}]},"description":"The entry type's field values, keyed by field key."},"author":{"type":"object","properties":{"userId":{"description":"The person who wrote the entry, or for whom an agent wrote it; null for an API key or the automation.","type":["string","null"]},"name":{"type":["string","null"]},"via":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["oauth","api_key"]},"name":{"description":"The connected app's or API key's name; null once it is deleted.","type":["string","null"]}},"required":["kind","name"],"additionalProperties":false},{"type":"null"}],"description":"The connected app or API key the entry was written through; null for a person in the app."}},"required":["userId","name","via"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","leadId","type","title","body","link","occurredAt","fields","author","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_lead-entries_id","summary":"Delete a lead entry","description":"Moves the entry to the recycle bin, from where an owner or admin can restore it onto its lead.","tags":["Lead entries"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a lead entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/{id}/tasks":{"get":{"operationId":"get_workspaces_slug_leads_id_tasks","summary":"List a lead's checklist","description":"The lead's checklist tasks, open ones first, then by due date (none last). Not paginated. A lead in another workspace is not found.","tags":["Lead tasks"],"security":[{"apiKey":[]},{"oauth2":["leads:read"]}],"x-rokn-scope":"leads:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List a lead's checklist","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status on the workspace's default task list; class `done` means the item is done."},"required":{"type":"boolean","description":"A checklist item the lead must have done."},"assigneeUserId":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","leadId","title","description","status","required","assigneeUserId","dueDate","completedAt","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_leads_id_tasks","summary":"Add a task to a lead's checklist","description":"Adds a task to the lead's checklist, in the default task list's initial status: `title`, and optionally `description`, `dueDate`, `assigneeId` (a member's user id) and `required` (an item the lead must have done). An assignee who is not a member of the workspace, or a lead in another workspace, is not found.","tags":["Lead tasks"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"required":{"type":"boolean"}},"required":["title"],"additionalProperties":false}}}},"responses":{"201":{"description":"Add a task to a lead's checklist","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status on the workspace's default task list; class `done` means the item is done."},"required":{"type":"boolean","description":"A checklist item the lead must have done."},"assigneeUserId":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","leadId","title","description","status","required","assigneeUserId","dueDate","completedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leads/{id}/tasks/{taskId}":{"patch":{"operationId":"patch_workspaces_slug_leads_id_tasks_taskId","summary":"Update a task on a lead's checklist","description":"Partial update: `title`, `description`, `dueDate`, `assigneeId` (`null` clears the last three) and `required`; `done: true` completes the task and `done: false` reopens it. A task of another lead, or of no lead, is not found.","tags":["Lead tasks"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"taskId","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"required":{"type":"boolean"},"done":{"description":"true marks the task done (its list's first done status, stamped); false reopens it (the list's initial status).","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Update a task on a lead's checklist","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false,"description":"The task's status on the workspace's default task list; class `done` means the item is done."},"required":{"type":"boolean","description":"A checklist item the lead must have done."},"assigneeUserId":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the task entered a status of class `done`; null outside one."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","leadId","title","description","status","required","assigneeUserId","dueDate","completedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_leads_id_tasks_taskId","summary":"Delete a task from a lead's checklist","description":"Moves the task to the recycle bin (section Leads), from where an owner or admin can restore it onto its lead. A task of another lead, or of no lead, is not found.","tags":["Lead tasks"],"security":[{"apiKey":[]},{"oauth2":["leads:write"]}],"x-rokn-scope":"leads:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"taskId","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a task from a lead's checklist","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/retainers":{"get":{"operationId":"get_workspaces_slug_retainers","summary":"List retainers","description":"Retainers, newest first (up to 200), each with its open period and the remaining balance. Filter by `status` (`active` or `inactive`) or `client_id`. Not paginated.","tags":["Retainers"],"security":[{"apiKey":[]},{"oauth2":["invoices:read"]}],"x-rokn-scope":"invoices:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"status","schema":{"description":"Default: both.","type":"string","enum":["active","inactive"]},"description":"Default: both."},{"in":"query","name":"client_id","schema":{"type":"string"}}],"responses":{"200":{"description":"List retainers","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"cadence":{"type":"string","enum":["none","monthly","quarterly"]},"carryover":{"type":"string","enum":["expire","rollover"]},"rolloverCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"startsOn":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsOn":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"isActive":{"type":"boolean"},"currentPeriod":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"allowance":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"rolloverIn":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"consumed":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"unbilled":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"estimateUnavailable":{"type":"boolean"},"depletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"invoiceId":{"type":["string","null"]}},"required":["id","periodStart","periodEnd","allowance","rolloverIn","consumed","unbilled","estimateUnavailable","depletedAt","invoiceId"],"additionalProperties":false},{"type":"null"}]},"remaining":{"anyOf":[{"type":"object","properties":{"definite":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"provisional":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["definite","provisional"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","amount","cadence","carryover","rolloverCap","startsOn","endsOn","isActive","currentPeriod","remaining","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_retainers","summary":"Create a retainer","description":"Sets up a retainer for a client and opens its first period in the same step. `currency` must be the workspace's. `endsOn` is the LAST day the retainer covers, on or after `startsOn` (else 422): a one-off block (`cadence: none`) requires it, and its single period runs through that day; a monthly or quarterly retainer opens no period that would start after it (the period that includes it runs in full). A period's `periodEnd` is exclusive, the day after its last day. `startsOn` and `endsOn` are dates (the time of day is dropped). A client of another workspace is 404; a currency other than the workspace's is 409 `currency_mismatch`.","tags":["Retainers"],"security":[{"apiKey":[]},{"oauth2":["invoices:write"]}],"x-rokn-scope":"invoices:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"amountCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"type":"string"},"cadence":{"type":"string","enum":["none","monthly","quarterly"]},"carryover":{"default":"expire","type":"string","enum":["expire","rollover"]},"rolloverCapCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"startsOn":{"type":"string","format":"date-time"},"endsOn":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["clientId","name","amountCents","currency","cadence","startsOn"]}}}},"responses":{"201":{"description":"Create a retainer","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"cadence":{"type":"string","enum":["none","monthly","quarterly"]},"carryover":{"type":"string","enum":["expire","rollover"]},"rolloverCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"startsOn":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsOn":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"isActive":{"type":"boolean"},"currentPeriod":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"allowance":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"rolloverIn":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"consumed":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"unbilled":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"estimateUnavailable":{"type":"boolean"},"depletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"invoiceId":{"type":["string","null"]}},"required":["id","periodStart","periodEnd","allowance","rolloverIn","consumed","unbilled","estimateUnavailable","depletedAt","invoiceId"],"additionalProperties":false},{"type":"null"}]},"remaining":{"anyOf":[{"type":"object","properties":{"definite":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"provisional":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["definite","provisional"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","amount","cadence","carryover","rolloverCap","startsOn","endsOn","isActive","currentPeriod","remaining","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/retainers/{id}":{"get":{"operationId":"get_workspaces_slug_retainers_id","summary":"Get a retainer","description":"One retainer with its open period and remaining balance. A retainer in another workspace is not found.","tags":["Retainers"],"security":[{"apiKey":[]},{"oauth2":["invoices:read"]}],"x-rokn-scope":"invoices:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a retainer","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"cadence":{"type":"string","enum":["none","monthly","quarterly"]},"carryover":{"type":"string","enum":["expire","rollover"]},"rolloverCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"startsOn":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsOn":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"isActive":{"type":"boolean"},"currentPeriod":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"allowance":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"rolloverIn":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"consumed":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"unbilled":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"estimateUnavailable":{"type":"boolean"},"depletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"invoiceId":{"type":["string","null"]}},"required":["id","periodStart","periodEnd","allowance","rolloverIn","consumed","unbilled","estimateUnavailable","depletedAt","invoiceId"],"additionalProperties":false},{"type":"null"}]},"remaining":{"anyOf":[{"type":"object","properties":{"definite":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"provisional":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["definite","provisional"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","amount","cadence","carryover","rolloverCap","startsOn","endsOn","isActive","currentPeriod","remaining","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_retainers_id","summary":"Update a retainer","description":"Partial update of name, fee, rollover, rollover cap, end date or `isActive`; only the fields present are written, and `null` clears the cap or the end date. A new fee applies from the NEXT period: the open period keeps the allowance it opened with. `endsOn` is the last day covered: before `startsOn` it is 409 `retainer_ends_before_start`; a one-off block cannot clear it (409 `retainer_end_required`), and a new one moves the end of its period while that period is open. The currency cannot change (409 `currency_mismatch`).","tags":["Retainers"],"security":[{"apiKey":[]},{"oauth2":["invoices:write"]}],"x-rokn-scope":"invoices:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"amountCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"type":"string"},"carryover":{"type":"string","enum":["expire","rollover"]},"rolloverCapCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"endsOn":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"isActive":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Update a retainer","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"cadence":{"type":"string","enum":["none","monthly","quarterly"]},"carryover":{"type":"string","enum":["expire","rollover"]},"rolloverCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"startsOn":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsOn":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"isActive":{"type":"boolean"},"currentPeriod":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"allowance":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"rolloverIn":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"consumed":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"unbilled":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"estimateUnavailable":{"type":"boolean"},"depletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"invoiceId":{"type":["string","null"]}},"required":["id","periodStart","periodEnd","allowance","rolloverIn","consumed","unbilled","estimateUnavailable","depletedAt","invoiceId"],"additionalProperties":false},{"type":"null"}]},"remaining":{"anyOf":[{"type":"object","properties":{"definite":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"provisional":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["definite","provisional"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","amount","cadence","carryover","rolloverCap","startsOn","endsOn","isActive","currentPeriod","remaining","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/retainers/{id}/deactivate":{"post":{"operationId":"post_workspaces_slug_retainers_id_deactivate","summary":"Deactivate a retainer","description":"Switches a retainer off; its periods and invoices are kept. Idempotent: deactivating an inactive retainer is a no-op that still answers 200.","tags":["Retainers"],"security":[{"apiKey":[]},{"oauth2":["invoices:write"]}],"x-rokn-scope":"invoices:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Deactivate a retainer","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"cadence":{"type":"string","enum":["none","monthly","quarterly"]},"carryover":{"type":"string","enum":["expire","rollover"]},"rolloverCap":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]},"startsOn":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsOn":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"isActive":{"type":"boolean"},"currentPeriod":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"allowance":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"rolloverIn":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"consumed":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"unbilled":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"estimateUnavailable":{"type":"boolean"},"depletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"invoiceId":{"type":["string","null"]}},"required":["id","periodStart","periodEnd","allowance","rolloverIn","consumed","unbilled","estimateUnavailable","depletedAt","invoiceId"],"additionalProperties":false},{"type":"null"}]},"remaining":{"anyOf":[{"type":"object","properties":{"definite":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"provisional":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["definite","provisional"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","clientId","name","amount","cadence","carryover","rolloverCap","startsOn","endsOn","isActive","currentPeriod","remaining","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/calendar-events":{"get":{"operationId":"get_workspaces_slug_calendar-events","summary":"List calendar items","description":"Everything starting in `[from, to)` (at most 93 days), sorted by start: stored events and items generated from tasks due, invoices due, milestones and asset renewals. A task's, milestone's or invoice's due day is placed by the UTC days `[from, to)` covers and is an all-day item whose `startTime` is that day's UTC midnight. Not paginated. `owner_user_id` keeps that person's events and tasks; `client_id` keeps events, invoices and renewals of that client; `project_id` keeps everything that names the project.","tags":["Calendar"],"security":[{"apiKey":[]},{"oauth2":["calendar:read"]}],"x-rokn-scope":"calendar:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"from","schema":{"description":"Inclusive start instant (ISO 8601).","type":"string","format":"date-time"},"required":true,"description":"Inclusive start instant (ISO 8601)."},{"in":"query","name":"to","schema":{"description":"Exclusive end instant (ISO 8601), at most 93 days after `from`.","type":"string","format":"date-time"},"required":true,"description":"Exclusive end instant (ISO 8601), at most 93 days after `from`."},{"in":"query","name":"owner_user_id","schema":{"description":"Only that person's events and the tasks assigned to them.","type":"string"},"description":"Only that person's events and the tasks assigned to them."},{"in":"query","name":"client_id","schema":{"type":"string"}},{"in":"query","name":"project_id","schema":{"type":"string"}}],"responses":{"200":{"description":"List calendar items","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"A stored event's type (meeting, external — synced from a connected calendar, see `provider` —, other) or a generated item's: task, invoice_due, milestone, renewal."},"provider":{"anyOf":[{"type":"string","enum":["google","microsoft"]},{"type":"null"}],"description":"For an `external` event, the calendar provider it was synced from; null for every other item."},"title":{"type":"string"},"description":{"type":["string","null"]},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allDay":{"type":"boolean"},"location":{"type":["string","null"]},"meetingUrl":{"description":"The video-call link (http or https) of a synced calendar event; null for every other item (#163).","type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"description":"Invitees of a synced calendar event (rooms excluded, at most 100) or the booker of a booking-created event; [] for every other item (#163)."},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The client named beside `clientId` (#162)."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The project named beside `projectId` (#162)."},"ownerUserId":{"description":"Whose calendar a stored event occupies; null for a generated item or an unowned event.","type":["string","null"]},"relatedEntityType":{"description":"For a generated item: task, invoice, milestone or asset.","type":["string","null"]},"relatedEntityId":{"type":["string","null"]},"createdByBooking":{"type":"boolean"},"bookerName":{"type":["string","null"]},"overdue":{"type":"boolean"},"documentType":{"description":"invoice_due only: invoice, quote, deposit or credit_note.","type":["string","null"]},"amount":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["id","type","provider","title","description","startTime","endTime","allDay","location","meetingUrl","attendees","clientId","projectId","client","project","ownerUserId","relatedEntityType","relatedEntityId","createdByBooking","bookerName","overdue","documentType","amount"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_calendar-events","summary":"Create a calendar event","description":"Creates a meeting or `other` event (title and `startTime` required; `endTime`, `allDay`, `location`, `description`, `clientId`, `projectId` optional; the client and project must belong to the workspace, else 404). An event for a client is logged on that client's timeline. For a member's token the event is pushed to a connected calendar after it is saved: `pushTo` names one of the member's own connections, `none` pushes nowhere, and omitted uses their default connection. A key is no person and never pushes. Only the title, time and place are pushed: no attendees, and nothing is sent to anyone. `ownerUserId` assigns the event to another member (owner/admin or a key only); a key MUST name it, a member of the workspace (another workspace's user is 404), because an event with no owner would block every host's booking slots, and without it the request is refused 422 at `ownerUserId`.","tags":["Calendar"],"security":[{"apiKey":[]},{"oauth2":["calendar:write"]}],"x-rokn-scope":"calendar:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":"string"},"type":{"default":"meeting","type":"string","enum":["meeting","other"]},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"allDay":{"default":false,"type":"boolean"},"location":{"type":"string"},"clientId":{"type":"string"},"projectId":{"type":"string"},"pushTo":{"anyOf":[{"type":"string","const":"none"},{"type":"string","minLength":1,"maxLength":64}]},"ownerUserId":{"type":"string","minLength":1,"maxLength":64}},"required":["title","startTime"]}}}},"responses":{"201":{"description":"Create a calendar event","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"A stored event's type (meeting, external — synced from a connected calendar, see `provider` —, other) or a generated item's: task, invoice_due, milestone, renewal."},"provider":{"anyOf":[{"type":"string","enum":["google","microsoft"]},{"type":"null"}],"description":"For an `external` event, the calendar provider it was synced from; null for every other item."},"title":{"type":"string"},"description":{"type":["string","null"]},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allDay":{"type":"boolean"},"location":{"type":["string","null"]},"meetingUrl":{"description":"The video-call link (http or https) of a synced calendar event; null for every other item (#163).","type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"description":"Invitees of a synced calendar event (rooms excluded, at most 100) or the booker of a booking-created event; [] for every other item (#163)."},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The client named beside `clientId` (#162)."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The project named beside `projectId` (#162)."},"ownerUserId":{"description":"Whose calendar a stored event occupies; null for a generated item or an unowned event.","type":["string","null"]},"relatedEntityType":{"description":"For a generated item: task, invoice, milestone or asset.","type":["string","null"]},"relatedEntityId":{"type":["string","null"]},"createdByBooking":{"type":"boolean"},"bookerName":{"type":["string","null"]},"overdue":{"type":"boolean"},"documentType":{"description":"invoice_due only: invoice, quote, deposit or credit_note.","type":["string","null"]},"amount":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["id","type","provider","title","description","startTime","endTime","allDay","location","meetingUrl","attendees","clientId","projectId","client","project","ownerUserId","relatedEntityType","relatedEntityId","createdByBooking","bookerName","overdue","documentType","amount"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/calendar-events/{id}":{"get":{"operationId":"get_workspaces_slug_calendar-events_id","summary":"Get a calendar event","description":"One stored event. A generated item (a task, invoice, milestone or renewal) is read through its own resource.","tags":["Calendar"],"security":[{"apiKey":[]},{"oauth2":["calendar:read"]}],"x-rokn-scope":"calendar:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a calendar event","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"A stored event's type (meeting, external — synced from a connected calendar, see `provider` —, other) or a generated item's: task, invoice_due, milestone, renewal."},"provider":{"anyOf":[{"type":"string","enum":["google","microsoft"]},{"type":"null"}],"description":"For an `external` event, the calendar provider it was synced from; null for every other item."},"title":{"type":"string"},"description":{"type":["string","null"]},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allDay":{"type":"boolean"},"location":{"type":["string","null"]},"meetingUrl":{"description":"The video-call link (http or https) of a synced calendar event; null for every other item (#163).","type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"description":"Invitees of a synced calendar event (rooms excluded, at most 100) or the booker of a booking-created event; [] for every other item (#163)."},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The client named beside `clientId` (#162)."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The project named beside `projectId` (#162)."},"ownerUserId":{"description":"Whose calendar a stored event occupies; null for a generated item or an unowned event.","type":["string","null"]},"relatedEntityType":{"description":"For a generated item: task, invoice, milestone or asset.","type":["string","null"]},"relatedEntityId":{"type":["string","null"]},"createdByBooking":{"type":"boolean"},"bookerName":{"type":["string","null"]},"overdue":{"type":"boolean"},"documentType":{"description":"invoice_due only: invoice, quote, deposit or credit_note.","type":["string","null"]},"amount":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["id","type","provider","title","description","startTime","endTime","allDay","location","meetingUrl","attendees","clientId","projectId","client","project","ownerUserId","relatedEntityType","relatedEntityId","createdByBooking","bookerName","overdue","documentType","amount"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_calendar-events_id","summary":"Update a calendar event","description":"Partially updates a stored event; a field left out is unchanged. An event that was pushed to a connected calendar is updated there too. An event imported from a connected Google or Microsoft calendar is the provider's, not Rokn's: it is refused with 409 `event_not_editable`. A generated item (task, invoice, milestone, renewal) is changed through its own resource. Another workspace's event, client or project is 404.","tags":["Calendar"],"security":[{"apiKey":[]},{"oauth2":["calendar:write"]}],"x-rokn-scope":"calendar:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"type":{"type":"string","enum":["meeting","other"]},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"allDay":{"type":"boolean"},"location":{"type":["string","null"]},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"ownerUserId":{"type":"string","minLength":1,"maxLength":64}}}}}},"responses":{"200":{"description":"Update a calendar event","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"A stored event's type (meeting, external — synced from a connected calendar, see `provider` —, other) or a generated item's: task, invoice_due, milestone, renewal."},"provider":{"anyOf":[{"type":"string","enum":["google","microsoft"]},{"type":"null"}],"description":"For an `external` event, the calendar provider it was synced from; null for every other item."},"title":{"type":"string"},"description":{"type":["string","null"]},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"allDay":{"type":"boolean"},"location":{"type":["string","null"]},"meetingUrl":{"description":"The video-call link (http or https) of a synced calendar event; null for every other item (#163).","type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"description":"Invitees of a synced calendar event (rooms excluded, at most 100) or the booker of a booking-created event; [] for every other item (#163)."},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The client named beside `clientId` (#162)."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The project named beside `projectId` (#162)."},"ownerUserId":{"description":"Whose calendar a stored event occupies; null for a generated item or an unowned event.","type":["string","null"]},"relatedEntityType":{"description":"For a generated item: task, invoice, milestone or asset.","type":["string","null"]},"relatedEntityId":{"type":["string","null"]},"createdByBooking":{"type":"boolean"},"bookerName":{"type":["string","null"]},"overdue":{"type":"boolean"},"documentType":{"description":"invoice_due only: invoice, quote, deposit or credit_note.","type":["string","null"]},"amount":{"anyOf":[{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["id","type","provider","title","description","startTime","endTime","allDay","location","meetingUrl","attendees","clientId","projectId","client","project","ownerUserId","relatedEntityType","relatedEntityId","createdByBooking","bookerName","overdue","documentType","amount"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_calendar-events_id","summary":"Delete a calendar event","description":"Deletes a stored event, and its copy in the connected calendar it was pushed to. An event imported from a connected Google or Microsoft calendar is the provider's: it is refused with 409 `event_not_editable`. Another workspace's event is 404.","tags":["Calendar"],"security":[{"apiKey":[]},{"oauth2":["calendar:write"]}],"x-rokn-scope":"calendar:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a calendar event","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/notifications":{"get":{"operationId":"get_workspaces_slug_notifications","summary":"List my notifications","description":"The caller's own notifications in this workspace, read and unread, newest first; `unread=true` for unread only. Keyset-paginated on `createdAt`. `unreadCount` is the caller's whole unread total.","tags":["Notifications"],"security":[{"apiKey":[]},{"oauth2":["notifications:read"]}],"x-rokn-scope":"notifications:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"unread","schema":{"description":"true: unread only.","type":"string","enum":["true","false"]},"description":"true: unread only."}],"responses":{"200":{"description":"List my notifications","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"title":{"type":"string"},"message":{"type":["string","null"]},"target":{"anyOf":[{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string"}},"required":["entityType","entityId"],"additionalProperties":false},{"type":"null"}],"description":"The record to open (task, ticket, invoice, quote, contract, document, leave, retainer, asset, project, subscription…); null for a workspace-wide notice."},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","title","message","target","readAt","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the caller's notifications in this workspace are unread, whatever page or filter was asked for (#162): the bell badge."}},"required":["items","nextCursor","unreadCount"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/caller-id-directory":{"get":{"operationId":"get_workspaces_slug_caller-id-directory","summary":"Caller-ID directory","description":"Every phone number the workspace knows (clients, their contacts, open leads) as E.164, with the label to show on an incoming call. Archived clients and converted leads are left out; a number shared by several people is merged (a client or contact beats a lead; different companies read \"N ROKN contacts\"). Send the ETag back as `If-None-Match`: an unchanged directory is a 304.","tags":["Caller ID"],"security":[{"apiKey":[]},{"oauth2":["clients:read"]}],"x-rokn-scope":"clients:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"device_id","schema":{"description":"The app's install id: the first sync per device per day is audited.","type":"string","minLength":1,"maxLength":128},"description":"The app's install id: the first sync per device per day is audited."}],"responses":{"200":{"description":"Caller-ID directory","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"number":{"type":"string","description":"E.164."},"label":{"type":"string","description":"One display line built from the parts below; show it as is."},"kind":{"type":"string","enum":["client","contact","lead","multiple"]},"company":{"description":"The client's or lead's company, as in the label.","type":["string","null"]},"name":{"description":"The contact's or lead's person name, as in the label; null for a client entry and for kind \"multiple\".","type":["string","null"]},"project":{"description":"The label's project text: the one active project's name or \"Multiple projects\"; null when the label has none.","type":["string","null"]}},"required":["number","label","kind","company","name","project"],"additionalProperties":false}}},"required":["entries"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/push-devices/{token}":{"put":{"operationId":"put_workspaces_slug_push-devices_token","summary":"Register this phone for push","description":"Registers (or refreshes) the Expo push token of the caller's phone for this workspace. Idempotent: registering again updates the platform, app version and last-seen time.","tags":["Push devices"],"security":[{"apiKey":[]},{"oauth2":["notifications:write"]}],"x-rokn-scope":"notifications:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"token","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["ios","android"]},"appVersion":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]}},"required":["platform"],"additionalProperties":false}}}},"responses":{"200":{"description":"Register this phone for push","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"platform":{"type":"string"},"appVersion":{"type":["string","null"]},"lastSeenAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["token","platform","appVersion","lastSeenAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_push-devices_token","summary":"Stop push to this phone","description":"Removes the caller's registration of this Expo push token in this workspace, as on sign-out. Idempotent: a token that is not registered is 204 too.","tags":["Push devices"],"security":[{"apiKey":[]},{"oauth2":["notifications:write"]}],"x-rokn-scope":"notifications:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"token","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Stop push to this phone","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/notifications/read-all":{"post":{"operationId":"post_workspaces_slug_notifications_read-all","summary":"Mark all my notifications read","description":"Marks every unread notification of the caller's in this workspace read; returns how many changed.","tags":["Notifications"],"security":[{"apiKey":[]},{"oauth2":["notifications:write"]}],"x-rokn-scope":"notifications:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Mark all my notifications read","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["updated"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/notifications/{id}/read":{"post":{"operationId":"post_workspaces_slug_notifications_id_read","summary":"Mark a notification read","description":"Idempotent: an already-read notification keeps its time. Another person's notification is not found.","tags":["Notifications"],"security":[{"apiKey":[]},{"oauth2":["notifications:write"]}],"x-rokn-scope":"notifications:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Mark a notification read","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"title":{"type":"string"},"message":{"type":["string","null"]},"target":{"anyOf":[{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string"}},"required":["entityType","entityId"],"additionalProperties":false},{"type":"null"}],"description":"The record to open (task, ticket, invoice, quote, contract, document, leave, retainer, asset, project, subscription…); null for a workspace-wide notice."},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","title","message","target","readAt","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/notification-preferences/push":{"get":{"operationId":"get_workspaces_slug_notification-preferences_push","summary":"List my push preferences","description":"The caller's own push preference for every event that can push and be switched off, in the registry's order. Service-required events are not listed.","tags":["Notifications"],"security":[{"apiKey":[]},{"oauth2":["notifications:read"]}],"x-rokn-scope":"notifications:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List my push preferences","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string","description":"The notification event key, e.g. `appointment.reminder`."},"group":{"type":"string","enum":["billing","assets_domains","storage","work"]},"enabled":{"type":"boolean","description":"Whether a push is sent for this event: the stored choice, else the event's default."}},"required":["event","group","enabled"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/notification-preferences/push/{event}":{"put":{"operationId":"put_workspaces_slug_notification-preferences_push_event","summary":"Set a push preference","description":"Turns pushes for one event on or off for the caller. Idempotent. An event that is unknown, cannot push, or is service-required is not found.","tags":["Notifications"],"security":[{"apiKey":[]},{"oauth2":["notifications:write"]}],"x-rokn-scope":"notifications:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"event","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Set a push preference","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","description":"The notification event key, e.g. `appointment.reminder`."},"group":{"type":"string","enum":["billing","assets_domains","storage","work"]},"enabled":{"type":"boolean","description":"Whether a push is sent for this event: the stored choice, else the event's default."}},"required":["event","group","enabled"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/payments":{"get":{"operationId":"get_workspaces_slug_payments","summary":"List payments","description":"Newest-updated first, keyset-paginated. Filter with `invoice_id` to see one invoice's payment history; an `invoice_id` naming another workspace's invoice matches nothing and comes back as an empty page, not an error. `updated_after` is exclusive at millisecond precision. Read-only in v1 — recording, refunding and reconciling a payment have no REST surface yet.","tags":["Payments"],"security":[{"apiKey":[]},{"oauth2":["invoices:read"]}],"x-rokn-scope":"invoices:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"invoice_id","schema":{"type":"string"}}],"responses":{"200":{"description":"List payments","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceId":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"method":{"anyOf":[{"type":"string","enum":["card","bank_transfer","cash","check","other","paypal"]},{"type":"null"}]},"reference":{"type":["string","null"]},"receivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The day the money arrived: a calendar day, given as its UTC midnight (read the date part only). A card payment is dated on the workspace's day, in its time zone, of the gateway's event (#521). Null for a payment not yet completed."},"gatewayPaymentId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","invoiceId","amount","method","reference","receivedAt","gatewayPaymentId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/payments/{id}":{"get":{"operationId":"get_workspaces_slug_payments_id","summary":"Get a payment","description":"One payment by id. A payment in another workspace is not found.","tags":["Payments"],"security":[{"apiKey":[]},{"oauth2":["invoices:read"]}],"x-rokn-scope":"invoices:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a payment","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"invoiceId":{"type":"string"},"amount":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"method":{"anyOf":[{"type":"string","enum":["card","bank_transfer","cash","check","other","paypal"]},{"type":"null"}]},"reference":{"type":["string","null"]},"receivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The day the money arrived: a calendar day, given as its UTC midnight (read the date part only). A card payment is dated on the workspace's day, in its time zone, of the gateway's event (#521). Null for a payment not yet completed."},"gatewayPaymentId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","invoiceId","amount","method","reference","receivedAt","gatewayPaymentId","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/webhook-endpoints":{"get":{"operationId":"get_workspaces_slug_webhook-endpoints","summary":"List webhook endpoints","description":"Newest-updated first, keyset-paginated. `updated_after` is exclusive at millisecond precision. Never returns the signing secret — only `create` and `rotate-secret` do, and only once.","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:read"]}],"x-rokn-scope":"webhooks:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List webhook endpoints","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","url","events","active","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_webhook-endpoints","summary":"Create a webhook endpoint","description":"Registers a new endpoint and mints its signing secret, returned ONCE in this response — it is never retrievable again. `url` is resolved and validated (DNS, SSRF/private-address policy) before anything is written; an unresolvable, private, or otherwise blocked destination is 422 `validation_failed`. Deliberately not idempotent: a stored, replayable response would persist the secret and hand a previously-issued one back — call `GET /webhook-endpoints` to check whether a retried request already landed.","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:write"]}],"x-rokn-scope":"webhooks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string"}}},"required":["url","events"]}}}},"responses":{"201":{"description":"Create a webhook endpoint","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"secret":{"type":"string"}},"required":["id","url","events","active","createdAt","updatedAt","secret"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/webhook-endpoints/{id}":{"get":{"operationId":"get_workspaces_slug_webhook-endpoints_id","summary":"Get a webhook endpoint","description":"One webhook endpoint by id. An endpoint in another workspace is not found. Never returns the signing secret.","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:read"]}],"x-rokn-scope":"webhooks:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a webhook endpoint","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","url","events","active","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_webhook-endpoints_id","summary":"Update a webhook endpoint","description":"Partial update; only the fields present are written. A new `url` is re-validated (DNS, SSRF/private-address policy) before the write, the same as `create`. Supports `If-Match` (Task 13): a mismatched value is 412 `precondition_failed` and the write does not run — checked atomically as part of the same UPDATE, never a separate read-compare-write.","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:write"]}],"x-rokn-scope":"webhooks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string"}},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Update a webhook endpoint","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","url","events","active","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_webhook-endpoints_id","summary":"Delete a webhook endpoint","description":"Removes the endpoint. An endpoint in another workspace, or one already deleted, is not found.","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:write"]}],"x-rokn-scope":"webhooks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a webhook endpoint","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/webhook-endpoints/{id}/rotate-secret":{"post":{"operationId":"post_workspaces_slug_webhook-endpoints_id_rotate-secret","summary":"Rotate a webhook endpoint's signing secret","description":"Mints a fresh signing secret and returns it ONCE, replacing the old one immediately — the old secret stops verifying deliveries right away. Deliberately not `idempotent`: a replay of this request must never hand back a previously-issued, now-dead secret from a stored response, so it does not honour `Idempotency-Key` — check `list`/`get` instead to see whether a retried request already landed.","tags":["Webhooks"],"security":[{"apiKey":[]},{"oauth2":["webhooks:write"]}],"x-rokn-scope":"webhooks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Rotate a webhook endpoint's signing secret","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"secret":{"type":"string"}},"required":["id","url","events","active","createdAt","updatedAt","secret"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/api-keys":{"get":{"operationId":"get_workspaces_slug_api-keys","summary":"List API keys","description":"Every API key minted for this workspace — never the hash or the secret. Not paginated: `nextCursor` is always null, because keys are capped at the plan limit (currently at most a handful per workspace). `status` defaults to `active`, excluding revoked keys; pass `revoked` or `all` to see revoked ones too.","tags":["API Keys"],"security":[{"apiKey":[]},{"oauth2":["api.keys:read"]}],"x-rokn-scope":"api.keys:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"status","schema":{"default":"active","type":"string","enum":["active","revoked","all"]}}],"responses":{"200":{"description":"List API keys","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","name","prefix","scopes","expiresAt","lastUsedAt","createdAt","revokedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_api-keys","summary":"Create an API key","description":"Mints a new workspace API key and returns its plaintext secret ONCE — only its hash is stored, and it is never retrievable again. `scopes` may never include a scope wider than the issuing principal's own (the subset rule: an API key can mint a further key, but never one broader than itself), and may never include `openid`, `profile`, `offline_access`, or `mcp:tools` — those describe a user's own OAuth token, not a workspace key. Counts against the plan's API key limit; a revoked key does not count. An unknown scope string is 422 `validation_failed` naming `scopes.<i>`; a name already held by one of this workspace's ACTIVE keys is 409 `conflict` (a revoked key frees its name); `expiresAt` is an ISO 8601 datetime or date. Deliberately not idempotent: a replayed request must never hand back a previously-issued secret from a stored response — call `GET /api-keys` to check whether a retried request already landed.","tags":["API Keys"],"security":[{"apiKey":[]},{"oauth2":["api.keys:write"]}],"x-rokn-scope":"api.keys:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["org.settings:read","org.settings:write","org.team:read","org.team:write","org.roles:read","org.roles:write","trash:read","trash:write","clients:read","clients:write","projects:read","projects:write","invoices:read","invoices:write","quotes:read","quotes:write","expenses:read","expenses:write","tasks:read","tasks:write","time_tracking:read","time_tracking:write","capacity:read","capacity:write","leave:read","leave:write","utilization:read","reports:read","assets:read","assets:write","credentials:read","credentials:write","documents:read","documents:write","contracts:read","contracts:write","leads:read","leads:write","communications:read","communications:write","calendar:read","calendar:write","tickets:read","tickets:write","api.keys:read","api.keys:write","audit:read","campaigns:read","campaigns:write","services:read","services:write","templates:read","templates:write","webhooks:read","webhooks:write","code_hosts:read","code_hosts:write","customization:read","customization:write"]}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}]}},"required":["name","scopes"]}}}},"responses":{"201":{"description":"Create an API key","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"secret":{"type":"string"}},"required":["id","name","prefix","scopes","expiresAt","secret"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/api-keys/{id}":{"delete":{"operationId":"delete_workspaces_slug_api-keys_id","summary":"Revoke an API key","description":"Revokes the key immediately — including one whose own credential is being used to make this very request, which stops authenticating from its NEXT use onward. A key in another workspace, or one that does not exist, is not found. Revoking an already-revoked key is a no-op that still answers 204.","tags":["API Keys"],"security":[{"apiKey":[]},{"oauth2":["api.keys:write"]}],"x-rokn-scope":"api.keys:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Revoke an API key","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets":{"get":{"operationId":"get_workspaces_slug_tickets","summary":"List tickets","description":"Newest-updated first, keyset-paginated. Filters: `status`, `assignee_id`, `client_id`, and `sla_state` (`at_risk`, `breached`, `paused`, `unmeasured`). `updated_after` is exclusive at millisecond precision.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:read"]}],"x-rokn-scope":"tickets:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]}},{"in":"query","name":"assignee_id","schema":{"type":"string"}},{"in":"query","name":"client_id","schema":{"type":"string"}},{"in":"query","name":"sla_state","schema":{"type":"string","enum":["at_risk","breached","paused","unmeasured"]}}],"responses":{"200":{"description":"List tickets","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"assetId":{"type":["string","null"]},"assigneeId":{"type":["string","null"]},"subject":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["bug","feature_request","general"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"status":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]},"origin":{"type":"string","enum":["portal","staff","email","api"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sla":{"anyOf":[{"type":"object","properties":{"policyId":{"type":"string"},"calendar":{"anyOf":[{"type":"object","properties":{"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["clock","timezone","hours","holidays","pauseWhileWaiting","warningMinutes"],"additionalProperties":false},{"type":"null"}]},"targets":{"anyOf":[{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},{"type":"null"}]},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cycle":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyId","calendar","targets","firstResponseDueAt","firstResponseAt","firstResponseBreachedAt","resolutionDueAt","resolutionBreachedAt","pausedAt","pausedMinutes","cycle"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","clientId","projectId","assetId","assigneeId","subject","description","type","priority","status","origin","resolvedAt","closedAt","createdAt","updatedAt","sla"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_tickets","summary":"Create a ticket","description":"Creates a ticket in the addressed workspace, recorded with `origin: \"api\"`. A `clientId`/`projectId` naming a row in another workspace is not found.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1},"type":{"type":"string","enum":["bug","feature_request","general"]},"priority":{"default":"medium","type":"string","enum":["low","medium","high","urgent"]},"projectId":{"type":"string"},"subject":{"type":"string","minLength":1},"description":{"type":"string","minLength":1}},"required":["clientId","type","subject","description"]}}}},"responses":{"201":{"description":"Create a ticket","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"assetId":{"type":["string","null"]},"assigneeId":{"type":["string","null"]},"subject":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["bug","feature_request","general"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"status":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]},"origin":{"type":"string","enum":["portal","staff","email","api"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sla":{"anyOf":[{"type":"object","properties":{"policyId":{"type":"string"},"calendar":{"anyOf":[{"type":"object","properties":{"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["clock","timezone","hours","holidays","pauseWhileWaiting","warningMinutes"],"additionalProperties":false},{"type":"null"}]},"targets":{"anyOf":[{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},{"type":"null"}]},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cycle":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyId","calendar","targets","firstResponseDueAt","firstResponseAt","firstResponseBreachedAt","resolutionDueAt","resolutionBreachedAt","pausedAt","pausedMinutes","cycle"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","clientId","projectId","assetId","assigneeId","subject","description","type","priority","status","origin","resolvedAt","closedAt","createdAt","updatedAt","sla"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets/review":{"get":{"operationId":"get_workspaces_slug_tickets_review","summary":"List the inbound-mail review queue","description":"Inbound email the automatic router could not attribute to a ticket or client with confidence — newest-received first, keyset-paginated. Gated on `tickets:write`, the same cell `resolve` below uses, because reviewing is a staff action, not a read.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List the inbound-mail review queue","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"recipientAddress":{"type":"string"},"replyTagValid":{"type":"boolean"},"messageKey":{"type":"string"},"messageIdHeader":{"type":["string","null"]},"inReplyTo":{"type":["string","null"]},"references":{"type":"array","items":{"type":"string"}},"fromEmail":{"type":"string"},"fromName":{"type":["string","null"]},"to":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["email","name"],"additionalProperties":false}},"cc":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["email","name"],"additionalProperties":false}},"subject":{"type":"string"},"textBody":{"type":"string"},"receivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dateHeader":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"authSpf":{"type":"string"},"authDkim":{"type":"string"},"authDmarc":{"type":"string"},"authDmarcPolicy":{"type":["string","null"]},"kind":{"type":"string","enum":["message","automatic","bounce"]},"status":{"type":"string","enum":["routed","review","dismissed"]},"ticketId":{"type":["string","null"]},"ticketCommentId":{"type":["string","null"]},"attachmentsState":{"type":"string","enum":["stored","partial","over_quota"]},"reviewedById":{"type":["string","null"]},"reviewedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reviewDecision":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","recipientAddress","replyTagValid","messageKey","messageIdHeader","inReplyTo","references","fromEmail","fromName","to","cc","subject","textBody","receivedAt","dateHeader","authSpf","authDkim","authDmarc","authDmarcPolicy","kind","status","ticketId","ticketCommentId","attachmentsState","reviewedById","reviewedAt","reviewDecision","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets/review/{id}":{"post":{"operationId":"post_workspaces_slug_tickets_review_id","summary":"Resolve a review-queue item","description":"Attaches the inbound message to an existing client (`attach_client`), a brand-new one (`create_client`), an existing ticket (`attach_ticket`), or dismisses it. Every outcome but `dismiss` raises (or reuses) a ticket and returns its id; `create_client`/`attach_client` also return the client's id. A message already resolved (not `status: \"review\"`) is 409 `conflict`.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"attach_client"},"clientId":{"type":"string","minLength":1}},"required":["kind","clientId"]},{"type":"object","properties":{"kind":{"type":"string","const":"create_client"},"name":{"type":"string","minLength":1}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"attach_ticket"},"ticketId":{"type":"string","minLength":1}},"required":["kind","ticketId"]},{"type":"object","properties":{"kind":{"type":"string","const":"dismiss"}},"required":["kind"]}],"type":"object"}}}},"responses":{"200":{"description":"Resolve a review-queue item","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ticketId":{"type":"string"},"clientId":{"type":"string"}},"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets/{id}":{"get":{"operationId":"get_workspaces_slug_tickets_id","summary":"Get a ticket","description":"One ticket by id, with its SLA snapshot when a policy applies. A ticket in another workspace is not found.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:read"]}],"x-rokn-scope":"tickets:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get a ticket","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"assetId":{"type":["string","null"]},"assigneeId":{"type":["string","null"]},"subject":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["bug","feature_request","general"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"status":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]},"origin":{"type":"string","enum":["portal","staff","email","api"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sla":{"anyOf":[{"type":"object","properties":{"policyId":{"type":"string"},"calendar":{"anyOf":[{"type":"object","properties":{"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["clock","timezone","hours","holidays","pauseWhileWaiting","warningMinutes"],"additionalProperties":false},{"type":"null"}]},"targets":{"anyOf":[{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},{"type":"null"}]},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cycle":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyId","calendar","targets","firstResponseDueAt","firstResponseAt","firstResponseBreachedAt","resolutionDueAt","resolutionBreachedAt","pausedAt","pausedMinutes","cycle"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","clientId","projectId","assetId","assigneeId","subject","description","type","priority","status","origin","resolvedAt","closedAt","createdAt","updatedAt","sla"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_tickets_id","summary":"Update a ticket","description":"Partial update over `status`, `priority` and `assigneeId` — at least one is required. Supports `If-Match` (Task 13's convention): a mismatched value is 412 `precondition_failed` and no field is written — checked atomically as part of the first field's UPDATE, never a separate read-compare-write.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"If-Match","schema":{"type":"string"},"description":"The resource's current `ETag`, or `*`. Optional; a mismatch is 412 and the write does not run."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"assigneeId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Update a ticket","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"ETag":{"required":true,"description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write.","schema":{"$ref":"#/components/schemas/ETagHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"assetId":{"type":["string","null"]},"assigneeId":{"type":["string","null"]},"subject":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["bug","feature_request","general"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"status":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]},"origin":{"type":"string","enum":["portal","staff","email","api"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sla":{"anyOf":[{"type":"object","properties":{"policyId":{"type":"string"},"calendar":{"anyOf":[{"type":"object","properties":{"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["clock","timezone","hours","holidays","pauseWhileWaiting","warningMinutes"],"additionalProperties":false},{"type":"null"}]},"targets":{"anyOf":[{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},{"type":"null"}]},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cycle":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyId","calendar","targets","firstResponseDueAt","firstResponseAt","firstResponseBreachedAt","resolutionDueAt","resolutionBreachedAt","pausedAt","pausedMinutes","cycle"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","clientId","projectId","assetId","assigneeId","subject","description","type","priority","status","origin","resolvedAt","closedAt","createdAt","updatedAt","sla"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets/{id}/resolve":{"post":{"operationId":"post_workspaces_slug_tickets_id_resolve","summary":"Resolve a ticket","description":"Moves an open/in-progress ticket to `resolved`; a `closed` ticket refuses (409), an already-`resolved` one is idempotent.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Resolve a ticket","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"assetId":{"type":["string","null"]},"assigneeId":{"type":["string","null"]},"subject":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["bug","feature_request","general"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"status":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]},"origin":{"type":"string","enum":["portal","staff","email","api"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sla":{"anyOf":[{"type":"object","properties":{"policyId":{"type":"string"},"calendar":{"anyOf":[{"type":"object","properties":{"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["clock","timezone","hours","holidays","pauseWhileWaiting","warningMinutes"],"additionalProperties":false},{"type":"null"}]},"targets":{"anyOf":[{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},{"type":"null"}]},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cycle":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyId","calendar","targets","firstResponseDueAt","firstResponseAt","firstResponseBreachedAt","resolutionDueAt","resolutionBreachedAt","pausedAt","pausedMinutes","cycle"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","clientId","projectId","assetId","assigneeId","subject","description","type","priority","status","origin","resolvedAt","closedAt","createdAt","updatedAt","sla"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets/{id}/reopen":{"post":{"operationId":"post_workspaces_slug_tickets_id_reopen","summary":"Reopen a resolved or closed ticket","description":"Moves a `resolved` or `closed` ticket back to `open` as a new resolution cycle: the SLA resolution clock restarts, the outgoing cycle is kept in the SLA history, an unanswered satisfaction survey is cancelled, and the next resolve surveys again. Any other status refuses (409).","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Reopen a resolved or closed ticket","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"clientId":{"type":"string"},"projectId":{"type":["string","null"]},"assetId":{"type":["string","null"]},"assigneeId":{"type":["string","null"]},"subject":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["bug","feature_request","general"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"status":{"type":"string","enum":["open","in_progress","waiting_on_client","resolved","closed"]},"origin":{"type":"string","enum":["portal","staff","email","api"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sla":{"anyOf":[{"type":"object","properties":{"policyId":{"type":"string"},"calendar":{"anyOf":[{"type":"object","properties":{"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["clock","timezone","hours","holidays","pauseWhileWaiting","warningMinutes"],"additionalProperties":false},{"type":"null"}]},"targets":{"anyOf":[{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},{"type":"null"}]},"firstResponseDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"firstResponseBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionDueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"resolutionBreachedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pausedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cycle":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["policyId","calendar","targets","firstResponseDueAt","firstResponseAt","firstResponseBreachedAt","resolutionDueAt","resolutionBreachedAt","pausedAt","pausedMinutes","cycle"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","clientId","projectId","assetId","assigneeId","subject","description","type","priority","status","origin","resolvedAt","closedAt","createdAt","updatedAt","sla"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets/{id}/comments":{"get":{"operationId":"get_workspaces_slug_tickets_id_comments","summary":"List a ticket's comments","description":"The ticket's comment thread, OLDEST first (a thread reads chronologically, unlike every other list in this API), keyset-paginated.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:read"]}],"x-rokn-scope":"tickets:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List a ticket's comments","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ticketId":{"type":"string"},"authorKind":{"type":"string","enum":["user","contact","external","api_key"]},"authorId":{"type":["string","null"]},"authorContactId":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"authorName":{"type":["string","null"]},"content":{"type":"string"},"isInternal":{"type":"boolean"},"inboundMessageId":{"type":["string","null"]},"messageId":{"type":["string","null"]},"delivery":{"anyOf":[{"type":"string","enum":["sent","failed","bounced"]},{"type":"null"}]},"htmlBodyObjectId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","ticketId","authorKind","authorId","authorContactId","authorEmail","authorName","content","isInternal","inboundMessageId","messageId","delivery","htmlBodyObjectId","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_tickets_id_comments","summary":"Add a comment","description":"Adds a comment or internal note (`isInternal`). A public comment on a ticket with an email participant is delivered as a threaded reply, best-effort, after the comment is committed — `delivery` reports the outcome (`sent`, `failed`, or `null` when there was nothing to email: an internal note, or no email participant at all). An internal note never sends anything.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1},"isInternal":{"default":false,"type":"boolean"}},"required":["content"]}}}},"responses":{"201":{"description":"Add a comment","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"ticketId":{"type":"string"},"authorKind":{"type":"string","enum":["user","contact","external","api_key"]},"authorId":{"type":["string","null"]},"authorContactId":{"type":["string","null"]},"authorEmail":{"type":["string","null"]},"authorName":{"type":["string","null"]},"content":{"type":"string"},"isInternal":{"type":"boolean"},"inboundMessageId":{"type":["string","null"]},"messageId":{"type":["string","null"]},"delivery":{"anyOf":[{"type":"string","enum":["sent","failed","bounced"]},{"type":"null"}]},"htmlBodyObjectId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","ticketId","authorKind","authorId","authorContactId","authorEmail","authorName","content","isInternal","inboundMessageId","messageId","delivery","htmlBodyObjectId","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tickets/{id}/task":{"post":{"operationId":"post_workspaces_slug_tickets_id_task","summary":"Link a ticket to a task","description":"Links the ticket to an existing task of this workspace (`taskId`), or creates one for it (`createNew: true`, titled `taskTitle` or after the ticket's subject, in the ticket's project, in the initial status of the status list that project's tasks use, with the ticket's priority as the task's `priority` (the field's default option when that option is archived)) and links that. A required task field does not refuse it. Needs `tasks:write` as well as `tickets:write`. A task of another workspace is 404; naming no task without `createNew` is 422; a workspace with no task statuses is 409 `task_statuses_missing`.","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:write"]}],"x-rokn-scope":"tickets:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"taskId":{"type":"string"},"createNew":{"default":false,"type":"boolean"},"taskTitle":{"type":"string"}}}}}},"responses":{"200":{"description":"Link a ticket to a task","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ticketId":{"type":"string"},"taskId":{"type":"string"},"created":{"type":"boolean"}},"required":["ticketId","taskId","created"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/csat/surveys":{"get":{"operationId":"get_workspaces_slug_csat_surveys","summary":"List CSAT surveys","description":"Every CSAT survey in the workspace, newest-`resolvedAt` first, keyset-paginated. Filters: `status`, and a `[from, to)` window on `resolvedAt` (\"by period\").","tags":["Tickets"],"security":[{"apiKey":[]},{"oauth2":["tickets:read"]}],"x-rokn-scope":"tickets:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"updated_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"status","schema":{"type":"string","enum":["scheduled","sent","answered","expired","cancelled","suppressed","failed"]}},{"in":"query","name":"from","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"List CSAT surveys","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ticketId":{"type":"string"},"cycle":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolvedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recipientEmail":{"type":["string","null"]},"recipientContactId":{"type":["string","null"]},"status":{"type":"string","enum":["scheduled","sent","answered","expired","cancelled","suppressed","failed"]},"scheduledFor":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"answeredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"score":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"comment":{"type":["string","null"]},"suppressedReason":{"anyOf":[{"type":"string","enum":["opt_out","staff","feature_off","no_recipient"]},{"type":"null"}]},"suppressedById":{"type":["string","null"]},"followupTaskId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","ticketId","cycle","resolvedAt","recipientEmail","recipientContactId","status","scheduledFor","sentAt","answeredAt","score","comment","suppressedReason","suppressedById","followupTaskId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/sla-policies":{"get":{"operationId":"get_workspaces_slug_sla-policies","summary":"List SLA policies","description":"Every SLA policy in the workspace, by name. Not paginated.","tags":["SLA Policies"],"security":[{"apiKey":[]},{"oauth2":["org.settings:read"]}],"x-rokn-scope":"org.settings:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List SLA policies","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"targets":{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","isDefault","clock","timezone","hours","holidays","targets","pauseWhileWaiting","warningMinutes","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_sla-policies","summary":"Create an SLA policy","description":"Creates an SLA policy. `isDefault: true` clears the flag on the workspace's previous default in the same transaction.","tags":["SLA Policies"],"security":[{"apiKey":[]},{"oauth2":["org.settings:write"]}],"x-rokn-scope":"org.settings:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"clock":{"default":"support_hours","type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}}},"holidays":{"default":[],"maxItems":366,"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"targets":{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]}},"required":["low","medium","high","urgent"]},"pauseWhileWaiting":{"default":true,"type":"boolean"},"warningMinutes":{"default":30,"type":"integer","minimum":0,"maximum":10080},"isDefault":{"default":false,"type":"boolean"}},"required":["name","timezone","hours","targets"]}}}},"responses":{"201":{"description":"Create an SLA policy","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"targets":{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","isDefault","clock","timezone","hours","holidays","targets","pauseWhileWaiting","warningMinutes","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/sla-policies/{id}":{"get":{"operationId":"get_workspaces_slug_sla-policies_id","summary":"Get an SLA policy","description":"One SLA policy by id. A policy in another workspace is not found.","tags":["SLA Policies"],"security":[{"apiKey":[]},{"oauth2":["org.settings:read"]}],"x-rokn-scope":"org.settings:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Get an SLA policy","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"targets":{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","isDefault","clock","timezone","hours","holidays","targets","pauseWhileWaiting","warningMinutes","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patch_workspaces_slug_sla-policies_id","summary":"Update an SLA policy","description":"Partial update; only the fields present are written. `isDefault: true` clears the flag on every OTHER policy in the same transaction.","tags":["SLA Policies"],"security":[{"apiKey":[]},{"oauth2":["org.settings:write"]}],"x-rokn-scope":"org.settings:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":2,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}}},"holidays":{"maxItems":366,"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"targets":{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":1,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["firstResponse","resolution"]}},"required":["low","medium","high","urgent"]},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":0,"maximum":10080},"isDefault":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Update an SLA policy","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"clock":{"type":"string","enum":["always","support_hours"]},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"tue":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"wed":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"thu":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"fri":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sat":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"sun":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"additionalProperties":false},"holidays":{"type":"array","items":{"type":"string"}},"targets":{"type":"object","properties":{"low":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"medium":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"high":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false},"urgent":{"type":"object","properties":{"firstResponse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resolution":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["firstResponse","resolution"],"additionalProperties":false}},"required":["low","medium","high","urgent"],"additionalProperties":false},"pauseWhileWaiting":{"type":"boolean"},"warningMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","isDefault","clock","timezone","hours","holidays","targets","pauseWhileWaiting","warningMinutes","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_sla-policies_id","summary":"Delete an SLA policy","description":"Removes the policy. Refused (409) while any client names it as an override, and while it is the workspace's default with other policies still present — a workspace is never left with zero defaults by a delete alone.","tags":["SLA Policies"],"security":[{"apiKey":[]},{"oauth2":["org.settings:write"]}],"x-rokn-scope":"org.settings:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete an SLA policy","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leave":{"get":{"operationId":"get_workspaces_slug_leave","summary":"List leave requests","description":"Leave requests filtered by `userId`, `status`, and a `[from, to]` date window. `reason`/`decisionNote` are redacted to `null` on another member's row unless the caller holds an unnarrowed `leave` read (owner, admin, accountant).","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["leave:read"]}],"x-rokn-scope":"leave:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"userId","schema":{"type":"string","maxLength":128}},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","approved","rejected","cancelled"]}},{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"List leave requests","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"startPart":{"type":"string","enum":["full","am","pm"]},"endPart":{"type":"string","enum":["full","am","pm"]},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"reason":{"type":["string","null"]},"requestedBy":{"type":["string","null"]},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","userId","userName","startDate","endDate","startPart","endPart","status","reason","requestedBy","decidedBy","decidedAt","decisionNote","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_leave","summary":"Request leave","description":"Requests leave. `userId` omitted requests it for the caller; naming another member is owner/admin only. `approved: true` records it directly as approved and is refused for anyone without an unrestricted `leave` write scope — an API key must name `userId` (it has no identity of its own). Overlapping active leave for the same member is refused (409).","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["leave:write"]}],"x-rokn-scope":"leave:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":128},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startPart":{"default":"full","type":"string","enum":["full","am","pm"]},"endPart":{"default":"full","type":"string","enum":["full","am","pm"]},"reason":{"type":"string","maxLength":1000},"approved":{"default":false,"type":"boolean"}},"required":["startDate","endDate"],"additionalProperties":false}}}},"responses":{"201":{"description":"Request leave","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"startPart":{"type":"string","enum":["full","am","pm"]},"endPart":{"type":"string","enum":["full","am","pm"]},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"reason":{"type":["string","null"]},"requestedBy":{"type":["string","null"]},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","userId","userName","startDate","endDate","startPart","endPart","status","reason","requestedBy","decidedBy","decidedAt","decisionNote","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leave/{id}/approve":{"post":{"operationId":"post_workspaces_slug_leave_id_approve","summary":"Approve a leave request","description":"Moves a `pending` request to `approved`. Owner/admin (or a key/token holding an unrestricted `leave:write`) only — a member's own token is refused even for their own request. A request already decided is refused (409).","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["leave:write"]}],"x-rokn-scope":"leave:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":1000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Approve a leave request","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"startPart":{"type":"string","enum":["full","am","pm"]},"endPart":{"type":"string","enum":["full","am","pm"]},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"reason":{"type":["string","null"]},"requestedBy":{"type":["string","null"]},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","userId","userName","startDate","endDate","startPart","endPart","status","reason","requestedBy","decidedBy","decidedAt","decisionNote","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leave/{id}/reject":{"post":{"operationId":"post_workspaces_slug_leave_id_reject","summary":"Reject a leave request","description":"Moves a `pending` request to `rejected`. Owner/admin (or a key/token holding an unrestricted `leave:write`) only — a member's own token is refused even for their own request. A request already decided is refused (409).","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["leave:write"]}],"x-rokn-scope":"leave:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":1000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Reject a leave request","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"startPart":{"type":"string","enum":["full","am","pm"]},"endPart":{"type":"string","enum":["full","am","pm"]},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"reason":{"type":["string","null"]},"requestedBy":{"type":["string","null"]},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","userId","userName","startDate","endDate","startPart","endPart","status","reason","requestedBy","decidedBy","decidedAt","decisionNote","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/leave/{id}/cancel":{"post":{"operationId":"post_workspaces_slug_leave_id_cancel","summary":"Cancel a leave request","description":"The requester may cancel their own `pending` request, or an `approved` one before it starts; owner/admin may cancel any `pending`/`approved` request at any time. A request that can no longer be cancelled by the caller is refused (409 for owner/admin, 403 for the requester past that window).","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["leave:write"]}],"x-rokn-scope":"leave:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Cancel a leave request","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"startPart":{"type":"string","enum":["full","am","pm"]},"endPart":{"type":"string","enum":["full","am","pm"]},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"reason":{"type":["string","null"]},"requestedBy":{"type":["string","null"]},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","userId","userName","startDate","endDate","startPart","endPart","status","reason","requestedBy","decidedBy","decidedAt","decisionNote","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/allocations":{"get":{"operationId":"get_workspaces_slug_allocations","summary":"List weekly project allocations","description":"Planned minutes per member/project/week in `[from, to]` (both ISO-week Mondays, at most 26 weeks apart). Never narrowed for a member — `capacity`'s read cell is unrestricted for every staff role.","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["capacity:read"]}],"x-rokn-scope":"capacity:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"from","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true},{"in":"query","name":"to","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true}],"responses":{"200":{"description":"List weekly project allocations","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"projectId":{"type":"string"},"weekStart":{"type":"string"},"plannedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","userId","projectId","weekStart","plannedMinutes","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_allocations","summary":"Upsert a weekly allocation","description":"Replaces the planned minutes for (`userId`, `projectId`, `weekStart`); `plannedMinutes: 0` deletes the row instead and `item` is `null`. Owner/admin (or a key/token holding an unrestricted `capacity:write`) only. Registered as POST rather than PUT: this API has no PUT method, and the body already names the full row key.","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["capacity:write"]}],"x-rokn-scope":"capacity:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":128},"projectId":{"type":"string","minLength":1,"maxLength":128},"weekStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"plannedMinutes":{"type":"integer","minimum":0,"maximum":10080}},"required":["userId","projectId","weekStart","plannedMinutes"],"additionalProperties":false}}}},"responses":{"200":{"description":"Upsert a weekly allocation","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"projectId":{"type":"string"},"weekStart":{"type":"string"},"plannedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","userId","projectId","weekStart","plannedMinutes","updatedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["item"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/utilization":{"get":{"operationId":"get_workspaces_slug_utilization","summary":"Get the utilization report","description":"Available/logged/billable minutes per staff member over `[startDate, endDate]` (at most 366 days). A member's own token sees only their own row, with `team: null`; owner, admin and accountant see every row and the team total.","tags":["Capacity"],"security":[{"apiKey":[]},{"oauth2":["utilization:read"]}],"x-rokn-scope":"utilization:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"query","name":"startDate","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true},{"in":"query","name":"endDate","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true}],"responses":{"200":{"description":"Get the utilization report","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"startDate":{"type":"string"},"endDate":{"type":"string"},"timeZone":{"type":"string"}},"required":["startDate","endDate","timeZone"],"additionalProperties":false},"generatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"basis":{"type":"string","const":"time_start"},"rows":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"label":{"type":"string"},"availableMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"loggedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billableMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leaveDays":{"type":"number"},"totalRatio":{"type":["number","null"]},"billableRatio":{"type":["number","null"]}},"required":["userId","label","availableMinutes","loggedMinutes","billableMinutes","leaveDays","totalRatio","billableRatio"],"additionalProperties":false}},"team":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"label":{"type":"string"},"availableMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"loggedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billableMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leaveDays":{"type":"number"},"totalRatio":{"type":["number","null"]},"billableRatio":{"type":["number","null"]}},"required":["userId","label","availableMinutes","loggedMinutes","billableMinutes","leaveDays","totalRatio","billableRatio"],"additionalProperties":false},{"type":"null"}]},"incomplete":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["code","count"],"additionalProperties":false}}},"required":["period","generatedAt","basis","rows","team","incomplete","warnings"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/clients/{id}/timeline":{"get":{"operationId":"get_workspaces_slug_clients_id_timeline","summary":"List a client's timeline","description":"The notes, calls, meetings, emails and system events on a client, pinned entries first and then newest first. Keyset-paginated. A client of another workspace is 404.","tags":["Timeline"],"security":[{"apiKey":[]},{"oauth2":["communications:read"]}],"x-rokn-scope":"communications:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"List a client's timeline","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"type":{"type":"string","enum":["note","call","meeting","email","system"]},"subject":{"type":["string","null"]},"content":{"type":["string","null"]},"pinned":{"type":"boolean"},"isSystemEvent":{"type":"boolean","description":"true for an entry the app wrote itself; those cannot be edited or deleted."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"null for a system entry or a person who has since left."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it happened: `occurredAt` if one was given, else when it was logged."}},"required":["id","clientId","projectId","type","subject","content","pinned","isSystemEvent","author","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_clients_id_timeline","summary":"Log something on a client's timeline","description":"Logs a note, call, meeting or email, authored by the caller. Records only; nothing is sent, and `system` is never accepted. `subject` defaults to the content's first line; `occurredAt` back-dates it; `projectId` links a project of this workspace. A person must be the author, so an API key is refused 403. A client or project of another workspace is 404.","tags":["Timeline"],"security":[{"apiKey":[]},{"oauth2":["communications:write"]}],"x-rokn-scope":"communications:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["note","call","meeting","email"]},"content":{"type":"string","minLength":1,"maxLength":10000},"subject":{"type":"string","minLength":1,"maxLength":200},"occurredAt":{"type":"string","format":"date-time"},"projectId":{"type":"string","minLength":1}},"required":["type","content"]}}}},"responses":{"201":{"description":"Log something on a client's timeline","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"type":{"type":"string","enum":["note","call","meeting","email","system"]},"subject":{"type":["string","null"]},"content":{"type":["string","null"]},"pinned":{"type":"boolean"},"isSystemEvent":{"type":"boolean","description":"true for an entry the app wrote itself; those cannot be edited or deleted."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"null for a system entry or a person who has since left."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it happened: `occurredAt` if one was given, else when it was logged."}},"required":["id","clientId","projectId","type","subject","content","pinned","isSystemEvent","author","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/timeline/{id}":{"patch":{"operationId":"patch_workspaces_slug_timeline_id","summary":"Edit a timeline entry","description":"Changes the type, subject, content or pinned flag of an entry; at least one field. A member edits only their own entries, owner and admin any; anything else, and a system entry, is 404.","tags":["Timeline"],"security":[{"apiKey":[]},{"oauth2":["communications:write"]}],"x-rokn-scope":"communications:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["email","call","meeting","note"]},"subject":{"type":"string","minLength":1},"content":{"type":["string","null"]},"pinned":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Edit a timeline entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"type":{"type":"string","enum":["note","call","meeting","email","system"]},"subject":{"type":["string","null"]},"content":{"type":["string","null"]},"pinned":{"type":"boolean"},"isSystemEvent":{"type":"boolean","description":"true for an entry the app wrote itself; those cannot be edited or deleted."},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"null for a system entry or a person who has since left."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it happened: `occurredAt` if one was given, else when it was logged."}},"required":["id","clientId","projectId","type","subject","content","pinned","isSystemEvent","author","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_timeline_id","summary":"Delete a timeline entry","description":"Deletes the entry and its attachments for good. A member deletes only their own entries, owner and admin any; anything else, and a system entry, is 404.","tags":["Timeline"],"security":[{"apiKey":[]},{"oauth2":["communications:write"]}],"x-rokn-scope":"communications:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a timeline entry","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/{id}/milestones":{"get":{"operationId":"get_workspaces_slug_projects_id_milestones","summary":"List a project's milestones and deliverables","description":"Both lists of the project, in order (not paginated). Deliverables belong to the project, not to a milestone. A project of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:read"]}],"x-rokn-scope":"projects:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List a project's milestones and deliverables","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed":{"type":"boolean"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","dueDate","completed","completedAt","order","createdAt"],"additionalProperties":false}},"deliverables":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"completed":{"type":"boolean"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","completed","order","createdAt"],"additionalProperties":false}}},"required":["milestones","deliverables"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"post":{"operationId":"post_workspaces_slug_projects_id_milestones","summary":"Create a milestone","description":"Adds a milestone (`name`, optional `dueDate`) to the project. A project of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"dueDate":{"type":"string","format":"date-time"},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name"]}}}},"responses":{"201":{"description":"Create a milestone","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed":{"type":"boolean"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","dueDate","completed","completedAt","order","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/milestones/{id}":{"patch":{"operationId":"patch_workspaces_slug_milestones_id","summary":"Update a milestone","description":"Partial update: `name`, `dueDate` (null clears it) and `completed` (true completes it, false reopens it). A milestone of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"dueDate":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completed":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Update a milestone","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed":{"type":"boolean"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","dueDate","completed","completedAt","order","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_milestones_id","summary":"Delete a milestone","description":"Deletes the milestone. A milestone of another workspace, or one already deleted, is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a milestone","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/{id}/deliverables":{"post":{"operationId":"post_workspaces_slug_projects_id_deliverables","summary":"Create a deliverable","description":"Adds a deliverable (`name`) to the project. A project of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name"]}}}},"responses":{"201":{"description":"Create a deliverable","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"completed":{"type":"boolean"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","completed","order","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/deliverables/{id}":{"patch":{"operationId":"patch_workspaces_slug_deliverables_id","summary":"Update a deliverable","description":"Partial update: `name` and `completed` (true completes it, false reopens it). A deliverable of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"completed":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Update a deliverable","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"completed":{"type":"boolean"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","name","completed","order","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_deliverables_id","summary":"Delete a deliverable","description":"Deletes the deliverable. A deliverable of another workspace, or one already deleted, is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a deliverable","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/{id}/links":{"get":{"operationId":"get_workspaces_slug_projects_id_links","summary":"List a project's links","description":"Where the project lives — its site, app, login, dashboards, hosting panel — in order (not paginated). A project of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:read"]}],"x-rokn-scope":"projects:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List a project's links","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"links":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","label","url","position","createdAt","updatedAt"],"additionalProperties":false}}},"required":["links"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"put":{"operationId":"put_workspaces_slug_projects_id_links","summary":"Replace a project's links","description":"Replaces the whole list with `links`, in the given order: at most 30, each a `label` of 1–60 characters and an absolute http(s) `url` with no username or password (stored normalized). An empty list removes them all. A project of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:write"]}],"x-rokn-scope":"projects:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"links":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"url":{"type":"string"}},"required":["label","url"],"additionalProperties":false}}},"required":["links"],"additionalProperties":false}}}},"responses":{"200":{"description":"Replace a project's links","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"links":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","label","url","position","createdAt","updatedAt"],"additionalProperties":false}}},"required":["links"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/projects/{id}/repositories":{"get":{"operationId":"get_workspaces_slug_projects_id_repositories","summary":"List a project's repositories","description":"The code-host repositories attached to the project, by name, each with its last stored snapshot: CI on the default branch, the latest deployment, open issue and pull request counts, the last push. Snapshots refresh from the host's webhooks and every 30 minutes; `paused` means the account is suspended on the host and the snapshot is not refreshing. Not paginated. A project of another workspace is 404.","tags":["Projects"],"security":[{"apiKey":[]},{"oauth2":["projects:read"]}],"x-rokn-scope":"projects:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List a project's repositories","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"repositories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github"]},"fullName":{"type":"string"},"htmlUrl":{"type":"string"},"paused":{"type":"boolean"},"openIssues":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"openPullRequests":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastPushedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"pipeline":{"type":"object","properties":{"state":{"type":"string","enum":["passing","failing","running","none"]},"url":{"type":["string","null"]},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["state","url","at"],"additionalProperties":false},"deployment":{"type":"object","properties":{"state":{"type":"string","enum":["succeeded","failed","in_progress","none"]},"environment":{"type":["string","null"]},"url":{"type":["string","null"]},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["state","environment","url","at"],"additionalProperties":false},"snapshotRefreshedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","provider","fullName","htmlUrl","paused","openIssues","openPullRequests","lastPushedAt","pipeline","deployment","snapshotRefreshedAt"],"additionalProperties":false}}},"required":["repositories"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/code-hosts/connections":{"get":{"operationId":"get_workspaces_slug_code-hosts_connections","summary":"List connected code-host accounts","description":"The code-host accounts (a person's or an organization's) connected to the workspace, oldest first, with how many of their repositories projects hold. Connecting and disconnecting happen in Settings → Code hosting. Not paginated.","tags":["Code hosts"],"security":[{"apiKey":[]},{"oauth2":["code_hosts:read"]}],"x-rokn-scope":"code_hosts:read","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"List connected code-host accounts","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["github"]},"login":{"type":"string"},"type":{"type":"string","enum":["user","organization"]},"status":{"type":"string","enum":["active","suspended"]},"repoCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","provider","login","type","status","repoCount","createdAt"],"additionalProperties":false}}},"required":["connections"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tasks/{id}/subtasks":{"post":{"operationId":"post_workspaces_slug_tasks_id_subtasks","summary":"Create a subtask","description":"Adds a subtask (`title`) after the task's last one. A task of another workspace is 404.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"order":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["title"]}}}},"responses":{"201":{"description":"Create a subtask","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string"},"title":{"type":"string"},"completed":{"type":"boolean"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","taskId","title","completed","order","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/subtasks/{id}":{"patch":{"operationId":"patch_workspaces_slug_subtasks_id","summary":"Update a subtask","description":"Partial update: `title` and `completed` (true checks it off, false reopens it). A subtask of another workspace is 404.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"completed":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Update a subtask","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string"},"title":{"type":"string"},"completed":{"type":"boolean"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","taskId","title","completed","order","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"delete":{"operationId":"delete_workspaces_slug_subtasks_id","summary":"Delete a subtask","description":"Deletes the subtask. A subtask of another workspace, or one already deleted, is 404.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"204":{"description":"Delete a subtask","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/tasks/{id}/dependencies":{"post":{"operationId":"post_workspaces_slug_tasks_id_dependencies","summary":"Add a task dependency","description":"Marks the task as blocked by `blockingTaskId` (optional `note`). The same pair already unresolved returns that existing dependency. A task blocking itself is 409 `dependency_self`; a dependency that would make tasks wait on each other, directly or through others, is 409 `dependency_cycle`. A task of another workspace, on either side, is 404.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"blockingTaskId":{"type":"string","minLength":1},"note":{"type":"string","maxLength":500}},"required":["blockingTaskId"],"additionalProperties":false}}}},"responses":{"201":{"description":"Add a task dependency","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string","description":"The task that cannot proceed."},"blockingTaskId":{"description":"The task that must finish first; null when an asset blocks it.","type":["string","null"]},"blockingAssetId":{"type":["string","null"]},"note":{"type":["string","null"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"null while the blocker is in force."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","taskId","blockingTaskId","blockingAssetId","note","resolvedAt","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/dependencies/{id}/resolve":{"post":{"operationId":"post_workspaces_slug_dependencies_id_resolve","summary":"Resolve a task dependency","description":"Clears a blocker (it stays as history, with `resolvedAt`). Resolving an already-resolved dependency returns it unchanged. A dependency of another workspace is 404.","tags":["Tasks"],"security":[{"apiKey":[]},{"oauth2":["tasks:write"]}],"x-rokn-scope":"tasks:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Resolve a task dependency","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string","description":"The task that cannot proceed."},"blockingTaskId":{"description":"The task that must finish first; null when an asset blocks it.","type":["string","null"]},"blockingAssetId":{"type":["string","null"]},"note":{"type":["string","null"]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"null while the blocker is in force."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","taskId","blockingTaskId","blockingAssetId","note","resolvedAt","createdAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/services/{id}":{"patch":{"operationId":"patch_workspaces_slug_services_id","summary":"Update a service","description":"Partial update; `null` clears `description` or `categoryId`. A change of `rateCents` or `pricingType` closes the current rate in the history and opens a new one (issued invoices keep the rate they were issued at). `active: false` archives the service (it leaves the catalogue; there is no delete), `active: true` restores it. Another workspace's service or category is 404.","tags":["Services"],"security":[{"apiKey":[]},{"oauth2":["services:write"]}],"x-rokn-scope":"services:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"categoryId":{"type":["string","null"]},"pricingType":{"type":"string","enum":["hourly","fixed"]},"rateCents":{"type":"integer","minimum":1,"maximum":9007199254740991},"currency":{"type":"string"},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Update a service","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"categoryId":{"type":["string","null"]},"pricingType":{"type":"string","enum":["hourly","fixed"]},"rate":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","categoryId","pricingType","rate","active","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/packages":{"post":{"operationId":"post_workspaces_slug_packages","summary":"Create a package","description":"Bundles services at one price: `name`, `priceCents` in the workspace currency, and `items`, one `{ serviceId, quantity }` per service (at least one, each service once). A service of another workspace is 404 and nothing is created; a `currency` other than the workspace's is 409 `currency_mismatch`.","tags":["Services"],"security":[{"apiKey":[]},{"oauth2":["services:write"]}],"x-rokn-scope":"services:write","x-rokn-idempotent":true,"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":255},"description":"A caller-chosen key (1-255 chars). Optional; a replay with the same key and body returns the stored response without repeating the mutation."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"priceCents":{"type":"integer","minimum":1,"maximum":9007199254740991},"currency":{"type":"string"},"active":{"default":true,"type":"boolean"},"items":{"minItems":1,"type":"array","items":{"type":"object","properties":{"serviceId":{"type":"string"},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["serviceId","quantity"]}}},"required":["name","priceCents","items"]}}}},"responses":{"201":{"description":"Create a package","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"active":{"type":"boolean"},"services":{"type":"array","items":{"type":"object","properties":{"serviceId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["serviceId","name","quantity"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","price","active","services","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/workspaces/{slug}/packages/{id}":{"patch":{"operationId":"patch_workspaces_slug_packages_id","summary":"Update a package","description":"Partial update; `null` clears `description`. `items`, when sent, REPLACES the package's lines (send every service the package keeps, with its quantity); leave it out to keep them. `active: false` archives the package (there is no delete). Another workspace's package or service is 404.","tags":["Services"],"security":[{"apiKey":[]},{"oauth2":["services:write"]}],"x-rokn-scope":"services:write","parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true},{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"priceCents":{"type":"integer","minimum":1,"maximum":9007199254740991},"currency":{"type":"string"},"active":{"type":"boolean"},"items":{"minItems":1,"type":"array","items":{"type":"object","properties":{"serviceId":{"type":"string"},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["serviceId","quantity"]}}}}}}},"responses":{"200":{"description":"Update a package","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amountCents","currency"],"additionalProperties":false},"active":{"type":"boolean"},"services":{"type":"array","items":{"type":"object","properties":{"serviceId":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["serviceId","name","quantity"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","price","active","services","createdAt","updatedAt"],"additionalProperties":false}}}},"401":{"description":"Missing, expired, or otherwise invalid bearer credential.","content":{"application/json":{"example":{"type":"/developers/errors#invalid_token","title":"Missing, expired, or otherwise invalid bearer credential.","status":401,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"The credential does not carry the scope this operation requires.","content":{"application/json":{"example":{"type":"/developers/errors#insufficient_scope","title":"The credential does not carry the scope this operation requires.","status":403,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not found — including a row that exists, but in another workspace.","content":{"application/json":{"example":{"type":"/developers/errors#not_found","title":"Not found — including a row that exists, but in another workspace.","status":404,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Conflict with the resource's current state (for example, a non-draft invoice).","content":{"application/json":{"example":{"type":"/developers/errors#conflict","title":"Conflict with the resource's current state (for example, a non-draft invoice).","status":409,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"`If-Match` does not match the resource's current `ETag`; the write did not run.","content":{"application/json":{"example":{"type":"/developers/errors#precondition_failed","title":"`If-Match` does not match the resource's current `ETag`; the write did not run.","status":412,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"The request body or query string failed validation.","content":{"application/json":{"example":{"type":"/developers/errors#validation_failed","title":"The request body or query string failed validation.","status":422,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","headers":{"X-RateLimit-Limit":{"required":true,"description":"The credential's per-minute request budget, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitLimitHeader"}},"X-RateLimit-Remaining":{"required":true,"description":"Requests left in the current one-minute window, or `-1` for unlimited.","schema":{"$ref":"#/components/schemas/RateLimitRemainingHeader"}},"X-RateLimit-Reset":{"required":true,"description":"Unix seconds when the current window resets.","schema":{"$ref":"#/components/schemas/RateLimitResetHeader"}},"Retry-After":{"required":true,"description":"Seconds until the caller may retry — only present once the window is exhausted.","schema":{"type":"string","description":"Seconds until the caller may retry — only present once the window is exhausted."}}},"content":{"application/json":{"example":{"type":"/developers/errors#rate_limited","title":"Rate limited. See the `X-RateLimit-*` and `Retry-After` headers.","status":429,"requestId":"01jexampleexampleexamplex"},"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"webhooks":{"invoice.paid":{"post":{"summary":"invoice.paid delivery","description":"Posted to every active endpoint subscribed to `invoice.paid`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"invoice.paid"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"invoiceId":{"type":"string","minLength":1,"maxLength":200},"invoiceNumber":{"type":"string","minLength":1,"maxLength":240},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"amountPaidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["invoiceId","invoiceNumber","clientId","amountPaidCents","totalCents","currency"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"payment.refunded":{"post":{"summary":"payment.refunded delivery","description":"Posted to every active endpoint subscribed to `payment.refunded`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"payment.refunded"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"refundId":{"type":"string","minLength":1,"maxLength":200},"paymentId":{"type":"string","minLength":1,"maxLength":200},"invoiceId":{"type":"string","minLength":1,"maxLength":200},"amountCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"providerRefundId":{"type":"string","minLength":1,"maxLength":200}},"required":["refundId","paymentId","invoiceId","amountCents","currency","providerRefundId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"payment.disputed":{"post":{"summary":"payment.disputed delivery","description":"Posted to every active endpoint subscribed to `payment.disputed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"payment.disputed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"paymentId":{"type":"string","minLength":1,"maxLength":200},"invoiceId":{"type":"string","minLength":1,"maxLength":200},"amountCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"providerDisputeId":{"type":"string","minLength":1,"maxLength":200}},"required":["paymentId","invoiceId","amountCents","currency","providerDisputeId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"payment.dispute_reversed":{"post":{"summary":"payment.dispute_reversed delivery","description":"Posted to every active endpoint subscribed to `payment.dispute_reversed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"payment.dispute_reversed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"paymentId":{"type":"string","minLength":1,"maxLength":200},"invoiceId":{"type":"string","minLength":1,"maxLength":200},"amountCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"providerDisputeId":{"type":"string","minLength":1,"maxLength":200}},"required":["paymentId","invoiceId","amountCents","currency","providerDisputeId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"invoice.overdue":{"post":{"summary":"invoice.overdue delivery","description":"Posted to every active endpoint subscribed to `invoice.overdue`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"invoice.overdue"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"invoiceId":{"type":"string","minLength":1,"maxLength":200},"invoiceNumber":{"type":"string","minLength":1,"maxLength":240},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"dueDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["invoiceId","invoiceNumber","clientId","dueDate"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"invoice.reminder_blocked":{"post":{"summary":"invoice.reminder_blocked delivery","description":"Posted to every active endpoint subscribed to `invoice.reminder_blocked`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"invoice.reminder_blocked"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"invoiceId":{"type":"string","minLength":1,"maxLength":200},"invoiceNumber":{"type":"string","minLength":1,"maxLength":240},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":120}},"required":["invoiceId","invoiceNumber","clientId","reason"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"invoice.auto_send_failed":{"post":{"summary":"invoice.auto_send_failed delivery","description":"Posted to every active endpoint subscribed to `invoice.auto_send_failed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"invoice.auto_send_failed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"invoiceId":{"type":"string","minLength":1,"maxLength":200},"invoiceNumber":{"anyOf":[{"type":"string","minLength":1,"maxLength":240},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"clientName":{"anyOf":[{"type":"string","minLength":1,"maxLength":240},{"type":"null"}]},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"reason":{"type":"string","minLength":1,"maxLength":120}},"required":["invoiceId","invoiceNumber","clientId","clientName","totalCents","currency","reason"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"invoice.recurring_notice_due":{"post":{"summary":"invoice.recurring_notice_due delivery","description":"Posted to every active endpoint subscribed to `invoice.recurring_notice_due`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"invoice.recurring_notice_due"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"invoiceId":{"type":"string","minLength":1,"maxLength":200},"invoiceNumber":{"type":"string","minLength":1,"maxLength":240},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"nextRunAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"noticeMonths":{"type":"integer","minimum":1,"maximum":12}},"required":["invoiceId","invoiceNumber","clientId","nextRunAt","noticeMonths"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"ticket.created":{"post":{"summary":"ticket.created delivery","description":"Posted to every active endpoint subscribed to `ticket.created`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"ticket.created"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"ticketId":{"type":"string","minLength":1,"maxLength":200},"clientId":{"type":"string","minLength":1,"maxLength":200},"projectId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"subject":{"type":"string","minLength":1,"maxLength":240},"type":{"type":"string","minLength":1,"maxLength":80},"priority":{"type":"string","minLength":1,"maxLength":80},"origin":{"type":"string","enum":["portal","staff","email","api"]}},"required":["ticketId","clientId","projectId","subject","type","priority","origin"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"asset.expiring":{"post":{"summary":"asset.expiring delivery","description":"Posted to every active endpoint subscribed to `asset.expiring`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"asset.expiring"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"assetName":{"type":"string","minLength":1,"maxLength":240},"projectId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"expiryDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"thresholdDays":{"anyOf":[{"type":"number","const":30},{"type":"number","const":7}]}},"required":["assetId","assetName","projectId","expiryDate","thresholdDays"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"storage.quota.80":{"post":{"summary":"storage.quota.80 delivery","description":"Posted to every active endpoint subscribed to `storage.quota.80`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"storage.quota.80"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"usedBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":19,"pattern":"^(?:0|[1-9]\\d*)$"}]},"quotaBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":19,"pattern":"^(?:0|[1-9]\\d*)$"}]},"thresholdPercent":{"type":"number","const":80}},"required":["usedBytes","quotaBytes","thresholdPercent"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"storage.quota.100":{"post":{"summary":"storage.quota.100 delivery","description":"Posted to every active endpoint subscribed to `storage.quota.100`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"storage.quota.100"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"usedBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":19,"pattern":"^(?:0|[1-9]\\d*)$"}]},"quotaBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":19,"pattern":"^(?:0|[1-9]\\d*)$"}]},"thresholdPercent":{"type":"number","const":100}},"required":["usedBytes","quotaBytes","thresholdPercent"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"domain.expiring.30d":{"post":{"summary":"domain.expiring.30d delivery","description":"Posted to every active endpoint subscribed to `domain.expiring.30d`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"domain.expiring.30d"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"monitorId":{"type":"string","minLength":1,"maxLength":200},"hostname":{"type":"string","minLength":1,"maxLength":240},"expiryDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"thresholdDays":{"type":"number","const":30}},"required":["assetId","monitorId","hostname","expiryDate","thresholdDays"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"domain.expiring.7d":{"post":{"summary":"domain.expiring.7d delivery","description":"Posted to every active endpoint subscribed to `domain.expiring.7d`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"domain.expiring.7d"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"monitorId":{"type":"string","minLength":1,"maxLength":200},"hostname":{"type":"string","minLength":1,"maxLength":240},"expiryDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"thresholdDays":{"type":"number","const":7}},"required":["assetId","monitorId","hostname","expiryDate","thresholdDays"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"domain.expiry_changed":{"post":{"summary":"domain.expiry_changed delivery","description":"Posted to every active endpoint subscribed to `domain.expiry_changed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"domain.expiry_changed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"monitorId":{"type":"string","minLength":1,"maxLength":200},"hostname":{"type":"string","minLength":1,"maxLength":240},"previousExpiryDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiryDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["assetId","monitorId","hostname","previousExpiryDate","expiryDate"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"ssl.expiring.30d":{"post":{"summary":"ssl.expiring.30d delivery","description":"Posted to every active endpoint subscribed to `ssl.expiring.30d`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"ssl.expiring.30d"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"monitorId":{"type":"string","minLength":1,"maxLength":200},"hostname":{"type":"string","minLength":1,"maxLength":240},"validTo":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"thresholdDays":{"type":"number","const":30}},"required":["assetId","monitorId","hostname","validTo","thresholdDays"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"ssl.expiring.7d":{"post":{"summary":"ssl.expiring.7d delivery","description":"Posted to every active endpoint subscribed to `ssl.expiring.7d`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"ssl.expiring.7d"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"monitorId":{"type":"string","minLength":1,"maxLength":200},"hostname":{"type":"string","minLength":1,"maxLength":240},"validTo":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"thresholdDays":{"type":"number","const":7}},"required":["assetId","monitorId","hostname","validTo","thresholdDays"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"ssl.invalid":{"post":{"summary":"ssl.invalid delivery","description":"Posted to every active endpoint subscribed to `ssl.invalid`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"ssl.invalid"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"monitorId":{"type":"string","minLength":1,"maxLength":200},"hostname":{"type":"string","minLength":1,"maxLength":240},"validTo":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":120}},"required":["assetId","monitorId","hostname","validTo","reason"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"monitor.check_failed":{"post":{"summary":"monitor.check_failed delivery","description":"Posted to every active endpoint subscribed to `monitor.check_failed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"monitor.check_failed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"monitorId":{"type":"string","minLength":1,"maxLength":200},"hostname":{"type":"string","minLength":1,"maxLength":240},"consecutiveFailures":{"type":"integer","minimum":3,"maximum":20},"errorCode":{"type":"string","minLength":1,"maxLength":120}},"required":["assetId","monitorId","hostname","consecutiveFailures","errorCode"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"task.assigned":{"post":{"summary":"task.assigned delivery","description":"Posted to every active endpoint subscribed to `task.assigned`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"task.assigned"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"taskId":{"type":"string","minLength":1,"maxLength":200},"taskTitle":{"type":"string","minLength":1,"maxLength":240},"projectId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"leadId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"assignedUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["taskId","taskTitle","projectId","assignedUserId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"task.status_changed":{"post":{"summary":"task.status_changed delivery","description":"Posted to every active endpoint subscribed to `task.status_changed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"task.status_changed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"taskId":{"type":"string","minLength":1,"maxLength":200},"taskTitle":{"type":"string","minLength":1,"maxLength":240},"projectId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"leadId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"previousStatus":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":240},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":240},"class":{"type":"string","enum":["todo","in_progress","done"]}},"required":["id","name","class"],"additionalProperties":false},"assignedUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["taskId","taskTitle","projectId","previousStatus","status","assignedUserId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"project.status_changed":{"post":{"summary":"project.status_changed delivery","description":"Posted to every active endpoint subscribed to `project.status_changed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"project.status_changed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"projectId":{"type":"string","minLength":1,"maxLength":200},"projectName":{"type":"string","minLength":1,"maxLength":240},"previousStatus":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":240},"class":{"type":"string","enum":["draft","active","paused","done","cancelled"]}},"required":["id","name","class"],"additionalProperties":false},{"type":"null"}]},"status":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":240},"class":{"type":"string","enum":["draft","active","paused","done","cancelled"]}},"required":["id","name","class"],"additionalProperties":false}},"required":["projectId","projectName","previousStatus","status"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"retainer.depleted":{"post":{"summary":"retainer.depleted delivery","description":"Posted to every active endpoint subscribed to `retainer.depleted`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"retainer.depleted"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"retainerId":{"type":"string","minLength":1,"maxLength":200},"clientId":{"type":"string","minLength":1,"maxLength":200},"remainingCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"periodStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"periodEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["retainerId","clientId","remainingCents","periodStart","periodEnd"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"subscription.payment_failed":{"post":{"summary":"subscription.payment_failed delivery","description":"Posted to every active endpoint subscribed to `subscription.payment_failed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"subscription.payment_failed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"subscriptionId":{"type":"string","minLength":1,"maxLength":200},"stripeInvoiceId":{"type":"string","minLength":1,"maxLength":200},"episodeId":{"type":"string","minLength":1,"maxLength":200},"graceEndsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["subscriptionId","stripeInvoiceId","episodeId","graceEndsAt"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"subscription.grace_ending":{"post":{"summary":"subscription.grace_ending delivery","description":"Posted to every active endpoint subscribed to `subscription.grace_ending`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"subscription.grace_ending"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"subscriptionId":{"type":"string","minLength":1,"maxLength":200},"stripeInvoiceId":{"type":"string","minLength":1,"maxLength":200},"episodeId":{"type":"string","minLength":1,"maxLength":200},"graceEndsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"daysRemaining":{"anyOf":[{"type":"number","const":4},{"type":"number","const":1}]}},"required":["subscriptionId","stripeInvoiceId","episodeId","graceEndsAt","daysRemaining"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"subscription.billing_restricted":{"post":{"summary":"subscription.billing_restricted delivery","description":"Posted to every active endpoint subscribed to `subscription.billing_restricted`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"subscription.billing_restricted"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"subscriptionId":{"type":"string","minLength":1,"maxLength":200},"stripeInvoiceId":{"type":"string","minLength":1,"maxLength":200},"episodeId":{"type":"string","minLength":1,"maxLength":200},"graceEndsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["subscriptionId","stripeInvoiceId","episodeId","graceEndsAt"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"subscription.payment_recovered":{"post":{"summary":"subscription.payment_recovered delivery","description":"Posted to every active endpoint subscribed to `subscription.payment_recovered`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"subscription.payment_recovered"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"subscriptionId":{"type":"string","minLength":1,"maxLength":200},"stripeInvoiceId":{"type":"string","minLength":1,"maxLength":200},"episodeId":{"type":"string","minLength":1,"maxLength":200}},"required":["subscriptionId","stripeInvoiceId","episodeId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"quote.approved":{"post":{"summary":"quote.approved delivery","description":"Posted to every active endpoint subscribed to `quote.approved`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"quote.approved"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"quoteId":{"type":"string","minLength":1,"maxLength":200},"quoteNumber":{"type":"string","minLength":1,"maxLength":240},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"signed":{"type":"boolean"}},"required":["quoteId","quoteNumber","clientId","totalCents","currency","signed"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"quote.rejected":{"post":{"summary":"quote.rejected delivery","description":"Posted to every active endpoint subscribed to `quote.rejected`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"quote.rejected"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"quoteId":{"type":"string","minLength":1,"maxLength":200},"quoteNumber":{"type":"string","minLength":1,"maxLength":240},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["quoteId","quoteNumber","clientId","totalCents","currency"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"asset.renewal_approved":{"post":{"summary":"asset.renewal_approved delivery","description":"Posted to every active endpoint subscribed to `asset.renewal_approved`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"asset.renewal_approved"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"assetId":{"type":"string","minLength":1,"maxLength":200},"assetName":{"type":"string","minLength":1,"maxLength":240},"clientId":{"type":"string","minLength":1,"maxLength":200},"expiryDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["assetId","assetName","clientId","expiryDate"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"ticket.sla_at_risk":{"post":{"summary":"ticket.sla_at_risk delivery","description":"Posted to every active endpoint subscribed to `ticket.sla_at_risk`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"ticket.sla_at_risk"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"ticketId":{"type":"string","minLength":1,"maxLength":200},"ticketNumber":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"clientId":{"type":"string","minLength":1,"maxLength":200},"obligation":{"type":"string","enum":["first_response","resolution"]},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["ticketId","ticketNumber","clientId","obligation","dueAt"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"ticket.sla_breached":{"post":{"summary":"ticket.sla_breached delivery","description":"Posted to every active endpoint subscribed to `ticket.sla_breached`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"ticket.sla_breached"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"ticketId":{"type":"string","minLength":1,"maxLength":200},"ticketNumber":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"clientId":{"type":"string","minLength":1,"maxLength":200},"obligation":{"type":"string","enum":["first_response","resolution"]},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["ticketId","ticketNumber","clientId","obligation","dueAt"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"contract.artifact_ready":{"post":{"summary":"contract.artifact_ready delivery","description":"Posted to every active endpoint subscribed to `contract.artifact_ready`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"contract.artifact_ready"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"contractId":{"type":"string","minLength":1,"maxLength":200},"requestId":{"type":"string","minLength":1,"maxLength":200},"documentId":{"type":"string","minLength":1,"maxLength":200}},"required":["contractId","requestId","documentId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"contract.request_declined":{"post":{"summary":"contract.request_declined delivery","description":"Posted to every active endpoint subscribed to `contract.request_declined`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"contract.request_declined"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"contractId":{"type":"string","minLength":1,"maxLength":200},"requestId":{"type":"string","minLength":1,"maxLength":200},"documentId":{"type":"string","minLength":1,"maxLength":200},"signerId":{"type":"string","minLength":1,"maxLength":200}},"required":["contractId","requestId","documentId","signerId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"contract.delivery_failed":{"post":{"summary":"contract.delivery_failed delivery","description":"Posted to every active endpoint subscribed to `contract.delivery_failed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"contract.delivery_failed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"contractId":{"type":"string","minLength":1,"maxLength":200},"requestId":{"type":"string","minLength":1,"maxLength":200},"documentId":{"type":"string","minLength":1,"maxLength":200},"signerId":{"type":"string","minLength":1,"maxLength":200},"failureCode":{"type":"string","minLength":1,"maxLength":120}},"required":["contractId","requestId","documentId","failureCode"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"leave.requested":{"post":{"summary":"leave.requested delivery","description":"Posted to every active endpoint subscribed to `leave.requested`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"leave.requested"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"leaveId":{"type":"string","minLength":1,"maxLength":200},"userId":{"type":"string","minLength":1,"maxLength":200},"actorUserId":{"type":"string","minLength":1,"maxLength":200}},"required":["leaveId","userId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"leave.decided":{"post":{"summary":"leave.decided delivery","description":"Posted to every active endpoint subscribed to `leave.decided`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"leave.decided"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"leaveId":{"type":"string","minLength":1,"maxLength":200},"userId":{"type":"string","minLength":1,"maxLength":200},"decision":{"type":"string","enum":["approved","rejected"]},"actorUserId":{"type":"string","minLength":1,"maxLength":200}},"required":["leaveId","userId","decision"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"document.signed":{"post":{"summary":"document.signed delivery","description":"Posted to every active endpoint subscribed to `document.signed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"document.signed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"documentId":{"type":"string","minLength":1,"maxLength":200},"workflowId":{"type":"string","minLength":1,"maxLength":200},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["documentId","workflowId","clientId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"document.declined":{"post":{"summary":"document.declined delivery","description":"Posted to every active endpoint subscribed to `document.declined`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"document.declined"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"documentId":{"type":"string","minLength":1,"maxLength":200},"workflowId":{"type":"string","minLength":1,"maxLength":200},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["documentId","workflowId","clientId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"document.expired":{"post":{"summary":"document.expired delivery","description":"Posted to every active endpoint subscribed to `document.expired`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"document.expired"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"documentId":{"type":"string","minLength":1,"maxLength":200},"workflowId":{"type":"string","minLength":1,"maxLength":200},"clientId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["documentId","workflowId","clientId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"appointment.reminder":{"post":{"summary":"appointment.reminder delivery","description":"Posted to every active endpoint subscribed to `appointment.reminder`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"appointment.reminder"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"calendarEventId":{"type":"string","minLength":1,"maxLength":200},"userId":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":240},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"localTime":{"type":"string","pattern":"^\\d{2}:\\d{2}$"}},"required":["calendarEventId","userId","title","startTime","localTime"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"time.reminder":{"post":{"summary":"time.reminder delivery","description":"Posted to every active endpoint subscribed to `time.reminder`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"time.reminder"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":200},"localDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["userId","localDate"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"booking.cancelled":{"post":{"summary":"booking.cancelled delivery","description":"Posted to every active endpoint subscribed to `booking.cancelled`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"booking.cancelled"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"bookingLinkId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"bookerName":{"type":"string","minLength":1,"maxLength":240},"startTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"timeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["userId","bookingLinkId","bookerName","startTime","timeZone"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"calendar.connection_lost":{"post":{"summary":"calendar.connection_lost delivery","description":"Posted to every active endpoint subscribed to `calendar.connection_lost`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"calendar.connection_lost"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1,"maxLength":200},"userId":{"type":"string","minLength":1,"maxLength":200},"provider":{"type":"string","enum":["google","microsoft"]}},"required":["connectionId","userId","provider"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"upload.infected":{"post":{"summary":"upload.infected delivery","description":"Posted to every active endpoint subscribed to `upload.infected`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"upload.infected"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"storageObjectId":{"type":"string","minLength":1,"maxLength":200},"fileName":{"type":"string","minLength":1,"maxLength":200},"documentId":{"type":"string","minLength":1,"maxLength":200},"ticketId":{"type":"string","minLength":1,"maxLength":200},"uploaderUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["storageObjectId","fileName","uploaderUserId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"upload.unscannable":{"post":{"summary":"upload.unscannable delivery","description":"Posted to every active endpoint subscribed to `upload.unscannable`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"upload.unscannable"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"storageObjectId":{"type":"string","minLength":1,"maxLength":200},"fileName":{"type":"string","minLength":1,"maxLength":200},"documentId":{"type":"string","minLength":1,"maxLength":200},"ticketId":{"type":"string","minLength":1,"maxLength":200},"uploaderUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["storageObjectId","fileName","uploaderUserId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"invoice.send_failed":{"post":{"summary":"invoice.send_failed delivery","description":"Posted to every active endpoint subscribed to `invoice.send_failed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"invoice.send_failed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"invoiceId":{"type":"string","minLength":1,"maxLength":200},"invoiceNumber":{"anyOf":[{"type":"string","minLength":1,"maxLength":240},{"type":"null"}]},"clientName":{"anyOf":[{"type":"string","minLength":1,"maxLength":240},{"type":"null"}]},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"reason":{"type":"string","minLength":1,"maxLength":120},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["invoiceId","invoiceNumber","clientName","totalCents","currency","reason","userId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"quote.send_failed":{"post":{"summary":"quote.send_failed delivery","description":"Posted to every active endpoint subscribed to `quote.send_failed`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"quote.send_failed"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"quoteId":{"type":"string","minLength":1,"maxLength":200},"quoteNumber":{"type":"string","minLength":1,"maxLength":240},"reason":{"type":"string","minLength":1,"maxLength":120},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["quoteId","quoteNumber","reason","userId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"code_host.connection_lost":{"post":{"summary":"code_host.connection_lost delivery","description":"Posted to every active endpoint subscribed to `code_host.connection_lost`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"code_host.connection_lost"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"codeHostConnectionId":{"type":"string","minLength":1,"maxLength":200},"provider":{"type":"string","enum":["github"]},"accountLogin":{"type":"string","minLength":1,"maxLength":240},"reason":{"type":"string","enum":["removed","suspended"]}},"required":["codeHostConnectionId","provider","accountLogin","reason"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"field_reminder.due":{"post":{"summary":"field_reminder.due delivery","description":"Posted to every active endpoint subscribed to `field_reminder.due`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"field_reminder.due"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"recordType":{"type":"string","const":"lead"},"recordId":{"type":"string","minLength":1,"maxLength":200},"fieldId":{"type":"string","minLength":1,"maxLength":200},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"valueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"offsetMinutes":{"type":"integer","minimum":0,"maximum":525600}},"required":["recordType","recordId","fieldId","fieldKey","dueAt","valueAt","offsetMinutes"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"client_field_reminder.due":{"post":{"summary":"client_field_reminder.due delivery","description":"Posted to every active endpoint subscribed to `client_field_reminder.due`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"client_field_reminder.due"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"recordType":{"type":"string","enum":["client","contact"]},"recordId":{"type":"string","minLength":1,"maxLength":200},"fieldId":{"type":"string","minLength":1,"maxLength":200},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"valueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"offsetMinutes":{"type":"integer","minimum":0,"maximum":525600}},"required":["recordType","recordId","fieldId","fieldKey","dueAt","valueAt","offsetMinutes"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"project_field_reminder.due":{"post":{"summary":"project_field_reminder.due delivery","description":"Posted to every active endpoint subscribed to `project_field_reminder.due`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"project_field_reminder.due"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"recordType":{"type":"string","const":"project"},"recordId":{"type":"string","minLength":1,"maxLength":200},"fieldId":{"type":"string","minLength":1,"maxLength":200},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"valueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"offsetMinutes":{"type":"integer","minimum":0,"maximum":525600}},"required":["recordType","recordId","fieldId","fieldKey","dueAt","valueAt","offsetMinutes"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"task_field_reminder.due":{"post":{"summary":"task_field_reminder.due delivery","description":"Posted to every active endpoint subscribed to `task_field_reminder.due`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"task_field_reminder.due"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"recordType":{"type":"string","const":"task"},"recordId":{"type":"string","minLength":1,"maxLength":200},"fieldId":{"type":"string","minLength":1,"maxLength":200},"fieldKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"valueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"offsetMinutes":{"type":"integer","minimum":0,"maximum":525600}},"required":["recordType","recordId","fieldId","fieldKey","dueAt","valueAt","offsetMinutes"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"lead_entry.created":{"post":{"summary":"lead_entry.created delivery","description":"Posted to every active endpoint subscribed to `lead_entry.created`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"lead_entry.created"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"entryId":{"type":"string","minLength":1,"maxLength":200},"leadId":{"type":"string","minLength":1,"maxLength":200},"entryTypeId":{"type":"string","minLength":1,"maxLength":200},"entryTypeKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"}},"required":["entryId","leadId","entryTypeId","entryTypeKey"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"lead.converted":{"post":{"summary":"lead.converted delivery","description":"Posted to every active endpoint subscribed to `lead.converted`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"lead.converted"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"leadId":{"type":"string","minLength":1,"maxLength":200},"pipelineId":{"type":"string","minLength":1,"maxLength":200},"statusKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"clientId":{"type":"string","minLength":1,"maxLength":200},"clientCreated":{"type":"boolean"},"projectId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"contractDocumentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"recurringInvoiceId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["leadId","pipelineId","statusKey","clientId","clientCreated","projectId","contractDocumentId","recurringInvoiceId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"lead.stalled":{"post":{"summary":"lead.stalled delivery","description":"Posted to every active endpoint subscribed to `lead.stalled`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"lead.stalled"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"leadId":{"type":"string","minLength":1,"maxLength":200},"pipelineId":{"type":"string","minLength":1,"maxLength":200},"statusKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"stalledAfterDays":{"type":"integer","minimum":1,"maximum":365}},"required":["leadId","pipelineId","statusKey","stalledAfterDays"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"lead.updated":{"post":{"summary":"lead.updated delivery","description":"Posted to every active endpoint subscribed to `lead.updated`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"lead.updated"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"leadId":{"type":"string","minLength":1,"maxLength":200},"pipelineId":{"type":"string","minLength":1,"maxLength":200},"entryCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"tasksDoneCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["leadId","pipelineId","entryCount","tasksDoneCount","since","until"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}},"webhook_endpoint.disabled":{"post":{"summary":"webhook_endpoint.disabled delivery","description":"Posted to every active endpoint subscribed to `webhook_endpoint.disabled`, signed with that endpoint's own secret. A non-2xx, non-408/429 response permanently stops retries for this delivery.","tags":["Webhooks"],"parameters":[{"in":"header","name":"X-Rokn-Signature","schema":{"type":"string"},"description":"HMAC-SHA256 over the raw body: `t=<unix seconds>,v1=<hex hmac of \"<t>.<body>\" using the endpoint's own secret>` (Stripe-style; the timestamp is inside the signed material).","required":true},{"in":"header","name":"X-Rokn-Event","schema":{"type":"string"},"description":"The event name, duplicated from the body's own `name` field.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","const":"webhook_endpoint.disabled"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"organizationId":{"type":"string"},"payload":{"type":"object","properties":{"webhookEndpointId":{"type":"string","minLength":1,"maxLength":200},"userId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["webhookEndpointId","userId"],"additionalProperties":false}},"required":["id","name","occurredAt","organizationId","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Acknowledged."}}}}},"components":{"schemas":{"RateLimitLimitHeader":{"type":"string","description":"The credential's per-minute request budget, or `-1` for unlimited."},"RateLimitRemainingHeader":{"type":"string","description":"Requests left in the current one-minute window, or `-1` for unlimited."},"RateLimitResetHeader":{"type":"string","description":"Unix seconds when the current window resets."},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requestId":{"type":"string"},"detail":{"type":"string"},"reason":{"description":"On a 409 `conflict` refused for a named rule: that rule, snake_case (for example `delete_blocked_by_locked_records`).","type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["type","title","status","requestId"],"additionalProperties":false,"description":"RFC 7807 problem-details body every non-2xx response returns."},"ETagHeader":{"type":"string","description":"Weak ETag over `updatedAt`, `W/\"<epoch ms>\"` — pass back as `If-Match` to condition a write."}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"rk_live_…","description":"A workspace-scoped API key, minted under Settings -> API. Send as `Authorization: Bearer rk_live_...`."},"oauth2":{"type":"oauth2","description":"An OAuth 2.1 authorization-code + PKCE grant on behalf of a signed-in member. Send the RFC 8707 `resource` parameter on both the authorization and the token request, naming this API: `resource=<origin>/api/v1` for the REST API (`<origin>/api/mcp` for the MCP server; a token minted for MCP is accepted here too). A request with no `resource` receives an opaque token this API refuses.","flows":{"authorizationCode":{"authorizationUrl":"/api/auth/oauth2/authorize","tokenUrl":"/api/auth/oauth2/token","scopes":{"org.settings:read":"View your organization's settings","org.settings:write":"Change your organization's settings","org.team:read":"View your organization's team members","org.team:write":"Manage your organization's team members","org.roles:read":"See what each role can use in your workspace","org.roles:write":"Change what each role can use in your workspace","trash:read":"See deleted records in the recycle bin","trash:write":"Restore or permanently delete records in the recycle bin","clients:read":"See your clients and their contacts","clients:write":"Create, edit and remove clients","projects:read":"See your projects","projects:write":"Create, edit and remove projects","invoices:read":"See your invoices","invoices:write":"Create, edit and send invoices","quotes:read":"See your quotes","quotes:write":"Create, edit and send quotes","expenses:read":"See your expenses","expenses:write":"Create, edit and remove expenses","tasks:read":"See your tasks","tasks:write":"Create, edit and remove tasks","time_tracking:read":"See logged time","time_tracking:write":"Log and edit time entries","capacity:read":"See member schedules and workspace capacity settings","capacity:write":"Manage member schedules and workspace capacity settings","leave:read":"See leave requests","leave:write":"Request, approve and cancel leave","utilization:read":"See utilization reports","utilization:write":"Change utilization report settings","reports:read":"View financial and business reports","reports:write":"Change report settings","assets:read":"See your domains, subscriptions and other tracked assets","assets:write":"Create, edit and remove tracked assets","credentials:read":"See stored credentials (passwords are never exposed)","credentials:write":"Create, edit and remove stored credentials","documents:read":"See your documents","documents:write":"Create, edit and remove documents","contracts:read":"See your contracts","contracts:write":"Create, edit and remove contracts","leads:read":"See your sales leads","leads:write":"Create, edit and remove sales leads","communications:read":"See client communication history","communications:write":"Add and edit communication entries","calendar:read":"See your calendar events","calendar:write":"Create, edit and remove calendar events","tickets:read":"See support tickets","tickets:write":"Create, edit and remove support tickets","notifications:read":"See your notification preferences","notifications:write":"Change your notification preferences","api.keys:read":"See your API keys (secrets are never exposed)","api.keys:write":"Create and revoke API keys","audit:read":"See the workspace audit log","audit:write":"Change audit log settings","campaigns:read":"See your email campaigns","campaigns:write":"Create, edit and send email campaigns","services:read":"See your services and packages","services:write":"Create, edit and remove services and packages","templates:read":"See your document templates","templates:write":"Create, edit and remove document templates","webhooks:read":"See your configured webhooks","webhooks:write":"Create, edit and remove webhooks","code_hosts:read":"See the workspace's code-host connections","code_hosts:write":"Connect and disconnect code-host accounts","customization:read":"See and change the workspace's fields, statuses and pipelines","customization:write":"Change the workspace's fields, statuses and pipelines","mcp:tools":"Use Rokn's tools on your behalf"}}}}}}}