{"openapi":"3.1.0","info":{"title":"ARENF API","version":"1.0.0","description":"ARENF REST API. Workspace routes require an active membership; a foreign or unknown workspace answers 404. Writes require Idempotency-Key, PATCH requires If-Match."},"security":[{"bearer":[]}],"paths":{"/health/live":{"get":{"operationId":"healthLive","summary":"Liveness: the process is up (no dependency checked).","tags":["operations"],"parameters":[],"responses":{"200":{"description":"Alive.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/health/ready":{"get":{"operationId":"healthReady","summary":"Readiness: database reachable through the NON-privileged runtime role.","tags":["operations"],"parameters":[],"responses":{"200":{"description":"Ready.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/openapi.json":{"get":{"operationId":"getOpenApi","summary":"OpenAPI 3.1 document generated from the shared Zod contracts.","tags":["operations"],"parameters":[],"responses":{"200":{"description":"OpenAPI document.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/contacts":{"get":{"operationId":"listContacts","summary":"List contacts: search, filter, sort, group (collection view, ADR 0039); newest first by default.","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over email, firstName, lastName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: email (text): starts_with, eq, neq, contains; firstName (text): starts_with, eq, is_set, is_not_set; lastName (text): starts_with, eq, is_set, is_not_set; lifecycle (enum): in, nin — lead | subscriber | customer | inactive; list (ref): in, nin; source (text): eq, neq, starts_with; subscription (enum): in, nin — subscribed | unsubscribed; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: email, createdAt, updatedAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (lifecycle): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"query","in":"query","required":false,"description":"Legacy: case-insensitive prefix of the email address; prefer `q`.","schema":{"type":"string","minLength":1,"maxLength":320}},{"name":"listId","in":"query","required":false,"description":"Legacy: only contacts with a membership (any state) in this list; prefer filter list in [...].","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"segmentId","in":"query","required":false,"description":"Only contacts matching this saved segment, evaluated now within its budget (not combinable with q/filter/sort/group).","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of contacts with their lists and last activity, the total (an estimate on large audiences) and, when grouped, whole-collection group counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SEGMENT_BUDGET_EXCEEDED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","x-collection":{"resource":"contacts","fields":[{"key":"email","label":"Email","type":"text","sortable":true,"filterOperators":["starts_with","eq","neq","contains"],"groupable":false},{"key":"firstName","label":"First name","type":"text","sortable":false,"filterOperators":["starts_with","eq","is_set","is_not_set"],"groupable":false},{"key":"lastName","label":"Last name","type":"text","sortable":false,"filterOperators":["starts_with","eq","is_set","is_not_set"],"groupable":false},{"key":"lifecycle","label":"Lifecycle","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"lead","label":"Lead"},{"value":"subscriber","label":"Subscriber"},{"value":"customer","label":"Customer"},{"value":"inactive","label":"Inactive"}]},{"key":"list","label":"List","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"source","label":"Source","type":"text","sortable":false,"filterOperators":["eq","neq","starts_with"],"groupable":false},{"key":"subscription","label":"Subscription","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"subscribed","label":"Subscribed"},{"value":"unsubscribed","label":"Unsubscribed"}]},{"key":"createdAt","label":"Added","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last updated","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"customers","label":"Customers","filter":{"op":"and","conditions":[{"field":"lifecycle","operator":"in","value":["customer"]}]}},{"id":"leads","label":"Leads","filter":{"op":"and","conditions":[{"field":"lifecycle","operator":"in","value":["lead"]}]}},{"id":"subscribed","label":"Subscribed","filter":{"op":"and","conditions":[{"field":"subscription","operator":"in","value":["subscribed"]}]}},{"id":"unsubscribed","label":"Unsubscribed","filter":{"op":"and","conditions":[{"field":"subscription","operator":"in","value":["unsubscribed"]}]}},{"id":"unnamed","label":"Without a name","filter":{"op":"and","conditions":[{"field":"firstName","operator":"is_not_set"},{"field":"lastName","operator":"is_not_set"}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["email","firstName","lastName"],"mode":"prefix"}}},"post":{"operationId":"createContact","summary":"Create a contact with a normalized email identity.","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDENTITY_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactInput"}}}}}},"/v1/workspaces/{workspaceId}/contacts/{contactId}":{"get":{"operationId":"getContact","summary":"Read one contact.","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The contact.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"},"patch":{"operationId":"updateContact","summary":"Patch a contact's attributes (optimistic concurrency with If-Match).","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/lifecycle":{"get":{"operationId":"getCampaignLifecycle","summary":"Lifecycle summary: state, latest version/snapshot/preflight, approvals, schedule, message counts, allowed actions.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The lifecycle summary.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignLifecycle"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/audience-sources":{"get":{"operationId":"listAudienceSources","summary":"Lists and segments a campaign audience can include or exclude (S24).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Audience sources.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSourceList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/audience-estimate":{"post":{"operationId":"estimateAudience","summary":"Exact deduplicated size of an audience selection before its snapshot (distinct subscribed contacts, bounded).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The estimate.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceEstimate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateAudienceInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/audience-snapshot":{"post":{"operationId":"createAudienceSnapshot","summary":"Materialize the audience: union with dedupe, exclusions with reason counts, frozen members and hash (R019).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Snapshot recorded (built inline within a bounded budget, else by the job).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSnapshotAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SUPPRESSION_STORE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAudienceSnapshotInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/audience-snapshots/{snapshotId}":{"get":{"operationId":"getAudienceSnapshot","summary":"Read a snapshot's status and exclusion counts (statusUrl of the snapshot job).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"snapshotId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The snapshot.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceSnapshot"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/delivery-settings":{"get":{"operationId":"getDeliverySettings","summary":"Route, tracking, schedule strategy, quiet hours, frequency cap and budget of a campaign (S29).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The settings (revision 1 = defaults).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverySettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"patch":{"operationId":"updateDeliverySettings","summary":"Change delivery settings. Every field is material: an approval bound to the old values becomes stale.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverySettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: REGION_ROUTE_UNAVAILABLE, CAMPAIGN_STATE_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDeliverySettingsInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/preflight":{"post":{"operationId":"runPreflight","summary":"Content, sender readiness, audience freshness, entitlement/spend bound and route checks (Appendix C run_preflight).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The preflight report (recorded).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SNAPSHOT_NOT_READY, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunPreflightInput"}}}}}},"/v1/workspaces/{workspaceId}/test-recipients":{"get":{"operationId":"listTestRecipients","summary":"The workspace's test-send allowlist.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Allowlisted addresses.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRecipientList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.test"},"post":{"operationId":"createTestRecipient","summary":"Add an address to the test-send allowlist (workspace administrators).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Added.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRecipient"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTestRecipientInput"}}}}}},"/v1/workspaces/{workspaceId}/test-recipients/{testRecipientId}":{"delete":{"operationId":"deleteTestRecipient","summary":"Remove an address from the test-send allowlist.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"testRecipientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Removed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/test":{"post":{"operationId":"sendCampaignTest","summary":"Send a test of a version to explicit allowlisted addresses only (R026).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Queued (outbox campaign.test_send).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: TEST_RECIPIENT_NOT_ALLOWED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.test","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/test-sends":{"get":{"operationId":"listCampaignTestSends","summary":"Recent test sends of a campaign (latest 50).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Test sends.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSendList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/approval-requests":{"post":{"operationId":"requestCampaignApproval","summary":"Freeze the version and request approval of exact content, audience, route policy and spend ceiling.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Approval requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PREFLIGHT_STALE, AUDIENCE_CHANGED, CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestApprovalInput"}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}":{"get":{"operationId":"getApproval","summary":"Read an approval and the exact state it binds.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"approvalId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The approval.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/approve":{"post":{"operationId":"approveCampaign","summary":"Approve the exact hashes and spend cap reviewed (separation of duties enforced).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"approvalId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Approved.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: SEPARATION_OF_DUTIES, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: APPROVAL_STALE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.approve","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveInput"}}}}}},"/v1/workspaces/{workspaceId}/approvals/{approvalId}/reject":{"post":{"operationId":"rejectCampaignApproval","summary":"Reject an approval request with a reason; the campaign returns to draft.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"approvalId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rejected.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: APPROVAL_STALE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.approve","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectApprovalInput"}}}}}},"/v1/workspaces/{workspaceId}/schedule-time-resolution":{"get":{"operationId":"resolveScheduleTime","summary":"Resolve a local wall time in an IANA zone: exact, ambiguous (two instants) or nonexistent (DST gap).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"localTime","in":"query","required":true,"description":"Wall-clock time in the given time zone, minute precision (YYYY-MM-DDTHH:mm).","schema":{"type":"string","pattern":"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})$"}},{"name":"timezone","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"The resolution and its options.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocalTimeResolution"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/schedule":{"post":{"operationId":"scheduleCampaign","summary":"Consume an approval and schedule the send (UTC instant + IANA zone + local time); emits campaign.dispatch_requested.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Scheduled.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: APPROVAL_STALE, CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: LOCAL_TIME_AMBIGUOUS, LOCAL_TIME_NONEXISTENT, TIMEZONE_FALLBACK_REQUIRED, UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/pause":{"post":{"operationId":"pauseCampaign","summary":"Stop NEW attempts (checked between jobs and before transport); accepted mail stays accepted.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Pause recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.pause","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/resume":{"post":{"operationId":"resumeCampaign","summary":"Resume a paused campaign under its SAME approval, re-verified (APPROVAL_STALE otherwise).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Resume recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: APPROVAL_STALE, CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/cancel":{"post":{"operationId":"cancelCampaign","summary":"Cancel: no new attempts; unused reservations are released by the dispatch engine (campaign.cancel_requested).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Cancellation recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/retry-candidates":{"get":{"operationId":"listRetryCandidates","summary":"Messages a retry may select (definitely failed / never submitted), ids and states only.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of candidates.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryCandidatePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"message.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/retry-failed":{"post":{"operationId":"retryFailedMessages","summary":"Retry selected definitely-failed / never-submitted messages; never accepted or unresolved ones.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Retry recorded (campaign.retry_requested).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SUBMISSION_UNKNOWN, RETRY_NOT_ALLOWED, APPROVAL_STALE, CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryFailedInput"}}}}}},"/v1/workspaces/{workspaceId}/calendar":{"get":{"operationId":"getCampaignCalendar","summary":"Scheduled campaigns in a window with audience-overlap and frequency-cap collision warnings (R030).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":true,"schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"to","in":"query","required":true,"schema":{"$ref":"#/components/schemas/IsoDateTime"}}],"responses":{"200":{"description":"The calendar.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCalendar"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/readiness":{"get":{"operationId":"getCampaignReadiness","summary":"The unified readiness of a campaign: content checks and sending preflight in ONE list, each item with the composer section that fixes it (computed by the workers after every save).","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The latest readiness result (see `upToDate`).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignReadiness"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/readiness/recompute":{"post":{"operationId":"recomputeCampaignReadiness","summary":"Ask for a readiness recompute (rare manual case: something outside the campaign changed, e.g. a domain was authenticated). Debounced like a save; the result arrives on the change stream.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Recompute requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessRecomputeAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/send":{"post":{"operationId":"sendCampaign","summary":"Send now / Schedule (ADR 0047): freezes the version, builds the snapshot and the final preflight, then — four-eyes off and the caller may approve and publish — approves and schedules in one audited step; otherwise records an approval request carrying the schedule.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Scheduled, or approval requested (see `outcome`).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendCampaignResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_NOT_READY, READINESS_PENDING, CAMPAIGN_STATE_CONFLICT, CONFLICT, APPROVAL_STALE, AGENCY_SEND_CAP_EXCEEDED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: LOCAL_TIME_AMBIGUOUS, LOCAL_TIME_NONEXISTENT, TIMEZONE_FALLBACK_REQUIRED, UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendCampaignInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/send-estimate":{"get":{"operationId":"getCampaignSendEstimate","summary":"Estimated send duration and its limiting factor (pace, workspace rate, pool × provider buckets, warm-up ceilings, credits, plan cap), from the campaign's recipients grouped by mailbox provider — the counted audience, or a draft's current selection. While the campaign sends, from the observed rate and the remaining count. Every figure is an estimate.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pace","in":"query","required":false,"schema":{"type":"string","enum":["fastest","spread","per_hour"]}},{"name":"spreadMinutes","in":"query","required":false,"schema":{"type":"integer","minimum":15,"maximum":1380}},{"name":"perHour","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000000}}],"responses":{"200":{"description":"The estimate.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEstimate"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/sending-capacity":{"get":{"operationId":"getSendingCapacity","summary":"How much can I send? Today's ceilings of the workspace (plan, credits, warm-up, hourly rate, monthly cap) and what raises each. Estimates.","tags":["campaign-lifecycle"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The ceilings.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingCapacity"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/contacts/{contactId}/memberships":{"get":{"operationId":"getContactMemberships","summary":"A contact's list and topic memberships.","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Memberships.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMemberships"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/contacts/{contactId}/consent":{"get":{"operationId":"getContactConsent","summary":"Projected consent state per channel and purpose (latest event wins; evidence kept).","tags":["consent"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Consent state.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactConsentState"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"consent.read"}},"/v1/workspaces/{workspaceId}/contacts/{contactId}/protected-fields/{fieldKey}":{"get":{"operationId":"revealProtectedField","summary":"Decrypt one encrypted field value (separate grant, audited).","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"fieldKey","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"}}],"responses":{"200":{"description":"The decrypted value.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectedFieldValue"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.protected_fields"}},"/v1/workspaces/{workspaceId}/contacts/{contactId}/erase":{"post":{"operationId":"eraseContact","summary":"Erase a contact's personal data, keeping a minimal keyed suppression tombstone.","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Erased.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErasureResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EraseContactInput"}}}}}},"/v1/workspaces/{workspaceId}/contact-bulk-jobs/add-to-list":{"post":{"operationId":"bulkAddContactsToList","summary":"Subscribe the selected contacts to a list, with permission evidence (202 + job).","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Bulk job queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAddToListInput"}}}}}},"/v1/workspaces/{workspaceId}/contact-bulk-jobs/unsubscribe":{"post":{"operationId":"bulkUnsubscribeContacts","summary":"Stop marketing mail to the selected contacts (workspace marketing suppression, reason unsubscribe; 202 + job).","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Bulk job queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"suppression.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUnsubscribeInput"}}}}}},"/v1/workspaces/{workspaceId}/contact-bulk-jobs/erase":{"post":{"operationId":"bulkEraseContacts","summary":"Erase the selected contacts' personal data, keeping keyed suppression tombstones (202 + job).","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Bulk job queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: BULK_SELECTION_CHANGED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEraseInput"}}}}}},"/v1/workspaces/{workspaceId}/contact-bulk-jobs/{jobId}":{"get":{"operationId":"getContactBulkJob","summary":"Progress and outcome of a bulk action on contacts.","tags":["contacts"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"jobId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The job.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactBulkJob"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/fields":{"get":{"operationId":"listFieldDefinitions","summary":"The workspace's WHOLE custom-field catalog in one read (contact form, import mapping, merge tags); archived fields last. The S19 list reads queryFieldDefinitions.","tags":["fields"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Definitions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldDefinitionList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"},"post":{"operationId":"createFieldDefinition","summary":"Create a typed custom field (encrypted/restricted needs the protected-field grant).","tags":["fields"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldDefinition"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFieldDefinitionInput"}}}}}},"/v1/workspaces/{workspaceId}/field-definitions":{"get":{"operationId":"queryFieldDefinitions","summary":"Custom fields: search (label, key), filter, sort, group by type or protection (collection view, ADR 0039); by label, archived ones only through a filter.","tags":["fields"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over label, key.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: label (text): contains, starts_with, eq, neq; key (text): starts_with, eq; type (enum): in, nin — text | number | boolean | enum | multiselect | date | url | reference; protection (enum): in, nin — standard | restricted | encrypted; required (bool): eq; mergeAllowed (bool): eq; archived (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: label, key, createdAt, updatedAt. Default label:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (type, protection): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of field definitions, the total and, when grouped, whole-collection group counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldDefinitionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","x-collection":{"resource":"field_definitions","fields":[{"key":"label","label":"Field","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"key","label":"Key","type":"text","sortable":true,"filterOperators":["starts_with","eq"],"groupable":false},{"key":"type","label":"Type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"text","label":"Text"},{"value":"number","label":"Number"},{"value":"boolean","label":"Yes / no"},{"value":"enum","label":"One choice"},{"value":"multiselect","label":"Several choices"},{"value":"date","label":"Date"},{"value":"url","label":"Web address"},{"value":"reference","label":"Contact reference"}]},{"key":"protection","label":"Protection","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"standard","label":"Standard"},{"value":"restricted","label":"Restricted"},{"value":"encrypted","label":"Encrypted"}]},{"key":"required","label":"Required","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"mergeAllowed","label":"Allowed in merge tags","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"archived","label":"Archived","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"required","label":"Required","filter":{"op":"and","conditions":[{"field":"required","operator":"eq","value":true}]}},{"id":"protected","label":"Restricted or encrypted","filter":{"op":"and","conditions":[{"field":"protection","operator":"in","value":["restricted","encrypted"]}]}},{"id":"archived","label":"Archived","filter":{"op":"and","conditions":[{"field":"archived","operator":"eq","value":true}]}}],"defaultSort":{"field":"label","dir":"asc"},"search":{"fields":["label","key"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/fields/{fieldId}":{"get":{"operationId":"getFieldDefinition","summary":"A field definition with its version history.","tags":["fields"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"fieldId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Definition.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldDefinitionDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"},"patch":{"operationId":"updateFieldDefinition","summary":"Edit a field; validation/default/required/purpose changes create a new version.","tags":["fields"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"fieldId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldDefinition"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFieldDefinitionInput"}}}}}},"/v1/workspaces/{workspaceId}/lists":{"get":{"operationId":"listLists","summary":"Lists and topics with membership counts: search, filter, sort, group (collection view, ADR 0039); by name by default.","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; topic (bool): eq; doubleOptIn (bool): eq; trackingMode (enum): in, nin — off | minimal | aggregate | individual_consented | individual_restricted; archived (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt, updatedAt. Default name:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (topic, doubleOptIn): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"includeArchived","in":"query","required":false,"description":"Legacy: archived lists are hidden unless 'true' or a filter on `archived`.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"A page of lists with their membership counts, the total and, when grouped, whole-collection group counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","x-collection":{"resource":"lists","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"topic","label":"Topic","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":true,"options":[{"value":"false","label":"List"},{"value":"true","label":"Topic"}]},{"key":"doubleOptIn","label":"Double opt-in","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":true,"options":[{"value":"true","label":"Double opt-in"},{"value":"false","label":"Single opt-in"}]},{"key":"trackingMode","label":"Tracking","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"off","label":"Off"},{"value":"minimal","label":"Minimal"},{"value":"aggregate","label":"Aggregate"},{"value":"individual_consented","label":"Individual (consented)"},{"value":"individual_restricted","label":"Individual (restricted)"}]},{"key":"archived","label":"Archived","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"lists","label":"Lists","filter":{"op":"and","conditions":[{"field":"topic","operator":"eq","value":false}]}},{"id":"topics","label":"Topics","filter":{"op":"and","conditions":[{"field":"topic","operator":"eq","value":true}]}},{"id":"double_opt_in","label":"Double opt-in","filter":{"op":"and","conditions":[{"field":"doubleOptIn","operator":"eq","value":true}]}},{"id":"archived","label":"Archived","filter":{"op":"and","conditions":[{"field":"archived","operator":"eq","value":true}]}}],"defaultSort":{"field":"name","dir":"asc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createList","summary":"Create a list or topic.","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListInput"}}}}}},"/v1/workspaces/{workspaceId}/lists/{listId}":{"get":{"operationId":"getList","summary":"One list with its settings.","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"listId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The list.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"},"patch":{"operationId":"updateList","summary":"Edit list settings (double opt-in, confirmation expiry, tracking, archive).","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"listId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateListInput"}}}}}},"/v1/workspaces/{workspaceId}/lists/{listId}/members":{"get":{"operationId":"listListMembers","summary":"Memberships of a list: filter (state, source, dates), sort by added or last change (reduced collection view, ADR 0039); newest first.","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"listId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: state (enum): in, nin — pending_confirmation | subscribed | unsubscribed; source (text): eq, starts_with; subscribedAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt, updatedAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"description":"Legacy: one membership state (prefer a filter on `state`).","schema":{"$ref":"#/components/schemas/ListMembershipState"}}],"responses":{"200":{"description":"A page of memberships and the total (an estimate on very large lists).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","x-collection":{"resource":"list_members","fields":[{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"pending_confirmation","label":"Pending confirmation"},{"value":"subscribed","label":"Subscribed"},{"value":"unsubscribed","label":"Unsubscribed"}]},{"key":"source","label":"Source","type":"text","sortable":false,"filterOperators":["eq","starts_with"],"groupable":false},{"key":"subscribedAt","label":"Subscribed","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Added","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last change","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"subscribed","label":"Subscribed","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["subscribed"]}]}},{"id":"pending","label":"Pending confirmation","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["pending_confirmation"]}]}},{"id":"unsubscribed","label":"Unsubscribed","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["unsubscribed"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/lists/{listId}/subscriptions":{"post":{"operationId":"subscribeToList","summary":"Subscribe a contact with evidence; double opt-in lists start pending confirmation.","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"listId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Membership after the request.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SUPPRESSION_NOT_LIFTABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONSENT_EVIDENCE_MISSING","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeInput"}}}}}},"/v1/workspaces/{workspaceId}/lists/{listId}/unsubscriptions":{"post":{"operationId":"unsubscribeFromList","summary":"Unsubscribe a contact from one list (topic lists also record a topic suppression).","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"listId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Membership after the request.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMembership"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeInput"}}}}}},"/v1/workspaces/{workspaceId}/imports/uploads":{"post":{"operationId":"createImportUpload","summary":"Presigned PUT URL for a CSV under the workspace's private object prefix.","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Upload slot.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportUpload"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateImportUploadInput"}}}}}},"/v1/workspaces/{workspaceId}/imports/inspect":{"post":{"operationId":"inspectImport","summary":"Headers and sample rows of an uploaded file (first 64 KiB), for mapping.","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Inspection.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportInspection"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: IMPORT_FILE_REJECTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectImportInput"}}}}}},"/v1/workspaces/{workspaceId}/imports/preview":{"post":{"operationId":"previewImport","summary":"Validate the whole file without changing contacts (202 + job).","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Preview queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: IMPORT_MAPPING_INVALID, IMPORT_FILE_REJECTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewImportInput"}}}}}},"/v1/workspaces/{workspaceId}/imports":{"get":{"operationId":"listImports","summary":"Imports of the workspace.","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of imports.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import"}},"/v1/workspaces/{workspaceId}/imports/{importId}":{"get":{"operationId":"getImport","summary":"Import status, counters, issue categories and progress (the job status URL).","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The import.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportJob"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import"}},"/v1/workspaces/{workspaceId}/imports/{importId}/issues":{"get":{"operationId":"listImportIssues","summary":"Row-level issues found by the preview (rejected, duplicate, suppressed…).","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"category","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ImportIssueCategory"}}],"responses":{"200":{"description":"A page of issues.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportIssuePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import"}},"/v1/workspaces/{workspaceId}/imports/{importId}/commit":{"post":{"operationId":"commitImport","summary":"Apply the reviewed preview (exact previewHash and approvedRowCount).","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Commit queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IMPORT_PREVIEW_STALE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitImportInput"}}}}}},"/v1/workspaces/{workspaceId}/imports/{importId}/rollback":{"post":{"operationId":"rollbackImport","summary":"Reverse the import's own, untouched changes (never a later unsubscribe).","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Rollback queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackImportInput"}}}}}},"/v1/workspaces/{workspaceId}/imports/{importId}/confirmations":{"get":{"operationId":"getImportConfirmations","summary":"Review the double opt-in confirmations a committed import could send (counts only).","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Counts of pending, eligible and excluded memberships.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportConfirmationReview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import"},"post":{"operationId":"sendImportConfirmations","summary":"Send the double opt-in confirmations of an import's pending memberships (explicit, count-acknowledged, audited; never to suppressed or withdrawn subjects).","tags":["imports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Confirmation mails requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportConfirmationsSent"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IMPORT_CONFIRMATIONS_CHANGED, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendImportConfirmationsInput"}}}}}},"/v1/workspaces/{workspaceId}/exports":{"post":{"operationId":"createExport","summary":"Export contacts, suppressions or consent evidence to a private file (202 + job).","tags":["exports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Export queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PROTECTED_FIELD_ACCESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.export","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExportInput"}}}}},"get":{"operationId":"listExports","summary":"Exports of the workspace: filter, group by status or data, newest first (collection view, ADR 0039).","tags":["exports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: resource (enum): in, nin — contacts | suppressions | consent_events; status (enum): in, nin — queued | running | ready | failed | expired; expiresAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (resource, status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of exports and the total.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.export","x-collection":{"resource":"exports","fields":[{"key":"resource","label":"Data","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"contacts","label":"Contacts"},{"value":"suppressions","label":"Suppressions"},{"value":"consent_events","label":"Consent evidence"}]},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"queued","label":"Queued"},{"value":"running","label":"Running"},{"value":"ready","label":"Ready"},{"value":"failed","label":"Failed"},{"value":"expired","label":"Expired"}]},{"key":"rowCount","label":"Rows","type":"number","sortable":false,"filterOperators":[],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"ready","label":"Ready","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["ready"]}]}},{"id":"running","label":"In progress","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["queued","running"]}]}},{"id":"failed","label":"Failed","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["failed"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/exports/{exportId}":{"get":{"operationId":"getExport","summary":"Export status (the job status URL).","tags":["exports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"exportId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The export.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJob"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.export"}},"/v1/workspaces/{workspaceId}/exports/{exportId}/download-link":{"post":{"operationId":"createExportDownloadLink","summary":"Short-lived presigned download link (audited).","tags":["exports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"exportId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Link.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportDownloadLink"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: EXPORT_EXPIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.export"}},"/v1/workspaces/{workspaceId}/consent-events":{"get":{"operationId":"listConsentEvents","summary":"Immutable consent events (evidence history): exact address lookup, filter, sort by capture time (collection view, ADR 0039); newest first.","tags":["consent"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over subject.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: channel (enum): in, nin — email | sms | whatsapp | web_push | mobile_push | wallet; purpose (enum): in, nin — marketing | transactional | tracking | profiling; choice (enum): in, nin — granted | withdrawn; legalBasis (enum): in, nin — consent | legitimate_interest | contract | legal_obligation; actorType (enum): in, nin — user | api_key | mcp_agent | system | platform_staff | oauth_app; source (text): eq, starts_with; occurredAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: occurredAt. Default occurredAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"contactId","in":"query","required":false,"description":"One contact's events (by its subject key: earlier evidence included).","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"channel","in":"query","required":false,"description":"Legacy: prefer a filter on `channel`.","schema":{"$ref":"#/components/schemas/ConsentChannel"}},{"name":"purpose","in":"query","required":false,"description":"Legacy: prefer a filter on `purpose`.","schema":{"$ref":"#/components/schemas/ConsentPurpose"}},{"name":"choice","in":"query","required":false,"description":"Legacy: prefer a filter on `choice`.","schema":{"$ref":"#/components/schemas/ConsentChoice"}}],"responses":{"200":{"description":"A page of consent events and the total (an estimate on very large logs).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentEventPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"consent.read","x-collection":{"resource":"consent_events","fields":[{"key":"subject","label":"Address","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"channel","label":"Channel","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"email","label":"Email"},{"value":"sms","label":"SMS"},{"value":"whatsapp","label":"WhatsApp"},{"value":"web_push","label":"Web push"},{"value":"mobile_push","label":"Mobile push"},{"value":"wallet","label":"Wallet"}]},{"key":"purpose","label":"Purpose","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"marketing","label":"Marketing"},{"value":"transactional","label":"Transactional"},{"value":"tracking","label":"Tracking"},{"value":"profiling","label":"Profiling"}]},{"key":"choice","label":"Choice","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"granted","label":"Granted"},{"value":"withdrawn","label":"Withdrawn"}]},{"key":"legalBasis","label":"Legal basis","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"consent","label":"Consent"},{"value":"legitimate_interest","label":"Legitimate interest"},{"value":"contract","label":"Contract"},{"value":"legal_obligation","label":"Legal obligation"}]},{"key":"actorType","label":"Recorded by","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"user","label":"A person"},{"value":"api_key","label":"An API key"},{"value":"mcp_agent","label":"An AI agent"},{"value":"system","label":"The platform"},{"value":"platform_staff","label":"Platform staff"},{"value":"oauth_app","label":"An application"}]},{"key":"source","label":"Source","type":"text","sortable":false,"filterOperators":["eq","starts_with"],"groupable":false},{"key":"occurredAt","label":"Captured","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"granted","label":"Granted","filter":{"op":"and","conditions":[{"field":"choice","operator":"in","value":["granted"]}]}},{"id":"withdrawn","label":"Withdrawn","filter":{"op":"and","conditions":[{"field":"choice","operator":"in","value":["withdrawn"]}]}},{"id":"marketing","label":"Marketing","filter":{"op":"and","conditions":[{"field":"purpose","operator":"in","value":["marketing"]}]}},{"id":"tracking","label":"Tracking","filter":{"op":"and","conditions":[{"field":"purpose","operator":"in","value":["tracking"]}]}}],"defaultSort":{"field":"occurredAt","dir":"desc"},"search":{"fields":["subject"],"mode":"prefix"}}},"post":{"operationId":"recordConsentEvent","summary":"Record a consent grant or withdrawal with its evidence.","tags":["consent"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentEvent"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONSENT_EVIDENCE_MISSING","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"consent.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordConsentInput"}}}}}},"/v1/workspaces/{workspaceId}/suppressions":{"get":{"operationId":"listSuppressions","summary":"Suppressions, active by default: exact address or domain lookup, filter, sort, group (collection view, ADR 0039); newest first.","tags":["suppressions"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over domain.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: domain (text): eq; subjectType (enum): in, nin — email | domain | phone; scope (enum): in, nin — platform_safety | workspace_all | workspace_marketing | topic; reason (enum): in, nin — unsubscribe | hard_invalid_recipient | hard_invalid_domain | complaint | mailbox_full_temporary | manual | import | privacy_erasure | abuse_safety | privacy_restriction; active (bool): eq; source (text): eq, starts_with; effectiveAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: effectiveAt, createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (reason): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"scope","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SuppressionScope"}},{"name":"reason","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SuppressionReason"}},{"name":"email","in":"query","required":false,"description":"Exact address lookup (keyed HMAC match).","schema":{"type":"string","minLength":3,"maxLength":320}},{"name":"domain","in":"query","required":false,"schema":{"type":"string","minLength":3,"maxLength":253}},{"name":"includeLifted","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"A page of suppressions, the total and, when grouped, whole-collection group counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"suppression.read","x-collection":{"resource":"suppressions","fields":[{"key":"domain","label":"Domain","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"subjectType","label":"Subject","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"email","label":"Address"},{"value":"domain","label":"Domain"},{"value":"phone","label":"Phone number"}]},{"key":"scope","label":"Scope","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"platform_safety","label":"Platform safety"},{"value":"workspace_all","label":"All mail"},{"value":"workspace_marketing","label":"Marketing mail"},{"value":"topic","label":"One topic"}]},{"key":"reason","label":"Reason","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"unsubscribe","label":"Unsubscribed"},{"value":"hard_invalid_recipient","label":"Address does not exist"},{"value":"hard_invalid_domain","label":"Domain does not accept mail"},{"value":"complaint","label":"Marked as spam"},{"value":"mailbox_full_temporary","label":"Mailbox full (temporary)"},{"value":"manual","label":"Added by an operator"},{"value":"import","label":"From an import"},{"value":"privacy_erasure","label":"Erased"},{"value":"abuse_safety","label":"Safety block"},{"value":"privacy_restriction","label":"Privacy restriction"}]},{"key":"active","label":"Active","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"source","label":"Source","type":"text","sortable":false,"filterOperators":["eq","starts_with"],"groupable":false},{"key":"effectiveAt","label":"Effective","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Added","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"opt_outs","label":"Opt-outs","filter":{"op":"and","conditions":[{"field":"reason","operator":"in","value":["unsubscribe"]}]}},{"id":"bounces","label":"Hard bounces","filter":{"op":"and","conditions":[{"field":"reason","operator":"in","value":["hard_invalid_recipient","hard_invalid_domain"]}]}},{"id":"complaints","label":"Complaints","filter":{"op":"and","conditions":[{"field":"reason","operator":"in","value":["complaint"]}]}},{"id":"domains","label":"Domains","filter":{"op":"and","conditions":[{"field":"subjectType","operator":"in","value":["domain"]}]}},{"id":"inactive","label":"Lifted or expired","filter":{"op":"and","conditions":[{"field":"active","operator":"eq","value":false}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["domain"],"mode":"prefix"}}},"post":{"operationId":"createSuppression","summary":"Suppress an address or a domain for a scope.","tags":["suppressions"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (or the identical active suppression).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Suppression"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SUPPRESSION_SCOPE_INCOMPATIBLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"suppression.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSuppressionInput"}}}}}},"/v1/workspaces/{workspaceId}/suppressions/{suppressionId}/lift":{"post":{"operationId":"liftSuppression","summary":"Lift a suppression under reason-specific rules (new evidence; complaints need consent.override).","tags":["suppressions"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"suppressionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Lifted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Suppression"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SUPPRESSION_NOT_LIFTABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONSENT_EVIDENCE_MISSING","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"suppression.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiftSuppressionInput"}}}}}},"/v1/workspaces/{workspaceId}/segments":{"get":{"operationId":"listSegments","summary":"Saved segments: search, filter, sort (collection view, ADR 0039); by name by default, archived ones only through a filter.","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; estimated (bool): eq; archived (bool): eq; updatedAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, updatedAt, createdAt. Default name:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of segments with their last estimate and the total.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","x-collection":{"resource":"segments","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"estimated","label":"Estimated","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"archived","label":"Archived","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"updatedAt","label":"Rules updated","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"never_estimated","label":"Never estimated","filter":{"op":"and","conditions":[{"field":"estimated","operator":"eq","value":false}]}},{"id":"archived","label":"Archived","filter":{"op":"and","conditions":[{"field":"archived","operator":"eq","value":true}]}}],"defaultSort":{"field":"name","dir":"asc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createSegment","summary":"Save a segment definition (validated and compiled, not executed).","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SEGMENT_UNSAFE_OPERATOR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSegmentInput"}}}}}},"/v1/workspaces/{workspaceId}/segments/{segmentId}":{"get":{"operationId":"getSegment","summary":"One saved segment.","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"segmentId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The segment.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"},"patch":{"operationId":"updateSegment","summary":"Edit a segment (If-Match).","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"segmentId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SEGMENT_UNSAFE_OPERATOR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSegmentInput"}}}}}},"/v1/workspaces/{workspaceId}/segments/{segmentId}/duplicate":{"post":{"operationId":"duplicateSegment","summary":"Duplicate a segment: same rules and description under a new name (\"<name> (copy)\" by default); not estimated yet.","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"segmentId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The copy.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SEGMENT_UNSAFE_OPERATOR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateSegmentInput"}}}}}},"/v1/workspaces/{workspaceId}/segments/preview":{"post":{"operationId":"previewSegment","summary":"Estimated count of a definition, with calculation time, under an execution budget.","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Accepted; the result is in the body and at statusUrl.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreviewJob"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SEGMENT_UNSAFE_OPERATOR, SEGMENT_BUDGET_EXCEEDED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreviewInput"}}}}}},"/v1/workspaces/{workspaceId}/segments/previews/{previewId}":{"get":{"operationId":"getSegmentPreview","summary":"Result of a segment preview (statusUrl of POST /segments/preview), kept one hour.","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"previewId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The preview job and its result.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreviewJob"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/segments/{segmentId}/estimate":{"post":{"operationId":"estimateSegment","summary":"Refresh a saved segment's estimate.","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"segmentId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Estimate.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentPreview"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SEGMENT_BUDGET_EXCEEDED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentEstimateInput"}}}}}},"/v1/workspaces/{workspaceId}/segments/{segmentId}/contacts":{"get":{"operationId":"listSegmentContacts","summary":"Contacts matching a saved segment now (stable keyset cursor).","tags":["segments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"segmentId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of contacts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentMemberPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SEGMENT_BUDGET_EXCEEDED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/public/confirm/{token}":{"get":{"operationId":"getConfirmation","summary":"Describe a pending double opt-in confirmation. NEVER subscribes (link scanners).","tags":["public"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}],"responses":{"200":{"description":"Confirmation page data.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmationPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"post":{"operationId":"confirmSubscription","summary":"Explicit, idempotent confirmation of a subscription (single-use token).","tags":["public"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}],"responses":{"200":{"description":"Confirmed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmationResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: TOKEN_EXPIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmSubscriptionInput"}}}}}},"/v1/workspaces/{workspaceId}/oauth/authorizations":{"post":{"operationId":"startOAuthAuthorization","summary":"Start a provider consent for a sending server (SMTP XOAUTH2) or a bounce mailbox: authorization code + PKCE (S256), a single-use state bound to the caller, the target and an EXACT registered callback.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Where to send the browser.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAuthorizationStart"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: OAUTH_PROVIDER_NOT_CONFIGURED, OAUTH_REDIRECT_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartOAuthAuthorizationInput"}}}}}},"/v1/workspaces/{workspaceId}/oauth/authorizations/complete":{"post":{"operationId":"completeOAuthAuthorization","summary":"Complete a consent from the callback parameters: the state must be live, unused and issued to this caller in this workspace; the code is exchanged with the PKCE verifier and the tokens are stored write-only (the target must pass a new test before it is ready).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The connection (without its tokens) and where to return.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAuthorizationResult"}}}},"400":{"description":"Problem: OAUTH_STATE_INVALID, VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: OAUTH_AUTHORIZATION_FAILED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: OAUTH_PROVIDER_NOT_CONFIGURED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteOAuthAuthorizationInput"}}}}}},"/v1/workspaces/{workspaceId}/provider-adapters":{"get":{"operationId":"listProviderAdapters","summary":"Provider adapters with their declared capabilities and who controls the egress IP.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The catalog.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderCatalog"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/servers":{"get":{"operationId":"listServers","summary":"List sending endpoints (secrets never included).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over displayName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: displayName (text): contains, starts_with, eq, neq; adapter (enum): in, nin — smtp | ses | sendgrid | mailgun | postmark | brevo | resend | gmail | microsoft_graph | sink | kumomta; stream (enum): in, nin — marketing | transactional; region (enum): in, nin — eu | uk | us | ca | sg; state (enum): in, nin — draft | testing | ready | degraded | needs_reauthorization | disabled; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (adapter, stream, region, state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of endpoints.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingEndpointPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"servers","fields":[{"key":"displayName","label":"Server","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"adapter","label":"Type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"smtp","label":"SMTP"},{"value":"ses","label":"Amazon SES"},{"value":"sendgrid","label":"SendGrid"},{"value":"mailgun","label":"Mailgun"},{"value":"postmark","label":"Postmark"},{"value":"brevo","label":"Brevo"},{"value":"resend","label":"Resend"},{"value":"gmail","label":"Gmail"},{"value":"microsoft_graph","label":"Microsoft 365"},{"value":"sink","label":"Local sink"},{"value":"kumomta","label":"Managed (platform MTA)"}]},{"key":"stream","label":"Stream","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"marketing","label":"Marketing"},{"value":"transactional","label":"Transactional"}]},{"key":"region","label":"Region","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"eu","label":"EU"},{"value":"uk","label":"UK"},{"value":"us","label":"US"},{"value":"ca","label":"Canada"},{"value":"sg","label":"Singapore"}]},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"testing","label":"Testing"},{"value":"ready","label":"Ready"},{"value":"degraded","label":"Degraded"},{"value":"needs_reauthorization","label":"Needs reauthorization"},{"value":"disabled","label":"Disabled"}]},{"key":"createdAt","label":"Connected","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"ready","label":"Ready","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["ready"]}]}},{"id":"attention","label":"Needs attention","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["degraded","needs_reauthorization"]}]}},{"id":"transactional","label":"Transactional","filter":{"op":"and","conditions":[{"field":"stream","operator":"in","value":["transactional"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["displayName"],"mode":"contains"}}},"post":{"operationId":"createServer","summary":"Connect a sending endpoint; the secret is write-only and envelope-encrypted.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created in state draft (a connection test makes it ready).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: EGRESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CAPABILITY_UNSUPPORTED, REGION_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSendingEndpointInput"}}}}}},"/v1/workspaces/{workspaceId}/servers/{serverId}":{"get":{"operationId":"getServer","summary":"Read one endpoint, its readiness and its last connection test.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The endpoint.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"patch":{"operationId":"updateServer","summary":"Edit an endpoint. Blank secret fields keep the secret; region or secret changes invalidate readiness.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: EGRESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CAPABILITY_UNSUPPORTED, REGION_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSendingEndpointInput"}}}}}},"/v1/workspaces/{workspaceId}/servers/{serverId}/secret":{"post":{"operationId":"replaceServerSecret","summary":"Explicitly replace (rotate) the endpoint's credential: new version, readiness invalidated.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rotated (the secret is not echoed).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CAPABILITY_UNSUPPORTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceEndpointSecretInput"}}}}},"delete":{"operationId":"clearServerSecret","summary":"Destroy the endpoint's credential (separate destructive action). Dispatch through it stops.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"reason","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":500}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Cleared; the endpoint is no longer ready.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/servers/{serverId}/test":{"post":{"operationId":"runServerTest","summary":"Queue a layered connection test (parse/egress → DNS → TCP → TLS → capability → auth → test message → downstream).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Queued; poll the test resource.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionTest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: EGRESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CAPABILITY_UNSUPPORTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunConnectionTestInput"}}}}}},"/v1/workspaces/{workspaceId}/servers/{serverId}/tests":{"get":{"operationId":"listServerTests","summary":"Connection test history (timestamp + credential version).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of tests, oldest first.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionTestPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/servers/{serverId}/tests/{testId}":{"get":{"operationId":"getServerTest","summary":"One connection test with its per-layer results.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"testId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The test.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionTest"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/domains":{"get":{"operationId":"listDomains","summary":"List sending domains with their latest DNS evidence.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over domain.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: domain (text): contains, starts_with, eq, neq; verificationStatus (enum): in, nin — pending | verified | failed | revoked; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: domain. Default domain:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (verificationStatus): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of domains.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainIdentityPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"domains","fields":[{"key":"domain","label":"Domain","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"verificationStatus","label":"Ownership","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"pending","label":"Pending"},{"value":"verified","label":"Verified"},{"value":"failed","label":"Failed"},{"value":"revoked","label":"Revoked"}]},{"key":"createdAt","label":"Added","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"verified","label":"Verified","filter":{"op":"and","conditions":[{"field":"verificationStatus","operator":"in","value":["verified"]}]}},{"id":"pending","label":"Awaiting proof","filter":{"op":"and","conditions":[{"field":"verificationStatus","operator":"in","value":["pending","failed"]}]}}],"defaultSort":{"field":"domain","dir":"asc"},"search":{"fields":["domain"],"mode":"contains"}}},"post":{"operationId":"createDomain","summary":"Add a sending domain; returns the ownership TXT record to publish.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (pending ownership).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DOMAIN_RESERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainInput"}}}}}},"/v1/workspaces/{workspaceId}/domains/{domainId}":{"get":{"operationId":"getDomain","summary":"Read a domain and its DNS evidence.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The domain.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"patch":{"operationId":"updateDomain","summary":"Change DKIM selector/signing, return-path or tracking domain (clears readiness until rechecked).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainInput"}}}}},"delete":{"operationId":"deleteDomain","summary":"Delete a sending domain and its senders (refused while they are in use; past campaigns keep their history).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: DOMAIN_IN_USE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DOMAIN_RESERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/domains/{domainId}/deletion":{"get":{"operationId":"getDomainDeletionImpact","summary":"What deleting the domain would remove (senders, managed key) and what still blocks it (campaigns, journeys, templates, pages).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The deletion's consequences and blockers.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDeletionImpact"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DOMAIN_RESERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/domains/{domainId}/verify":{"post":{"operationId":"verifyDomain","summary":"Run the DNS checks (ownership, SPF, DKIM, DMARC, alignment, return-path, tracking, egress FCrDNS) and store the evidence.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Checked; the evidence is stored on the domain.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: OWNERSHIP_MISSING, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyDomainInput"}}}}}},"/v1/workspaces/{workspaceId}/domains/{domainId}/managed-signing":{"post":{"operationId":"enableManagedSigning","summary":"Generate the platform DKIM key for this domain and switch it to the three managed records (ADR 0046).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The domain, now managed, with its records to publish.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/domains/{domainId}/mta-sts":{"patch":{"operationId":"updateHostedMtaSts","summary":"Hosted MTA-STS + TLS-RPT of a managed domain: enable, disable, testing or enforce (ADR 0092). Audited, announced as `domain.verification_changed`.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The domain with its hosted MTA-STS state.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, MTA_STS_NOT_CONFIGURED, MTA_STS_ENFORCE_BLOCKED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHostedMtaStsInput"}}}}}},"/internal/mta-sts/{domain}":{"get":{"operationId":"getMtaStsPolicy","summary":"Internal (nginx only): the hosted MTA-STS policy file of a managed domain, as text/plain.","tags":["internal"],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9-]{2,63}$"}}],"responses":{"200":{"description":"The policy file (text/plain).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/domains/{domainId}/health":{"get":{"operationId":"getDomainHealth","summary":"Read the domain's health report, its score history and the check weights (ADR 0092).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The health overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainHealthOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"runDomainHealth","summary":"Run the domain health analyzer now and store the report (ADR 0092).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The new report, with the history.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainHealthOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/domains/{domainId}/domain-connect":{"post":{"operationId":"startDomainConnect","summary":"Get the signed Domain Connect URL that publishes this managed domain's records at its DNS host (ADR 0072).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The URL to open, and the size of the window the DNS host asked for.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainConnectStart"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: DOMAIN_CONNECT_UNAVAILABLE, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartDomainConnectInput"}}}}}},"/v1/workspaces/{workspaceId}/domains/{domainId}/dns-connection":{"get":{"operationId":"getDnsConnection","summary":"Read whether this managed domain can be connected to its Cloudflare zone, and its connection (ADR 0099).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Eligibility, the token creation link and the connection (the token itself is write-only).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"connectDnsProvider","summary":"Connect this managed domain's Cloudflare zone with an API token limited to it (verified, stored write-only). Signed-in people only.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The connection.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: DNS_CONNECTION_UNAVAILABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DNS_TOKEN_INVALID, DNS_TOKEN_TOO_BROAD, DNS_TOKEN_ZONE_MISMATCH","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"Problem: DNS_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectDnsProviderInput"}}}}},"patch":{"operationId":"updateDnsConnection","summary":"Turn the automatic re-publish of this domain's records on or off (ADR 0099).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The connection.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: DNS_CONNECTION_MISSING","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDnsConnectionInput"}}}}},"delete":{"operationId":"disconnectDnsProvider","summary":"Disconnect: the stored token is destroyed. Revoke it in Cloudflare too.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"204":{"description":"Disconnected (also when nothing was connected).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/domains/{domainId}/dns-connection/preview":{"post":{"operationId":"previewDnsPublish","summary":"Compare the records this domain needs with what its Cloudflare zone holds now: create, replace, merge, unchanged or conflict, per record.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The plan and its fingerprint (send it back to publish).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsPublishPlan"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: DNS_CONNECTION_MISSING, DNS_CONNECTION_UNAVAILABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DNS_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"Problem: DNS_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewDnsPublishInput"}}}}}},"/v1/workspaces/{workspaceId}/domains/{domainId}/dns-connection/publish":{"post":{"operationId":"publishDnsRecords","summary":"Publish the previewed records in the domain's Cloudflare zone (the plan's fingerprint is required), then re-check the domain. Never deletes a record.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Per record: created, replaced, merged, unchanged, conflict or failed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DnsPublishResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: DNS_CONNECTION_MISSING, DNS_CONNECTION_UNAVAILABLE, DNS_PUBLISH_PLAN_CHANGED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DNS_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"502":{"description":"Problem: DNS_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishDnsRecordsInput"}}}}}},"/v1/workspaces/{workspaceId}/domains/{domainId}/dmarc":{"get":{"operationId":"getDomainDmarc","summary":"DMARC aggregate reports of a managed domain: messages, aligned pass rate, other sources, last report, next policy step.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The DMARC summary of the domain.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainDmarcSummary"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/sending-mode":{"get":{"operationId":"getSendingMode","summary":"Managed (platform sending, three generated DNS records) or advanced (own endpoints, pools, routing); what advanced configuration exists.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The sending mode.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingModeSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"},"patch":{"operationId":"updateSendingMode","summary":"Switch to managed sending (advanced is enabled by support only: switching TO it is refused with SENDING_MODE_SUPPORT_ONLY). Never deletes the advanced configuration. Audited, announced as `workspace.sending_mode_changed`.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The new mode.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingModeSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: SENDING_MODE_SUPPORT_ONLY, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSendingModeInput"}}}}}},"/internal/kumomta/domains/{domain}":{"get":{"operationId":"getKumoSigningDomain","summary":"Internal (KumoMTA only): DKIM key and return-path of a managed, DKIM-verified domain whose workspace may send.","tags":["internal"],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","maxLength":253,"pattern":"^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9-]{2,63}$"}}],"responses":{"200":{"description":"Signing material (no-store).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KumoSigningDomain"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/internal/kumomta/warmup":{"get":{"operationId":"getKumoWarmup","summary":"Internal (KumoMTA only): the warm-up stage of every platform sending IP per provider group.","tags":["internal"],"parameters":[],"responses":{"200":{"description":"Stages by egress source (no-store).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KumoWarmup"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/starter-address":{"get":{"operationId":"getStarterAddress","summary":"The workspace's shared starter sending address `<slug>.<starter domain>`: state, From, confirmed Reply-To, caps, or a suggested slug when none is claimed yet.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The starter address (state `unavailable` outside managed sending).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarterAddress"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"claimStarterAddress","summary":"Claim the starter address once (slug chosen at onboarding; only platform staff change it later). Creates the ready sender identity and emails a confirmation link to the Reply-To address.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The claimed address (sending blocked until the Reply-To is confirmed).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarterAddress"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: STARTER_ADDRESS_UNAVAILABLE, STARTER_ADDRESS_EXISTS, STARTER_SLUG_TAKEN, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimStarterAddressInput"}}}}}},"/v1/workspaces/{workspaceId}/starter-address/slug-check":{"get":{"operationId":"checkStarterSlug","summary":"Is this slug valid and free? The same rule as the claim (length, characters, reserved names, brand words, uniqueness).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"slug","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"The verdict.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarterSlugCheck"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/starter-address/reply-to":{"post":{"operationId":"setStarterReplyTo","summary":"Change the Reply-To of the starter address (or resend its link): a new confirmation link is emailed and sending waits for it.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The starter address with its pending Reply-To.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarterAddress"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetStarterReplyToInput"}}}}}},"/v1/starter-reply-to/confirm":{"post":{"operationId":"confirmStarterReplyTo","summary":"Confirm a starter address's Reply-To with the emailed link's token (public: the mailbox owner may not be a member).","tags":["infrastructure"],"parameters":[],"responses":{"200":{"description":"Confirmed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarterReplyToConfirmation"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: STARTER_REPLY_TO_LINK_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmStarterReplyToInput"}}}}}},"/v1/workspaces/{workspaceId}/sender-identities":{"get":{"operationId":"listSenderIdentities","summary":"Sender identities with their readiness (what campaigns may send as).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"readyOnly","in":"query","required":false,"description":"Only senders whose domain passes every required check.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"A page of sender identities.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderIdentityPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"createSenderIdentity","summary":"Add a From identity on a VERIFIED domain of the workspace.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SENDER_DOMAIN_UNVERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSenderIdentityInput"}}}}}},"/v1/workspaces/{workspaceId}/sender-identities/{senderId}":{"patch":{"operationId":"updateSenderIdentity","summary":"Change a From address, its name or its Reply-To (the address stays on its domain; a new address is refused while something in flight sends as the old one).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderIdentity"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SENDER_IN_USE, CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DOMAIN_RESERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSenderIdentityInput"}}}}},"delete":{"operationId":"deleteSenderIdentity","summary":"Delete a From address (refused while a campaign, journey, transactional template or SMTP credential uses it; past campaigns keep their history).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SENDER_IN_USE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: DOMAIN_RESERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/egress-ips":{"get":{"operationId":"listEgressIps","summary":"Recipient-facing egress IPs available to this workspace.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of egress IPs.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EgressIpPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"createEgressIp","summary":"Declare an egress IP of a customer-controlled MTA (public addresses only).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EgressIp"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: EGRESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEgressIpInput"}}}}}},"/v1/workspaces/{workspaceId}/pools":{"get":{"operationId":"listPools","summary":"Server pools and egress IP pools with their members.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; kind (enum): in, nin — server | egress_ip; stream (enum): in, nin — marketing | transactional; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name. Default name:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (kind, stream): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of pools.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"pools","fields":[{"key":"name","label":"Pool","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"kind","label":"Kind","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"server","label":"Server pool"},{"value":"egress_ip","label":"Egress IP pool"}]},{"key":"stream","label":"Stream","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"marketing","label":"Marketing"},{"value":"transactional","label":"Transactional"}]},{"key":"createdAt","label":"Created","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"servers","label":"Server pools","filter":{"op":"and","conditions":[{"field":"kind","operator":"in","value":["server"]}]}},{"id":"egress","label":"Egress IP pools","filter":{"op":"and","conditions":[{"field":"kind","operator":"in","value":["egress_ip"]}]}}],"defaultSort":{"field":"name","dir":"asc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createPool","summary":"Create a server pool or an egress IP pool (capability-checked members).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CAPABILITY_UNSUPPORTED, REGION_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePoolInput"}}}}}},"/v1/workspaces/{workspaceId}/pools/{poolId}":{"get":{"operationId":"getPool","summary":"Read a pool and its members.","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The pool.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"patch":{"operationId":"updatePool","summary":"Replace weighted members and constraints (412 on concurrent edit).","tags":["infrastructure"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pool"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CAPABILITY_UNSUPPORTED, REGION_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePoolInput"}}}}}},"/v1/ingest/providers/{provider}":{"post":{"operationId":"ingestProviderEvents","summary":"Provider event callback: signature-verified, bounded, durably recorded before 202.","tags":["ingest"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/IngestProvider"}}],"responses":{"202":{"description":"Durably recorded (processing may still be running).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/ingest/providers/{provider}/endpoints/{endpointId}":{"post":{"operationId":"ingestEndpointProviderEvents","summary":"Customer-owned provider event callback (SES/SNS, SendGrid): signature-verified against the endpoint's own key, bounded, durably recorded before 202.","tags":["ingest"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/EndpointIngestProvider"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"202":{"description":"Durably recorded (processing may still be running).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/unsubscribe/{token}":{"post":{"operationId":"unsubscribeOneClick","summary":"RFC 8058 one-click unsubscribe (also the human confirmation form). No login, cookie or survey.","tags":["recipient"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Suppression durably committed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: PUBLIC_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/preferences/{token}":{"get":{"operationId":"getRecipientPreferences","summary":"Read the recipient's preferences. Side-effect free: a GET never unsubscribes (scanner-safe).","tags":["recipient"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Preferences.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientPreferences"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: PUBLIC_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"post":{"operationId":"updateRecipientPreferences","summary":"Save topics, tracking permission or a full unsubscribe (durable before 200).","tags":["recipient"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Saved.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientPreferences"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: PUBLIC_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRecipientPreferencesInput"}}}}}},"/v1/public/track/open/{token}":{"get":{"operationId":"trackOpen","summary":"Open pixel: always a 1×1 GIF; stores an event only when the effective tracking mode allows it.","tags":["tracking"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}}],"responses":{"200":{"description":"image/gif","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/track/click/{token}":{"get":{"operationId":"trackClick","summary":"Click redirect to an APPROVED link id only (no open redirect); redirects even when collection is denied.","tags":["tracking"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":2143}}],"responses":{"200":{"description":"302 redirect to the approved destination (documented as 200 for the contract registry).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: PUBLIC_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/report":{"get":{"operationId":"getCampaignReport","summary":"Campaign report with truth labels, denominators and freshness (raw or filtered view).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"view","in":"query","required":false,"schema":{"default":"filtered","$ref":"#/components/schemas/ReportView"}}],"responses":{"200":{"description":"The report.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/report/export":{"get":{"operationId":"exportCampaignReport","summary":"CSV export of the campaign report (aggregates only, formula-safe, with classifier version and freshness).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"view","in":"query","required":false,"schema":{"default":"filtered","$ref":"#/components/schemas/ReportView"}}],"responses":{"200":{"description":"text/csv","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.export"}},"/v1/workspaces/{workspaceId}/reports/overview":{"get":{"operationId":"getWorkspaceOverview","summary":"Workspace overview (S10): accepted, reported delivered, human-likely clicks, revenue availability.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"description":"Inclusive start (message creation time). Default: 30 days ago.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"to","in":"query","required":false,"description":"Exclusive end. Default: now.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"stream","in":"query","required":false,"description":"Only the campaigns of this stream (marketing / transactional). Default: all.","schema":{"$ref":"#/components/schemas/Stream"}}],"responses":{"200":{"description":"Overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/reports/sending":{"get":{"operationId":"getWorkspaceSendingSummary","summary":"Home (S10): mail sent per product module (campaigns, automations, transactional API, SMTP relay), per day, with transactional latency.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"description":"Inclusive start (message creation time). Default: 30 days ago.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"to","in":"query","required":false,"description":"Exclusive end. Default: now.","schema":{"$ref":"#/components/schemas/IsoDateTime"}}],"responses":{"200":{"description":"Sending summary.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSendingSummary"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/reports/analytics":{"get":{"operationId":"getAnalyticsOverview","summary":"Cross-campaign analytics (S69), raw or filtered.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"description":"Inclusive start (message creation time). Default: 30 days ago.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"to","in":"query","required":false,"description":"Exclusive end. Default: now.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"campaignId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"view","in":"query","required":false,"schema":{"default":"filtered","$ref":"#/components/schemas/ReportView"}}],"responses":{"200":{"description":"Analytics.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/reports/analytics/export":{"get":{"operationId":"exportAnalytics","summary":"CSV export of the analytics rows (aggregates only, formula-safe).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"description":"Inclusive start (message creation time). Default: 30 days ago.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"to","in":"query","required":false,"description":"Exclusive end. Default: now.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"campaignId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"view","in":"query","required":false,"schema":{"default":"filtered","$ref":"#/components/schemas/ReportView"}}],"responses":{"200":{"description":"text/csv","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.export"}},"/v1/workspaces/{workspaceId}/delivery-investigations":{"get":{"operationId":"listDeliveryInvestigations","summary":"Contradictory delivery evidence waiting for an operator (Appendix C investigation queue).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of investigations.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryInvestigationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"message.read"}},"/v1/workspaces/{workspaceId}/contacts/{contactId}/activity":{"get":{"operationId":"getContactActivity","summary":"A contact's delivery and linked engagement events, newest first (S12 activity timeline).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of activity, newest first.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactActivityPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"message.read"}},"/v1/auth/sign-up":{"post":{"operationId":"signUp","summary":"Request an account: emails a single-use verification link. Constant answer whether or not the address is known.","tags":["auth"],"parameters":[],"responses":{"202":{"description":"Verification requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationRequested"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpInput"}}}}}},"/v1/auth/verify-email/resend":{"post":{"operationId":"resendVerification","summary":"Send a fresh verification link to a pending sign-up (constant answer).","tags":["auth"],"parameters":[],"responses":{"202":{"description":"Verification requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationRequested"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationInput"}}}}}},"/v1/auth/verify-email":{"post":{"operationId":"verifyEmail","summary":"Consume a verification token: creates the identity ONCE and signs it in.","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Verified and signed in (session cookie set).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSession"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailInput"}}}}}},"/v1/auth/sign-in":{"post":{"operationId":"signIn","summary":"Password sign-in. Answers `mfa_required` (challenge cookie) when the account has a second factor.","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Signed in, or second factor required.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: INVALID_CREDENTIALS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInInput"}}}}}},"/v1/auth/challenge/totp":{"post":{"operationId":"completeTotpChallenge","summary":"Second factor: authenticator code for the pending sign-in challenge.","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Signed in.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSession"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: INVALID_CREDENTIALS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpChallengeInput"}}}}}},"/v1/auth/challenge/recovery-code":{"post":{"operationId":"completeRecoveryCodeChallenge","summary":"Second factor: a single-use recovery code (consumed on success).","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Signed in.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSession"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: INVALID_CREDENTIALS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodeChallengeInput"}}}}}},"/v1/auth/passkeys/authentication-options":{"post":{"operationId":"passkeyAuthenticationOptions","summary":"WebAuthn request options (discoverable credential, or the pending challenge's account).","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Options for navigator.credentials.get().","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptionsJson"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/auth/passkeys/authenticate":{"post":{"operationId":"authenticateWithPasskey","summary":"Sign in with a passkey (counts as multi-factor).","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Signed in.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSession"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: INVALID_CREDENTIALS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyAuthenticateInput"}}}}}},"/v1/auth/recovery":{"post":{"operationId":"requestRecovery","summary":"Email a password-reset link. Constant answer and timing whether or not the account exists.","tags":["auth"],"parameters":[],"responses":{"202":{"description":"Recovery requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryRequested"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryRequestInput"}}}}}},"/v1/auth/recovery/reset":{"post":{"operationId":"resetPassword","summary":"Consume a recovery token: set a new password, revoke every session and remembered device.","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Password reset.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordReset"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryResetInput"}}}}}},"/v1/auth/invitations/preview":{"post":{"operationId":"previewInvitation","summary":"What an invitation link grants (workspace name, roles, masked email) before accepting it.","tags":["auth"],"parameters":[],"responses":{"200":{"description":"Invitation preview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPreview"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationTokenInput"}}}}}},"/v1/auth/session":{"get":{"operationId":"getAuthSession","summary":"The caller's session: identity, assurance, factors, active workspaces, CSRF token.","tags":["account"],"parameters":[],"responses":{"200":{"description":"Current session.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSession"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/sign-out":{"post":{"operationId":"signOut","summary":"Revoke the current session and clear its cookies.","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"204":{"description":"Signed out.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/sessions":{"get":{"operationId":"listSessions","summary":"The caller's active sessions (devices).","tags":["account"],"parameters":[],"responses":{"200":{"description":"Sessions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionList"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/sessions/{sessionId}":{"delete":{"operationId":"revokeSession","summary":"Revoke one of the caller's sessions (effective on that session's next request).","tags":["account"],"parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/mfa/totp/enrollment":{"post":{"operationId":"startTotpEnrollment","summary":"Generate a pending authenticator secret (not active until confirmed with a code).","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Pending secret.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpEnrollment"}}}},"400":{"description":"Problem: IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/mfa/totp/activation":{"post":{"operationId":"activateTotp","summary":"Confirm the pending secret with a code; returns the recovery codes ONCE.","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Authenticator active.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodes"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: INVALID_CREDENTIALS, UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpActivateInput"}}}}}},"/v1/auth/mfa/totp":{"delete":{"operationId":"disableTotp","summary":"Remove the authenticator (step-up). Refused when a policy requires MFA and no passkey remains.","tags":["account"],"parameters":[],"responses":{"204":{"description":"Removed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/mfa/recovery-codes":{"post":{"operationId":"regenerateRecoveryCodes","summary":"Replace every recovery code (step-up); the old ones stop working immediately.","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"New codes, shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodes"}}}},"400":{"description":"Problem: IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/passkeys/registration-options":{"post":{"operationId":"passkeyRegistrationOptions","summary":"WebAuthn creation options for a new passkey of the caller.","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Options for navigator.credentials.create().","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptionsJson"}}}},"400":{"description":"Problem: IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/passkeys":{"post":{"operationId":"registerPasskey","summary":"Verify and store a new passkey.","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Registered.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Passkey"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: INVALID_CREDENTIALS, UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPasskeyInput"}}}}},"get":{"operationId":"listPasskeys","summary":"The caller's passkeys.","tags":["account"],"parameters":[],"responses":{"200":{"description":"Passkeys.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyList"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/passkeys/{passkeyId}":{"delete":{"operationId":"deletePasskey","summary":"Remove a passkey (step-up).","tags":["account"],"parameters":[{"name":"passkeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Removed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/step-up/passkey-options":{"post":{"operationId":"stepUpPasskeyOptions","summary":"WebAuthn request options to step up with one of the caller's passkeys.","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Options for navigator.credentials.get().","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptionsJson"}}}},"400":{"description":"Problem: IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/step-up":{"post":{"operationId":"stepUp","summary":"Fresh strong re-authentication; unlocks step-up routes for a few minutes (rotates the session).","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Stepped up.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepUpResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: INVALID_CREDENTIALS, UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepUpInput"}}}}}},"/v1/regions":{"get":{"operationId":"listServedRegions","summary":"The data-residency regions this deployment serves: the only ones a workspace or agency client can be created in.","tags":["people"],"parameters":[],"responses":{"200":{"description":"Served regions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServedRegions"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/workspaces":{"post":{"operationId":"createWorkspace","summary":"Create an organization and its first workspace; the caller becomes its owner. Region is fixed here, among the served regions.","tags":["people"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: REGION_NOT_SERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceInput"}}}}}},"/v1/auth/invitations/accept":{"post":{"operationId":"acceptInvitation","summary":"Accept an invitation addressed to the caller's verified email (single use).","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Membership active.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedInvitation"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INVITATION_EMAIL_MISMATCH, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationTokenInput"}}}}}},"/v1/workspaces/{workspaceId}":{"get":{"operationId":"getWorkspace","summary":"Workspace profile.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Workspace.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"},"patch":{"operationId":"updateWorkspace","summary":"Edit name, timezone, locale (never region).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceInput"}}}}}},"/v1/workspaces/{workspaceId}/members":{"get":{"operationId":"listMembers","summary":"Members of the workspace with their roles, factor and last activity, as a collection: search by name or email, filter by status or role, sort by join date (S91).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: status (enum): in, nin — invited | active | suspended | revoked; role (enum): in — owner | admin | marketer | designer | approver | publisher | operator | analyst | billing | privacy | developer | auditor; joinedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: joinedAt. Default joinedAt:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/MembershipStatus"}}],"responses":{"200":{"description":"A page of members.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.read","x-collection":{"resource":"members","fields":[{"key":"name","label":"Member","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"invited","label":"Invited"},{"value":"active","label":"Active"},{"value":"suspended","label":"Suspended"},{"value":"revoked","label":"Revoked"}]},{"key":"role","label":"Role","type":"enum","sortable":false,"filterOperators":["in"],"groupable":false,"options":[{"value":"owner","label":"Owner"},{"value":"admin","label":"Admin"},{"value":"marketer","label":"Marketer"},{"value":"designer","label":"Designer"},{"value":"approver","label":"Approver"},{"value":"publisher","label":"Publisher"},{"value":"operator","label":"Operator"},{"value":"analyst","label":"Analyst"},{"value":"billing","label":"Billing"},{"value":"privacy","label":"Privacy"},{"value":"developer","label":"Developer"},{"value":"auditor","label":"Auditor"}]},{"key":"joinedAt","label":"Joined","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["active"]}]}},{"id":"suspended","label":"Suspended","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["suspended"]}]}},{"id":"revoked","label":"Revoked","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["revoked"]}]}}],"defaultSort":{"field":"joinedAt","dir":"asc"},"search":{"fields":["name"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/members/{membershipId}":{"get":{"operationId":"getMember","summary":"One member with their roles, factor and last activity.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"membershipId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The member.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.read"},"patch":{"operationId":"updateMember","summary":"Change a member's roles (no escalation beyond the caller's own permissions; `owner` only by transfer).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"membershipId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: LAST_OWNER","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberInput"}}}}},"delete":{"operationId":"revokeMember","summary":"Revoke a membership: access ends on the member's next request; their keys and invitations are revoked.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"membershipId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: LAST_OWNER","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage"}},"/v1/workspaces/{workspaceId}/invitations":{"get":{"operationId":"listInvitations","summary":"Pending and past invitations, as a collection: search by email, filter by status, newest first (S91).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over email.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: email (text): contains, starts_with, eq; status (enum): in, nin — pending | accepted | revoked | expired; createdAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of invitations.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.read","x-collection":{"resource":"invitations","fields":[{"key":"email","label":"Email","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"pending","label":"Pending"},{"value":"accepted","label":"Accepted"},{"value":"revoked","label":"Revoked"},{"value":"expired","label":"Expired"}]},{"key":"createdAt","label":"Sent","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"pending","label":"Pending","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["pending"]}]}},{"id":"expired","label":"Expired","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["expired"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["email"],"mode":"contains"}}},"post":{"operationId":"createInvitation","summary":"Invite someone by email (single-use link, 7 days).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Invitation sent.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationInput"}}}}}},"/v1/workspaces/{workspaceId}/invitations/{invitationId}":{"delete":{"operationId":"revokeInvitation","summary":"Revoke a pending invitation (its link stops working).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"invitationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage"}},"/v1/workspaces/{workspaceId}/ownership-transfer":{"post":{"operationId":"transferOwnership","summary":"Make another verified member the owner; the caller becomes admin (step-up).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Transferred.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnershipTransferResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.ownership.transfer","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnershipTransferInput"}}}}}},"/v1/workspaces/{workspaceId}/billing-owner":{"put":{"operationId":"setBillingOwner","summary":"Change the organization's billing owner to an active verified member (step-up, AT-005).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Billing owner set.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingOwner"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingOwnerInput"}}}}}},"/v1/workspaces/{workspaceId}/roles":{"get":{"operationId":"listRoles","summary":"Built-in role bundles and the workspace's custom roles.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Roles.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.read"},"post":{"operationId":"createRole","summary":"Create a custom role (validated against the separation rules; no escalation).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoleInput"}}}}}},"/v1/workspaces/{workspaceId}/roles/{roleId}":{"patch":{"operationId":"updateRole","summary":"Edit a custom role.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"roleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleDefinition"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleInput"}}}}},"delete":{"operationId":"deleteRole","summary":"Delete a custom role that no active member holds.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"roleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage"}},"/v1/workspaces/{workspaceId}/security-policy":{"get":{"operationId":"getSecurityPolicy","summary":"IP allowlist, MFA requirement, four-eyes approval; SSO/SCIM status (P2).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Policy.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityPolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"},"patch":{"operationId":"updateSecurityPolicy","summary":"Change the security policy (step-up). Refuses an allowlist that would lock the caller out.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityPolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecurityPolicyInput"}}}}}},"/v1/workspaces/{workspaceId}/audit-events":{"get":{"operationId":"listAuditEvents","summary":"Audit trail of the workspace, newest first, as a collection: exact correlation / resource id search, action prefix, actor, result and date filters (S94).","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over requestId, resourceId.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: occurredAt (date): eq, gt, gte, lt, lte, between; action (text): starts_with, eq; actorType (enum): in, nin — user | api_key | mcp_agent | system | platform_staff | oauth_app; actorId (ref): in; resourceType (text): eq; resourceId (text): eq; result (enum): in, nin — success | denied | failure; requestId (text): eq. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates, \"@me\" for the caller on user references.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: occurredAt. Default occurredAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"action","in":"query","required":false,"description":"Legacy: action prefix, e.g. `membership.` (prefer the `action` filter).","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"actorId","in":"query","required":false,"description":"Legacy: one actor id (prefer the `actorId` filter).","schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"result","in":"query","required":false,"description":"Legacy: one result (prefer the `result` filter).","schema":{"type":"string","enum":["success","denied","failure"]}}],"responses":{"200":{"description":"A page of audit events and the total (an estimate on a big log).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audit.read","x-collection":{"resource":"audit-events","fields":[{"key":"occurredAt","label":"Time","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"action","label":"Action","type":"text","sortable":false,"filterOperators":["starts_with","eq"],"groupable":false},{"key":"actorType","label":"Actor type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"user","label":"Person"},{"value":"api_key","label":"API key"},{"value":"mcp_agent","label":"MCP agent"},{"value":"system","label":"System"},{"value":"platform_staff","label":"Platform staff"},{"value":"oauth_app","label":"OAuth application"}]},{"key":"actorId","label":"Actor","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false,"currentUser":true},{"key":"resourceType","label":"Resource type","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"resourceId","label":"Resource id","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"result","label":"Result","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"success","label":"Success"},{"value":"denied","label":"Denied"},{"value":"failure","label":"Failure"}]},{"key":"requestId","label":"Correlation id","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false}],"quickFilters":[{"id":"mine","label":"My actions","filter":{"op":"and","conditions":[{"field":"actorId","operator":"in","value":["@me"]}]}},{"id":"refused","label":"Denied or failed","filter":{"op":"and","conditions":[{"field":"result","operator":"in","value":["denied","failure"]}]}},{"id":"staff","label":"Platform staff","filter":{"op":"and","conditions":[{"field":"actorType","operator":"in","value":["platform_staff"]}]}},{"id":"integrations","label":"Keys, agents and apps","filter":{"op":"and","conditions":[{"field":"actorType","operator":"in","value":["api_key","mcp_agent","oauth_app"]}]}}],"defaultSort":{"field":"occurredAt","dir":"desc"},"search":{"fields":["requestId","resourceId"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/audit-events/{auditEventId}":{"get":{"operationId":"getAuditEvent","summary":"One audit event of the workspace: actor, action, resource, result, correlation id, hashes, reason and non-personal metadata.","tags":["people"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"auditEventId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The event.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEvent"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audit.read"}},"/v1/workspaces/{workspaceId}/campaigns":{"get":{"operationId":"listCampaigns","summary":"List campaigns: search, filter, sort, group (collection view, ADR 0039); automation emails only with type=automation.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; state (enum): in, nin — draft | validating | awaiting_approval | approved | scheduled | dispatching | completed | paused | cancelling | cancelled | failed | completed_with_errors; type (enum): in, nin — broadcast | newsletter | ab_experiment | recurring_digest | transactional_template; purpose (enum): in, nin — marketing | transactional; subject (text): contains, starts_with, eq; sender (ref): in, nin; owner (ref): in, nin; folder (text): eq, neq, is_set, is_not_set; archived (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates, \"@me\" for the caller on user references.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, state, createdAt, updatedAt. Default updatedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (state, type, purpose): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"description":"Legacy: prefer filter state in [...].","schema":{"$ref":"#/components/schemas/CampaignState"}},{"name":"type","in":"query","required":false,"description":"Legacy; `automation` lists the automation emails (excluded otherwise).","schema":{"$ref":"#/components/schemas/CampaignType"}},{"name":"folder","in":"query","required":false,"description":"Legacy: prefer filter folder eq.","schema":{"type":"string","maxLength":120}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"query","in":"query","required":false,"description":"Legacy: case-insensitive substring of the name; prefer `q`.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"ownerUserId","in":"query","required":false,"description":"Legacy: prefer filter owner in [...].","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"archived","in":"query","required":false,"description":"Legacy archive scope. Default: archived campaigns are excluded, unless the filter has a condition on `archived`.","schema":{"type":"string","enum":["exclude","include","only"]}}],"responses":{"200":{"description":"A page of campaigns, with the total and, when grouped, whole-collection group counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read","x-collection":{"resource":"campaigns","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"state","label":"Status","type":"enum","sortable":true,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"validating","label":"Validating"},{"value":"awaiting_approval","label":"Awaiting approval"},{"value":"approved","label":"Approved"},{"value":"scheduled","label":"Scheduled"},{"value":"dispatching","label":"Sending"},{"value":"completed","label":"Sent"},{"value":"paused","label":"Paused"},{"value":"cancelling","label":"Cancelling"},{"value":"cancelled","label":"Cancelled"},{"value":"failed","label":"Failed"},{"value":"completed_with_errors","label":"Sent with errors"}]},{"key":"type","label":"Type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"broadcast","label":"Broadcast"},{"value":"newsletter","label":"Newsletter"},{"value":"ab_experiment","label":"A/B experiment"},{"value":"recurring_digest","label":"Recurring digest"},{"value":"transactional_template","label":"Transactional template"}]},{"key":"purpose","label":"Stream","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"marketing","label":"Marketing"},{"value":"transactional","label":"Transactional"}]},{"key":"subject","label":"Subject","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"sender","label":"Sender","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"owner","label":"Owner","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false,"currentUser":true},{"key":"folder","label":"Folder","type":"text","sortable":false,"filterOperators":["eq","neq","is_set","is_not_set"],"groupable":false},{"key":"archived","label":"Archived","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"drafts","label":"Drafts","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["draft"]}]}},{"id":"scheduled","label":"Scheduled","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["scheduled"]}]}},{"id":"sent","label":"Sent","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["completed","completed_with_errors"]}]}},{"id":"mine","label":"Mine","filter":{"op":"and","conditions":[{"field":"owner","operator":"in","value":["@me"]}]}},{"id":"archived","label":"Archived","filter":{"op":"and","conditions":[{"field":"archived","operator":"eq","value":true}]}}],"defaultSort":{"field":"updatedAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createCampaign","summary":"Create a campaign draft (optionally from a template version).","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SENDER_UNVERIFIED, CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.create","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}":{"get":{"operationId":"getCampaign","summary":"Read a campaign with its current draft.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The campaign.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"patch":{"operationId":"updateCampaign","summary":"Patch metadata and/or the draft (autosave). 412 on a stale revision: fetch, compare, re-apply.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_NOT_EDITABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SENDER_UNVERIFIED, CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCampaignInput"}}}}},"delete":{"operationId":"deleteCampaign","summary":"Delete a DRAFT campaign that was never versioned, approved or sent (anything with history is archived instead).","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/archive":{"post":{"operationId":"archiveCampaign","summary":"Archive a finished campaign (completed, completed with errors, cancelled, failed): hidden from the default list, reports kept.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Archived.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/unarchive":{"post":{"operationId":"unarchiveCampaign","summary":"Bring an archived campaign back to the default list.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Unarchived.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/clone":{"post":{"operationId":"cloneCampaign","summary":"Clone into a new draft: content and asset references copied; no version, approval or schedule carried over (AT-017).","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The new draft.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.create","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneCampaignInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/preview":{"post":{"operationId":"previewCampaign","summary":"Browser preview + content checks of the draft (or of unsaved edits) for a fixture or a real contact.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rendered preview (labelled browser_preview) and checks.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/revisions":{"get":{"operationId":"listCampaignRevisions","summary":"Draft revision history, newest first.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of revisions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentRevisionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/revisions/{revisionId}":{"get":{"operationId":"getCampaignRevision","summary":"One saved revision with its full snapshot (compare before restoring).","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"revisionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The revision.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentRevision"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/revisions/{revisionId}/restore":{"post":{"operationId":"restoreCampaignRevision","summary":"Restore a revision into the draft (a NEW revision; history is never rewritten).","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"revisionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The draft after restore.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_NOT_EDITABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/versions":{"get":{"operationId":"listCampaignVersions","summary":"Immutable versions, newest first.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of versions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVersionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"post":{"operationId":"createCampaignVersion","summary":"Compile the current draft with the pinned renderer into an immutable version (content hash, asset manifest).","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVersion"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_NOT_EDITABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignVersionInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/versions/{versionId}":{"get":{"operationId":"getCampaignVersion","summary":"One immutable version with its block JSON, HTML and text.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"versionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignVersion"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/content/merge-fields":{"get":{"operationId":"listMergeFields","summary":"Merge fields the editor may insert, with their protection (encrypted fields are listed as not mergeable).","tags":["content"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The catalog.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeFieldCatalog"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"}},"/v1/workspaces/{workspaceId}/content/sender-options":{"get":{"operationId":"listSenderOptions","summary":"Sender identities a campaign may use, with their verification state.","tags":["content"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Sender identities.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderOptionList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/content/html-imports":{"post":{"operationId":"importHtmlContent","summary":"Sanitize untrusted HTML and propose a block conversion with an explicit loss report (nothing is stored).","tags":["content"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Sanitized HTML and the conversion proposal.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlImportResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlImportInput"}}}}}},"/v1/workspaces/{workspaceId}/content/settings":{"get":{"operationId":"getContentSettings","summary":"Footer compliance settings (postal address, company name). Revision 1 with empty values when never set.","tags":["content"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The settings.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"patch":{"operationId":"updateContentSettings","summary":"Set the postal address / company name printed in footers (affects every later version).","tags":["content"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContentSettingsInput"}}}}}},"/v1/workspaces/{workspaceId}/templates":{"get":{"operationId":"listTemplates","summary":"Template library: shared templates and the caller's own restricted ones; search, filter, sort, group (collection view, ADR 0039).","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; kind (enum): in, nin — email | section; shared (bool): eq; published (bool): eq; owner (ref): in, nin; folder (text): eq, neq, is_set, is_not_set; archived (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates, \"@me\" for the caller on user references.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt, updatedAt. Default updatedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (kind, shared): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"kind","in":"query","required":false,"description":"Legacy: prefer filter kind in [...].","schema":{"$ref":"#/components/schemas/TemplateKind"}},{"name":"folder","in":"query","required":false,"description":"Legacy: prefer filter folder eq.","schema":{"type":"string","maxLength":120}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"query","in":"query","required":false,"description":"Legacy: case-insensitive substring of the name; prefer `q`.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"archived","in":"query","required":false,"description":"Legacy archive scope. Default: archived templates are excluded, unless the filter has a condition on `archived`.","schema":{"type":"string","enum":["exclude","include","only"]}},{"name":"include","in":"query","required":false,"description":"`draft`: each row carries its draft (subject, preheader, blocks) for thumbnails.","schema":{"type":"string","const":"draft"}}],"responses":{"200":{"description":"A page of templates, with the total and, when grouped, whole-collection group counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read","x-collection":{"resource":"templates","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"kind","label":"Type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"email","label":"Email"},{"value":"section","label":"Reusable section"}]},{"key":"shared","label":"Access","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":true,"options":[{"value":"true","label":"Whole workspace"},{"value":"false","label":"Only the owner"}]},{"key":"published","label":"Published","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"owner","label":"Owner","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false,"currentUser":true},{"key":"folder","label":"Folder","type":"text","sortable":false,"filterOperators":["eq","neq","is_set","is_not_set"],"groupable":false},{"key":"archived","label":"Archived","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"emails","label":"Emails","filter":{"op":"and","conditions":[{"field":"kind","operator":"in","value":["email"]}]}},{"id":"sections","label":"Sections","filter":{"op":"and","conditions":[{"field":"kind","operator":"in","value":["section"]}]}},{"id":"published","label":"Published","filter":{"op":"and","conditions":[{"field":"published","operator":"eq","value":true}]}},{"id":"mine","label":"Mine","filter":{"op":"and","conditions":[{"field":"owner","operator":"in","value":["@me"]}]}},{"id":"archived","label":"Archived","filter":{"op":"and","conditions":[{"field":"archived","operator":"eq","value":true}]}}],"defaultSort":{"field":"updatedAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createTemplate","summary":"Create a template (or save a campaign draft as one).","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/templates/{templateId}":{"get":{"operationId":"getTemplate","summary":"Read a template (a restricted template of another user is NOT_FOUND).","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The template.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"},"patch":{"operationId":"updateTemplate","summary":"Patch a template's metadata, access or draft.","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateInput"}}}}},"delete":{"operationId":"deleteTemplate","summary":"Delete a template that has no published version (a published one is archived instead).","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: TEMPLATE_PUBLISHED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit"}},"/v1/workspaces/{workspaceId}/templates/{templateId}/preview":{"post":{"operationId":"previewTemplate","summary":"Browser preview + checks of a template draft.","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rendered preview and checks.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewInputInput"}}}}}},"/v1/workspaces/{workspaceId}/templates/{templateId}/versions":{"get":{"operationId":"listTemplateVersions","summary":"Published template versions, newest first.","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of versions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateVersionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"},"post":{"operationId":"createTemplateVersion","summary":"Publish the template draft as an immutable version.","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateVersion"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignVersionInput"}}}}}},"/v1/workspaces/{workspaceId}/templates/{templateId}/versions/{versionId}":{"get":{"operationId":"getTemplateVersion","summary":"One template version.","tags":["templates"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"versionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateVersion"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"}},"/v1/workspaces/{workspaceId}/asset-capabilities":{"get":{"operationId":"getAssetCapabilities","summary":"What this deployment offers for files: public image hosting (publish) and malware scanning.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The capabilities.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetCapabilities"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"}},"/v1/workspaces/{workspaceId}/assets":{"get":{"operationId":"listAssets","summary":"Asset gallery: search, filter, sort, group (collection view, ADR 0039); image rows carry a short-lived preview URL.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over fileName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: fileName (text): contains, starts_with, eq, neq; kind (enum): in, nin — image | attachment; status (enum): in, nin — uploading | pending_scan | clean | quarantined | scan_unavailable; published (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: fileName, createdAt, updatedAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (kind, status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"kind","in":"query","required":false,"description":"Legacy: prefer filter kind in [...].","schema":{"$ref":"#/components/schemas/AssetKind"}},{"name":"status","in":"query","required":false,"description":"Legacy: prefer filter status in [...].","schema":{"$ref":"#/components/schemas/AssetStatus"}},{"name":"query","in":"query","required":false,"description":"Legacy: case-insensitive substring of the file name; prefer `q`.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"deleted","in":"query","required":false,"schema":{"default":"exclude","type":"string","enum":["exclude","include","only"]}}],"responses":{"200":{"description":"A page of assets, with the total and, when grouped, whole-collection group counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read","x-collection":{"resource":"assets","fields":[{"key":"fileName","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"kind","label":"Type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"image","label":"Image"},{"value":"attachment","label":"PDF file"}]},{"key":"status","label":"Scan status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"uploading","label":"Uploading"},{"value":"pending_scan","label":"Scanning"},{"value":"clean","label":"Scanned clean"},{"value":"quarantined","label":"Quarantined"},{"value":"scan_unavailable","label":"Not scanned"}]},{"key":"published","label":"Published","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Uploaded","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"images","label":"Images","filter":{"op":"and","conditions":[{"field":"kind","operator":"in","value":["image"]}]}},{"id":"files","label":"PDF files","filter":{"op":"and","conditions":[{"field":"kind","operator":"in","value":["attachment"]}]}},{"id":"published","label":"Published","filter":{"op":"and","conditions":[{"field":"published","operator":"eq","value":true}]}},{"id":"attention","label":"Needs attention","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["quarantined","scan_unavailable"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["fileName"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/assets/uploads":{"post":{"operationId":"createAssetUpload","summary":"Start an upload: validates type and size, returns a short-lived signed PUT URL into the workspace's quarantine prefix.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Upload ticket.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetUploadTicket"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: ASSET_TYPE_NOT_ALLOWED, ASSET_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"asset.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssetUploadInput"}}}}}},"/v1/workspaces/{workspaceId}/assets/{assetId}/complete":{"post":{"operationId":"completeAssetUpload","summary":"Finish an upload: sniff the bytes, re-encode images (metadata stripped), scan, store. Type confusion is refused.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"assetId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The processed asset.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ASSET_UPLOAD_INCOMPLETE, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: ASSET_TYPE_NOT_ALLOWED, ASSET_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"asset.manage"}},"/v1/workspaces/{workspaceId}/assets/{assetId}":{"get":{"operationId":"getAsset","summary":"One asset with its usage.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"assetId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The asset.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"},"patch":{"operationId":"updateAsset","summary":"Rename or set the alternative text.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"assetId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"asset.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetInput"}}}}},"delete":{"operationId":"deleteAsset","summary":"Soft-delete: hidden from the gallery and from new content; kept while an immutable version references it (AT-024).","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"assetId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The deleted asset.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"asset.manage"}},"/v1/workspaces/{workspaceId}/assets/{assetId}/publish":{"post":{"operationId":"publishAsset","summary":"Publish an image for recipients (reviewed). Refused unless the malware scan returned clean.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"assetId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The published asset.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ASSET_NOT_CLEAN, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"asset.manage"}},"/v1/workspaces/{workspaceId}/assets/{assetId}/rescan":{"post":{"operationId":"rescanAsset","summary":"Scan again a file that could not be scanned (status scan_unavailable): clean → usable for recipients, infected → quarantined, scanner still unavailable → unchanged. Any other status is returned as is.","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"assetId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The asset after the scan.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"asset.manage"}},"/v1/workspaces/{workspaceId}/assets/{assetId}/download":{"get":{"operationId":"getAssetDownload","summary":"A short-lived signed URL to the processed object (never the raw upload).","tags":["assets"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"assetId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Signed URL.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetDownload"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ASSET_NOT_CLEAN","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"}},"/v1/workspaces/{workspaceId}/routing/simulate":{"post":{"operationId":"simulateRouting","summary":"Simulate route eligibility (reason codes) and the traffic split for a campaign or stream (read-only).","tags":["routing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Eligible and ineligible routes with machine reason codes.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingSimulation"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateRoutingInput"}}}}}},"/v1/workspaces/{workspaceId}/routing/quotas":{"get":{"operationId":"getDispatchQuotas","summary":"Rate limits per scope (workspace, sender domain, pool, endpoint, recipient MX…) with their current usage, and warm-up ceilings per mailbox provider (R055, R056).","tags":["routing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Configured limits and current consumption.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchQuotas"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/messages":{"get":{"operationId":"listMessages","summary":"Message log: one row per recipient intent and generation — exact message id or recipient lookup, filter by state, stream or campaign, newest first (collection view, ADR 0039).","tags":["messages"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over recipient.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: state (enum): in, nin — eligible | suppressed | reserved | queued | submitting | provider_accepted | reported_delivered | deferred | bounced | complained | failed | cancelled | submission_unknown; stream (enum): in, nin — marketing | transactional; campaignId (ref): in; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"campaignId","in":"query","required":false,"description":"One campaign's messages (the selected-retry view, R029).","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"state","in":"query","required":false,"description":"Legacy: prefer a filter on `state`.","schema":{"$ref":"#/components/schemas/MessageState"}},{"name":"stream","in":"query","required":false,"description":"Legacy: prefer a filter on `stream`.","schema":{"$ref":"#/components/schemas/Stream"}}],"responses":{"200":{"description":"A page of messages and the total (an estimate on large logs).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"message.read","x-collection":{"resource":"messages","fields":[{"key":"recipient","label":"Recipient","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"eligible","label":"Eligible"},{"value":"suppressed","label":"Suppressed"},{"value":"reserved","label":"Reserved"},{"value":"queued","label":"Queued"},{"value":"submitting","label":"Submitting"},{"value":"provider_accepted","label":"Accepted by provider"},{"value":"reported_delivered","label":"Reported delivered"},{"value":"deferred","label":"Deferred"},{"value":"bounced","label":"Bounced"},{"value":"complained","label":"Complaint"},{"value":"failed","label":"Failed"},{"value":"cancelled","label":"Cancelled"},{"value":"submission_unknown","label":"Outcome unknown"}]},{"key":"stream","label":"Stream","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"marketing","label":"Marketing"},{"value":"transactional","label":"Transactional"}]},{"key":"campaignId","label":"Campaign","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"failed","label":"Failed","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["failed"]}]}},{"id":"bounced","label":"Bounced","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["bounced"]}]}},{"id":"deferred","label":"Deferred","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["deferred"]}]}},{"id":"unknown","label":"Outcome unknown","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["submission_unknown"]}]}},{"id":"transactional","label":"Transactional","filter":{"op":"and","conditions":[{"field":"stream","operator":"in","value":["transactional"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["recipient"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/messages/{messageId}":{"get":{"operationId":"getMessage","summary":"One message with its attempts, route decisions, reservation and delivery events.","tags":["messages"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The message.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"message.read"}},"/v1/workspaces/{workspaceId}/messages/{messageId}/resend":{"post":{"operationId":"resendMessage","summary":"Operator resend: a NEW audited generation of a failed or unknown message (duplication warning when unknown).","tags":["messages"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"The new generation is reserved and queued (not sent).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SUBMISSION_UNKNOWN, APPROVAL_STALE, CONFLICT, CREDIT_RESERVATION_FAILED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendMessageInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/usage":{"get":{"operationId":"getUsageSummary","summary":"Usage ledger summary: available/reserved/settled units and reservation states for a period.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IsoDateTime"}}],"responses":{"200":{"description":"Balances from the append-only journal.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummary"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/reservations":{"get":{"operationId":"listReservations","summary":"Credit reservations (held, held_unknown, settled, released) — message ids only, no recipient data — as a collection: exact message id search, status / route filters, newest first (S87).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over messageId.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: status (enum): in, nin — held | settled | released | held_unknown; routeType (enum): in, nin — managed | byos; createdAt (date): eq, gt, gte, lt, lte, between; settledAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/ReservationStatus"}}],"responses":{"200":{"description":"A page of reservations (the total an estimate on a big ledger).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReservationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read","x-collection":{"resource":"reservations","fields":[{"key":"messageId","label":"Message","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"held","label":"Held"},{"value":"settled","label":"Settled"},{"value":"released","label":"Released"},{"value":"held_unknown","label":"Held — outcome unknown"}]},{"key":"routeType","label":"Route type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"managed","label":"Managed"},{"value":"byos","label":"Own server"}]},{"key":"createdAt","label":"Reserved","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"settledAt","label":"Settled","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"open","label":"Open holds","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["held","held_unknown"]}]}},{"id":"unknown","label":"Outcome unknown","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["held_unknown"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["messageId"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/billing/ledger":{"get":{"operationId":"listLedgerTransactions","summary":"Balanced journal transactions with their entries (append-only), newest first, as a collection: exact key or message id search, entry type and date filters (S87).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over idempotencyKey.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: occurredAt (date): eq, gt, gte, lt, lte, between; type (enum): in, nin — credit_grant | credit_purchase | reservation | reservation_release | usage_settlement | adjustment | refund; idempotencyKey (text): eq. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: occurredAt. Default occurredAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of ledger transactions (the total an estimate on a big journal).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerTransactionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read","x-collection":{"resource":"ledger-transactions","fields":[{"key":"occurredAt","label":"When","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"type","label":"Entry","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"credit_grant","label":"Credit grant"},{"value":"credit_purchase","label":"Credit purchase"},{"value":"reservation","label":"Reservation"},{"value":"reservation_release","label":"Reservation released"},{"value":"usage_settlement","label":"Usage settled"},{"value":"adjustment","label":"Adjustment"},{"value":"refund","label":"Refund"}]},{"key":"idempotencyKey","label":"Key","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false}],"quickFilters":[{"id":"credits","label":"Credits and adjustments","filter":{"op":"and","conditions":[{"field":"type","operator":"in","value":["credit_grant","credit_purchase","adjustment","refund"]}]}},{"id":"settlements","label":"Usage settled","filter":{"op":"and","conditions":[{"field":"type","operator":"in","value":["usage_settlement"]}]}}],"defaultSort":{"field":"occurredAt","dir":"desc"},"search":{"fields":["idempotencyKey"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/api-keys":{"get":{"operationId":"listApiKeys","summary":"Service keys of the workspace (never their secrets), as a collection: search, filter, sort (S77).","tags":["developers"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; state (enum): in, nin — active | expired | revoked; createdAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between; lastUsedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of keys.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"api_keys.manage","x-collection":{"resource":"api-keys","fields":[{"key":"name","label":"Name","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"state","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"active","label":"Active"},{"value":"expired","label":"Expired"},{"value":"revoked","label":"Revoked"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"lastUsedAt","label":"Last used","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active"]}]}},{"id":"expired","label":"Expired","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["expired"]}]}},{"id":"revoked","label":"Revoked","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["revoked"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createApiKey","summary":"Issue a scoped, expiring service key. The secret is in this response only.","tags":["developers"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created; `secret` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"api_keys.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyInput"}}}}}},"/v1/workspaces/{workspaceId}/api-keys/{apiKeyId}":{"get":{"operationId":"getApiKey","summary":"One service key (metadata, last use).","tags":["developers"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"apiKeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The key.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"api_keys.manage"}},"/v1/workspaces/{workspaceId}/api-keys/{apiKeyId}/revoke":{"post":{"operationId":"revokeApiKey","summary":"Revoke a key; the very next request with it is refused.","tags":["developers"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"apiKeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"api_keys.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeInput"}}}}}},"/v1/workspaces/{workspaceId}/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","summary":"Outgoing webhook endpoints with their last delivery, as a collection: search, filter, sort, group (S78).","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over url, description.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: url (text): contains, starts_with, eq, neq; description (text): contains, is_set, is_not_set; status (enum): in, nin — pending_verification | active | disabled; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of endpoints.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read","x-collection":{"resource":"webhook-endpoints","fields":[{"key":"url","label":"URL","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"description","label":"Description","type":"text","sortable":false,"filterOperators":["contains","is_set","is_not_set"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"pending_verification","label":"Pending verification"},{"value":"active","label":"Active"},{"value":"disabled","label":"Disabled"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last changed","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["active"]}]}},{"id":"pending","label":"Pending verification","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["pending_verification"]}]}},{"id":"disabled","label":"Disabled","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["disabled"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["url","description"],"mode":"contains"}}},"post":{"operationId":"createWebhookEndpoint","summary":"Add an HTTPS endpoint (pending until verified). The signing secret is in this response only.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created; `signingSecret` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretIssued"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: WEBHOOK_URL_REFUSED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointInput"}}}}}},"/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}":{"get":{"operationId":"getWebhookEndpoint","summary":"One endpoint.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The endpoint.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"},"patch":{"operationId":"updateWebhookEndpoint","summary":"Change URL (back to pending verification), events or description, or disable.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: WEBHOOK_URL_REFUSED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpointInput"}}}}}},"/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/verify":{"post":{"operationId":"verifyWebhookEndpoint","summary":"Send a signed challenge; the receiver must echo it. Success activates the endpoint.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Verification outcome (the endpoint stays pending on failure).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookVerificationResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage"}},"/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","summary":"New signing secret; the previous one keeps signing (second signature) for the overlap.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rotated; `signingSecret` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretIssued"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateWebhookSecretInput"}}}}}},"/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"Deliveries (one per event) of an endpoint, newest first.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"state","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WebhookDeliveryState"}}],"responses":{"200":{"description":"A page of deliveries.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}/attempts":{"get":{"operationId":"listWebhookAttempts","summary":"Every HTTP attempt of an endpoint (AT-080: the UI exposes every attempt), newest first.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"deliveryId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of attempts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAttemptPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/webhook-attempts/{attemptId}/replay":{"post":{"operationId":"replayWebhookAttempt","summary":"Deliver the attempt's event again (dead-lettered or not), preserving the ORIGINAL event id.","tags":["webhooks"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"attemptId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Queued; delivery happens asynchronously.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookReplayAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayWebhookInput"}}}}}},"/v1/workspaces/{workspaceId}/mcp/connections":{"get":{"operationId":"listAgentConnections","summary":"AI clients connected to the workspace through OAuth, with policy, budgets and usage, as a collection: search by client, filter by status / policy / person, group by policy (S79).","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over clientName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: clientName (text): contains, starts_with, eq; status (enum): in, nin — active | expired | revoked; approvalPolicy (enum): in, nin — read_only | draft | execute_with_grant; userId (ref): in, nin; createdAt (date): eq, gt, gte, lt, lte, between; lastUsedAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates, \"@me\" for the caller on user references.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (approvalPolicy): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of connections.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentConnectionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read","x-collection":{"resource":"mcp-connections","fields":[{"key":"clientName","label":"Client","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"active","label":"Connected"},{"value":"expired","label":"Expired"},{"value":"revoked","label":"Revoked"}]},{"key":"approvalPolicy","label":"Approval policy","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"read_only","label":"Read only"},{"value":"draft","label":"Drafts"},{"value":"execute_with_grant","label":"Execute with grant"}]},{"key":"userId","label":"Connected by","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false,"currentUser":true},{"key":"createdAt","label":"Connected","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"lastUsedAt","label":"Last used","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Connected","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["active"]}]}},{"id":"mine","label":"Connected by me","filter":{"op":"and","conditions":[{"field":"userId","operator":"in","value":["@me"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["clientName"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/mcp/connections/{connectionId}":{"get":{"operationId":"getAgentConnection","summary":"One connection.","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The connection.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"},"patch":{"operationId":"updateAgentConnection","summary":"Change the approval policy or budgets, or narrow the scopes (effective on the next tool call).","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agent.grants.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentConnectionInput"}}}}}},"/v1/workspaces/{workspaceId}/mcp/connections/{connectionId}/revoke":{"post":{"operationId":"revokeAgentConnection","summary":"Disconnect: every token and every unused approval grant of the connection stops working immediately.","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agent.grants.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeInput"}}}}}},"/v1/workspaces/{workspaceId}/mcp/tool-calls":{"get":{"operationId":"listAgentToolCalls","summary":"Tool audit: every MCP tool call with its outcome (arguments are hashed, not stored), newest first, as a collection: exact correlation id or tool search, client / outcome / date filters (S79).","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over requestId, tool.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: tool (text): eq; connectionId (ref): in, nin; outcome (enum): in, nin — ok | denied | budget_exceeded | invalid_input | failed; requestId (text): eq; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"connectionId","in":"query","required":false,"description":"Legacy: one connection (prefer the `connectionId` filter).","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of tool calls.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentToolCallPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read","x-collection":{"resource":"mcp-tool-calls","fields":[{"key":"tool","label":"Tool","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"connectionId","label":"Client","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"outcome","label":"Outcome","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"ok","label":"OK"},{"value":"denied","label":"Denied"},{"value":"budget_exceeded","label":"Budget exceeded"},{"value":"invalid_input","label":"Invalid input"},{"value":"failed","label":"Failed"}]},{"key":"requestId","label":"Correlation id","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"When","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"refused","label":"Refused or failed","filter":{"op":"and","conditions":[{"field":"outcome","operator":"nin","value":["ok"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["requestId","tool"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/mcp/approval-grants":{"get":{"operationId":"listMcpGrants","summary":"Approval grants issued to agents (never their tokens), newest first, as a collection: status, client and issuer filters (S79).","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: status (enum): in, nin — unused | used | revoked | expired; clientId (ref): in, nin; issuedByUserId (ref): in, nin; createdAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates, \"@me\" for the caller on user references.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/McpGrantStatus"}}],"responses":{"200":{"description":"A page of grants.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpGrantPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agent.grants.manage","x-collection":{"resource":"mcp-grants","fields":[{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"unused","label":"Unused"},{"value":"used","label":"Used"},{"value":"revoked","label":"Revoked"},{"value":"expired","label":"Expired"}]},{"key":"clientId","label":"Client","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"issuedByUserId","label":"Issued by","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false,"currentUser":true},{"key":"createdAt","label":"Issued","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"unused","label":"Unused","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["unused"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"}}},"post":{"operationId":"createMcpGrant","summary":"A PERSON issues a short-lived, one-use grant letting one agent connection execute one approval (invariant 11).","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created; `token` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedMcpGrant"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: AGENT_POLICY_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: APPROVAL_STALE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: AGENT_BUDGET_EXCEEDED, RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agent.grants.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMcpGrantInput"}}}}}},"/v1/workspaces/{workspaceId}/mcp/approval-grants/{grantId}/revoke":{"post":{"operationId":"revokeMcpGrant","summary":"Revoke an unused grant (immediate).","tags":["mcp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"grantId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked (or already used/expired: unchanged).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpGrant"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agent.grants.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeInput"}}}}}},"/.well-known/oauth-authorization-server":{"get":{"operationId":"getAuthorizationServerMetadata","summary":"RFC 8414 authorization server metadata (PKCE S256, public clients, resource indicators).","tags":["oauth"],"parameters":[],"responses":{"200":{"description":"Metadata.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationServerMetadata"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/oauth/register":{"post":{"operationId":"registerOAuthClient","summary":"RFC 7591 dynamic registration of a PUBLIC client (no secret; loopback or https redirect URIs).","tags":["oauth"],"parameters":[],"responses":{"201":{"description":"Registered (body: ClientRegistration). Errors use the RFC 7591 §3.2.2 format.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRegistrationInput"}}}}}},"/oauth/authorize":{"get":{"operationId":"authorizeOAuth","summary":"Authorization endpoint: validates the request (PKCE S256, resource, redirect URI) and sends the browser to the console consent page.","tags":["oauth"],"parameters":[{"name":"response_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"client_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string"}},{"name":"resource","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Never 200: 302 to the consent page, or 302 back to the client with an error, or 400 when the client/redirect cannot be trusted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/oauth/token":{"post":{"operationId":"oauthToken","summary":"Token endpoint (form-encoded): authorization_code with PKCE + resource, refresh_token with rotation. RFC 6749 errors.","tags":["oauth"],"parameters":[],"responses":{"200":{"description":"Tokens bound to the requested resource (audience) (body: TokenResponse). Errors use the RFC 6749 §5.2 format, except the throttle.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/oauth/revoke":{"post":{"operationId":"oauthRevoke","summary":"RFC 7009 token revocation (form-encoded). Always 200.","tags":["oauth"],"parameters":[],"responses":{"200":{"description":"Revoked or unknown (indistinguishable).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/oauth/authorization-requests/{requestId}":{"get":{"operationId":"getAuthorizationRequest","summary":"What a pending authorization request asks for (consent page).","tags":["oauth"],"parameters":[{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The request and the workspaces the person may connect.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationRequestView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/oauth/authorization-requests/{requestId}/decision":{"post":{"operationId":"decideAuthorizationRequest","summary":"Approve (workspace, scopes ⊆ own permissions, policy, budgets, expiry) or deny. Returns where to send the browser.","tags":["oauth"],"parameters":[{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The redirect for the client.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationDecisionResult"}}}},"400":{"description":"Problem: TOKEN_INVALID, VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationDecisionInput"}}}}}},"/v1/workspaces/{workspaceId}/oauth-applications":{"get":{"operationId":"listOAuthApplications","summary":"OAuth applications this workspace publishes (never their secrets), as a collection (S77).","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; status (enum): in, nin — active | disabled; clientType (enum): in, nin — confidential | public; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status, clientType): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of applications.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApplicationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read","x-collection":{"resource":"oauth-applications","fields":[{"key":"name","label":"Name","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"active","label":"Active"},{"value":"disabled","label":"Disabled"}]},{"key":"clientType","label":"Client type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"confidential","label":"Confidential (server)"},{"value":"public","label":"Public (native, PKCE only)"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last changed","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["active"]}]}},{"id":"disabled","label":"Disabled","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["disabled"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createOAuthApplication","summary":"Register an OAuth application (a person only). A confidential one gets its client secret in this response only.","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Registered; `clientSecret` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApplicationIssued"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOAuthApplicationInput"}}}}}},"/v1/workspaces/{workspaceId}/oauth-applications/{applicationId}":{"get":{"operationId":"getOAuthApplication","summary":"One application this workspace publishes.","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"applicationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The application.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApplication"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"},"patch":{"operationId":"updateOAuthApplication","summary":"Change the name, redirect URIs, allowed scopes or audience. Narrower scopes or audience apply to existing grants on their next request.","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"applicationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApplication"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOAuthApplicationInput"}}}}}},"/v1/workspaces/{workspaceId}/oauth-applications/{applicationId}/rotate-secret":{"post":{"operationId":"rotateOAuthApplicationSecret","summary":"Issue a new client secret (confidential applications); the previous one stops working immediately.","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"applicationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The new secret, shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApplicationIssued"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage"}},"/v1/workspaces/{workspaceId}/oauth-applications/{applicationId}/disable":{"post":{"operationId":"disableOAuthApplication","summary":"Disable an application for good: no new authorization, and every token of every grant (in every workspace) is refused from the next request.","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"applicationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Disabled.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApplication"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeInput"}}}}}},"/v1/workspaces/{workspaceId}/oauth-app-grants":{"get":{"operationId":"listOAuthAppGrants","summary":"Applications people allowed to act in this workspace, with scopes and last use, as a collection (S77).","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over applicationName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: applicationName (text): contains, starts_with, eq, neq; state (enum): in, nin — active | expired | revoked; createdAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between; lastUsedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of grants.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppGrantPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read","x-collection":{"resource":"oauth-app-grants","fields":[{"key":"applicationName","label":"Application","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"state","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"active","label":"Active"},{"value":"expired","label":"Expired"},{"value":"revoked","label":"Revoked"}]},{"key":"createdAt","label":"Granted","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"lastUsedAt","label":"Last used","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active"]}]}},{"id":"revoked","label":"Revoked","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["revoked"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["applicationName"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/oauth-app-grants/{grantId}/revoke":{"post":{"operationId":"revokeOAuthAppGrant","summary":"Revoke an application's access to this workspace: every access and refresh token of the grant is refused from the next request.","tags":["oauth-applications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"grantId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked (or already revoked: unchanged).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppGrant"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeInput"}}}}}},"/.well-known/oauth-protected-resource":{"get":{"operationId":"getApiProtectedResourceMetadata","summary":"RFC 9728 metadata of the REST API as an OAuth protected resource (its resource indicator and authorization server).","tags":["oauth"],"parameters":[],"responses":{"200":{"description":"Metadata.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectedResourceMetadata"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/platform/workspaces":{"get":{"operationId":"listPlatformWorkspaces","summary":"S117: every workspace with its status, plan, available email units and region, as a collection: name or owner-address search, status / plan / region filters, newest first (platform staff).","tags":["platform"],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over workspaceName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: workspaceStatus (enum): in, nin — provisioning | trial | active | suspended | closed; planState (enum): in, nin — entitled | none | lapsed; region (enum): in, nin — eu | uk | us | ca | sg; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (workspaceStatus, region): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of workspaces.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformWorkspacePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-collection":{"resource":"platform-workspaces","fields":[{"key":"workspaceName","label":"Workspace","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"workspaceStatus","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"provisioning","label":"Provisioning"},{"value":"trial","label":"Trial"},{"value":"active","label":"Active"},{"value":"suspended","label":"Suspended"},{"value":"closed","label":"Closed"}]},{"key":"planState","label":"Plan","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"entitled","label":"On a plan"},{"value":"none","label":"No plan"},{"value":"lapsed","label":"Plan lapsed"}]},{"key":"region","label":"Region","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"eu","label":"EU"},{"value":"uk","label":"UK"},{"value":"us","label":"US"},{"value":"ca","label":"CA"},{"value":"sg","label":"SG"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"noPlan","label":"No plan","filter":{"op":"and","conditions":[{"field":"planState","operator":"in","value":["none","lapsed"]},{"field":"workspaceStatus","operator":"in","value":["provisioning","trial","active"]}]}},{"id":"trial","label":"Trial","filter":{"op":"and","conditions":[{"field":"workspaceStatus","operator":"in","value":["trial"]}]}},{"id":"suspended","label":"Suspended","filter":{"op":"and","conditions":[{"field":"workspaceStatus","operator":"in","value":["suspended"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["workspaceName"],"mode":"contains"}}}},"/v1/platform/workspaces/{workspaceId}":{"get":{"operationId":"getPlatformWorkspace","summary":"S117: one workspace — plan and period, credits, add-ons, channel balances, what sends without a plan, the plans a grant may choose, the latest decisions (platform staff).","tags":["platform"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The workspace.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformWorkspaceDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/workspaces/{workspaceId}/plan":{"post":{"operationId":"grantPlatformWorkspacePlan","summary":"Put a workspace on a plan without a purchase: trial → active, a local subscription, this month's allowance funded once (step-up; the `workspace-plan grant` code).","tags":["platform"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed workspace.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformWorkspaceDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantWorkspacePlanInput"}}}}}},"/v1/platform/workspaces/{workspaceId}/addons":{"post":{"operationId":"setPlatformWorkspaceAddon","summary":"Grant, change or cancel (quantity 0) a plan add-on without a purchase (step-up; the `workspace-plan addon` code).","tags":["platform"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed workspace.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformWorkspaceDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetWorkspaceAddonInput"}}}}}},"/v1/platform/workspaces/{workspaceId}/channel-credits":{"post":{"operationId":"grantPlatformWorkspaceChannelCredits","summary":"Grant SMS / WhatsApp / push / wallet units (never email: plans fund those) (step-up; the `channel-credits grant` code).","tags":["platform"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed workspace.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformWorkspaceDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantWorkspaceChannelCreditsInput"}}}}}},"/v1/platform/workspaces/{workspaceId}/region":{"post":{"operationId":"changePlatformWorkspaceRegion","summary":"Move a workspace's residency region; refused while its sending infrastructure is configured in another region (step-up; the `workspace-plan region` code).","tags":["platform"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed workspace.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformWorkspaceDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeWorkspaceRegionInput"}}}}}},"/v1/platform/sending":{"get":{"operationId":"getPlatformSending","summary":"S98 'Sending IPs': the platform egress IP inventory with its states and history, the tier pool mapping, workspaces per tier and recent tier moves, starter addresses per starter domain (ADR 0050, platform staff).","tags":["platform"],"parameters":[],"responses":{"200":{"description":"Platform sending inventory (ids, names, counts — no recipient data).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSending"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/sending/ips/{address}/dedicate":{"post":{"operationId":"dedicatePlatformIp","summary":"Dedicate an available inventory IP to a workspace; its automatic overflow warm-up starts (ADR 0050 §2, step-up).","tags":["platform"],"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,3}(?:\\.\\d{1,3}){3}$"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed platform sending view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSending"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedicateIpInput"}}}}}},"/v1/platform/sending/ips/{address}/warm":{"post":{"operationId":"warmPlatformIp","summary":"Start warming an available inventory IP as new shared capacity of a tier pool, fed by established senders' engaged traffic (ADR 0050 §4, step-up).","tags":["platform"],"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,3}(?:\\.\\d{1,3}){3}$"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed platform sending view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSending"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmIpInput"}}}}}},"/v1/platform/sending/ips/{address}/release":{"post":{"operationId":"releasePlatformIp","summary":"Give a dedicated or warming IP back to the stock (or quarantine it); its ramp is cancelled (step-up).","tags":["platform"],"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{1,3}(?:\\.\\d{1,3}){3}$"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed platform sending view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSending"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseIpInput"}}}}}},"/v1/platform/sending/ramps/{kind}/{rampId}/review":{"post":{"operationId":"reviewSendingRamp","summary":"Human review of an automatic warm-up (ADR 0022): resume, hold, step back or cancel, with a reason (step-up).","tags":["platform"],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"$ref":"#/components/schemas/RampKind"}},{"name":"rampId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The refreshed platform sending view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSending"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRampInput"}}}}}},"/v1/platform/operations/overview":{"get":{"operationId":"getPlatformOverview","summary":"S98: tenant health, queue lag, worker capacity, regional dispatch authority, provider errors and cost estimates (platform staff).","tags":["platform"],"parameters":[],"responses":{"200":{"description":"Operations overview (aggregates, no recipient data).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformOverview"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/recovery":{"get":{"operationId":"getPlatformRecovery","summary":"S100: release, migrations, regional dispatch authority and its history, restore drills with measured recovery times (platform staff).","tags":["platform"],"parameters":[],"responses":{"200":{"description":"Recovery status.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformRecovery"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/recovery/drills":{"post":{"operationId":"requestRestoreDrill","summary":"S100 'Run restore drill': records a requested drill, executed by the ops runner (`ops restore-drill --pending`).","tags":["platform"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Drill requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreDrill"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestRestoreDrillInput"}}}}}},"/v1/platform/regions/{region}/dispatch-authority/activate":{"post":{"operationId":"activateDispatchAuthority","summary":"Promote / re-activate a region's dispatch authority: epoch + 1, bound to this database; processes of the previous epoch are fenced (step-up).","tags":["platform"],"parameters":[{"name":"region","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Region"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The new authority.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegionAuthority"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateDispatchAuthorityInput"}}}}}},"/v1/platform/regions/{region}/dispatch-authority/fence":{"post":{"operationId":"fenceDispatchAuthority","summary":"Fence a region's dispatch authority: nothing dispatches for it until the next activation (step-up).","tags":["platform"],"parameters":[{"name":"region","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Region"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The fenced authority.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegionAuthority"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FenceDispatchAuthorityInput"}}}}}},"/v1/workspaces/{workspaceId}/changes":{"get":{"operationId":"streamWorkspaceChanges","summary":"Server-Sent Events: what changes in the workspace (type and subject id only, never data). `event: status` ({ live }) then `event: change` ({ type, subjectId }); a heartbeat comment every 25 s; the server closes the stream after ~15 minutes and the client reconnects (`retry: 3000`).","tags":["realtime"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"An event stream (text/event-stream), open until the client leaves, the server drains or the stream's lifetime ends.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"}},"/v1/workspaces/{workspaceId}/notification-preferences":{"get":{"operationId":"listNotificationPreferences","summary":"S97 delivery preferences of every owner-notice event (defaults when never configured).","tags":["notifications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"One entry per event.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferenceList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"}},"/v1/workspaces/{workspaceId}/notification-preferences/{event}":{"patch":{"operationId":"updateNotificationPreference","summary":"Set an event's email channel, recipients (permission-based audience) and threshold. Critical events always email.","tags":["notifications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"event","in":"path","required":true,"schema":{"$ref":"#/components/schemas/NotificationEvent"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The saved preference.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreference"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationPreferenceInput"}}}}}},"/v1/workspaces/{workspaceId}/support-cases":{"get":{"operationId":"listSupportCases","summary":"Support cases of this workspace, newest first.","tags":["notifications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SupportCaseStatus"}}],"responses":{"200":{"description":"A page of cases.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportCasePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"},"post":{"operationId":"createSupportCase","summary":"Open a support case (any member). Never put recipient data in it.","tags":["notifications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Opened.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportCaseInput"}}}}}},"/v1/workspaces/{workspaceId}/support-cases/{caseId}/close":{"post":{"operationId":"closeSupportCase","summary":"Close a case (its author, or a member who manages the workspace).","tags":["notifications"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"caseId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Closed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseSupportCaseInput"}}}}}},"/v1/platform/support-cases":{"get":{"operationId":"listPlatformSupportCases","summary":"S98: open and answered support cases of every tenant (platform staff).","tags":["platform"],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of cases.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSupportCasePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/support-cases/{caseId}/reply":{"post":{"operationId":"replySupportCase","summary":"Answer a support case (platform staff); the workspace sees the answer on S97.","tags":["platform"],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Answered.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSupportCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplySupportCaseInput"}}}}}},"/v1/auth/push":{"get":{"operationId":"getMyPushSettings","summary":"Whether device notifications are available, the VAPID public key, and the caller's own devices.","tags":["account"],"parameters":[],"responses":{"200":{"description":"Push settings of the caller.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSettings"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/auth/push/devices":{"post":{"operationId":"registerMyPushDevice","summary":"Turn notifications on for this device (the browser's push subscription). Re-registering the same endpoint updates it.","tags":["account"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The device.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushDevice"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePushDeviceInput"}}}}}},"/v1/auth/push/devices/{deviceId}":{"delete":{"operationId":"removeMyPushDevice","summary":"Turn notifications off for one of the caller's devices.","tags":["account"],"parameters":[{"name":"deviceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Removed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/workspaces/{workspaceId}/billing/plans":{"get":{"operationId":"listBillingPlans","summary":"Published plan versions with managed and BYOS rates (illustrative prices are flagged).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The catalog.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/overview":{"get":{"operationId":"getBillingOverview","summary":"Subscription, entitlement projection, credits, current-period estimate, spend limits and recent owner notices.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The billing overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/checkout":{"post":{"operationId":"createCheckoutSession","summary":"Opens a Stripe-hosted Checkout session for a plan version. Returning from Checkout grants nothing: only a verified Stripe event does.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The Checkout session URL.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionView"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PLAN_NOT_PURCHASABLE, SUBSCRIPTION_EXISTS, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: BILLING_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/portal":{"post":{"operationId":"createPortalSession","summary":"Opens the Stripe customer portal (payment methods, invoices, cancellation). The return URL must be an allowed console address.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The portal URL.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionView"}}}},"400":{"description":"Problem: RETURN_URL_NOT_ALLOWED, VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: BILLING_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePortalInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/limits":{"patch":{"operationId":"updateBillingLimits","summary":"Spend cap beyond the included allowance and spend-alert thresholds (takes effect on the ledger immediately).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The new limits.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingLimits"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBillingLimitsInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/invoices":{"get":{"operationId":"listInvoices","summary":"Invoices with their lines, payment status and credit notes (projected from verified Stripe events), as a collection: number search, status filter and groups, newest period first (S86).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over number.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: number (text): starts_with, eq, is_set, is_not_set; status (enum): in, nin — draft | open | paid | void | uncollectible; periodStart (date): eq, gt, gte, lt, lte, between; totalMinor (number): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: periodStart. Default periodStart:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/InvoiceStatus"}}],"responses":{"200":{"description":"A page of invoices.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read","x-collection":{"resource":"invoices","fields":[{"key":"number","label":"Invoice","type":"text","sortable":false,"filterOperators":["starts_with","eq","is_set","is_not_set"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"open","label":"Open"},{"value":"paid","label":"Paid"},{"value":"void","label":"Void"},{"value":"uncollectible","label":"Uncollectible"}]},{"key":"periodStart","label":"Period","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"totalMinor","label":"Total (minor units)","type":"number","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"open","label":"Unpaid","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["open","uncollectible"]}]}},{"id":"paid","label":"Paid","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["paid"]}]}}],"defaultSort":{"field":"periodStart","dir":"desc"},"search":{"fields":["number"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/billing/invoices/{invoiceId}":{"get":{"operationId":"getInvoice","summary":"One invoice with its lines and credit notes.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"invoiceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The invoice.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/adjustments":{"get":{"operationId":"listBillingAdjustments","summary":"Visible usage adjustments (late usage after the close window, bounce refunds the plan grants, reconciliation corrections).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of adjustments.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingAdjustmentPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/meter-batches":{"get":{"operationId":"listMeterBatches","summary":"Immutable usage batches sent to Stripe meters, with their deterministic keys and delivery state.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of meter batches.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterBatchPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/reconciliation":{"get":{"operationId":"getBillingReconciliation","summary":"Latest daily reconciliation per period and route type: local settled units vs meter batches vs Stripe totals.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Reconciliation rows.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingReconciliationView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/usage/export":{"get":{"operationId":"exportUsageLedger","summary":"CSV export of billable usage: one row per reservation (message id, units, route type, rate version, reconciliation state). Formula-safe.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}],"responses":{"200":{"description":"text/csv","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/ingest/stripe":{"post":{"operationId":"ingestStripeEvent","summary":"Stripe webhook: signature verified over the RAW bytes, deduplicated on (account, event id), durably recorded before 200.","tags":["ingest"],"parameters":[],"responses":{"200":{"description":"Durably recorded (processing may still be running).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeIngestAccepted"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/privacy/retention-policy":{"get":{"operationId":"getRetentionPolicy","summary":"The workspace's retention policy (platform defaults until saved) with the platform bounds.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The policy.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage"},"patch":{"operationId":"updateRetentionPolicy","summary":"Change retention durations (within platform bounds) or the workspace legal hold.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: RETENTION_OUT_OF_BOUNDS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRetentionPolicyInput"}}}}}},"/v1/workspaces/{workspaceId}/privacy/retention-jobs":{"get":{"operationId":"listRetentionJobs","summary":"Retention and hygiene job runs with their affected counts, newest first, as a collection: class, status, trigger and hold filters, class / status groups (S95).","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: dataClass (enum): in, nin — raw_evidence | event_detail | aggregate | audit | export_files | import_files | contact | list_hygiene; status (enum): in, nin — scheduled | running | completed | failed; trigger (enum): in, nin — schedule | manual; held (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; finishedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (dataClass, status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"dataClass","in":"query","required":false,"description":"Legacy: one data class (prefer the `dataClass` filter).","schema":{"$ref":"#/components/schemas/RetentionDataClass"}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/RetentionJobStatus"}}],"responses":{"200":{"description":"A page of jobs.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionJobPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","x-collection":{"resource":"retention-jobs","fields":[{"key":"dataClass","label":"Data class","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"raw_evidence","label":"Raw evidence"},{"value":"event_detail","label":"Event detail"},{"value":"aggregate","label":"Aggregate"},{"value":"audit","label":"Audit"},{"value":"export_files","label":"Export files"},{"value":"import_files","label":"Import files"},{"value":"contact","label":"Contact"},{"value":"list_hygiene","label":"List hygiene"}]},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"scheduled","label":"Scheduled"},{"value":"running","label":"Running"},{"value":"completed","label":"Completed"},{"value":"failed","label":"Failed"}]},{"key":"trigger","label":"Trigger","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"schedule","label":"Schedule"},{"value":"manual","label":"Manual"}]},{"key":"held","label":"Held by a legal hold","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Queued","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"finishedAt","label":"Finished","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"failed","label":"Failed","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["failed"]}]}},{"id":"manual","label":"Manual runs","filter":{"op":"and","conditions":[{"field":"trigger","operator":"in","value":["manual"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"}}},"post":{"operationId":"runRetention","summary":"Queue a retention run now (one class or every class). Idempotent per class and day.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Queued (not complete).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionRunAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunRetentionInput"}}}}}},"/v1/workspaces/{workspaceId}/privacy/requests":{"get":{"operationId":"listPrivacyRequests","summary":"Data subject requests with status, deadline and legal hold, newest first, as a collection: EXACT subject address search (hashed), type / status / hold filters, deadline sort, type / status groups (S95).","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over subject.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: type (enum): in, nin — access | export | rectification | restriction | deletion; status (enum): in, nin — received | verifying | in_progress | completed | rejected | on_legal_hold; legalHold (bool): eq; deadlineAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between; completedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: deadlineAt, createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (type, status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/PrivacyRequestStatus"}},{"name":"type","in":"query","required":false,"description":"Legacy: one type (prefer the `type` filter).","schema":{"$ref":"#/components/schemas/PrivacyRequestType"}}],"responses":{"200":{"description":"A page of requests.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequestPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","x-collection":{"resource":"privacy-requests","fields":[{"key":"subject","label":"Subject","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"type","label":"Type","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"access","label":"Access"},{"value":"export","label":"Export"},{"value":"rectification","label":"Rectification"},{"value":"restriction","label":"Restriction"},{"value":"deletion","label":"Deletion"}]},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"received","label":"Received"},{"value":"verifying","label":"Verifying"},{"value":"in_progress","label":"In progress"},{"value":"completed","label":"Completed"},{"value":"rejected","label":"Rejected"},{"value":"on_legal_hold","label":"On legal hold"}]},{"key":"legalHold","label":"Legal hold","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"deadlineAt","label":"Deadline","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Received","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"completedAt","label":"Completed","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"open","label":"Open","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["received","verifying","in_progress","on_legal_hold"]}]}},{"id":"deletion","label":"Deletions","filter":{"op":"and","conditions":[{"field":"type","operator":"in","value":["deletion"]}]}},{"id":"hold","label":"Legal hold","filter":{"op":"and","conditions":[{"field":"legalHold","operator":"eq","value":true}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["subject"],"mode":"prefix"}}},"post":{"operationId":"createPrivacyRequest","summary":"Record a data subject request (access, export, rectification, restriction, deletion) with its deadline. Nothing runs before identity verification.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Recorded with its deadline (not executed).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePrivacyRequestInput"}}}}}},"/v1/workspaces/{workspaceId}/privacy/requests/{requestId}":{"get":{"operationId":"getPrivacyRequest","summary":"One data subject request with its report.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The request.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage"}},"/v1/workspaces/{workspaceId}/privacy/requests/{requestId}/verify":{"post":{"operationId":"verifyPrivacyRequest","summary":"Record how the subject's identity was verified; the request is then executed in the background (unless on legal hold).","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Verified and queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: SEPARATION_OF_DUTIES, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PRIVACY_REQUEST_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPrivacyRequestInput"}}}}}},"/v1/workspaces/{workspaceId}/privacy/requests/{requestId}/verification-link":{"post":{"operationId":"sendPrivacyVerificationLink","summary":"Email the data subject a signed, single-use link to prove control of the address (the address is given again, matched to the request, never stored). Replaces any unused earlier link.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Recorded; the email leaves through the platform mail path after commit.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyVerificationLinkSent"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PRIVACY_REQUEST_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: PRIVACY_SUBJECT_MISMATCH","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPrivacyVerificationLinkInput"}}}}}},"/v1/public/privacy/verify/{token}":{"get":{"operationId":"getPrivacyVerification","summary":"Describe a pending subject verification link. NEVER verifies (link scanners).","tags":["public"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}],"responses":{"200":{"description":"Verification page data.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyVerificationPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"post":{"operationId":"confirmPrivacyVerification","summary":"The subject's explicit confirmation: verifies the privacy request (method email_link), which then executes. Idempotent, single-use link.","tags":["public"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{32}\\.[A-Za-z0-9_-]{43}$"}}],"responses":{"200":{"description":"Verified.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyVerificationResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PRIVACY_REQUEST_STATE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: TOKEN_EXPIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPrivacyVerificationInput"}}}}}},"/v1/workspaces/{workspaceId}/privacy/requests/{requestId}/reject":{"post":{"operationId":"rejectPrivacyRequest","summary":"Reject a request (identity not verified, manifestly unfounded…) with a reason.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rejected.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PRIVACY_REQUEST_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectPrivacyRequestInput"}}}}}},"/v1/workspaces/{workspaceId}/privacy/requests/{requestId}/legal-hold":{"post":{"operationId":"setPrivacyLegalHold","summary":"Place or release a legal hold on a request. A held deletion does not run.","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PRIVACY_REQUEST_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyLegalHoldInput"}}}}}},"/v1/workspaces/{workspaceId}/privacy/requests/{requestId}/result-link":{"post":{"operationId":"privacyResultLink","summary":"Short-lived download link of an access/export result (each issuance is audited).","tags":["privacy"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"requestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Signed link.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyResultLink"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: PRIVACY_REQUEST_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: EXPORT_EXPIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"privacy.manage"}},"/v1/workspaces/{workspaceId}/lists/{listId}/hygiene":{"get":{"operationId":"getListHygiene","summary":"Hygiene rules of a list (defaults until saved).","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"listId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The rules.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListHygienePolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"},"patch":{"operationId":"updateListHygiene","summary":"Change a list's hygiene rules. Hygiene removes memberships; it never subscribes anyone or lifts a suppression.","tags":["lists"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"listId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListHygienePolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateListHygieneInput"}}}}}},"/v1/workspaces/{workspaceId}/support-grants":{"get":{"operationId":"listSupportGrants","summary":"Time-bound support access grants of the workspace (active and past).","tags":["audit"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"active","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"A page of grants.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportGrantPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audit.read"},"post":{"operationId":"createSupportGrant","summary":"Grant a platform staff member time-bound, scoped access to this workspace, with a reason.","tags":["audit"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Granted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportGrant"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"support.grants.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportGrantInput"}}}}}},"/v1/workspaces/{workspaceId}/support-grants/{grantId}/revoke":{"post":{"operationId":"revokeSupportGrant","summary":"End a support grant now (takes effect on the staff member's next request).","tags":["audit"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"grantId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportGrant"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"support.grants.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeSupportGrantInput"}}}}}},"/v1/workspaces/{workspaceId}/trust/profile":{"get":{"operationId":"getTrustProfile","summary":"Business verification state, risk tier and open trust cases of the workspace.","tags":["trust"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The profile.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustProfile"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/trust/verification":{"post":{"operationId":"submitBusinessVerification","summary":"Submit the business identity for review by trust staff.","tags":["trust"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Pending review.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustProfile"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBusinessVerificationInput"}}}}}},"/v1/workspaces/{workspaceId}/trust/cases":{"get":{"operationId":"listTrustCases","summary":"Trust & abuse cases concerning the workspace, with evidence and decisions.","tags":["trust"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AbuseCaseStatus"}}],"responses":{"200":{"description":"A page of cases.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbuseCasePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/trust/cases/{caseId}":{"get":{"operationId":"getTrustCase","summary":"One case: signal, evidence, decision, reason, appeal.","tags":["trust"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"caseId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The case.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbuseCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/trust/cases/{caseId}/appeal":{"post":{"operationId":"appealTrustCase","summary":"Appeal a decision (once per decision). Available while suspended.","tags":["trust"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"caseId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Appeal recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbuseCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: TRUST_CASE_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppealAbuseCaseInput"}}}}}},"/v1/platform/trust/tenants":{"get":{"operationId":"listPlatformTrustTenants","summary":"Platform staff: tenants with verification state, risk tier and live signals, as a collection: workspace name search, verification / tier / status filters, newest first (S99).","tags":["trust"],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over workspaceName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: workspaceStatus (enum): in, nin — provisioning | trial | active | suspended | closed; businessStatus (enum): in, nin — unverified | pending | verified | rejected; riskTier (enum): in, nin — trial | standard | elevated | restricted; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (workspaceStatus): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"businessStatus","in":"query","required":false,"description":"Legacy: one verification status (prefer the `businessStatus` filter).","schema":{"$ref":"#/components/schemas/BusinessVerificationStatus"}}],"responses":{"200":{"description":"A page of tenants.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustTenantPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-collection":{"resource":"trust-tenants","fields":[{"key":"workspaceName","label":"Workspace","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"workspaceStatus","label":"Workspace status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"provisioning","label":"Provisioning"},{"value":"trial","label":"Trial"},{"value":"active","label":"Active"},{"value":"suspended","label":"Suspended"},{"value":"closed","label":"Closed"}]},{"key":"businessStatus","label":"Business verification","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"unverified","label":"Unverified"},{"value":"pending","label":"Pending"},{"value":"verified","label":"Verified"},{"value":"rejected","label":"Rejected"}]},{"key":"riskTier","label":"Risk tier","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"trial","label":"Trial"},{"value":"standard","label":"Standard"},{"value":"elevated","label":"Elevated"},{"value":"restricted","label":"Restricted"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"pending","label":"Verification pending","filter":{"op":"and","conditions":[{"field":"businessStatus","operator":"in","value":["pending"]}]}},{"id":"restricted","label":"Elevated or restricted","filter":{"op":"and","conditions":[{"field":"riskTier","operator":"in","value":["elevated","restricted"]}]}},{"id":"suspended","label":"Suspended","filter":{"op":"and","conditions":[{"field":"workspaceStatus","operator":"in","value":["suspended"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["workspaceName"],"mode":"contains"}}}},"/v1/platform/trust/tenants/{workspaceId}":{"get":{"operationId":"getPlatformTrustTenant","summary":"Platform staff: one tenant with its verification state, risk tier and live signals.","tags":["trust"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The tenant.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustTenant"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/trust/tenants/{workspaceId}/verification":{"post":{"operationId":"reviewBusinessVerification","summary":"Platform staff: verify or reject a tenant's business identity (and set its risk tier).","tags":["trust"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Reviewed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustTenant"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewBusinessVerificationInput"}}}}}},"/v1/platform/trust/cases":{"get":{"operationId":"listPlatformTrustCases","summary":"Platform staff: trust & abuse cases across tenants, as a collection: workspace name search, status / signal / workspace filters and groups, newest first (S99).","tags":["trust"],"parameters":[{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over workspaceName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: workspaceId (ref): in, nin; signal (enum): in, nin — complaint_rate | hard_bounce_rate | volume_spike | unverified_business_sending | compromised_credentials | manual_report | abuse_report; status (enum): in, nin — open | under_review | actioned | appealed | closed; createdAt (date): eq, gt, gte, lt, lte, between; decidedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (signal, status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/AbuseCaseStatus"}},{"name":"workspaceId","in":"query","required":false,"description":"Legacy: one workspace (prefer the `workspaceId` filter).","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"signal","in":"query","required":false,"description":"Legacy: one signal (prefer the `signal` filter).","schema":{"$ref":"#/components/schemas/TrustSignalKind"}}],"responses":{"200":{"description":"A page of cases.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformAbuseCasePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-collection":{"resource":"platform-trust-cases","fields":[{"key":"workspaceName","label":"Workspace","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"workspaceId","label":"Workspace id","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"signal","label":"Signal","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"complaint_rate","label":"Complaint rate"},{"value":"hard_bounce_rate","label":"Hard bounce rate"},{"value":"volume_spike","label":"Volume spike"},{"value":"unverified_business_sending","label":"Unverified business sending"},{"value":"compromised_credentials","label":"Compromised credentials"},{"value":"manual_report","label":"Manual report"},{"value":"abuse_report","label":"Abuse report"}]},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"open","label":"Open"},{"value":"under_review","label":"Under review"},{"value":"actioned","label":"Actioned"},{"value":"appealed","label":"Appealed"},{"value":"closed","label":"Closed"}]},{"key":"createdAt","label":"Opened","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"decidedAt","label":"Decided","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"queue","label":"To review","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["open","under_review","appealed"]}]}},{"id":"appeals","label":"Appeals","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["appealed"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["workspaceName"],"mode":"contains"}}},"post":{"operationId":"openPlatformTrustCase","summary":"Platform staff: open a case against a tenant with a signal and a note.","tags":["trust"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Opened.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbuseCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAbuseCaseInput"}}}}}},"/v1/platform/trust/cases/{caseId}":{"get":{"operationId":"getPlatformTrustCase","summary":"Platform staff: one case.","tags":["trust"],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The case.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbuseCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/trust/cases/{caseId}/decision":{"post":{"operationId":"decidePlatformTrustCase","summary":"Platform staff: decide a case (restriction + reason). `suspended` blocks dispatch; recipient opt-outs keep working.","tags":["trust"],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Decided.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbuseCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: TRUST_CASE_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideAbuseCaseInput"}}}}}},"/v1/platform/trust/cases/{caseId}/appeal-decision":{"post":{"operationId":"decidePlatformTrustAppeal","summary":"Platform staff: decide an appeal. Overturning lifts the restriction; the reviewer must differ from the original decision's.","tags":["trust"],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Decided.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbuseCase"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: SEPARATION_OF_DUTIES","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: TRUST_CASE_STATE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideAppealInput"}}}}}},"/v1/platform/trust/signals/evaluate":{"post":{"operationId":"evaluateTrustSignals","summary":"Platform staff: evaluate complaint, bounce and volume signals now and open cases where thresholds are crossed.","tags":["trust"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Evaluation result.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateSignalsResult"}}}},"400":{"description":"Problem: IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/workspaces/{workspaceId}/bounce-sources":{"get":{"operationId":"listBounceSources","summary":"Bounce sources with their health (lag, last success, credential expiry, parser failures) and dispatch impact: search, filter, sort, group by state or protocol (collection view, ADR 0039).","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over displayName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: displayName (text): contains, starts_with, eq; transport (enum): in, nin — provider_events | hosted_inbound_dsn | gmail_api | microsoft_graph | imap | pop3_legacy; state (enum): in, nin — draft | active | degraded | needs_reauthorization | disabled; requiredForDispatch (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: displayName, createdAt. Default displayName:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (transport, state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"transport","in":"query","required":false,"description":"Legacy: prefer a filter on `transport`.","schema":{"$ref":"#/components/schemas/BounceTransport"}},{"name":"state","in":"query","required":false,"description":"Legacy: prefer a filter on `state`.","schema":{"$ref":"#/components/schemas/BounceSourceState"}}],"responses":{"200":{"description":"A page of sources and the total.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceSourcePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"bounce_sources","fields":[{"key":"displayName","label":"Inbox","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"transport","label":"Protocol","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"provider_events","label":"Signed provider events"},{"value":"hosted_inbound_dsn","label":"Hosted inbound DSN"},{"value":"gmail_api","label":"Gmail API"},{"value":"microsoft_graph","label":"Microsoft Graph"},{"value":"imap","label":"IMAP over TLS"},{"value":"pop3_legacy","label":"POP3 over TLS (legacy)"}]},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"active","label":"Active"},{"value":"degraded","label":"Degraded"},{"value":"needs_reauthorization","label":"Needs reauthorization"},{"value":"disabled","label":"Disabled"}]},{"key":"requiredForDispatch","label":"Required for dispatch","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Connected","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active"]}]}},{"id":"attention","label":"Needs attention","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["degraded","needs_reauthorization"]}]}},{"id":"required","label":"Required for dispatch","filter":{"op":"and","conditions":[{"field":"requiredForDispatch","operator":"eq","value":true}]}}],"defaultSort":{"field":"displayName","dir":"asc"},"search":{"fields":["displayName"],"mode":"contains"}}},"post":{"operationId":"createBounceSource","summary":"Connect a bounce source. Credentials are write-only; the source starts as draft until a read-only test passes.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (draft).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceSource"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: EGRESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: INSECURE_TRANSPORT, UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBounceSourceInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-sources/{sourceId}":{"get":{"operationId":"getBounceSource","summary":"Read one source, its cursor summary, health and last read-only test.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"sourceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The source.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceSource"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"patch":{"operationId":"updateBounceSource","summary":"Edit a source. Blank secret fields keep the credential; activation needs a passing test of the current credential version.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"sourceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceSource"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: EGRESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: INSECURE_TRANSPORT, UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBounceSourceInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-sources/{sourceId}/test":{"post":{"operationId":"testBounceSource","summary":"Read-only connection test (egress → DNS → TCP → TLS → authentication → folder). Never moves or deletes anything.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"sourceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Test ran; the result is stored with the credential version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceSourceTest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: EGRESS_DENIED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONNECTOR_REAUTH_REQUIRED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestBounceSourceInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-sources/{sourceId}/poll":{"post":{"operationId":"pollBounceSource","summary":"Ask the fenced poller to poll this source now (the poll itself runs in the workers).","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"sourceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Scheduled.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollBounceSourceResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/bounce-policies":{"get":{"operationId":"getBouncePolicies","summary":"Platform floor and defaults, the workspace/server/campaign layers (current versions) and the workspace effective policy.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Policy overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BouncePolicyOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"createBouncePolicy","summary":"Create the policy layer of a scope (workspace, server or campaign). A floor violation is refused, never clamped.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (version 1).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BouncePolicyLayer"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: BOUNCE_POLICY_FLOOR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBouncePolicyInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-policies/{policyId}":{"patch":{"operationId":"updateBouncePolicy","summary":"Replace a layer's document: a NEW immutable version (If-Match: the version you edited). Messages keep the version frozen at send time.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"policyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The new version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BouncePolicyLayer"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: BOUNCE_POLICY_FLOOR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBouncePolicyInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-policies/resolve":{"post":{"operationId":"resolveBouncePolicy","summary":"Effective policy for a server and/or campaign, with field-level provenance (platform floor → workspace → server → campaign).","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Effective fields and provenance.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveBouncePolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveBouncePolicyInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-policies/effective":{"get":{"operationId":"getEffectiveBouncePolicy","summary":"Same as resolve, as a cacheable read (screens).","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"serverId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Effective fields and provenance.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveBouncePolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/bounce-policy":{"get":{"operationId":"getCampaignBouncePolicy","summary":"Campaign bounce screen (S30): inherited and effective policy per bound server, the campaign layer, and source health.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Campaign bounce policy.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignBouncePolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/bounce-events":{"get":{"operationId":"listBounceEvents","summary":"Normalized bounce/complaint outcomes, including quarantined uncertain matches (masked recipients): exact message id lookup, filter, newest received first (collection view, ADR 0039).","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over reference.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: status (enum): in, nin — applied | quarantined | ignored | duplicate | superseded | dismissed; bounceClass (enum): in, nin — hard_invalid_recipient | hard_invalid_domain | soft_mailbox_full | soft_transient_network | soft_rate_limited | blocked_policy | authentication_failure | content_rejected | complaint | unsubscribe | out_of_office | unknown; confidence (enum): in, nin — verified_provider_event | verified_verp | original_envelope_id | message_id_match | unverified; kind (enum): in, nin — dsn | arf | provider_event | auto_reply | human_reply | unrecognized | malformed | rejected_unsafe; transport (enum): in, nin — provider_events | hosted_inbound_dsn | gmail_api | microsoft_graph | imap | pop3_legacy; sourceId (ref): in; campaignId (ref): in; occurredAt (date): eq, gt, gte, lt, lte, between; receivedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: receivedAt. Default receivedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: prefer a filter on `status`.","schema":{"$ref":"#/components/schemas/BounceEventStatus"}},{"name":"bounceClass","in":"query","required":false,"description":"Legacy: prefer a filter on `bounceClass`.","schema":{"$ref":"#/components/schemas/BounceClass"}},{"name":"sourceId","in":"query","required":false,"description":"Legacy: prefer a filter on `sourceId`.","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"query","required":false,"description":"Legacy: prefer a filter on `campaignId`.","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"confidence","in":"query","required":false,"description":"Legacy: prefer a filter on `confidence`.","schema":{"$ref":"#/components/schemas/EvidenceConfidence"}}],"responses":{"200":{"description":"A page of events and the total (an estimate on very large logs).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceEventPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"bounce_events","fields":[{"key":"reference","label":"Message or event id","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"applied","label":"Applied"},{"value":"quarantined","label":"Needs review"},{"value":"ignored","label":"Ignored"},{"value":"duplicate","label":"Duplicate"},{"value":"superseded","label":"Superseded"},{"value":"dismissed","label":"Reviewed"}]},{"key":"bounceClass","label":"Classification","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"hard_invalid_recipient","label":"Invalid recipient"},{"value":"hard_invalid_domain","label":"Invalid domain"},{"value":"soft_mailbox_full","label":"Mailbox full"},{"value":"soft_transient_network","label":"Transient network failure"},{"value":"soft_rate_limited","label":"Rate limited"},{"value":"blocked_policy","label":"Policy block"},{"value":"authentication_failure","label":"Sender authentication failure"},{"value":"content_rejected","label":"Content rejected"},{"value":"complaint","label":"Complaint"},{"value":"unsubscribe","label":"Unsubscribe"},{"value":"out_of_office","label":"Out of office"},{"value":"unknown","label":"Unknown"}]},{"key":"confidence","label":"Confidence","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"verified_provider_event","label":"Verified provider event"},{"value":"verified_verp","label":"Verified (signed VERP)"},{"value":"original_envelope_id","label":"Envelope id match"},{"value":"message_id_match","label":"Message-ID + recipient"},{"value":"unverified","label":"Unverified"}]},{"key":"kind","label":"Evidence","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"dsn","label":"Delivery status notification"},{"value":"arf","label":"Feedback report"},{"value":"provider_event","label":"Provider event"},{"value":"auto_reply","label":"Automatic reply"},{"value":"human_reply","label":"Human reply"},{"value":"unrecognized","label":"Unrecognized"},{"value":"malformed","label":"Malformed"},{"value":"rejected_unsafe","label":"Rejected (unsafe)"}]},{"key":"transport","label":"Protocol","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"provider_events","label":"Signed provider events"},{"value":"hosted_inbound_dsn","label":"Hosted inbound DSN"},{"value":"gmail_api","label":"Gmail API"},{"value":"microsoft_graph","label":"Microsoft Graph"},{"value":"imap","label":"IMAP over TLS"},{"value":"pop3_legacy","label":"POP3 over TLS (legacy)"}]},{"key":"sourceId","label":"Bounce source","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"campaignId","label":"Campaign","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"occurredAt","label":"Occurred","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"receivedAt","label":"Received","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"review","label":"Needs review","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["quarantined"]}]}},{"id":"applied","label":"Applied","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["applied"]}]}},{"id":"hard","label":"Hard bounces","filter":{"op":"and","conditions":[{"field":"bounceClass","operator":"in","value":["hard_invalid_recipient","hard_invalid_domain"]}]}},{"id":"complaints","label":"Complaints","filter":{"op":"and","conditions":[{"field":"bounceClass","operator":"in","value":["complaint"]}]}}],"defaultSort":{"field":"receivedAt","dir":"desc"},"search":{"fields":["reference"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/bounce-events/{eventId}":{"get":{"operationId":"getBounceEvent","summary":"One normalized event (diagnostic excerpt, confidence, frozen policy action). Never the raw message body.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"eventId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The event.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceEvent"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/bounce-events/{eventId}/review":{"post":{"operationId":"reviewBounceEvent","summary":"Mark a quarantined event reviewed (dismissed, with a note). Audited; changes no suppression.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"eventId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Reviewed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceEvent"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewBounceEventInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-events/reprocess":{"post":{"operationId":"reprocessBounceEvents","summary":"Replay events with a parser version: dry-run first (diff of classifications and proposed suppressions), then apply that dry-run. Idempotent; never rebills.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"The job (dry-run diff, or the applied result).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceReprocessJob"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: EVIDENCE_UNAVAILABLE, REPROCESS_DRY_RUN_REQUIRED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReprocessBounceEventsInput"}}}}}},"/v1/workspaces/{workspaceId}/bounce-reprocess-jobs/{jobId}":{"get":{"operationId":"getBounceReprocessJob","summary":"A reprocessing job and its diff.","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"jobId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The job.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BounceReprocessJob"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/complaints":{"get":{"operationId":"listComplaints","summary":"Feedback-loop complaints with their originating campaign and suppression state (S66): exact message id lookup, filter, newest received first (collection view, ADR 0039).","tags":["bounces"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over reference.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: campaignId (ref): in; feedbackType (text): eq, is_set, is_not_set; occurredAt (date): eq, gt, gte, lt, lte, between; receivedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: receivedAt. Default receivedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"campaignId","in":"query","required":false,"description":"Legacy: prefer a filter on `campaignId`.","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of complaints and the total.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplaintPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"complaints","fields":[{"key":"reference","label":"Message or complaint id","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"campaignId","label":"Campaign","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"feedbackType","label":"Feedback type","type":"text","sortable":false,"filterOperators":["eq","is_set","is_not_set"],"groupable":false},{"key":"occurredAt","label":"Occurred","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"receivedAt","label":"Received","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"abuse","label":"Marked as spam","filter":{"op":"and","conditions":[{"field":"feedbackType","operator":"eq","value":"abuse"}]}}],"defaultSort":{"field":"receivedAt","dir":"desc"},"search":{"fields":["reference"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/journeys":{"get":{"operationId":"listJourneys","summary":"Journeys, autoresponders and triggers (scope `kind`) with status, active contacts, goal rate and version (S38, S41, S42): search, filter, sort, group (collection view, ADR 0039); last edited first by default.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; status (enum): in, nin — draft | published | paused | archived; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt, updatedAt. Default updatedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"kind","in":"query","required":false,"description":"Only journeys of this kind (S38 journey, S41 autoresponder, S42 trigger); all kinds when absent.","schema":{"$ref":"#/components/schemas/JourneyKind"}},{"name":"status","in":"query","required":false,"description":"Legacy: only this status; prefer `filter` on `status`.","schema":{"$ref":"#/components/schemas/JourneyStatus"}}],"responses":{"200":{"description":"A page of journeys, the total and, when grouped, whole-collection status counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.read","x-collection":{"resource":"journeys","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"published","label":"Active"},{"value":"paused","label":"Paused"},{"value":"archived","label":"Archived"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["published"]}]}},{"id":"drafts","label":"Drafts","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["draft"]}]}},{"id":"paused","label":"Paused","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["paused"]}]}},{"id":"archived","label":"Archived","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["archived"]}]}}],"defaultSort":{"field":"updatedAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createJourney","summary":"Create a journey draft (any kind). Nothing runs before a version is published.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJourneyInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/duplicate":{"post":{"operationId":"duplicateJourney","summary":"Duplicate into a new draft of the same kind (the draft graph and settings copied; no version, run or statistic carried over).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The new draft.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateJourneyInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}":{"get":{"operationId":"getJourney","summary":"A journey: draft graph and settings, draft validation, published versions.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The journey.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.read"},"patch":{"operationId":"updateJourney","summary":"Edit the draft (graph, settings, name). Published versions and live runs are never touched.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: JOURNEY_STATE_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJourneyInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/validate":{"post":{"operationId":"validateJourney","summary":"Validation report of the draft: cycles, unreachable nodes, missing branches, configs and workspace references.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Validation report (valid or not).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyValidationReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.edit"}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/publish":{"post":{"operationId":"publishJourney","summary":"Publish the reviewed draft as a new immutable version. Active runs stay on their version.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The published version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyVersion"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: SEPARATION_OF_DUTIES, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: JOURNEY_GRAPH_STALE, JOURNEY_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: JOURNEY_GRAPH_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishJourneyInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/versions/{versionId}":{"get":{"operationId":"getJourneyVersion","summary":"One immutable published version (graph, settings, bound content).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"versionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyVersion"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.read"}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/pause":{"post":{"operationId":"pauseJourney","summary":"Pause: no new entries, no step executes (runs wait in place, timers keep their due time).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Paused.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: JOURNEY_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyControlInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/resume":{"post":{"operationId":"resumeJourney","summary":"Resume a paused journey; overdue waits follow the catch-up policy.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Resumed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: JOURNEY_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyControlInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/archive":{"post":{"operationId":"archiveJourney","summary":"Archive: live runs are cancelled (no further step, queued sends cancelled before submission).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Archived.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Journey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: JOURNEY_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyControlInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/enrollments":{"post":{"operationId":"enrollJourneyContact","summary":"Start a run for ONE contact (journeys whose entry trigger is `manual`; test runs to the sink).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Enrollment decision (a run, or why none).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollContactResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: JOURNEY_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollContactInput"}}}}}},"/v1/workspaces/{workspaceId}/imports/{importId}/journey-enrollment":{"get":{"operationId":"getImportJourneyEnrollment","summary":"How many runs enrolling this import's contacts WOULD start in each published journey listening to its list (R034); nothing starts.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The enrollment preview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportJourneyEnrollmentPreview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.read"},"post":{"operationId":"enrollImportIntoJourney","summary":"Explicitly enroll a committed import's subscribed contacts into ONE journey, acknowledging the previewed number of runs (audited, once per import and journey).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"importId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Enrollment queued; the workers start the runs in batches.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportJourneyEnrollment"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IMPORT_PREVIEW_STALE, JOURNEY_STATE_CONFLICT, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollImportInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/runs":{"get":{"operationId":"listJourneyRuns","summary":"Runs of a journey (S40), newest first: filter by state, contact, version or current step, sort by start, group by state (reduced collection view, ADR 0039); the total is an estimate on large journeys.","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: state (enum): in, nin — active | waiting | completed | exited | cancelled | failed; startedAt (date): eq, gt, gte, lt, lte, between; endedAt (date): gte, lte, between; contactId (ref): in; versionId (ref): in, nin; nodeId (text): eq, is_set, is_not_set. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: startedAt. Default startedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"description":"Legacy: only this state; prefer `filter` on `state`.","schema":{"$ref":"#/components/schemas/JourneyRunState"}},{"name":"contactId","in":"query","required":false,"description":"Legacy: only this contact's runs; prefer `filter` on `contactId`.","schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"nodeId","in":"query","required":false,"description":"Legacy: only runs currently on this node; prefer `filter` on `nodeId`.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"}}],"responses":{"200":{"description":"A page of runs, the total (an estimate past the counting budget) and, when grouped, whole-collection state counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyRunPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.read","x-collection":{"resource":"journey-runs","fields":[{"key":"state","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"active","label":"Running"},{"value":"waiting","label":"Waiting"},{"value":"completed","label":"Completed"},{"value":"exited","label":"Exited"},{"value":"cancelled","label":"Cancelled"},{"value":"failed","label":"Failed"}]},{"key":"startedAt","label":"Started","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"endedAt","label":"Ended","type":"date","sortable":false,"filterOperators":["gte","lte","between"],"groupable":false},{"key":"contactId","label":"Contact","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"versionId","label":"Execution version","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"nodeId","label":"Current step","type":"text","sortable":false,"filterOperators":["eq","is_set","is_not_set"],"groupable":false}],"quickFilters":[{"id":"live","label":"Live","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active","waiting"]}]}},{"id":"waiting","label":"Waiting","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["waiting"]}]}},{"id":"completed","label":"Completed","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["completed"]}]}},{"id":"exited","label":"Exited","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["exited","cancelled"]}]}},{"id":"failed","label":"Failed","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["failed"]}]}}],"defaultSort":{"field":"startedAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/runs/{runId}":{"get":{"operationId":"getJourneyRun","summary":"One run explained: every node decision, timers, messages, the pinned version's graph (S40).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"runId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The run.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyRunDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.read"}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/runs/{runId}/retry":{"post":{"operationId":"retryJourneyRunStep","summary":"Retry a FAILED step that never reached a provider (safe failures only).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"runId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Retry scheduled.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyRunDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: JOURNEY_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryRunStepInput"}}}}}},"/v1/workspaces/{workspaceId}/journeys/{journeyId}/report":{"get":{"operationId":"getJourneyReport","summary":"Per-step report: entries, decisions, waits, sends (accepted / delivered / engagement kept distinct).","tags":["automation"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"journeyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"versionId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The report.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JourneyReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"journey.read"}},"/v1/workspaces/{workspaceId}/forms":{"get":{"operationId":"listForms","summary":"Forms with status, live version, embed snippets and all-time counters (S43).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; status (enum): in, nin — draft | published | archived; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt, updatedAt. Default name:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of forms.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read","x-collection":{"resource":"forms","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"published","label":"Live"},{"value":"archived","label":"Stopped"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"live","label":"Live","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["published"]}]}},{"id":"drafts","label":"Drafts","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["draft"]}]}},{"id":"stopped","label":"Stopped","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["archived"]}]}}],"defaultSort":{"field":"name","dir":"asc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createForm","summary":"Create a draft subscription form on the given lists (email + marketing consent to start with).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (draft).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormInput"}}}}}},"/v1/workspaces/{workspaceId}/forms/{formId}":{"get":{"operationId":"getForm","summary":"A form: draft, live version, embed snippets, counters.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The form.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"},"patch":{"operationId":"updateForm","summary":"Save the draft (If-Match). The live version is untouched until the next publish.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Saved.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFormInput"}}}}},"delete":{"operationId":"deleteForm","summary":"Delete a never-published form (a published one is stopped instead).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GROWTH_PUBLISHED, GROWTH_IN_USE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit"}},"/v1/workspaces/{workspaceId}/forms/{formId}/publish":{"post":{"operationId":"publishForm","summary":"Publish the reviewed draft revision as a new immutable version (the form starts collecting).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Published.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: GROWTH_NOT_PUBLISHABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/forms/{formId}/unpublish":{"post":{"operationId":"unpublishForm","summary":"Stop collecting (archived): the hosted page and embeds answer 404, history and counters are kept.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Archived.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnpublishGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/forms/{formId}/duplicate":{"post":{"operationId":"duplicateForm","summary":"Duplicate into a new draft (the draft copied; no version, counter or public address carried over).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The new draft.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Form"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/forms/{formId}/versions":{"get":{"operationId":"listFormVersions","summary":"Published versions of a form (newest first).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Versions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrowthVersionList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"}},"/v1/workspaces/{workspaceId}/forms/{formId}/analytics":{"get":{"operationId":"getFormAnalytics","summary":"Views, submissions, confirmed signups and conversion with their denominators (last 30 days by day + all time).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Analytics.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormAnalytics"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"}},"/v1/public/forms/{formId}":{"get":{"operationId":"getPublicForm","summary":"The LIVE version of a published form, for rendering (hosted page, iframe, landing page). `render` counts one view.","tags":["public"],"parameters":[{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"render","in":"query","required":false,"schema":{"type":"string","enum":["hosted","embed"]}},{"name":"r","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"}}],"responses":{"200":{"description":"Renderable form.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicForm"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/forms/{formId}/submissions":{"post":{"operationId":"submitPublicForm","summary":"Submit a published form. Origin allowlisted, honeypot, throttled, optional Turnstile; the same answer for every address.","tags":["public"],"parameters":[{"name":"formId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"201":{"description":"Durably recorded (and the subscription requested).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmissionReceipt"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: FORM_ORIGIN_NOT_ALLOWED, FORM_CHALLENGE_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSubmissionInput"}}}}}},"/v1/workspaces/{workspaceId}/surveys":{"get":{"operationId":"listSurveys","summary":"Surveys with status, responses and expiry (S47).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; status (enum): in, nin — draft | published | archived; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between; purpose (enum): in, nin — feedback | unsubscribe. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt, updatedAt. Default name:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status, purpose): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of surveys.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read","x-collection":{"resource":"surveys","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"published","label":"Live"},{"value":"archived","label":"Stopped"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"purpose","label":"Purpose","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"feedback","label":"Feedback survey"},{"value":"unsubscribe","label":"Unsubscribe survey"}]}],"quickFilters":[{"id":"live","label":"Live","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["published"]}]}},{"id":"drafts","label":"Drafts","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["draft"]}]}},{"id":"stopped","label":"Stopped","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["archived"]}]}}],"defaultSort":{"field":"name","dir":"asc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createSurvey","summary":"Create a draft survey (feedback, or unsubscribe survey for some lists).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (draft).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSurveyInput"}}}}}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}":{"get":{"operationId":"getSurvey","summary":"A survey: draft, live version, counters.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The survey.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"},"patch":{"operationId":"updateSurvey","summary":"Save the draft (If-Match).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Saved.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSurveyInput"}}}}},"delete":{"operationId":"deleteSurvey","summary":"Delete a never-published survey (a published one is stopped instead).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GROWTH_PUBLISHED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit"}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}/publish":{"post":{"operationId":"publishSurvey","summary":"Publish the reviewed draft revision (an unsubscribe survey claims its lists; one survey per list).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Published.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: GROWTH_NOT_PUBLISHABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}/unpublish":{"post":{"operationId":"closeSurvey","summary":"Close the survey (archived): no more responses, results kept.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Closed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnpublishGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}/duplicate":{"post":{"operationId":"duplicateSurvey","summary":"Duplicate into a new draft (the draft copied; no version, counter or public address carried over).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The new draft.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}/results":{"get":{"operationId":"getSurveyResults","summary":"Aggregate results (S49): every percentage with its displayed denominator; no answer text.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Results.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyResults"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}/responses":{"get":{"operationId":"listSurveyResponses","summary":"Answer detail (permissioned, S49): masked contact for non-anonymous surveys, upload states; sorted by submission time, filtered or grouped by source.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: submittedAt (date): eq, gt, gte, lt, lte, between; source (enum): in, nin — hosted | unsubscribe. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: submittedAt. Default submittedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (source): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of responses, with the total and, when grouped, the source counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyResponsePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"survey.responses.read","x-collection":{"resource":"survey_responses","fields":[{"key":"submittedAt","label":"Submitted","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"source","label":"Given on","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"hosted","label":"Hosted survey page"},{"value":"unsubscribe","label":"Unsubscribe page"}]}],"quickFilters":[{"id":"hosted","label":"Hosted page","filter":{"op":"and","conditions":[{"field":"source","operator":"in","value":["hosted"]}]}},{"id":"unsubscribe","label":"Unsubscribe page","filter":{"op":"and","conditions":[{"field":"source","operator":"in","value":["unsubscribe"]}]}}],"defaultSort":{"field":"submittedAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}/responses/export":{"get":{"operationId":"exportSurveyResponses","summary":"CSV export of the responses (formula-safe, no contact address).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"text/csv","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"survey.responses.read"}},"/v1/workspaces/{workspaceId}/surveys/{surveyId}/uploads/{uploadId}/link":{"post":{"operationId":"createSurveyUploadLink","summary":"Short-lived download link of an uploaded file — only once it passed the malware scan (AT-039).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"uploadId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Signed link.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyUploadLink"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ASSET_NOT_CLEAN, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"survey.responses.read"}},"/v1/public/surveys/{surveyId}":{"get":{"operationId":"getPublicSurvey","summary":"The live version of a published feedback survey. `render=hosted` counts one view.","tags":["public"],"parameters":[{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"render","in":"query","required":false,"schema":{"type":"string","enum":["hosted"]}}],"responses":{"200":{"description":"Survey.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSurvey"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: SURVEY_CLOSED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/surveys/{surveyId}/responses":{"post":{"operationId":"submitPublicSurvey","summary":"Submit answers: required questions and branching are re-validated server side.","tags":["public"],"parameters":[{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"201":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyResponseReceipt"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: SURVEY_CLOSED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitSurveyResponseInput"}}}}}},"/v1/public/surveys/{surveyId}/uploads":{"post":{"operationId":"createPublicSurveyUpload","summary":"Signed PUT ticket for one file of an upload question (type and exact size bound).","tags":["public"],"parameters":[{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"201":{"description":"Ticket.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyUploadTicket"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: SURVEY_CLOSED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: ASSET_TYPE_NOT_ALLOWED, ASSET_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSurveyUploadInput"}}}}}},"/v1/public/surveys/{surveyId}/uploads/{uploadId}/complete":{"post":{"operationId":"completePublicSurveyUpload","summary":"The file reached storage: sniff its type, scan it, report the verdict (pending files are never readable).","tags":["public"],"parameters":[{"name":"surveyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"uploadId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Upload state.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyUploadState"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ASSET_UPLOAD_INCOMPLETE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: ASSET_TYPE_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: STORAGE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/unsubscribe/{token}/survey":{"get":{"operationId":"getUnsubscribeSurvey","summary":"S51: the optional survey offered AFTER a successful unsubscribe (null before, or when the lists have none).","tags":["recipient"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"200":{"description":"Offer.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeSurveyOffer"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: PUBLIC_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"post":{"operationId":"submitUnsubscribeSurvey","summary":"S51: optional feedback; only accepted once the unsubscribe is durable. Skipping it changes nothing.","tags":["recipient"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}}],"responses":{"201":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyResponseReceipt"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: PUBLIC_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: SURVEY_NOT_OFFERED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitSurveyResponseInput"}}}}}},"/v1/workspaces/{workspaceId}/pages":{"get":{"operationId":"listLandingPages","summary":"Landing pages with domain, status, visitors and conversions (S45).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; status (enum): in, nin — draft | published | archived; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt, updatedAt. Default name:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of landing pages.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPagePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read","x-collection":{"resource":"pages","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"published","label":"Live"},{"value":"archived","label":"Stopped"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last edited","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"live","label":"Live","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["published"]}]}},{"id":"drafts","label":"Drafts","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["draft"]}]}},{"id":"stopped","label":"Stopped","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["archived"]}]}}],"defaultSort":{"field":"name","dir":"asc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createLandingPage","summary":"Create a draft landing page on a domain of the workspace.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (draft).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLandingPageInput"}}}}}},"/v1/workspaces/{workspaceId}/pages/{pageId}":{"get":{"operationId":"getLandingPage","summary":"A landing page: draft, live version, domain verification state.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The page.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"},"patch":{"operationId":"updateLandingPage","summary":"Save the draft / name / address (If-Match). A live page's address changes only by publishing.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Saved.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLandingPageInput"}}}}},"delete":{"operationId":"deleteLandingPage","summary":"Delete a never-published landing page (a published one is stopped instead).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GROWTH_PUBLISHED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit"}},"/v1/workspaces/{workspaceId}/pages/{pageId}/publish":{"post":{"operationId":"publishLandingPage","summary":"Publish the reviewed draft revision — only on a domain whose ownership is verified (AT-041).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Published.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: OWNERSHIP_MISSING, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: GROWTH_NOT_PUBLISHABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/pages/{pageId}/rollback":{"post":{"operationId":"rollbackLandingPage","summary":"Make an earlier published version live again (audited). The draft is untouched.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rolled back.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: OWNERSHIP_MISSING, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackLandingPageInput"}}}}}},"/v1/workspaces/{workspaceId}/pages/{pageId}/unpublish":{"post":{"operationId":"unpublishLandingPage","summary":"Take the page offline (archived).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Archived.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnpublishGrowthInput"}}}}}},"/v1/workspaces/{workspaceId}/pages/{pageId}/duplicate":{"post":{"operationId":"duplicateLandingPage","summary":"Duplicate into a new draft (the draft copied; no version, counter or public address carried over).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The new draft.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateLandingPageInput"}}}}}},"/v1/workspaces/{workspaceId}/pages/{pageId}/versions":{"get":{"operationId":"listLandingPageVersions","summary":"Published versions (rollback targets).","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Versions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrowthVersionList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"}},"/v1/workspaces/{workspaceId}/pages/{pageId}/analytics":{"get":{"operationId":"getLandingPageAnalytics","summary":"Renders, consented visitors, conversions and conversion rate with denominators.","tags":["growth"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Analytics.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandingPageAnalytics"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"growth.read"}},"/v1/public/pages/resolve":{"get":{"operationId":"resolvePublicPage","summary":"The live landing page at host + path (edge rendering). Unknown, unpublished or unverified → 404.","tags":["public"],"parameters":[{"name":"host","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","maxLength":200,"pattern":"^\\/([a-z0-9]+(-[a-z0-9]+)*(\\/[a-z0-9]+(-[a-z0-9]+)*)*)?$"}},{"name":"render","in":"query","required":false,"schema":{"type":"string","enum":["page"]}}],"responses":{"200":{"description":"Renderable page.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicLandingPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/pages/{pageId}/visits":{"post":{"operationId":"recordPublicPageVisit","summary":"Consented visit beacon (sent by the page only AFTER the visitor accepted analytics). Aggregate count only.","tags":["public"],"parameters":[{"name":"pageId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"202":{"description":"Counted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageVisitRecorded"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPageVisitInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/experiment":{"get":{"operationId":"getExperiment","summary":"The campaign's experiment setup with its fixed allocation layout and planned sample per arm (S28).","tags":["experiments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The setup (revision 1 = never saved).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Experiment"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"patch":{"operationId":"saveExperiment","summary":"Replace the experiment setup (variants, split, holdout, primary metric, minimum sample, decision window). Material: a live approval becomes stale.","tags":["experiments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Saved.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Experiment"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_NOT_EDITABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID, UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveExperimentInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/experiment/results":{"get":{"operationId":"getExperimentResults","summary":"Per-arm figures, the recorded decision (winner or inconclusive, with the method) and the holdout (S28, S71).","tags":["experiments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Results.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentResults"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/experiments":{"get":{"operationId":"listExperiments","summary":"Campaigns with an experiment, newest first, with their run state and outcome (S71).","tags":["experiments"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of experiments.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/field-grant":{"get":{"operationId":"getFieldGrant","summary":"Restricted custom fields this campaign may merge, and the ones that could be granted (S26).","tags":["personalization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The grant (revision 1 = none).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldGrant"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"patch":{"operationId":"saveFieldGrant","summary":"Grant (or revoke) restricted fields for this campaign, with a reason. Humans holding audience.protected_fields only; encrypted fields are refused. Material: a live approval becomes stale.","tags":["personalization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Saved.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldGrant"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_NOT_EDITABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.protected_fields","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFieldGrantInput"}}}}}},"/v1/workspaces/{workspaceId}/publications":{"get":{"operationId":"listPublications","summary":"Publications (titles) of the workspace with their archive slug and cadence.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Publications.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"post":{"operationId":"createPublication","summary":"Create a publication (title) with its public archive slug.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicationInput"}}}}}},"/v1/workspaces/{workspaceId}/publications/{publicationId}":{"patch":{"operationId":"updatePublication","summary":"Rename, change the cadence label, enable/disable or archive the public archive.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"publicationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicationInput"}}}}}},"/v1/workspaces/{workspaceId}/publications/{publicationId}/issues":{"get":{"operationId":"listPublicationIssues","summary":"Archive issues of a publication, newest first (withdrawn included).","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"publicationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of issues.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveIssuePage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/archive-issues":{"post":{"operationId":"publishArchiveIssue","summary":"Publish the campaign's APPROVED, sent version to a publication's public archive, rendered for an anonymous reader (no tokens, no tracking, merge fields at their fallbacks).","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Published.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveIssue"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CAMPAIGN_STATE_CONFLICT, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishIssueInput"}}}}}},"/v1/workspaces/{workspaceId}/archive-issues/{issueId}/withdraw":{"post":{"operationId":"withdrawArchiveIssue","summary":"Withdraw an issue from the public archive (final).","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"issueId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Withdrawn.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveIssue"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawIssueInput"}}}}}},"/v1/public/news/{slug}":{"get":{"operationId":"getPublicArchive","summary":"Public newsletter archive of a publication (S53): approved public versions only.","tags":["publishing"],"parameters":[{"name":"slug","in":"path","required":true,"description":"Public archive URL segment: /news/<slug>.","schema":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Search in titles, topics and summaries.","schema":{"type":"string","maxLength":100}},{"name":"topic","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"The archive.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicArchive"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/news/{slug}/issues/{issueId}":{"get":{"operationId":"getPublicArchiveIssue","summary":"One public archive issue (anonymous render).","tags":["publishing"],"parameters":[{"name":"slug","in":"path","required":true,"description":"Public archive URL segment: /news/<slug>.","schema":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},{"name":"issueId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The issue.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicArchiveIssueDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/digests":{"get":{"operationId":"listDigests","summary":"Recurring RSS digests with their next run.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Digests.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringDigestList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"post":{"operationId":"createDigest","summary":"Create a recurring digest: on its cadence, NEW feed items become a draft issue cloned from the source campaign (never sent without approval).","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringDigest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDigestInput"}}}}}},"/v1/workspaces/{workspaceId}/digests/{digestId}":{"patch":{"operationId":"updateDigest","summary":"Pause/resume a digest or change its cadence.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"digestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringDigest"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDigestInput"}}}}}},"/v1/workspaces/{workspaceId}/digests/{digestId}/run":{"post":{"operationId":"runDigestNow","summary":"Run the digest now (fetch through the SSRF-safe egress; skip when nothing is new).","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"digestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The recorded run.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestRun"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/v1/workspaces/{workspaceId}/digests/{digestId}/runs":{"get":{"operationId":"listDigestRuns","summary":"The latest runs of a digest (created / skipped unchanged / failed).","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"digestId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Runs.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestRunList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/sponsors":{"get":{"operationId":"listCampaignSponsors","summary":"Sponsor slots of a campaign.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Sponsors.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSponsorList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"post":{"operationId":"createCampaignSponsor","summary":"Mark blocks of the campaign as a sponsor's slot.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignSponsor"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSponsorInput"}}}}}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/sponsors/{sponsorId}":{"delete":{"operationId":"deleteCampaignSponsor","summary":"Remove a sponsor slot.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"sponsorId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Removed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/sponsor-report":{"get":{"operationId":"getSponsorReport","summary":"Advertiser report: raw, bot-filtered and human-likely sponsor clicks, with unavailable metrics labelled (opens never prove a human read).","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The report.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SponsorReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/sponsor-reports":{"get":{"operationId":"listSponsoredCampaigns","summary":"Campaigns with sponsor slots (S70 sponsor reports view), keyset order; the report itself is getSponsorReport.","tags":["publishing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Sponsored campaigns.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SponsoredCampaignPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/agency":{"get":{"operationId":"getAgencyProfile","summary":"Whether this workspace's organization is an agency, and how many clients it manages.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The profile.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyProfile"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.read"}},"/v1/workspaces/{workspaceId}/agency/enable":{"post":{"operationId":"enableAgency","summary":"Turn this workspace's organization into an agency (or reseller) that can provision client workspaces.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Enabled (idempotent).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyProfile"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableAgencyInput"}}}}}},"/v1/workspaces/{workspaceId}/agency/clients":{"get":{"operationId":"listAgencyClients","summary":"Client portfolio (S88): each client with COUNTS and health — never recipient data — as a collection: client name search, status filter and groups (released hidden unless asked), newest first; totals cover the whole portfolio.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: status (enum): in, nin — active | suspended | released; externalRef (text): eq, is_set, is_not_set; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"status","in":"query","required":false,"description":"Legacy: one status (prefer the `status` filter).","schema":{"$ref":"#/components/schemas/AgencyClientStatus"}}],"responses":{"200":{"description":"A page of clients with portfolio totals.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyPortfolioPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: AGENCY_NOT_ENABLED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.read","x-collection":{"resource":"agency-clients","fields":[{"key":"name","label":"Client","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"active","label":"Active"},{"value":"suspended","label":"Suspended"},{"value":"released","label":"Released"}]},{"key":"externalRef","label":"External reference","type":"text","sortable":false,"filterOperators":["eq","is_set","is_not_set"],"groupable":false},{"key":"createdAt","label":"Added","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["active"]}]}},{"id":"suspended","label":"Suspended","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["suspended"]}]}},{"id":"released","label":"Released","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["released"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"provisionAgencyClient","summary":"Provision a client workspace (own organization, limits, optional owner invitation). Replay-safe on externalRef.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Provisioned, or the existing client of this externalRef.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionAgencyClientResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: AGENCY_NOT_ENABLED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE, REGION_NOT_SERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionAgencyClientInput"}}}}}},"/v1/workspaces/{workspaceId}/agency/clients/{clientId}":{"get":{"operationId":"getAgencyClient","summary":"One client (S89): limits, delegations and the provisioning checklist.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The client.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyClientDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.read"},"patch":{"operationId":"updateAgencyClient","summary":"Rename a client, change its limits, suspend, reactivate or release it (If-Match).","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyClient"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgencyClientInput"}}}}}},"/v1/workspaces/{workspaceId}/agency/clients/{clientId}/delegations":{"post":{"operationId":"setAgencyDelegation","summary":"Give one agency member explicit, scoped access to a client workspace (replaces their live delegation).","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Delegated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyDelegation"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAgencyDelegationInput"}}}}},"get":{"operationId":"listAgencyClientDelegations","summary":"Delegations of one client workspace to agency people (live and ended), as a reduced collection: live / ended / data-access filters, newest first (S89).","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: active (bool): eq; dataAccess (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between; revokedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of delegations.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyDelegationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: AGENCY_NOT_ENABLED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.read","x-collection":{"resource":"agency-delegations","fields":[{"key":"active","label":"Live","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"dataAccess","label":"Recipient data access","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Granted","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"revokedAt","label":"Ended","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"live","label":"Live","filter":{"op":"and","conditions":[{"field":"active","operator":"eq","value":true}]}},{"id":"ended","label":"Ended","filter":{"op":"and","conditions":[{"field":"active","operator":"eq","value":false}]}},{"id":"data","label":"With data access","filter":{"op":"and","conditions":[{"field":"dataAccess","operator":"eq","value":true}]}}],"defaultSort":{"field":"createdAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/agency/clients/{clientId}/delegations/{delegationId}/revoke":{"post":{"operationId":"revokeAgencyDelegation","summary":"End a delegation now (takes effect on the person's next request).","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"delegationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked (idempotent).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyDelegation"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAgencyDelegationInput"}}}}}},"/v1/workspaces/{workspaceId}/agency/clients/{clientId}/templates":{"post":{"operationId":"shareTemplateWithClient","summary":"Copy the latest published version of an agency template into a client's template library (R077).","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Copied.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/agency/notices":{"post":{"operationId":"publishClientNotice","summary":"Publish a system notice to clients (in-app, optionally emailed to their owners by the platform mailer).","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Published.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishClientNoticeResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: AGENCY_NOT_ENABLED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishClientNoticeInput"}}}}}},"/v1/workspaces/{workspaceId}/agency-link":{"get":{"operationId":"getAgencyLink","summary":"Which agency manages this workspace, and the limits it set.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The link (managed: false when none).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyLink"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"}},"/v1/workspaces/{workspaceId}/agency-delegations":{"get":{"operationId":"listAgencyDelegations","summary":"Agency people who can act in this workspace through a delegation (active and past), as a reduced collection: live / ended / data-access filters, newest first.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: active (bool): eq; dataAccess (bool): eq; createdAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between; revokedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"active","in":"query","required":false,"description":"Legacy: live (true) or ended (false) only (prefer the `active` filter).","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"A page of delegations.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyDelegationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.read","x-collection":{"resource":"agency-delegations","fields":[{"key":"active","label":"Live","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"dataAccess","label":"Recipient data access","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Granted","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"revokedAt","label":"Ended","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"live","label":"Live","filter":{"op":"and","conditions":[{"field":"active","operator":"eq","value":true}]}},{"id":"ended","label":"Ended","filter":{"op":"and","conditions":[{"field":"active","operator":"eq","value":false}]}},{"id":"data","label":"With data access","filter":{"op":"and","conditions":[{"field":"dataAccess","operator":"eq","value":true}]}}],"defaultSort":{"field":"createdAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/agency-delegations/{delegationId}/revoke":{"post":{"operationId":"revokeAgencyDelegationAsClient","summary":"The client ends an agency person's delegated access.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"delegationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked (idempotent).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyDelegation"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"membership.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAgencyDelegationInput"}}}}}},"/v1/workspaces/{workspaceId}/notices":{"get":{"operationId":"listWorkspaceNotices","summary":"System notices and account alerts of this workspace (S97), newest first.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of notices.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceNoticePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"}},"/v1/workspaces/{workspaceId}/brand":{"get":{"operationId":"getBrand","summary":"The brand draft, the published snapshot and the custom-domain checks.","tags":["branding"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The brand.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"},"patch":{"operationId":"updateBrand","summary":"Edit the brand draft (published only by publishBrand). Changing a domain resets its check.","tags":["branding"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated draft.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"brand.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBrandInput"}}}}}},"/v1/workspaces/{workspaceId}/brand/domains/verify":{"post":{"operationId":"verifyBrandDomains","summary":"Check the custom login/tracking hosts: under a verified sending domain of this workspace, CNAME to the portal host.","tags":["branding"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The brand with fresh domain checks.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"brand.manage"}},"/v1/workspaces/{workspaceId}/brand/publish":{"post":{"operationId":"publishBrand","summary":"Validate the draft (contrast, clean public logo, verified domains) and publish it as the approved brand.","tags":["branding"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Published.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: BRAND_DOMAIN_TAKEN, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: BRAND_INVALID, BRAND_DOMAIN_UNVERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"brand.manage"}},"/v1/public/brand":{"get":{"operationId":"getPublicBrand","summary":"Published brand of a verified custom console host (unauthenticated; drafts are never served).","tags":["branding"],"parameters":[{"name":"host","in":"query","required":true,"schema":{"$ref":"#/components/schemas/DomainName"}}],"responses":{"200":{"description":"The brand.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicBrand"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/warmup-schedules":{"get":{"operationId":"listWarmupSchedules","summary":"Warm-up schedules with their ceiling in force, today's usage and the last health-gate evaluation: search, filter, sort, group (collection view, ADR 0039); newest first by default.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; state (enum): in, nin — active | frozen | completed | cancelled; poolKind (enum): in — server | egress_ip; poolId (ref): in, nin; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"description":"Legacy: only this state; prefer `filter` on `state`.","schema":{"$ref":"#/components/schemas/WarmupState"}},{"name":"poolId","in":"query","required":false,"description":"Legacy: only this pool's schedules; prefer `filter` on `poolId`.","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of schedules, the total and, when grouped, whole-collection state counts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupSchedulePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"warmup-schedules","fields":[{"key":"name","label":"Schedule","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"active","label":"Active"},{"value":"frozen","label":"Frozen — review required"},{"value":"completed","label":"Completed"},{"value":"cancelled","label":"Cancelled"}]},{"key":"poolKind","label":"Member kind","type":"enum","sortable":false,"filterOperators":["in"],"groupable":false,"options":[{"value":"server","label":"Server route"},{"value":"egress_ip","label":"Egress IP"}]},{"key":"poolId","label":"Pool","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"live","label":"In progress","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active","frozen"]}]}},{"id":"frozen","label":"Review required","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["frozen"]}]}},{"id":"finished","label":"Finished","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["completed","cancelled"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createWarmupSchedule","summary":"Warm one pool member (server route or egress IP) with operator-chosen daily ceilings and pause thresholds.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created and in force immediately (step 1).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupSchedule"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWarmupScheduleInput"}}}}}},"/v1/workspaces/{workspaceId}/warmup-schedules/{scheduleId}":{"get":{"operationId":"getWarmupSchedule","summary":"One warm-up schedule.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"scheduleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The schedule.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupSchedule"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"patch":{"operationId":"updateWarmupSchedule","summary":"Edit name, steps, thresholds or cohort. Never changes the state: a frozen schedule stays frozen until reviewed.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"scheduleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupSchedule"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: WARMUP_STATE_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWarmupScheduleInput"}}}}}},"/v1/workspaces/{workspaceId}/warmup-schedules/{scheduleId}/review":{"post":{"operationId":"reviewWarmupSchedule","summary":"Operator review: resume, hold, step back or cancel (AT-056: the only way out of a freeze). Recorded with the metrics seen.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"scheduleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The schedule after the decision.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupSchedule"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: WARMUP_STATE_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewWarmupScheduleInput"}}}}}},"/v1/workspaces/{workspaceId}/warmup-schedules/{scheduleId}/evaluate":{"post":{"operationId":"evaluateWarmupSchedule","summary":"Run the health gate now (the workers also run it periodically): may freeze, advance or complete.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"scheduleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The schedule after the evaluation.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupSchedule"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/warmup-schedules/{scheduleId}/reviews":{"get":{"operationId":"listWarmupReviews","summary":"Operator decisions on a schedule, newest first.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"scheduleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of reviews.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupReviewPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/deliverability/center":{"get":{"operationId":"getDeliverabilityCenter","summary":"Authentication, delivery outcomes with denominators, inbox-placement evidence, external signals, bounce sources, pools and recommendations.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The center.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverabilityCenter"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/deliverability/signals":{"get":{"operationId":"getMailboxProviderSignals","summary":"External reputation per mailbox provider with observation windows and freshness, plus the latest seed tests.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The signals.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxProviderSignals"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/deliverability/compliance":{"get":{"operationId":"getComplianceOverview","summary":"Bulk-sender compliance evidence (Gmail, Yahoo, Microsoft) with measured / estimated / unavailable labels and the fixes.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The compliance overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/reputation-sources":{"get":{"operationId":"listReputationSources","summary":"External reputation sources with their state and freshness.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of sources.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReputationSourcePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"createReputationSource","summary":"Add a provider data source for a domain or IP. A live API connection waits for authorization; manual import works now.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReputationSource"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReputationSourceInput"}}}}}},"/v1/workspaces/{workspaceId}/reputation-sources/{sourceId}/observations":{"post":{"operationId":"importReputationObservations","summary":"Import observations copied from the provider's own report; each keeps the provider's window, value and sample.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"sourceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Imported (duplicates of an already imported window are counted, not overwritten).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportObservationsResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportObservationsInput"}}}}}},"/v1/workspaces/{workspaceId}/seed-tests":{"get":{"operationId":"listSeedTests","summary":"Seed placement tests, newest first.","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of seed tests.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedTestPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"post":{"operationId":"createSeedTest","summary":"Record a seed placement test (a sample, shown with its size and date).","tags":["deliverability"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedTest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSeedTestInput"}}}}}},"/v1/workspaces/{workspaceId}/transactional-templates":{"get":{"operationId":"listTransactionalTemplates","summary":"Transactional templates with their versions and the active one: search key and name, filter, group by state, sort (collection view, ADR 0039).","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over key, name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: key (text): contains, starts_with, eq; name (text): contains, starts_with, eq; state (enum): in, nin — draft | active | disabled; createdAt (date): eq, gt, gte, lt, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: key, name, createdAt, updatedAt. Default key:asc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of templates and the total.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalTemplatePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read","x-collection":{"resource":"transactional_templates","fields":[{"key":"key","label":"Template key","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Draft"},{"value":"active","label":"Active"},{"value":"disabled","label":"Disabled"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"updatedAt","label":"Updated","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active"]}]}},{"id":"draft","label":"Not sendable yet","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["draft"]}]}}],"defaultSort":{"field":"key","dir":"asc"},"search":{"fields":["key","name"],"mode":"contains"}}},"post":{"operationId":"createTransactionalTemplate","summary":"Create a template (draft, version 1). Nothing sends until a version is activated.","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SENDER_UNVERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransactionalTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/transactional-templates/{templateId}":{"get":{"operationId":"getTransactionalTemplate","summary":"One transactional template.","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The template.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.read"}},"/v1/workspaces/{workspaceId}/transactional-templates/{templateId}/versions":{"post":{"operationId":"createTransactionalVersion","summary":"Add an immutable version; the active one keeps sending until another is activated.","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The template with its new version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: TRANSACTIONAL_PARAMETERS_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransactionalVersionInput"}}}}}},"/v1/workspaces/{workspaceId}/transactional-templates/{templateId}/activate":{"post":{"operationId":"activateTransactionalVersion","summary":"Approve one exact version for sending (human only). Messages already requested keep the version they were requested with.","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Active.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.approve","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateTransactionalVersionInput"}}}}}},"/v1/workspaces/{workspaceId}/transactional-templates/{templateId}/disable":{"post":{"operationId":"disableTransactionalTemplate","summary":"Stop the template: new sends are refused; queued messages are cancelled at their next dispatch check.","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Disabled.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisableTransactionalTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/transactional/messages":{"post":{"operationId":"sendTransactional","summary":"Queue one service message through an active template, in the transactional stream. Durable Idempotency-Key.","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Queued (or the original answer for a replayed key). Not delivered yet.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalSendAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: TRANSACTIONAL_TEMPLATE_INACTIVE, CREDIT_RESERVATION_FAILED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: TRANSACTIONAL_PARAMETERS_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"transactional.send","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTransactionalInput"}}}}}},"/v1/workspaces/{workspaceId}/transactional/requests":{"get":{"operationId":"listTransactionalRequests","summary":"Accepted transactional requests with their message state (recipients masked without audience.read): exact idempotency key or id lookup, filter, newest first (collection view, ADR 0039).","tags":["transactional"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over reference.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: templateId (ref): in; requestedByType (enum): in, nin — user | api_key | mcp_agent | oauth_app; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}},{"name":"templateId","in":"query","required":false,"description":"One template's requests. Legacy: prefer a filter on `templateId`.","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of requests and the total (an estimate on large logs).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalRequestPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"message.read","x-collection":{"resource":"transactional_requests","fields":[{"key":"reference","label":"Idempotency key or id","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"templateId","label":"Template","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"requestedByType","label":"Requested by","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"user","label":"A person"},{"value":"api_key","label":"An API key"},{"value":"mcp_agent","label":"An AI agent"},{"value":"oauth_app","label":"An application"}]},{"key":"createdAt","label":"Requested","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"keys","label":"From API keys","filter":{"op":"and","conditions":[{"field":"requestedByType","operator":"in","value":["api_key"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["reference"],"mode":"prefix"}}}},"/v1/workspaces/{workspaceId}/smtp-credentials":{"get":{"operationId":"listSmtpCredentials","summary":"SMTP relay credentials of the workspace (never their secrets), as a collection: search, filter, sort.","tags":["smtp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name, username.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq, neq; username (text): eq, starts_with; state (enum): in, nin — pending_activation | active | expired | revoked; createdAt (date): eq, gt, gte, lt, lte, between; expiresAt (date): eq, gt, gte, lt, lte, between; lastUsedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of credentials.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmtpCredentialPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"smtp.read","x-collection":{"resource":"smtp-credentials","fields":[{"key":"name","label":"Name","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"username","label":"Username","type":"text","sortable":false,"filterOperators":["eq","starts_with"],"groupable":false},{"key":"state","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"pending_activation","label":"Awaiting activation"},{"value":"active","label":"Active"},{"value":"expired","label":"Expired"},{"value":"revoked","label":"Revoked"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"lastUsedAt","label":"Last used","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active"]}]}},{"id":"pending","label":"Awaiting activation","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["pending_activation"]}]}},{"id":"revoked","label":"Revoked","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["revoked"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["name","username"],"mode":"contains"}}},"post":{"operationId":"createSmtpCredential","summary":"Mint an SMTP credential (a person only). The secret is in this response only; nothing sends before a person with campaign.approve activates it.","tags":["smtp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created; `secret` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedSmtpCredential"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE, SENDER_UNVERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"smtp.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSmtpCredentialInput"}}}}}},"/v1/workspaces/{workspaceId}/smtp-credentials/{credentialId}":{"get":{"operationId":"getSmtpCredential","summary":"One SMTP credential (metadata, activation, last use).","tags":["smtp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"credentialId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The credential.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmtpCredential"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"smtp.read"},"patch":{"operationId":"updateSmtpCredential","summary":"Rename, change senders, networks or limits. Widening is a person's act; new senders need a new activation.","tags":["smtp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"credentialId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmtpCredential"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE, SENDER_UNVERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"smtp.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSmtpCredentialInput"}}}}}},"/v1/workspaces/{workspaceId}/smtp-credentials/{credentialId}/rotate":{"post":{"operationId":"rotateSmtpCredential","summary":"Mint a new secret (a person only); the previous one keeps working for the grace period.","tags":["smtp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"credentialId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rotated; `secret` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedSmtpCredential"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"smtp.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateSmtpCredentialInput"}}}}}},"/v1/workspaces/{workspaceId}/smtp-credentials/{credentialId}/revoke":{"post":{"operationId":"revokeSmtpCredential","summary":"Revoke a credential: the next AUTH is refused and messages already queued under it stop at their next dispatch check.","tags":["smtp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"credentialId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmtpCredential"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"smtp.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeSmtpCredentialInput"}}}}}},"/v1/workspaces/{workspaceId}/smtp-credentials/{credentialId}/activate":{"post":{"operationId":"activateSmtpCredential","summary":"Approve what the credential may send (a person with campaign.approve; four-eyes applies). The activation is the approval the dispatcher re-checks.","tags":["smtp"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"credentialId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Active.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmtpCredential"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: SEPARATION_OF_DUTIES, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SENDER_UNVERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.approve","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateSmtpCredentialInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailboxes":{"get":{"operationId":"listHostedMailboxes","summary":"Hosted mailboxes of the workspace (never their passwords), as a collection.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over address, displayName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: address (text): contains, starts_with, eq, neq; domain (text): eq, neq; displayName (text): contains; state (enum): in, nin — active | revoked; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of mailboxes.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.read","x-collection":{"resource":"hosted-mailboxes","fields":[{"key":"address","label":"Address","type":"text","sortable":false,"filterOperators":["contains","starts_with","eq","neq"],"groupable":false},{"key":"domain","label":"Domain","type":"text","sortable":false,"filterOperators":["eq","neq"],"groupable":false},{"key":"displayName","label":"Name","type":"text","sortable":false,"filterOperators":["contains"],"groupable":false},{"key":"state","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":false,"options":[{"value":"active","label":"Active"},{"value":"revoked","label":"Revoked"}]},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active"]}]}},{"id":"revoked","label":"Revoked","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["revoked"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["address","displayName"],"mode":"contains"}}},"post":{"operationId":"createHostedMailbox","summary":"Create a mailbox on a verified domain the platform receives for (a person only). The password is in this response only.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created; `password` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedHostedMailbox"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: MAILBOX_ADDRESS_TAKEN, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SENDER_UNVERIFIED, MAILBOX_DOMAIN_RESERVED, MAILBOX_DOMAIN_NOT_RECEIVING","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHostedMailboxInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}":{"get":{"operationId":"getHostedMailbox","summary":"One hosted mailbox (state, quota, usage, rules sync).","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The mailbox.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailbox"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.read"},"patch":{"operationId":"updateHostedMailbox","summary":"Change the display name or the quota.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailbox"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: HOSTED_MAILBOX_INACTIVE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHostedMailboxInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}/rotate-password":{"post":{"operationId":"rotateHostedMailboxPassword","summary":"Mint a new password (a person only); the old one stops working within a minute.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rotated; `password` is shown once.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedHostedMailbox"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: HOSTED_MAILBOX_INACTIVE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateHostedMailboxPasswordInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}/revoke":{"post":{"operationId":"revokeHostedMailbox","summary":"Revoke a mailbox: logins stop, its sessions are closed and the MX stops accepting its address within a minute. Final; the stored mail stays on the server.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailbox"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeHostedMailboxInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}/rules":{"get":{"operationId":"listHostedMailboxRules","summary":"The mailbox's rules in order, the Sieve script they compile to and whether the mail host runs it.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Rules.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxRuleList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.read"},"post":{"operationId":"createHostedMailboxRule","summary":"Add a rule (applies to NEW mail once the mail host installs it, within a minute).","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxRule"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: HOSTED_MAILBOX_INACTIVE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHostedMailboxRuleInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}/rules/{ruleId}":{"patch":{"operationId":"updateHostedMailboxRule","summary":"Change a rule (conditions, actions, enabled, position).","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"ruleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxRule"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: HOSTED_MAILBOX_INACTIVE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHostedMailboxRuleInput"}}}}},"delete":{"operationId":"deleteHostedMailboxRule","summary":"Delete a rule.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"ruleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: HOSTED_MAILBOX_INACTIVE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage"}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}/rules/{ruleId}/apply":{"post":{"operationId":"applyHostedMailboxRule","summary":"Run the rule once on the messages already in INBOX (bounded by maxMessages, audited). Only rules whose conditions all use `contains`.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"ruleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Queued: the mail host runs it within a minute.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxRuleRun"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: HOSTED_MAILBOX_INACTIVE, MAILBOX_RULE_NOT_APPLICABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyHostedMailboxRuleInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}/rule-runs":{"get":{"operationId":"listHostedMailboxRuleRuns","summary":"The last runs of rules on existing messages (newest first, at most 50).","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Runs.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxRuleRunList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.read"}},"/v1/workspaces/{workspaceId}/hosted-mailboxes/{mailboxId}/folders":{"get":{"operationId":"listHostedMailboxFolders","summary":"Folders as the mail host last reported them (messages, size), plus the ones asked for.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Folders.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxFolderList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.read"},"post":{"operationId":"createHostedMailboxFolder","summary":"Ask for a new folder; the mail host creates it within a minute.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Requested (or already there).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxFolderList"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: HOSTED_MAILBOX_INACTIVE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHostedMailboxFolderInput"}}}}}},"/v1/workspaces/{workspaceId}/hosted-mailbox-domains":{"get":{"operationId":"listHostedMailboxDomains","summary":"The workspace's domains and whether each can hold mailboxes: ownership verified and an MX naming one of the platform's inbound listeners — and, when not, the MX record to add.","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Every live customer domain of the workspace with its receiving state.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxDomainList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.read"}},"/v1/workspaces/{workspaceId}/hosted-mailbox-domains/{domainId}/recheck":{"post":{"operationId":"recheckHostedMailboxDomain","summary":"Look the domain's MX up again now and store whether it names one of the platform's inbound listeners (audited when the state changes).","tags":["mailboxes"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Checked; the receiving state as stored.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedMailboxDomain"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: MAILBOX_DOMAIN_DNS_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"mailboxes.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecheckHostedMailboxDomainInput"}}}}}},"/internal/kumomta/mailboxes":{"get":{"operationId":"getKumoMailboxes","summary":"Internal (KumoMTA only): the active hosted mailboxes its inbound listeners accept.","tags":["internal"],"parameters":[],"responses":{"200":{"description":"Addresses (no-store).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KumoMailboxes"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/internal/mailbox-sync/pull":{"post":{"operationId":"pullMailboxSync","summary":"Internal (the mail host's sync agent only): desired accounts, rules and folders; leases pending rule runs.","tags":["internal"],"parameters":[],"responses":{"200":{"description":"Desired state (no-store).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxSyncState"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/internal/mailbox-sync/report":{"post":{"operationId":"reportMailboxSync","summary":"Internal (the mail host's sync agent only): what is installed, the folders observed, the outcome of rule runs.","tags":["internal"],"parameters":[],"responses":{"200":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxSyncAck"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxSyncReport"}}}}}},"/v1/workspaces/{workspaceId}/git-connections":{"get":{"operationId":"listGitConnections","summary":"Provider connections (GitHub App installations, GitLab / Bitbucket authorizations, supplied access tokens). Never a token.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of connections.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitConnectionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"},"post":{"operationId":"createGitTokenConnection","summary":"Connect GitLab (gitlab.com or a self-managed base URL) or Bitbucket with an access token the customer supplies. The token is checked against the provider, stored write-only and never returned.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Connected.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GIT_PROVIDER_AUTH_REQUIRED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: GIT_PROVIDER_RATE_LIMITED, RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: GIT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGitTokenConnectionInput"}}}}}},"/v1/workspaces/{workspaceId}/git-connections/{connectionId}":{"get":{"operationId":"getGitConnection","summary":"One connection (no token).","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The connection.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/git-connections/{connectionId}/revoke":{"post":{"operationId":"revokeGitConnection","summary":"Forget the connection's credentials (crypto-shredded); its bindings need a new connection. Nothing is changed at the provider.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeGitConnectionInput"}}}}}},"/v1/workspaces/{workspaceId}/git-connections/authorize":{"post":{"operationId":"startGitAuthorization","summary":"Start connecting a provider account: GitHub = install the platform's GitHub App; GitLab / Bitbucket = OAuth consent (authorization code + PKCE). A signed-in member only; the state is bound to them.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Where to send the browser.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitAuthorizationStart"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: OAUTH_PROVIDER_NOT_CONFIGURED, OAUTH_REDIRECT_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartGitAuthorizationInput"}}}}}},"/v1/workspaces/{workspaceId}/git-connections/authorize/complete":{"post":{"operationId":"completeGitAuthorization","summary":"Complete it with what the provider put on the callback (single use; GitHub: the installation is claimed only if the member's own GitHub authorization can see it).","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The connection.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitConnection"}}}},"400":{"description":"Problem: OAUTH_STATE_INVALID, VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: OAUTH_AUTHORIZATION_FAILED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: OAUTH_PROVIDER_NOT_CONFIGURED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteGitAuthorizationInput"}}}}}},"/v1/workspaces/{workspaceId}/git-connections/{connectionId}/repositories":{"get":{"operationId":"listGitRemoteRepositories","summary":"Repositories the connection can write (the S80 picker), one provider page at a time.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":500}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"A page of repositories.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitRemoteRepositoryPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GIT_PROVIDER_AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: GIT_PROVIDER_RATE_LIMITED, RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: GIT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage"}},"/v1/workspaces/{workspaceId}/git-connections/{connectionId}/branches":{"get":{"operationId":"listGitRemoteBranches","summary":"Branches of one repository of the connection.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectionId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"repository","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":500}}],"responses":{"200":{"description":"A page of branches.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitRemoteBranchPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GIT_PROVIDER_AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: GIT_PROVIDER_RATE_LIMITED, RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: GIT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage"}},"/v1/ingest/git/github":{"post":{"operationId":"ingestGitHubWebhook","summary":"GitHub App webhook (push, installation): signature-verified, deduplicated by delivery id, 202 before any preview runs.","tags":["ingest"],"parameters":[],"responses":{"202":{"description":"Verified and recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitWebhookAccepted"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/ingest/git/{provider}/bindings/{bindingId}":{"post":{"operationId":"ingestGitBindingWebhook","summary":"GitLab / Bitbucket repository webhook registered for one binding: verified against that binding's secret, deduplicated, 202 before any preview runs.","tags":["ingest"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","enum":["gitlab","bitbucket"]}},{"name":"bindingId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"202":{"description":"Verified and recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitWebhookAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/git-bindings":{"get":{"operationId":"listGitBindings","summary":"Repositories bound to this workspace for content sync (S80).","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of bindings.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitBindingPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"},"post":{"operationId":"createGitBinding","summary":"Bind a GitHub / GitLab / Bitbucket repository branch through a connection. When an adapter serves it, the initial sync records the base commit and object hashes, and a signed webhook is registered for pull triggers.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Bound (state says whether an adapter serves it).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitBinding"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: GIT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGitBindingInput"}}}}}},"/v1/workspaces/{workspaceId}/git-bindings/{bindingId}":{"get":{"operationId":"getGitBinding","summary":"One binding with its last run and open conflicts.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"bindingId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The binding.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitBinding"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/git-bindings/{bindingId}/disconnect":{"post":{"operationId":"disconnectGitBinding","summary":"Stop syncing. Nothing is deleted from the repository or the workspace.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"bindingId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Disconnected.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitBinding"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectGitBindingInput"}}}}}},"/v1/workspaces/{workspaceId}/git-bindings/{bindingId}/preview":{"post":{"operationId":"previewGitSync","summary":"Three-way diff (base, workspace, repository head) in one direction; conflicts become SyncConflicts to resolve on S81.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"bindingId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"The preview run (read `status`).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitSyncRun"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GIT_DIFF_STALE, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: GIT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewGitSyncInput"}}}}}},"/v1/workspaces/{workspaceId}/git-bindings/{bindingId}/apply":{"post":{"operationId":"applyGitSync","summary":"Apply a reviewed preview: export opens a pull/merge request from a NEW branch (never force, never the base branch); import writes template drafts (never published).","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"bindingId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"The apply run (read `status`).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitSyncRun"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: GIT_SYNC_CONFLICTS_OPEN, GIT_DIFF_STALE, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: GIT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyGitSyncInput"}}}}}},"/v1/workspaces/{workspaceId}/git-bindings/{bindingId}/runs":{"get":{"operationId":"listGitSyncRuns","summary":"Previews and applies of a binding, newest first.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"bindingId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of runs.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitSyncRunPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/git-bindings/{bindingId}/runs/{runId}":{"get":{"operationId":"getGitSyncRun","summary":"One run with its full diff.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"bindingId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"runId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The run.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitSyncRun"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/git-sync-conflicts/{conflictId}":{"get":{"operationId":"getSyncConflict","summary":"A sync conflict: base, workspace and repository versions, conflicting fields, suggested merge (S81).","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conflictId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The conflict.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncConflict"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/git-sync-conflicts/{conflictId}/resolve":{"post":{"operationId":"resolveSyncConflict","summary":"Choose the workspace or repository version, or supply a merged one; validated server-side. `dryRun` previews without saving.","tags":["git-sync"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conflictId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The conflict with its merge result and validation.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncConflict"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveSyncConflictInput"}}}}}},"/v1/workspaces/{workspaceId}/connector-catalog":{"get":{"operationId":"getConnectorCatalog","summary":"Providers a connector can be created for, with what a real connection requires.","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The catalog.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorCatalog"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/connectors":{"get":{"operationId":"listConnectors","summary":"Connectors with their sync health (cursor, last batch, counts), as a collection: name search, provider / state / rejection filters, provider and state groups (S76).","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq; provider (enum): in, nin — shopify | woocommerce | salesforce | hubspot | stripe | custom_events; state (enum): in, nin — awaiting_authorization | active | paused | needs_reauthorization | error; recordsRejected (number): eq, gt, gte, lt, lte, between; lastSyncAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (provider, state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of connectors.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read","x-collection":{"resource":"connectors","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"provider","label":"Provider","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"shopify","label":"Shopify"},{"value":"woocommerce","label":"WooCommerce"},{"value":"salesforce","label":"Salesforce"},{"value":"hubspot","label":"HubSpot"},{"value":"stripe","label":"Stripe"},{"value":"custom_events","label":"Custom events"}]},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"awaiting_authorization","label":"Awaiting authorization"},{"value":"active","label":"Active"},{"value":"paused","label":"Paused"},{"value":"needs_reauthorization","label":"Needs reauthorization"},{"value":"error","label":"Error"}]},{"key":"recordsRejected","label":"Records rejected","type":"number","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"lastSyncAt","label":"Last sync","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Connected","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"attention","label":"Needs attention","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["needs_reauthorization","error"]}]}},{"id":"rejections","label":"With rejected records","filter":{"op":"and","conditions":[{"field":"recordsRejected","operator":"gt","value":0}]}},{"id":"paused","label":"Paused","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["paused"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createConnector","summary":"Create a connector. Providers this deployment cannot authorize stay awaiting_authorization.","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connector"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConnectorInput"}}}}}},"/v1/workspaces/{workspaceId}/connectors/{connectorId}":{"get":{"operationId":"getConnector","summary":"One connector.","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectorId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The connector.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connector"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"},"patch":{"operationId":"updateConnector","summary":"Rename, change settings, pause or resume a connector.","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectorId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connector"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, CONNECTOR_NOT_ACTIVE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConnectorInput"}}}}}},"/v1/workspaces/{workspaceId}/connectors/{connectorId}/batches":{"post":{"operationId":"submitConnectorBatch","summary":"Apply one batch (contact records + events) with the provider cursor. Replays change nothing already applied.","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectorId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Applied; per-item outcomes and the batch receipt.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorBatchResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONNECTOR_NOT_ACTIVE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitConnectorBatchInput"}}}}},"get":{"operationId":"listConnectorBatches","summary":"Batch receipts of a connector, newest first.","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"connectorId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of batch receipts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorBatchPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.read"}},"/v1/workspaces/{workspaceId}/connector-events":{"get":{"operationId":"listConnectorEvents","summary":"Schema-versioned events received from connectors, newest first.","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"connectorId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","minLength":3,"maxLength":80}}],"responses":{"200":{"description":"A page of events.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorEventPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/commerce/overview":{"get":{"operationId":"getCommerceOverview","summary":"Orders, refunds, cart and product events received over the last 30 days, with connector health (S102).","tags":["connectors"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommerceOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/saved-reports":{"get":{"operationId":"listSavedReports","summary":"Saved reports with their schedule and recipients (S70).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"archived","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"A page of saved reports.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReportPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"},"post":{"operationId":"createSavedReport","summary":"Save a report definition, optionally scheduled to workspace members (recipients must currently hold report.read).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: REPORT_RECIPIENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.export","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSavedReportInput"}}}}}},"/v1/workspaces/{workspaceId}/saved-reports/{reportId}":{"get":{"operationId":"getSavedReport","summary":"A saved report.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"reportId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The report.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"},"patch":{"operationId":"updateSavedReport","summary":"Change a saved report (definition, schedule, recipients). The next run is recomputed.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"reportId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: REPORT_RECIPIENT_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.export","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSavedReportInput"}}}}}},"/v1/workspaces/{workspaceId}/saved-reports/{reportId}/archive":{"post":{"operationId":"archiveSavedReport","summary":"Archive a saved report: its schedule stops; past runs stay until they expire.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"reportId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Archived.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.export"}},"/v1/workspaces/{workspaceId}/saved-reports/{reportId}/result":{"get":{"operationId":"getSavedReportResult","summary":"Run the saved definition now (read-only transaction) and return the rows.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"reportId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Result.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: REPORT_BUDGET_EXCEEDED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/report-previews":{"post":{"operationId":"previewReport","summary":"Builder preview of an UNSAVED definition (read-only transaction, nothing stored).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Result.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: REPORT_BUDGET_EXCEEDED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewReportInput"}}}}}},"/v1/workspaces/{workspaceId}/saved-reports/{reportId}/runs":{"post":{"operationId":"runSavedReport","summary":"Queue a CSV export of the saved report (S72 tracks it; the file expires).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"reportId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRun"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.export"}},"/v1/workspaces/{workspaceId}/report-runs":{"get":{"operationId":"listReportRuns","summary":"Report exports and scheduled runs with status, requester and expiry (S72): search by report name, filter, group by status or trigger, newest first (collection view, ADR 0039).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over reportName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: status (enum): in, nin — queued | running | succeeded | failed | expired; trigger (enum): in, nin — manual | schedule; reportId (ref): in; expiresAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status, trigger): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}},{"name":"reportId","in":"query","required":false,"description":"One saved report's runs. Legacy: prefer a filter on `reportId`.","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of runs and the total.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRunPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read","x-collection":{"resource":"report_runs","fields":[{"key":"reportName","label":"Report","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"queued","label":"Queued"},{"value":"running","label":"Running"},{"value":"succeeded","label":"Ready"},{"value":"failed","label":"Failed"},{"value":"expired","label":"Expired"}]},{"key":"trigger","label":"Trigger","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"manual","label":"Manual export"},{"value":"schedule","label":"Scheduled"}]},{"key":"reportId","label":"Saved report","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"ready","label":"Ready","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["succeeded"]}]}},{"id":"scheduled","label":"Scheduled","filter":{"op":"and","conditions":[{"field":"trigger","operator":"in","value":["schedule"]}]}},{"id":"failed","label":"Failed","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["failed"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["reportName"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/report-runs/{runId}":{"get":{"operationId":"getReportRun","summary":"A report run.","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"runId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The run.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRun"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/report-runs/{runId}/download-link":{"post":{"operationId":"createReportRunDownloadLink","summary":"Short-lived presigned link to the run's CSV (authorized now, audited).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"runId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Link.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDownloadLink"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"410":{"description":"Problem: EXPORT_EXPIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.export"}},"/v1/workspaces/{workspaceId}/commerce/orders":{"post":{"operationId":"recordCommerceOrder","summary":"Record a trusted order (server-to-server). The same (source, externalOrderId) counts once.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Recorded (or the existing order on an identical replay).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordOrderResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ORDER_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordOrderInput"}}}}},"get":{"operationId":"listCommerceOrders","summary":"Recorded orders (contact id only, no customer address) — S102.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"source","in":"query","required":false,"schema":{"type":"string","maxLength":60}}],"responses":{"200":{"description":"A page of orders.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommerceOrderPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/commerce/orders/{orderId}/refunds":{"post":{"operationId":"recordCommerceRefund","summary":"Record a refund of an order; reduces net revenue and net attributed revenue. Refunds never exceed the order.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"orderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Recorded (or the existing refund on an identical replay).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRefundResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ORDER_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: REFUND_EXCEEDS_ORDER","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordRefundInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/health":{"get":{"operationId":"getCommerceSyncHealth","summary":"Per-source order feed health: volume, last order received, unlinked orders (S102).","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Health.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommerceSyncHealth"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/revenue/attribution":{"get":{"operationId":"getAttributionReport","summary":"Attributed net revenue (model, window, currency policy) and, separately, holdout lift (S71).","tags":["reports"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"from","in":"query","required":false,"description":"Order time, inclusive. Default: 30 days ago.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"to","in":"query","required":false,"description":"Order time, exclusive. Default: now.","schema":{"$ref":"#/components/schemas/IsoDateTime"}},{"name":"windowDays","in":"query","required":false,"schema":{"default":7,"type":"integer","minimum":1,"maximum":90}},{"name":"model","in":"query","required":false,"schema":{"default":"last_human_click","$ref":"#/components/schemas/AttributionModel"}},{"name":"currency","in":"query","required":false,"schema":{"default":"EUR","$ref":"#/components/schemas/CurrencyCode"}},{"name":"campaignId","in":"query","required":false,"description":"Incrementality (holdout lift) of this campaign.","schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Attribution report.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributionReport"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/ai/settings":{"get":{"operationId":"getAiSettings","summary":"AI opt-in, model, monthly budget and spend, brand voice (S82).","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Settings.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"},"patch":{"operationId":"updateAiSettings","summary":"Opt the workspace in or out of AI assistance, choose the model, set the monthly budget and brand voice (audited).","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAiSettingsInput"}}}}}},"/v1/workspaces/{workspaceId}/ai/sources":{"get":{"operationId":"listAiSources","summary":"Workspace sources a draft may be grounded in: brand voice, templates, approved campaign versions (redacted excerpts).","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Allowed sources.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiSourceList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/ai/drafts":{"post":{"operationId":"generateAiDraft","summary":"Draft subject lines / copy from a goal and allowed sources. Returns a reviewable draft; never changes, sends or approves a campaign.","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The generation (draft + findings + cost).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGeneration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: AI_NOT_ENABLED, AI_BUDGET_EXCEEDED, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: AI_SOURCE_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: AI_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateDraftInput"}}}}}},"/v1/workspaces/{workspaceId}/ai/audience-explanations":{"post":{"operationId":"explainAudience","summary":"Explain a segment or list from its definition and aggregate counts only (no contact data reaches the model).","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The generation (explanation + the facts it used).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGeneration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: AI_NOT_ENABLED, AI_BUDGET_EXCEEDED, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: AI_SOURCE_NOT_ALLOWED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: AI_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplainAudienceInput"}}}}}},"/v1/workspaces/{workspaceId}/ai/generations":{"get":{"operationId":"listAiGenerations","summary":"AI generations of the workspace with their review decision (audit trail of every call).","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"campaignId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"A page of generations.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGenerationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/ai/generations/{generationId}":{"get":{"operationId":"getAiGeneration","summary":"One generation.","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"generationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The generation.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGeneration"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"}},"/v1/workspaces/{workspaceId}/ai/generations/{generationId}/review":{"post":{"operationId":"reviewAiGeneration","summary":"Record the person's review of a draft (accepted / rejected). Accepting applies nothing by itself; a blocked draft cannot be accepted.","tags":["ai"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"generationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Reviewed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiGeneration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: AI_DRAFT_BLOCKED, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewAiGenerationInput"}}}}}},"/v1/auth/preferences":{"get":{"operationId":"getMyPreferences","summary":"The caller's interface language, formatting locale and display time zone.","tags":["account"],"parameters":[],"responses":{"200":{"description":"Preferences (defaults when never saved).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPreferences"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"updateMyPreferences","summary":"Change the caller's own preferences (never another member's).","tags":["account"],"parameters":[{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPreferences"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserPreferencesInput"}}}}}},"/v1/auth/profile":{"get":{"operationId":"getMyProfile","summary":"The caller's own profile: display name, login email, sign-in methods.","tags":["account"],"parameters":[],"responses":{"200":{"description":"The profile.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyProfile"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"updateMyProfile","summary":"Change the caller's own display name (never another person's, never the login email).","tags":["account"],"parameters":[{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyProfile"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMyProfileInput"}}}}}},"/v1/auth/sso/start":{"post":{"operationId":"startSso","summary":"Start an SP-initiated SSO sign-in (by email domain or workspace): returns the IdP URL and sets the browser binder cookie.","tags":["sso"],"parameters":[],"responses":{"200":{"description":"Where to send the browser.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSsoResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: SSO_NOT_CONFIGURED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSsoInput"}}}}}},"/v1/auth/sso/step-up":{"post":{"operationId":"startSsoStepUp","summary":"Re-authenticate at the workspace's IdP (forced login) to open the step-up window of an SSO session.","tags":["sso"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Where to send the browser.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSsoResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SSO_FAILED, UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: SSO_NOT_CONFIGURED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSsoStepUpInput"}}}}}},"/v1/auth/sso/oidc/callback":{"post":{"operationId":"completeOidcSso","summary":"OIDC redirect-URI parameters relayed by the console: validates state, PKCE, issuer, nonce and the ID token, then signs in.","tags":["sso"],"parameters":[],"responses":{"200":{"description":"Signed in (session cookies) or stepped up.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoSignInResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SSO_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: SSO_NOT_CONFIGURED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SSO_DOMAIN_NOT_VERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OidcCallbackInput"}}}}}},"/v1/auth/sso/saml/acs":{"post":{"operationId":"receiveSamlResponse","summary":"SAML HTTP-POST binding relayed by the console: validates the signed response (audience, recipient, InResponseTo, time, replay) and returns a one-time completion ticket.","tags":["sso"],"parameters":[],"responses":{"200":{"description":"Assertion accepted; complete with the ticket.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamlResponseAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SSO_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamlResponseInput"}}}}}},"/v1/auth/sso/complete":{"post":{"operationId":"completeSso","summary":"Finish a SAML sign-in in the browser that started it (binder cookie + ticket).","tags":["sso"],"parameters":[],"responses":{"200":{"description":"Signed in (session cookies) or stepped up.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoSignInResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SSO_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: SSO_NOT_CONFIGURED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: SSO_DOMAIN_NOT_VERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteSsoInput"}}}}}},"/v1/workspaces/{workspaceId}/sso":{"get":{"operationId":"getSsoSettings","summary":"The workspace's identity provider, verified domains, group mappings, recovery owners and SCIM directory.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Settings.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/sso/connection":{"post":{"operationId":"createSsoConnection","summary":"Configure the workspace's identity provider (starts as draft). Step-up.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, ROLE_ESCALATION, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSsoConnectionInput"}}}}},"patch":{"operationId":"updateSsoConnection","summary":"Change the connection: settings, status, enforcement, group mappings, recovery owners. Step-up.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConnection"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, ROLE_ESCALATION, SSO_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE, SSO_DOMAIN_NOT_VERIFIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSsoConnectionInput"}}}}},"delete":{"operationId":"deleteSsoConnection","summary":"Remove the identity provider: enforcement ends, its sessions are revoked, its client secret is destroyed. Step-up.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Removed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/sso/connection/test":{"post":{"operationId":"testSsoConnection","summary":"Check the IdP settings without signing anyone in (OIDC discovery and JWKS; SAML certificate validity).","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Checks.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConnectionTestResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: SSO_NOT_CONFIGURED, NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/sso/domains":{"post":{"operationId":"addSsoDomain","summary":"Claim an email domain: returns the TXT record to publish, then verify it.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Claimed (unverified).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoDomain"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSsoDomainInput"}}}}}},"/v1/workspaces/{workspaceId}/sso/domains/{domainId}/verify":{"post":{"operationId":"verifySsoDomain","summary":"Look up the domain's TXT record now. A domain verified by another organization is refused.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Outcome of the check.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoDomain"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/sso/domains/{domainId}":{"delete":{"operationId":"deleteSsoDomain","summary":"Release a domain (people of that domain can no longer sign in through the IdP). Step-up.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"domainId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Released.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/scim-tokens":{"post":{"operationId":"createScimToken","summary":"Create a SCIM bearer token for the IdP's provisioning app (shown once). Step-up.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created; the secret is in this answer only.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedScimToken"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScimTokenInput"}}}}}},"/v1/workspaces/{workspaceId}/scim-tokens/{tokenId}":{"delete":{"operationId":"revokeScimToken","summary":"Revoke a SCIM token (effective on its next request).","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"tokenId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Revoked.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/sso/break-glass":{"post":{"operationId":"breakGlass","summary":"Recovery owner only: reach an SSO-enforced workspace with password + second factor for one hour. Step-up; audited; the other owners are emailed; an alert fires.","tags":["sso"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"This session may reach the workspace until `expiresAt`.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BreakGlassResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, MFA_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: SSO_NOT_CONFIGURED, NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BreakGlassInput"}}}}}},"/scim/v2/ServiceProviderConfig":{"get":{"operationId":"scimServiceProviderConfig","summary":"SCIM capabilities: PATCH and filter supported, no bulk, no sort, no password change; bearer token auth.","tags":["scim"],"parameters":[],"responses":{"200":{"description":"ServiceProviderConfig (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/scim/v2/ResourceTypes":{"get":{"operationId":"scimResourceTypes","summary":"User and Group resource types.","tags":["scim"],"parameters":[],"responses":{"200":{"description":"ListResponse of ResourceType (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/scim/v2/Schemas":{"get":{"operationId":"scimSchemas","summary":"The User and Group attributes this server stores.","tags":["scim"],"parameters":[],"responses":{"200":{"description":"ListResponse of Schema (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/scim/v2/Users":{"get":{"operationId":"scimListUsers","summary":"List or filter Users (`userName eq`, `externalId eq`, `emails.value eq`, `active eq`, `and`/`or`).","tags":["scim"],"parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"startIndex","in":"query","required":false,"schema":{"type":"string","maxLength":12}},{"name":"count","in":"query","required":false,"schema":{"type":"string","maxLength":12}},{"name":"attributes","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"excludedAttributes","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"sortBy","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"sortOrder","in":"query","required":false,"schema":{"type":"string","maxLength":16}}],"responses":{"200":{"description":"ListResponse of User (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"post":{"operationId":"scimCreateUser","summary":"Provision a person: the account (email in a VERIFIED domain of the workspace) and its membership.","tags":["scim"],"parameters":[],"responses":{"201":{"description":"User created (application/scim+json); 409 uniqueness when the userName exists.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/scim/v2/Users/{scimUserId}":{"get":{"operationId":"scimGetUser","summary":"One User.","tags":["scim"],"parameters":[{"name":"scimUserId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"User (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"put":{"operationId":"scimReplaceUser","summary":"Replace a User (active=false deactivates: membership suspended, sessions, keys and agent grants revoked in one transaction).","tags":["scim"],"parameters":[{"name":"scimUserId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"User (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"patch":{"operationId":"scimPatchUser","summary":"PatchOp on a User (add / replace / remove; `active` deactivates or reactivates). If-Match honoured when sent.","tags":["scim"],"parameters":[{"name":"scimUserId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"User (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"delete":{"operationId":"scimDeleteUser","summary":"Deprovision: membership revoked, sessions, keys and agent grants revoked; the account itself stays (it may belong to other workspaces).","tags":["scim"],"parameters":[{"name":"scimUserId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/scim/v2/Groups":{"get":{"operationId":"scimListGroups","summary":"List or filter Groups (`displayName eq`, `externalId eq`).","tags":["scim"],"parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"startIndex","in":"query","required":false,"schema":{"type":"string","maxLength":12}},{"name":"count","in":"query","required":false,"schema":{"type":"string","maxLength":12}},{"name":"attributes","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"excludedAttributes","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"sortBy","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"sortOrder","in":"query","required":false,"schema":{"type":"string","maxLength":16}}],"responses":{"200":{"description":"ListResponse of Group (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"post":{"operationId":"scimCreateGroup","summary":"Create a Group (members' roles follow the workspace's group mappings).","tags":["scim"],"parameters":[],"responses":{"201":{"description":"Group created (application/scim+json).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/scim/v2/Groups/{scimGroupId}":{"get":{"operationId":"scimGetGroup","summary":"One Group.","tags":["scim"],"parameters":[{"name":"scimGroupId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Group (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"put":{"operationId":"scimReplaceGroup","summary":"Replace a Group (name and members).","tags":["scim"],"parameters":[{"name":"scimGroupId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Group (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"patch":{"operationId":"scimPatchGroup","summary":"PatchOp on a Group (`members` add / remove / replace, `displayName`).","tags":["scim"],"parameters":[{"name":"scimGroupId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Group (application/scim+json, written by the handler; errors in the SCIM error format).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"delete":{"operationId":"scimDeleteGroup","summary":"Delete a Group (its members' mapped roles are recomputed).","tags":["scim"],"parameters":[{"name":"scimGroupId","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/migrations":{"get":{"operationId":"listMigrations","summary":"Migrations from other email platforms.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Page of migrations.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrationPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"},"post":{"operationId":"createMigration","summary":"Start a migration from Mailchimp, Brevo or Interspire export files.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMigrationInput"}}}}}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}":{"get":{"operationId":"getMigration","summary":"A migration: files with their analysis, loss report and reconciliation.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Migration.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/files":{"post":{"operationId":"addMigrationFile","summary":"Register an uploaded export file and analyze it (dry run: nothing is written).","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Analysis queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: IMPORT_FILE_REJECTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMigrationFileInput"}}}}}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/files/{fileId}/apply":{"post":{"operationId":"applyMigrationFile","summary":"Apply the reviewed analysis: suppressions first, then stage contacts, record history, list losses.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Apply queued.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IMPORT_PREVIEW_STALE, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyMigrationFileInput"}}}}}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/files/{fileId}/import":{"post":{"operationId":"importMigrationFile","summary":"Hand the staged contacts to the audience import pipeline (preview on S14). Every file's suppressions must be applied first.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"fileId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Import preview queued (the job id is the import id).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import"}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/templates":{"post":{"operationId":"importMigrationTemplate","summary":"Import one exported HTML template (sanitized; source merge tags reported, never executed).","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Template created; the migration lists it.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportMigrationTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/campaign-history":{"get":{"operationId":"listMigrationCampaignHistory","summary":"Campaign statistics imported from the source, under the source's own labels.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Page of source campaigns.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrationCampaignHistoryPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/freeze":{"post":{"operationId":"freezeMigration","summary":"Cutover freeze: the owner attests the old platform's scheduler is disabled; delta files are still accepted.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Frozen.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeMigrationInput"}}}}}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/cutover":{"post":{"operationId":"cutOverMigration","summary":"Cut over: every file applied and every contact import committed; the new platform is the sender from now on.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Cut over.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/rollback":{"post":{"operationId":"requestMigrationRollback","summary":"Ask to resume the old platform: counts what the new platform already sent since the cutover; needs a second person's approval.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rollback requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestMigrationRollbackInput"}}}}}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/rollback/approve":{"post":{"operationId":"approveMigrationRollback","summary":"Approve the rollback (not the requester): releases the exclusion list for the old platform.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Rolled back.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Migration"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: SEPARATION_OF_DUTIES, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.approve"}},"/v1/workspaces/{workspaceId}/migrations/{migrationId}/rollback/exclusions":{"get":{"operationId":"listMigrationRollbackExclusions","summary":"Recipients the new platform already handed to a provider since the cutover: exclude them on the old platform.","tags":["migrations"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"migrationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Page of exclusions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrationRollbackExclusionPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.export"}},"/v1/workspaces/{workspaceId}/solution-packs":{"get":{"operationId":"listSolutionPacks","summary":"Solution packs and their installation in this workspace.","tags":["solution-packs"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Catalog.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionPackCatalog"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"}},"/v1/workspaces/{workspaceId}/solution-packs/{packId}/install":{"post":{"operationId":"installSolutionPack","summary":"Install (or repair, or update) a pack: creates what is missing, reuses compatible resources, updates only its own untouched drafts, never publishes anything.","tags":["solution-packs"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"packId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/SolutionPackId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Installation.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionPackInstallation"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallSolutionPackInput"}}}}}},"/v1/workspaces/{workspaceId}/solution-packs/{packId}/uninstall":{"post":{"operationId":"uninstallSolutionPack","summary":"Uninstall a pack: removes its untouched drafts, keeps everything a person changed, published or that holds their data.","tags":["solution-packs"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"packId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/SolutionPackId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"What was removed and what was kept.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolutionPackUninstallResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.manage"}},"/v1/workspaces/{workspaceId}/campaigns/{campaignId}/render-tests":{"get":{"operationId":"listCampaignRenderTests","summary":"The campaign's latest client rendering tests and the rendering provider (ADR 0069). A vendor test still pending is refreshed on read.","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Newest first, at most 10.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderTestList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.read"},"post":{"operationId":"createCampaignRenderTest","summary":"Render the campaign's draft (or one A/B arm) in mail clients through the rendering provider: a local simulation, or a contracted vendor (ADR 0069).","tags":["campaigns"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The test (complete at once for the local simulation, pending for a vendor).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderTest"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONTENT_INVALID, UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"campaign.test","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRenderTestInput"}}}}}},"/v1/platform/deliverability/spam-risk-reviews":{"get":{"operationId":"listSpamRiskReviews","summary":"Campaigns in preparation whose pre-send analysis scores a CRITICAL spam risk, with their override (platform staff, ADR 0069).","tags":["platform"],"parameters":[],"responses":{"200":{"description":"Highest risk first, at most 100.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpamRiskReviewList"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/v1/platform/workspaces/{workspaceId}/campaigns/{campaignId}/spam-risk-override":{"post":{"operationId":"grantSpamRiskOverride","summary":"Accept a campaign's critical spam risk for its current content: the send then needs a second person's approval instead of being refused (step-up, reason, audited; ADR 0056 §5, ADR 0069).","tags":["platform"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The campaign's review row with the override.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpamRiskReview"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantSpamRiskOverrideInput"}}}}}},"/v1/platform/workspaces/{workspaceId}/campaigns/{campaignId}/spam-risk-override/revoke":{"post":{"operationId":"revokeSpamRiskOverride","summary":"Revoke a campaign's live spam-risk override: a critical score blocks the send again (step-up, reason, audited; ADR 0069).","tags":["platform"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"campaignId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The campaign's review row without the override.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpamRiskReview"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED, STEP_UP_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeSpamRiskOverrideInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/settings":{"get":{"operationId":"getInboxSettings","summary":"Whether replies are routed to the shared inbox, the first-response SLA and the retention.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The settings.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.read"},"patch":{"operationId":"updateInboxSettings","summary":"Route replies to the shared inbox (new campaign messages get the routed Reply-To), set the SLA and the retention.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSettings"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INBOX_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInboxSettingsInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/conversations":{"get":{"operationId":"listInboxConversations","summary":"Conversations of the shared inbox: search subjects, filter by status, intent, assignee, campaign; group; sort by last message or SLA (collection view, ADR 0039).","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over subject.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: subject (text): contains; status (enum): in, nin — open | pending | closed; intent (enum): in, nin — question | positive | negative | out_of_office | stop | other; attribution (enum): in, nin — thread | sender | unverified; assigneeUserId (ref): in, nin; assigned (bool): eq; campaignId (ref): in, nin; stopRequested (bool): eq; lastMessageAt (date): eq, gt, gte, lt, lte, between; slaDueAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates, \"@me\" for the caller on user references.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: lastMessageAt, slaDueAt, createdAt. Default lastMessageAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status, intent, attribution): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of conversations and the total.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxConversationPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.read","x-collection":{"resource":"inbox_conversations","fields":[{"key":"subject","label":"Subject","type":"text","sortable":false,"filterOperators":["contains"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"open","label":"Open"},{"value":"pending","label":"Waiting on contact"},{"value":"closed","label":"Closed"}]},{"key":"intent","label":"Intent","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"question","label":"Question"},{"value":"positive","label":"Positive"},{"value":"negative","label":"Negative"},{"value":"out_of_office","label":"Out of office"},{"value":"stop","label":"Stop request"},{"value":"other","label":"Other"}]},{"key":"attribution","label":"Attribution","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"thread","label":"Verified thread"},{"value":"sender","label":"Verified sender"},{"value":"unverified","label":"Unverified"}]},{"key":"assigneeUserId","label":"Assignee","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false,"currentUser":true},{"key":"assigned","label":"Assigned","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"campaignId","label":"Campaign","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"stopRequested","label":"Stop request","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"lastMessageAt","label":"Last message","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"slaDueAt","label":"Answer due","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"Started","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"mine","label":"Assigned to me","filter":{"op":"and","conditions":[{"field":"assigneeUserId","operator":"in","value":["@me"]}]}},{"id":"open","label":"Open","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["open"]}]}},{"id":"unassigned","label":"Unassigned","filter":{"op":"and","conditions":[{"field":"assigned","operator":"eq","value":false}]}},{"id":"stop","label":"Stop requests","filter":{"op":"and","conditions":[{"field":"stopRequested","operator":"eq","value":true}]}}],"defaultSort":{"field":"lastMessageAt","dir":"desc"},"search":{"fields":["subject"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}":{"get":{"operationId":"getInboxConversation","summary":"One conversation with its replies, notes and drafts (bodies decrypted for the reader; reading is audited).","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The conversation.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxConversation"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.read"},"patch":{"operationId":"updateInboxConversation","summary":"Assign the conversation (or unassign it) and change its status.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxConversation"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: INBOX_ASSIGNEE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.reply","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInboxConversationInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/notes":{"post":{"operationId":"addInboxNote","summary":"Add an internal note (never sent).","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The note.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.reply","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddInboxNoteInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/replies":{"post":{"operationId":"createInboxReply","summary":"Draft a reply to the conversation's recipient. Nothing is sent until a reviewer with inbox.review approves it.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The draft, pending review.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INBOX_REPLY_NOT_ALLOWED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.reply","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInboxReplyInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/replies/{replyId}/review":{"post":{"operationId":"reviewInboxReply","summary":"Approve (it is sent through the workspace's sending route, DKIM-signed and threaded) or reject a reply draft. Human only; never its author under four-eyes.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"replyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The reviewed reply.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessage"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: INBOX_SELF_REVIEW, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INBOX_REPLY_NOT_REVIEWABLE, INBOX_REPLY_NOT_ALLOWED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.review","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewInboxReplyInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/unsubscribe":{"post":{"operationId":"unsubscribeInboxSender","summary":"Unsubscribe the conversation's recipient from the workspace's marketing (RFC 8058 effects, audited) after reading their stop request.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"conversationId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Unsubscribed (or already).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxConversation"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INBOX_REPLY_NOT_ALLOWED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"suppression.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeInboxSenderInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/canned-replies":{"get":{"operationId":"listCannedReplies","summary":"The workspace's canned replies (at most 200), by name.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The canned replies.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReplyList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.read"},"post":{"operationId":"createCannedReply","summary":"Save a canned reply (merge fields: {{first_name}}, {{last_name}}, {{email}}, {{campaign_name}}, {{agent_name}}, {{workspace_name}}).","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReply"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReplyInput"}}}}}},"/v1/workspaces/{workspaceId}/inbox/canned-replies/{cannedReplyId}":{"patch":{"operationId":"updateCannedReply","summary":"Edit a canned reply.","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cannedReplyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReply"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedReplyInput"}}}}},"delete":{"operationId":"deleteCannedReply","summary":"Delete a canned reply (replies already drafted from it keep their text).","tags":["inbox"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cannedReplyId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Deleted.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"inbox.manage"}},"/v1/workspaces/{workspaceId}/warmup/detect":{"get":{"operationId":"detectWarmupMailbox","summary":"From an address alone: which provider hosts it and the best ways to connect it (hosted mailbox, Google / Microsoft OAuth, IMAP with pre-filled settings from known providers, the MX or Mozilla autoconfig). Read-only; nothing is stored.","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"address","in":"query","required":true,"schema":{"type":"string","maxLength":320,"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,}$"}}],"responses":{"200":{"description":"The detected provider and connection options, best first.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupDetection"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/warmup":{"get":{"operationId":"getWarmupOverview","summary":"The add-on, the consent text, the network's size per provider and the workspace's summed deliverability and progress.","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The warm-up overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/warmup/mailboxes":{"get":{"operationId":"listWarmupMailboxes","summary":"The workspace's warm-up mailboxes (a collection: search, filter, group, sort).","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over address.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: address (text): contains; state (enum): in, nin — draft | active | paused | needs_reauthorization | suspended | left; provider (enum): in, nin — google | microsoft | yahoo | other; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: address, createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (state, provider): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of mailboxes.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupMailboxPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read","x-collection":{"resource":"warmup_mailboxes","fields":[{"key":"address","label":"Mailbox","type":"text","sortable":true,"filterOperators":["contains"],"groupable":false},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Not tested"},{"value":"active","label":"Warming up"},{"value":"paused","label":"Paused"},{"value":"needs_reauthorization","label":"Needs reconnection"},{"value":"suspended","label":"Suspended"},{"value":"left","label":"Left"}]},{"key":"provider","label":"Provider","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"google","label":"Google"},{"value":"microsoft","label":"Microsoft"},{"value":"yahoo","label":"Yahoo"},{"value":"other","label":"Other"}]},{"key":"createdAt","label":"Joined","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"warming","label":"Warming up","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["active"]}]}},{"id":"attention","label":"Needs attention","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["draft","paused","needs_reauthorization","suspended"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["address"],"mode":"contains"}}},"post":{"operationId":"createWarmupMailbox","summary":"Joins a mailbox to the warm-up network with the person's consent (human only), contributing (default: earns credits) or on the add-on. It starts in `draft` until a connection test passes; an OAuth connection is completed through /oauth/authorizations; a hosted mailbox connects with no input.","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The mailbox (a hosted connection also returns its new password, once).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWarmupMailbox"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: ADDON_REQUIRED, ADDON_LIMIT_REACHED, WARMUP_MAILBOX_LIMIT, WARMUP_MAILBOX_EXISTS, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: WARMUP_DOMAIN_NOT_VERIFIED, WARMUP_SMTP_REQUIRED, INSECURE_TRANSPORT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWarmupMailboxInput"}}}}}},"/v1/workspaces/{workspaceId}/warmup/mailboxes/{mailboxId}":{"get":{"operationId":"getWarmupMailbox","summary":"One mailbox with its dashboard: deliverability per provider (14 days), estimated safe capacity, daily progress (30 days), mail received and rescued.","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The mailbox and its dashboard.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupMailboxDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"},"patch":{"operationId":"updateWarmupMailbox","summary":"Ramp and reply share, display name, pause / resume, or a new password (the mailbox must then pass a new test).","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The mailbox.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupMailboxDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: WARMUP_MAILBOX_STATE, ADDON_REQUIRED, ADDON_LIMIT_REACHED, WARMUP_MAILBOX_LIMIT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWarmupMailboxInput"}}}}}},"/v1/workspaces/{workspaceId}/warmup/mailboxes/{mailboxId}/test":{"post":{"operationId":"testWarmupMailbox","summary":"Read-only IMAP connection test (TLS, login, INBOX). A passing test activates a `draft` or `needs_reauthorization` mailbox.","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The layered test and the mailbox after it.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupTestResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: WARMUP_MAILBOX_STATE, ADDON_REQUIRED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage"}},"/v1/workspaces/{workspaceId}/warmup/mailboxes/{mailboxId}/leave":{"post":{"operationId":"leaveWarmupMailbox","summary":"Leaves the network (human only, final): sending and reading stop, the credential is revoked, the pairing data is purged.","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The mailbox, now `left`.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupMailboxDetail"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupLeaveInput"}}}}}},"/v1/workspaces/{workspaceId}/warmup/mailboxes/{mailboxId}/health":{"get":{"operationId":"getWarmupMailboxHealth","summary":"Inbox health check of the mailbox's domain: SPF, DKIM, DMARC, alignment (stored domain check), MX (live), blocklists, domain age.","tags":["warmup"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"mailboxId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The health check.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmupHealth"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"infrastructure.read"}},"/v1/workspaces/{workspaceId}/organization":{"get":{"operationId":"getOrganization","summary":"This workspace's organization: whether it is governed, by which central workspace, with which floors (units listed for the central workspace only).","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The organization view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"},"post":{"operationId":"enableOrganization","summary":"Make this workspace the central workspace of its organization (university, association, enterprise). Sets no floor.","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The organization view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationView"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"organization.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableOrganizationInput"}}}}}},"/v1/workspaces/{workspaceId}/organization/policy":{"patch":{"operationId":"updateOrganizationPolicy","summary":"Set the organization's floors. Raised floors tighten every workspace of the organization in the same transaction (audited in each); lowered floors change no workspace.","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The new policy and what it changed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationPolicyChange"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, ORGANIZATION_NOT_CENTRAL, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"organization.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationPolicyInput"}}}}}},"/v1/workspaces/{workspaceId}/organization/units":{"post":{"operationId":"createOrganizationUnit","summary":"Create a department / chapter workspace in this organization, every floor applied; the caller becomes its first owner.","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The unit.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationUnit"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, ORGANIZATION_NOT_CENTRAL, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: ORGANIZATION_POLICY_FLOOR, REGION_NOT_SERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"organization.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationUnitInput"}}}}}},"/v1/workspaces/{workspaceId}/organization/units/{unitWorkspaceId}":{"patch":{"operationId":"updateOrganizationUnit","summary":"Change a unit's code, departmental quota or SIS organizations (central workspace only).","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"unitWorkspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The unit.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationUnit"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: STEP_UP_REQUIRED, ORGANIZATION_NOT_CENTRAL, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"organization.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationUnitInput"}}}}}},"/v1/workspaces/{workspaceId}/organization/rollup":{"get":{"operationId":"getOrganizationRollup","summary":"Counts and floor compliance of every workspace of the organization (central workspace only; no recipient data).","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The roll-up.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationRollup"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ORGANIZATION_NOT_CENTRAL, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"organization.read"}},"/v1/workspaces/{workspaceId}/organization/effective-policy":{"get":{"operationId":"getEffectiveOrganizationPolicy","summary":"Each floor of the organization next to this workspace's own setting: which one decides, and whether the workspace complies.","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The effective policy.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveOrganizationPolicy"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"workspace.read"}},"/v1/workspaces/{workspaceId}/organization/templates/{templateId}/share":{"post":{"operationId":"shareOrganizationTemplate","summary":"Copy a published template of the central workspace into units' libraries (copies, never references).","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The copies.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedOrganizationTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: ORGANIZATION_NOT_CENTRAL, PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"organization.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareOrganizationTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/sis/oneroster/sync":{"post":{"operationId":"syncOneRoster","summary":"Apply a OneRoster users.csv (and roles.csv) export: people of this workspace's SIS organizations become contacts through the connector ledger; consent is never created.","tags":["organization"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"What the export did.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OneRosterSyncResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONNECTOR_NOT_ACTIVE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.import","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OneRosterSyncInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/connect/seller":{"get":{"operationId":"getConnectSeller","summary":"The workspace's Stripe Connect seller account (onboarding state, capabilities) and the platform's Connect terms.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The seller view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectSellerView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/connect/seller/onboarding":{"post":{"operationId":"startConnectOnboarding","summary":"Creates the workspace's connected account once, then a Stripe-hosted onboarding link (KYC is Stripe's). A person only.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The onboarding link.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectOnboardingLink"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INTEGRATION_NOT_CONFIGURED, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CONNECT_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConnectOnboardingInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/connect/seller/refresh":{"post":{"operationId":"refreshConnectSeller","summary":"Retrieves the connected account's CURRENT state from Stripe now (after returning from onboarding).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The seller view.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectSellerView"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CONNECT_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage"}},"/v1/workspaces/{workspaceId}/billing/connect/plans":{"get":{"operationId":"listResellerPlans","summary":"The seller's plans (client plans and newsletter tiers), sold on its own Stripe account.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The plans.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerPlanList"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"},"post":{"operationId":"createResellerPlan","summary":"Publishes a plan: product and price created on the SELLER's account; terms and the platform fee are frozen.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The published plan.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerPlanView"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INTEGRATION_NOT_CONFIGURED, SELLER_NOT_ENABLED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CONNECT_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResellerPlanInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/connect/plans/{planId}/archive":{"post":{"operationId":"archiveResellerPlan","summary":"Stops offering a plan (existing subscriptions continue on Stripe).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"planId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The archived plan.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerPlanView"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage"}},"/v1/workspaces/{workspaceId}/agency/reseller/checkout":{"post":{"operationId":"createResellerCheckout","summary":"Opens a Checkout session on the agency's own Stripe account for a client plan; the client workspace is provisioned only from the verified payment event.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The Checkout URL.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerCheckoutView"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INTEGRATION_NOT_CONFIGURED, SELLER_NOT_ENABLED, PLAN_NOT_PURCHASABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: REGION_NOT_SERVED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CONNECT_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResellerCheckoutInput"}}}}}},"/v1/workspaces/{workspaceId}/billing/connect/subscriptions":{"get":{"operationId":"listResellerSubscriptions","summary":"Billing links of the seller (client plans and paid newsletter readers), newest first.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"kind","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ResellerPlanKind"}},{"name":"lifecycle","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ResellerLifecycle"}}],"responses":{"200":{"description":"A page of billing links.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerSubscriptionPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/agency/clients/{clientId}/billing":{"get":{"operationId":"getAgencyClientBilling","summary":"S89: the client's reseller subscription and the invoices the agency issued to it.","tags":["agency"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"clientId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The client's billing.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerBillingView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"agency.clients.read"}},"/v1/workspaces/{workspaceId}/billing/reseller":{"get":{"operationId":"getResellerBilling","summary":"Client side: the plan bought from the managing agency and the invoices it issued (the agency is the merchant of record).","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The workspace's reseller billing (empty when none).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerBillingView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/connect/ledger":{"get":{"operationId":"getConnectLedger","summary":"AT-075: the seller's Connect ledger balances per currency and its open disputes.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The ledger summary.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLedgerSummary"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/connect/ledger/transactions":{"get":{"operationId":"listConnectLedgerTransactions","summary":"The seller's Connect ledger transactions (payments, refunds, disputes) with their balanced entries, newest first.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of transactions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLedgerTransactionPage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/connect/charges":{"get":{"operationId":"listConnectCharges","summary":"Payments collected on the seller's account, newest first.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of charges.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectChargePage"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.read"}},"/v1/workspaces/{workspaceId}/billing/connect/charges/{chargeId}/refund":{"post":{"operationId":"refundConnectCharge","summary":"Asks Stripe to refund a payment on the seller's account (the platform fee is returned per policy). The ledger moves on the verified event.","tags":["billing"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"chargeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"The refund request.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectRefundRequested"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INTEGRATION_NOT_CONFIGURED, CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CONNECT_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"billing.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundConnectChargeInput"}}}}}},"/v1/public/news/{slug}/premium":{"get":{"operationId":"getPublicPremiumOffer","summary":"The publication's paid tier offer (R105), when the publisher sells one.","tags":["publishing"],"parameters":[{"name":"slug","in":"path","required":true,"description":"Public archive URL segment: /news/<slug>.","schema":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"The offer (available false when none).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicPremiumOffer"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/news/{slug}/premium/checkout":{"post":{"operationId":"createPremiumCheckout","summary":"Opens Checkout on the PUBLISHER's Stripe account for the premium tier; the reader becomes premium only from the verified payment event. Throttled.","tags":["publishing"],"parameters":[{"name":"slug","in":"path","required":true,"description":"Public archive URL segment: /news/<slug>.","schema":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}}],"responses":{"201":{"description":"The Checkout URL.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PremiumCheckoutView"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: INTEGRATION_NOT_CONFIGURED, PLAN_NOT_PURCHASABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CONNECT_NOT_CONFIGURED, PAYMENT_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PremiumCheckoutInput"}}}}}},"/v1/ingest/stripe-connect":{"post":{"operationId":"ingestStripeConnectEvent","summary":"Stripe CONNECT webhook (events of connected accounts, its own endpoint secret): signature verified over the RAW bytes, deduplicated on (account, event id), durably recorded before 200.","tags":["ingest"],"parameters":[],"responses":{"200":{"description":"Durably recorded (processing may still be running).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectIngestAccepted"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/predictions":{"get":{"operationId":"getPredictionOverview","summary":"Every predictive model kind of the workspace: the model in use, the latest training run and its history — requirements, sample sizes, validation score with its interval, drift, version, fallback and the person's override.","tags":["predictions"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The model cards.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"report.read"}},"/v1/workspaces/{workspaceId}/predictions/settings/{kind}":{"patch":{"operationId":"updatePredictionSetting","summary":"Turn a model kind off (every use falls back, the reason is required and audited) or back on.","tags":["predictions"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"kind","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PredictionKind"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"The kind's card after the change.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionKindOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePredictionSettingInput"}}}}}},"/v1/workspaces/{workspaceId}/predictions/retrain":{"post":{"operationId":"retrainPredictions","summary":"Ask for a new training run of some (default: every) kind at the next pass of the training loop. Audited.","tags":["predictions"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Requested.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrainPredictionsAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrainPredictionsInput"}}}}}},"/v1/workspaces/{workspaceId}/contacts/{contactId}/predictions":{"get":{"operationId":"getContactPredictions","summary":"One contact's predictions from the models in use, each with its interval, evidence and model version; kinds without a usable model are listed with the reason.","tags":["predictions"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"contactId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The contact's predictions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPredictions"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/channels/overview":{"get":{"operationId":"getChannelOverview","summary":"Per channel (SMS, WhatsApp, and the planned web push, mobile push, wallet): senders, templates, consented numbers, credits, coverage and prices.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The overview.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOverview"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.read"}},"/v1/workspaces/{workspaceId}/channels/senders":{"get":{"operationId":"listChannelSenders","summary":"SMS and WhatsApp senders with their registration state and readiness (collection view, ADR 0039).","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over displayName.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: displayName (text): contains; channel (enum): in, nin — sms | whatsapp | web_push | mobile_push | wallet; registrationState (enum): in, nin — draft | pending | approved | rejected | suspended; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: displayName, createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (channel, registrationState): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of senders.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSenderPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.read","x-collection":{"resource":"channel_senders","fields":[{"key":"displayName","label":"Name","type":"text","sortable":true,"filterOperators":["contains"],"groupable":false},{"key":"channel","label":"Channel","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"sms","label":"SMS"},{"value":"whatsapp","label":"WhatsApp"},{"value":"web_push","label":"Web push"},{"value":"mobile_push","label":"Mobile push"},{"value":"wallet","label":"Wallet"}]},{"key":"registrationState","label":"Registration","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"draft","label":"Not verified"},{"value":"pending","label":"Pending"},{"value":"approved","label":"Approved"},{"value":"rejected","label":"Rejected"},{"value":"suspended","label":"Suspended"}]},{"key":"createdAt","label":"Added","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"sms","label":"SMS","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["sms"]}]}},{"id":"whatsapp","label":"WhatsApp","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["whatsapp"]}]}},{"id":"push","label":"Push","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["web_push","mobile_push"]}]}},{"id":"wallet","label":"Wallet","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["wallet"]}]}},{"id":"approved","label":"Approved","filter":{"op":"and","conditions":[{"field":"registrationState","operator":"in","value":["approved"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["displayName"],"mode":"contains"}}},"post":{"operationId":"createChannelSender","summary":"Connect a sender the customer registered with the provider (Twilio number / messaging service, WhatsApp Business number). Credentials are sealed and never returned; it is not ready until `verify` sees the provider's approval.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (registration not verified yet).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSender"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CHANNEL_SENDER_CONFLICT, INTEGRATION_NOT_CONFIGURED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChannelSenderInput"}}}}}},"/v1/workspaces/{workspaceId}/channels/senders/{senderId}":{"get":{"operationId":"getChannelSender","summary":"One sender, its readiness and the callback URLs to configure at the provider.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The sender.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSender"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.read"},"patch":{"operationId":"updateChannelSender","summary":"Rename, change the countries, replace the credentials (the registration is verified again) or disable the sender.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSender"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChannelSenderInput"}}}}}},"/v1/workspaces/{workspaceId}/channels/senders/{senderId}/verify":{"post":{"operationId":"verifyChannelSender","summary":"Ask the provider for the sender's registration state (number owned, A2P 10DLC campaign / WhatsApp number status) and register the WhatsApp webhook. Only the provider's answer makes a sender `approved`.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The sender with the provider's answer.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSender"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_CREDENTIALS_REJECTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CHANNEL_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.manage"}},"/v1/workspaces/{workspaceId}/channels/templates":{"get":{"operationId":"listChannelTemplates","summary":"SMS and WhatsApp templates with their approval state (collection view, ADR 0039).","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains; channel (enum): in, nin — sms | whatsapp | web_push | mobile_push | wallet; approvalState (enum): in, nin — not_required | draft | pending | approved | rejected | paused; updatedAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, updatedAt. Default updatedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (channel, approvalState): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of templates.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTemplatePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.read","x-collection":{"resource":"channel_templates","fields":[{"key":"name","label":"Name","type":"text","sortable":true,"filterOperators":["contains"],"groupable":false},{"key":"channel","label":"Channel","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"sms","label":"SMS"},{"value":"whatsapp","label":"WhatsApp"},{"value":"web_push","label":"Web push"},{"value":"mobile_push","label":"Mobile push"},{"value":"wallet","label":"Wallet"}]},{"key":"approvalState","label":"Approval","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"not_required","label":"No approval needed"},{"value":"draft","label":"Draft"},{"value":"pending","label":"Pending approval"},{"value":"approved","label":"Approved"},{"value":"rejected","label":"Rejected"},{"value":"paused","label":"Paused"}]},{"key":"updatedAt","label":"Updated","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"sms","label":"SMS","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["sms"]}]}},{"id":"whatsapp","label":"WhatsApp","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["whatsapp"]}]}},{"id":"push","label":"Push","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["web_push","mobile_push"]}]}},{"id":"wallet","label":"Wallet","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["wallet"]}]}}],"defaultSort":{"field":"updatedAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createChannelTemplate","summary":"Write an SMS or WhatsApp template (merge tags `{{first_name}}`). A WhatsApp template must then be submitted to Meta and approved before any journey can send it.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_TEMPLATE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChannelTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/channels/templates/{templateId}":{"get":{"operationId":"getChannelTemplate","summary":"One template with its frozen versions.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The template.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.read"},"patch":{"operationId":"updateChannelTemplate","summary":"Change the template. A WhatsApp template whose body or category changes goes back to draft and needs a new approval.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_TEMPLATE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChannelTemplateInput"}}}}}},"/v1/workspaces/{workspaceId}/channels/templates/{templateId}/versions":{"post":{"operationId":"freezeChannelTemplateVersion","summary":"Freeze the current content as an immutable version a journey's channel step can bind (content hash). WhatsApp: only an APPROVED template.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The template with its new version.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CHANNEL_TEMPLATE_NOT_APPROVED, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"template.edit"}},"/v1/workspaces/{workspaceId}/channels/templates/{templateId}/submit":{"post":{"operationId":"submitChannelTemplate","summary":"Submit a WhatsApp template to Meta for approval through the sender's business account.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Submitted (pending, or already approved).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_TEMPLATE_INVALID, CHANNEL_CREDENTIALS_REJECTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CHANNEL_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.manage"}},"/v1/workspaces/{workspaceId}/channels/templates/{templateId}/sync":{"post":{"operationId":"syncChannelTemplate","summary":"Read the template's approval state from Meta (approved, rejected with the reason, paused).","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"templateId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The template with the provider's answer.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelTemplate"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_CREDENTIALS_REJECTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CHANNEL_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"channels.manage"}},"/v1/workspaces/{workspaceId}/channels/endpoints":{"get":{"operationId":"listChannelEndpoints","summary":"Contacts' phone numbers per channel with their OWN channel consent and suppression (exact-number search; collection view, ADR 0039).","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive prefix search over address.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: channel (enum): in, nin — sms | whatsapp | web_push | mobile_push | wallet; state (enum): in, nin — active | invalid | disabled; country (text): eq; contactId (ref): in, nin; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (channel, state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of endpoints.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelEndpointPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read","x-collection":{"resource":"channel_endpoints","fields":[{"key":"address","label":"Number","type":"text","sortable":false,"filterOperators":[],"groupable":false},{"key":"channel","label":"Channel","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"sms","label":"SMS"},{"value":"whatsapp","label":"WhatsApp"},{"value":"web_push","label":"Web push"},{"value":"mobile_push","label":"Mobile push"},{"value":"wallet","label":"Wallet"}]},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"active","label":"Active"},{"value":"invalid","label":"Invalid or expired"},{"value":"disabled","label":"Disabled"}]},{"key":"country","label":"Country","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"contactId","label":"Contact","type":"ref","sortable":false,"filterOperators":["in","nin"],"groupable":false},{"key":"createdAt","label":"Added","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"sms","label":"SMS","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["sms"]}]}},{"id":"whatsapp","label":"WhatsApp","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["whatsapp"]}]}},{"id":"push","label":"Push","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["web_push","mobile_push"]}]}},{"id":"wallet","label":"Wallet","filter":{"op":"and","conditions":[{"field":"channel","operator":"in","value":["wallet"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["address"],"mode":"prefix"}}},"post":{"operationId":"createChannelEndpoint","summary":"Add a contact's number for a channel (normalized to E.164). Adding a number grants NOTHING: its channel consent starts unknown.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created (or the existing endpoint of that number and channel).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CHANNEL_ENDPOINT_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_PHONE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChannelEndpointInput"}}}}}},"/v1/workspaces/{workspaceId}/channels/endpoints/{endpointId}/consent":{"post":{"operationId":"recordChannelConsent","summary":"Record the channel's consent for this number (append-only, evidence required). A withdrawal also writes the channel suppression dispatch enforces.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CONSENT_EVIDENCE_MISSING","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"consent.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordChannelConsentInput"}}}}}},"/v1/ingest/channels/twilio/{senderId}/status":{"post":{"operationId":"ingestTwilioStatus","summary":"Twilio message status callback (queued, sent, delivered, undelivered, failed): signature-verified against the sender's auth token, durably recorded, normalized into delivery facts.","tags":["ingest"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"202":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIngestAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/ingest/channels/twilio/{senderId}/inbound":{"post":{"operationId":"ingestTwilioInbound","summary":"Twilio inbound message webhook: STOP / HELP / START keywords become channel suppression / consent records. Answers 204 (no auto-reply; Twilio's own opt-out handling answers keywords).","tags":["ingest"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"204":{"description":"Handled.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/ingest/channels/whatsapp/{senderId}":{"post":{"operationId":"ingestWhatsAppWebhook","summary":"WhatsApp Cloud API webhook (message statuses and inbound messages): `X-Hub-Signature-256` verified against the app secret; statuses become delivery facts, inbound messages open the 24-hour session and STOP becomes a channel suppression.","tags":["ingest"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"202":{"description":"Recorded.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIngestAccepted"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: UNPROCESSABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]},"get":{"operationId":"verifyWhatsAppWebhook","summary":"Meta's webhook verification handshake: echoes `hub.challenge` (text/plain) when `hub.verify_token` is the sender's token.","tags":["ingest"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"hub.mode","in":"query","required":true,"schema":{"type":"string","const":"subscribe"}},{"name":"hub.verify_token","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"hub.challenge","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"The challenge, as text/plain.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/workspaces/{workspaceId}/channels/endpoints/push":{"post":{"operationId":"registerPushEndpoint","summary":"Register a contact's browser subscription (web push) or device token (mobile push) for a site / app sender. Registering grants NOTHING: the channel consent is recorded on the endpoint with its evidence.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Registered (or the existing endpoint of that subscription / token).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelEndpoint"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CHANNEL_ENDPOINT_CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_PUSH_SUBSCRIPTION_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPushEndpointInput"}}}}}},"/v1/workspaces/{workspaceId}/channels/endpoints/wallet":{"post":{"operationId":"issueWalletPass","summary":"Issue a contact's pass from the LATEST frozen version of a pass template (Apple Wallet: a signed .pkpass behind an expiring download link; Google Wallet: the object and its save link). Issuing again returns fresh links for the same pass.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The pass's add-to-wallet link.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletPassLinks"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CHANNEL_SENDER_NOT_READY, CHANNEL_TEMPLATE_NOT_FROZEN, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_CREDENTIALS_REJECTED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"503":{"description":"Problem: CHANNEL_PROVIDER_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueWalletPassInput"}}}}}},"/v1/workspaces/{workspaceId}/channels/endpoints/{endpointId}/wallet-link":{"get":{"operationId":"getWalletPassLink","summary":"A fresh add-to-wallet link for an issued pass (Apple download links expire).","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The link.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletPassLinks"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CHANNEL_SENDER_NOT_READY","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.read"}},"/v1/workspaces/{workspaceId}/channels/senders/{senderId}/subscriber-tokens":{"post":{"operationId":"createWebPushSubscriberToken","summary":"A short-lived token (24 h) that lets ONE contact's browser subscribe to this site's web push through the site snippet (`ArenfPush.subscribe(token)`; `MailerPush` stays an alias). Minted by the customer's backend for its signed-in visitor; it carries no email address.","tags":["channels"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"The token.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebPushSubscriberToken"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CHANNEL_SENDER_NOT_READY, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"audience.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebPushSubscriberTokenInput"}}}}}},"/v1/public/channels/push/sites/{senderId}":{"get":{"operationId":"getWebPushSite","summary":"The VAPID public key a site's visitors subscribe with (read by the snippet the edge serves). Unknown or disabled site: 404.","tags":["public"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The site's push configuration.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebPushSiteConfig"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/channels/push/sites/{senderId}/subscriptions":{"post":{"operationId":"subscribeWebPush","summary":"The snippet's subscription after the visitor allowed notifications: the subscriber token names the contact; the endpoint is created and its web push consent recorded with the browser permission as evidence.","tags":["public"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"201":{"description":"Subscribed.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicWebPushSubscribed"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: CHANNEL_SUBSCRIBER_TOKEN_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"422":{"description":"Problem: CHANNEL_PUSH_SUBSCRIPTION_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicWebPushSubscribeInput"}}}}}},"/v1/public/channels/push/receipts":{"post":{"operationId":"recordWebPushReceipt","summary":"The service worker's receipt (`shown`: the browser displayed the notification → the message's reported_delivered fact). Authenticated by the receipt token the push carried; a forged one is ignored the same way.","tags":["public"],"parameters":[],"responses":{"202":{"description":"Accepted (recorded when the token is valid).","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicWebPushReceiptInput"}}}}}},"/v1/public/channels/wallet/apple/download/{endpointId}":{"get":{"operationId":"downloadWalletPass","summary":"The signed .pkpass (application/vnd.apple.pkpass) behind an issued pass's download link (`t` = the link's expiring signature).","tags":["public"],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"t","in":"query","required":true,"schema":{"type":"string","minLength":20,"maxLength":256}}],"responses":{"200":{"description":"The pass file.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/channels/wallet/apple/v1/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}/{serialNumber}":{"post":{"operationId":"registerWalletDevice","summary":"Apple PassKit web service: a device that added the pass registers for its updates (`Authorization: ApplePass <token>`). 201 new, 200 already registered.","tags":["public"],"parameters":[{"name":"deviceLibraryIdentifier","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]{1,128}$"}},{"name":"passTypeIdentifier","in":"path","required":true,"schema":{"type":"string","maxLength":255,"pattern":"^pass(\\.[A-Za-z0-9-]+)+$"}},{"name":"serialNumber","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"201":{"description":"Registered.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterWalletDeviceInput"}}}}},"delete":{"operationId":"unregisterWalletDevice","summary":"Apple PassKit web service: the person removed the pass from this device.","tags":["public"],"parameters":[{"name":"deviceLibraryIdentifier","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]{1,128}$"}},{"name":"passTypeIdentifier","in":"path","required":true,"schema":{"type":"string","maxLength":255,"pattern":"^pass(\\.[A-Za-z0-9-]+)+$"}},{"name":"serialNumber","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"Unregistered.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/channels/wallet/apple/v1/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}":{"get":{"operationId":"listWalletSerials","summary":"Apple PassKit web service: the serial numbers of this device's passes updated since `passesUpdatedSince` (204 when none).","tags":["public"],"parameters":[{"name":"deviceLibraryIdentifier","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._-]{1,128}$"}},{"name":"passTypeIdentifier","in":"path","required":true,"schema":{"type":"string","maxLength":255,"pattern":"^pass(\\.[A-Za-z0-9-]+)+$"}},{"name":"passesUpdatedSince","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Updated serials.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletSerialsUpdated"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/channels/wallet/apple/v1/passes/{passTypeIdentifier}/{serialNumber}":{"get":{"operationId":"getLatestWalletPass","summary":"Apple PassKit web service: the latest version of the pass (signed .pkpass), 304 when unchanged since `If-Modified-Since`. Fetching an updated pass is that update's delivery receipt.","tags":["public"],"parameters":[{"name":"passTypeIdentifier","in":"path","required":true,"schema":{"type":"string","maxLength":255,"pattern":"^pass(\\.[A-Za-z0-9-]+)+$"}},{"name":"serialNumber","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The pass file.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: SIGNATURE_INVALID","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[]}},"/v1/public/channels/wallet/apple/v1/log":{"post":{"operationId":"logWalletDevice","summary":"Apple PassKit web service: devices report errors with our web service (kept as a bounded warning log line, never stored).","tags":["public"],"parameters":[],"responses":{"200":{"description":"Logged.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletDeviceLogInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/catalog/batches":{"post":{"operationId":"submitCatalogBatch","summary":"Synchronize catalog products (whole snapshots) of one store: each product gets a new version only when its content changed; the batch is a receipt and one audit row.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Applied; per-product outcomes and the batch receipt.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogBatchResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"integrations.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitCatalogBatchInput"}}}}},"get":{"operationId":"listCatalogBatches","summary":"Catalog synchronization receipts, newest first (sync health).","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: source (text): eq; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Not groupable.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of receipts.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogBatchPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read","x-collection":{"resource":"catalog_batches","fields":[{"key":"source","label":"Store","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"createdAt","label":"Received","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[],"defaultSort":{"field":"createdAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/commerce/catalog/products":{"get":{"operationId":"listCatalogProducts","summary":"Catalog products: search titles, filter by status, stock, store and replenishment; sort by title or last change (collection view, ADR 0039).","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over title.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: title (text): contains, starts_with, eq; status (enum): in, nin — active | removed; available (bool): eq; source (text): eq; replenishDays (number): gte, lte, between; updatedAt (date): eq, gt, gte, lt, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: title, updatedAt, createdAt. Default updatedAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of products.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogProductPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read","x-collection":{"resource":"catalog_products","fields":[{"key":"title","label":"Product","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"active","label":"Active"},{"value":"removed","label":"Removed from the store"}]},{"key":"available","label":"In stock","type":"bool","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"source","label":"Store","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"replenishDays","label":"Replenishment (days)","type":"number","sortable":false,"filterOperators":["gte","lte","between"],"groupable":false},{"key":"updatedAt","label":"Last change","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"createdAt","label":"First seen","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["active"]}]}},{"id":"replenishable","label":"With replenishment","filter":{"op":"and","conditions":[{"field":"replenishDays","operator":"gte","value":1}]}},{"id":"out_of_stock","label":"Out of stock","filter":{"op":"and","conditions":[{"field":"available","operator":"eq","value":false}]}}],"defaultSort":{"field":"updatedAt","dir":"desc"},"search":{"fields":["title"],"mode":"contains"}}}},"/v1/workspaces/{workspaceId}/commerce/catalog/products/{productId}":{"get":{"operationId":"getCatalogProduct","summary":"One product with its variants.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"productId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The product.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogProduct"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read"},"patch":{"operationId":"updateCatalogProduct","summary":"Set or clear the product's consumption interval (replenishment). The store's content is the feed's, never edited here.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"productId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogProduct"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCatalogProductInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/catalog/products/{productId}/versions":{"get":{"operationId":"listCatalogProductVersions","summary":"A product's content versions, newest first, each with the batch that produced it.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"productId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of versions.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogProductVersionPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read"}},"/v1/workspaces/{workspaceId}/commerce/coupon-pools":{"get":{"operationId":"listCouponPools","summary":"Coupon pools with their code counts and state (ready, low, exhausted, expired, archived).","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Case-insensitive substring search over name.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: name (text): contains, starts_with, eq; status (enum): in, nin — active | archived; issuance (enum): in, nin — once_per_contact | per_send; expiresAt (date): gte, lte, between; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: name, createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status, issuance): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of pools.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponPoolPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read","x-collection":{"resource":"coupon_pools","fields":[{"key":"name","label":"Pool","type":"text","sortable":true,"filterOperators":["contains","starts_with","eq"],"groupable":false},{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"active","label":"Active"},{"value":"archived","label":"Archived"}]},{"key":"issuance","label":"Issued","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"once_per_contact","label":"Once per contact"},{"value":"per_send","label":"Once per email"}]},{"key":"expiresAt","label":"Expires","type":"date","sortable":false,"filterOperators":["gte","lte","between"],"groupable":false},{"key":"createdAt","label":"Created","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"active","label":"Active","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["active"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"},"search":{"fields":["name"],"mode":"contains"}}},"post":{"operationId":"createCouponPool","summary":"Create a coupon pool; its key is the merge tag `{{ coupon.<key> }}`.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"location":{"schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponPool"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCouponPoolInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/coupon-pools/{poolId}":{"get":{"operationId":"getCouponPool","summary":"One coupon pool with its counts.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The pool.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponPool"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read"},"patch":{"operationId":"updateCouponPool","summary":"Rename, change the expiry or the low-stock threshold, archive or reactivate a pool.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponPool"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCouponPoolInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/coupon-pools/{poolId}/codes":{"post":{"operationId":"addCouponCodes","summary":"Add codes created in the store (upload). A code already in the workspace is counted as a duplicate, never added twice.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Added.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCouponCodesResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: COUPON_POOL_UNAVAILABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCouponCodesInput"}}}}},"get":{"operationId":"listCouponCodes","summary":"A pool's codes: filter by state, contact or exact code; newest first.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: code (text): eq; state (enum): in, nin — available | issued | redeemed | void; contactId (ref): in; createdAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: createdAt. Default createdAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (state): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of codes.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponCodePage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read","x-collection":{"resource":"coupon_codes","fields":[{"key":"code","label":"Code","type":"text","sortable":false,"filterOperators":["eq"],"groupable":false},{"key":"state","label":"State","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"available","label":"Available"},{"value":"issued","label":"Issued"},{"value":"redeemed","label":"Redeemed"},{"value":"void","label":"Void"}]},{"key":"contactId","label":"Contact","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"createdAt","label":"Added","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"issued","label":"Issued","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["issued"]}]}},{"id":"redeemed","label":"Redeemed","filter":{"op":"and","conditions":[{"field":"state","operator":"in","value":["redeemed"]}]}}],"defaultSort":{"field":"createdAt","dir":"desc"}}}},"/v1/workspaces/{workspaceId}/commerce/coupon-pools/{poolId}/codes/generate":{"post":{"operationId":"generateCouponCodes","summary":"Generate random codes into the pool (the store must accept them before they can be redeemed).","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Generated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCouponCodesResult"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: COUPON_POOL_UNAVAILABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCouponCodesInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/coupon-pools/{poolId}/issue":{"post":{"operationId":"issueCoupon","summary":"Issue a code to a contact (atomic claim): the same (pool, contact, source key) — or the same contact for a once-per-contact pool — always returns the same code.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"poolId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The issued code.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedCoupon"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: COUPON_POOL_EXHAUSTED, COUPON_POOL_UNAVAILABLE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueCouponInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/loyalty/program":{"get":{"operationId":"getLoyaltyProgram","summary":"The workspace's loyalty programme (null until one is created) with member counts per tier.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The programme.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyProgramState"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read"},"post":{"operationId":"createLoyaltyProgram","summary":"Create the workspace's loyalty programme (one per workspace).","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"201":{"description":"Created.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyProgram"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: CONFLICT, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLoyaltyProgramInput"}}}}},"patch":{"operationId":"updateLoyaltyProgram","summary":"Change the programme's name, status, earn rules or tiers. Tiers apply from each member's next posting.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"If-Match","in":"header","required":true,"description":"Revision the edit is based on, as returned in ETag (e.g. `\"3\"`). Mismatch → 412 VERSION_CONFLICT.","schema":{"type":"string"}}],"responses":{"200":{"description":"Updated.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyProgram"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"412":{"description":"Problem: VERSION_CONFLICT","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"428":{"description":"Problem: PRECONDITION_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLoyaltyProgramInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/loyalty/members":{"get":{"operationId":"listLoyaltyMembers","summary":"Loyalty members: filter by status, tier or contact; sort by points or joining date.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor` (same query only).","schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Not searchable.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"URL-encoded JSON filter group: {\"op\":\"and\"|\"or\",\"conditions\":[{\"field\",\"operator\",\"value?\"}]}. Fields and operators: status (enum): in, nin — enrolled | left; tierKey (text): eq, is_set, is_not_set; balance (number): eq, gt, gte, lt, lte, between; contactId (ref): in; enrolledAt (date): eq, gt, gte, lt, lte, between. Values: none for is_set/is_not_set, an array for in/nin, [from, to] for between, ISO dates (YYYY-MM-DD, whole UTC days) or date-times for dates.","schema":{"type":"string","maxLength":8000}},{"name":"sort","in":"query","required":false,"description":"`field:asc|desc`; sortable: balance, enrolledAt. Default enrolledAt:desc.","schema":{"type":"string","maxLength":80}},{"name":"group","in":"query","required":false,"description":"Group field (status): ordered by it first, with whole-collection counts in `groups`.","schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"A page of members.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyMemberPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read","x-collection":{"resource":"loyalty_members","fields":[{"key":"status","label":"Status","type":"enum","sortable":false,"filterOperators":["in","nin"],"groupable":true,"options":[{"value":"enrolled","label":"Enrolled"},{"value":"left","label":"Left"}]},{"key":"tierKey","label":"Tier","type":"text","sortable":false,"filterOperators":["eq","is_set","is_not_set"],"groupable":false},{"key":"balance","label":"Points","type":"number","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false},{"key":"contactId","label":"Contact","type":"ref","sortable":false,"filterOperators":["in"],"groupable":false},{"key":"enrolledAt","label":"Joined","type":"date","sortable":true,"filterOperators":["eq","gt","gte","lt","lte","between"],"groupable":false}],"quickFilters":[{"id":"enrolled","label":"Enrolled","filter":{"op":"and","conditions":[{"field":"status","operator":"in","value":["enrolled"]}]}}],"defaultSort":{"field":"enrolledAt","dir":"desc"}}},"post":{"operationId":"enrollLoyaltyMember","summary":"Enroll a contact with the PROVENANCE of their decision (method, reference, statement, time). Re-enrolling a member who left records the new provenance.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The member.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyMember"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: LOYALTY_PROGRAM_INACTIVE, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollLoyaltyMemberInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/loyalty/members/{memberId}":{"get":{"operationId":"getLoyaltyMember","summary":"One member with their provenance.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}}],"responses":{"200":{"description":"The member.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyMember"}}}},"400":{"description":"Problem: VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read"}},"/v1/workspaces/{workspaceId}/commerce/loyalty/members/{memberId}/leave":{"post":{"operationId":"leaveLoyaltyProgram","summary":"Record that the member left the programme (no further points; the journal stays).","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The member.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}},"etag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyMember"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveLoyaltyInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/loyalty/members/{memberId}/adjustments":{"post":{"operationId":"adjustLoyaltyPoints","summary":"Add or remove points by hand, with a reference (idempotent posting) and a note; never below zero.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Client-chosen key (8–255 visible ASCII). Same key + same body replays the stored response; same key + different body → 409.","schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"The posting and the member after it.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyPosting"}}}},"400":{"description":"Problem: VALIDATION_FAILED, IDEMPOTENCY_KEY_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"409":{"description":"Problem: LOYALTY_NOT_ENROLLED, LOYALTY_INSUFFICIENT_POINTS, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_REQUEST_IN_PROGRESS","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"413":{"description":"Problem: PAYLOAD_TOO_LARGE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"415":{"description":"Problem: UNSUPPORTED_MEDIA_TYPE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustLoyaltyPointsInput"}}}}}},"/v1/workspaces/{workspaceId}/commerce/loyalty/members/{memberId}/ledger":{"get":{"operationId":"listLoyaltyLedger","summary":"A member's points journal (append-only), newest first.","tags":["commerce"],"parameters":[{"name":"workspaceId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"memberId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Uuid"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":512}},{"name":"limit","in":"query","required":false,"description":"Page size, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of postings.","headers":{"x-request-id":{"description":"Request correlation id.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyLedgerPage"}}}},"400":{"description":"Problem: INVALID_CURSOR, VALIDATION_FAILED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"401":{"description":"Problem: UNAUTHENTICATED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Problem: PERMISSION_DENIED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Problem: NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Problem: RATE_LIMITED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Problem: INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"x-permission":"commerce.read"}}},"components":{"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"code":{"$ref":"#/components/schemas/ErrorCode"},"detail":{"type":"string"},"instance":{"description":"Request path the problem occurred on.","type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/FieldIssue"}},"integration":{"type":"string"}},"required":["type","title","status","code","requestId"],"additionalProperties":false,"description":"RFC 9457 problem document."},"ErrorCode":{"type":"string","enum":["VALIDATION_FAILED","INVALID_CURSOR","IDEMPOTENCY_KEY_REQUIRED","UNAUTHENTICATED","PERMISSION_DENIED","WORKSPACE_SUSPENDED","NOT_FOUND","METHOD_NOT_ALLOWED","CONFLICT","IDENTITY_CONFLICT","IDEMPOTENCY_KEY_REUSED","IDEMPOTENCY_REQUEST_IN_PROGRESS","VERSION_CONFLICT","PAYLOAD_TOO_LARGE","UNSUPPORTED_MEDIA_TYPE","UNPROCESSABLE","PRECONDITION_REQUIRED","RATE_LIMITED","INTERNAL_ERROR","SERVICE_UNAVAILABLE","APPROVAL_STALE","AUDIENCE_CHANGED","REGION_ROUTE_UNAVAILABLE","CREDIT_RESERVATION_FAILED","SUPPRESSION_STORE_UNAVAILABLE","CONNECTOR_REAUTH_REQUIRED","OAUTH_PROVIDER_NOT_CONFIGURED","OAUTH_REDIRECT_NOT_ALLOWED","OAUTH_STATE_INVALID","OAUTH_AUTHORIZATION_FAILED","SUBMISSION_UNKNOWN","SEPARATION_OF_DUTIES","PREFLIGHT_STALE","CAMPAIGN_STATE_CONFLICT","TEMPLATE_PUBLISHED","CAMPAIGN_NOT_READY","READINESS_PENDING","DELIVERABILITY_BLOCKED","SPAM_RISK_REVIEW_REQUIRED","SNAPSHOT_NOT_READY","TEST_RECIPIENT_NOT_ALLOWED","LOCAL_TIME_AMBIGUOUS","LOCAL_TIME_NONEXISTENT","TIMEZONE_FALLBACK_REQUIRED","RETRY_NOT_ALLOWED","JOURNEY_GRAPH_INVALID","JOURNEY_GRAPH_STALE","JOURNEY_STATE_CONFLICT","REPORT_RECIPIENT_INVALID","REPORT_BUDGET_EXCEEDED","ORDER_CONFLICT","REFUND_EXCEEDS_ORDER","AI_NOT_ENABLED","AI_BUDGET_EXCEEDED","AI_PROVIDER_UNAVAILABLE","AI_SOURCE_NOT_ALLOWED","AI_DRAFT_BLOCKED","CONSENT_EVIDENCE_MISSING","SUPPRESSION_SCOPE_INCOMPATIBLE","SUPPRESSION_NOT_LIFTABLE","IMPORT_MAPPING_INVALID","IMPORT_FILE_REJECTED","IMPORT_PREVIEW_STALE","IMPORT_CONFIRMATIONS_CHANGED","PROTECTED_FIELD_ACCESS_DENIED","SEGMENT_UNSAFE_OPERATOR","SEGMENT_BUDGET_EXCEEDED","BULK_SELECTION_CHANGED","FIELD_DEFINITION_IMMUTABLE","TOKEN_EXPIRED","EXPORT_EXPIRED","STORAGE_UNAVAILABLE","EGRESS_DENIED","CAPABILITY_UNSUPPORTED","REGION_NOT_ALLOWED","SENDING_MODE_SUPPORT_ONLY","REGION_NOT_SERVED","DNS_TOKEN_INVALID","DNS_TOKEN_TOO_BROAD","DNS_TOKEN_ZONE_MISMATCH","DNS_CONNECTION_MISSING","DNS_CONNECTION_UNAVAILABLE","DNS_PROVIDER_UNAVAILABLE","DNS_PUBLISH_PLAN_CHANGED","DOMAIN_CONNECT_UNAVAILABLE","STARTER_ADDRESS_UNAVAILABLE","STARTER_ADDRESS_EXISTS","STARTER_SLUG_TAKEN","STARTER_REPLY_TO_LINK_INVALID","DOMAIN_RESERVED","SENDER_IN_USE","DOMAIN_IN_USE","MTA_STS_NOT_CONFIGURED","MTA_STS_ENFORCE_BLOCKED","OWNERSHIP_MISSING","SENDER_DOMAIN_UNVERIFIED","SIGNATURE_INVALID","PUBLIC_TOKEN_INVALID","INVALID_CREDENTIALS","TOKEN_INVALID","STEP_UP_REQUIRED","MFA_REQUIRED","MFA_ENROLLMENT_REQUIRED","IP_NOT_ALLOWED","SSO_REQUIRED","SSO_NOT_CONFIGURED","SSO_FAILED","SSO_DOMAIN_NOT_VERIFIED","CSRF_REJECTED","ROLE_ESCALATION","LAST_OWNER","INVITATION_EMAIL_MISMATCH","SENDER_UNVERIFIED","CAMPAIGN_NOT_EDITABLE","CONTENT_INVALID","ASSET_TYPE_NOT_ALLOWED","ASSET_TOO_LARGE","ASSET_UPLOAD_INCOMPLETE","RETENTION_OUT_OF_BOUNDS","PRIVACY_REQUEST_STATE","PRIVACY_SUBJECT_MISMATCH","SUPPORT_GRANT_EXPIRED","TRUST_CASE_STATE","ASSET_NOT_CLEAN","WEBHOOK_URL_REFUSED","AGENT_POLICY_DENIED","AGENT_BUDGET_EXCEEDED","GRANT_INVALID","BILLING_NOT_CONFIGURED","INTEGRATION_NOT_CONFIGURED","PAYMENT_PROVIDER_UNAVAILABLE","RETURN_URL_NOT_ALLOWED","PLAN_NOT_PURCHASABLE","ADDON_REQUIRED","ADDON_LIMIT_REACHED","WARMUP_DOMAIN_NOT_VERIFIED","WARMUP_SMTP_REQUIRED","WARMUP_MAILBOX_EXISTS","WARMUP_MAILBOX_STATE","WARMUP_MAILBOX_LIMIT","SUBSCRIPTION_EXISTS","CONNECT_NOT_CONFIGURED","SELLER_NOT_ENABLED","BOUNCE_POLICY_FLOOR","INSECURE_TRANSPORT","EVIDENCE_UNAVAILABLE","REPROCESS_DRY_RUN_REQUIRED","FORM_ORIGIN_NOT_ALLOWED","FORM_CHALLENGE_FAILED","RECIPIENT_LINK_INVALID","GROWTH_NOT_PUBLISHABLE","GROWTH_PUBLISHED","GROWTH_IN_USE","SURVEY_CLOSED","SURVEY_NOT_OFFERED","AGENCY_NOT_ENABLED","AGENCY_LIMIT","AGENCY_SEND_CAP_EXCEEDED","BRAND_INVALID","BRAND_DOMAIN_UNVERIFIED","BRAND_DOMAIN_TAKEN","WARMUP_STATE_CONFLICT","TRANSACTIONAL_TEMPLATE_INACTIVE","TRANSACTIONAL_PARAMETERS_INVALID","SMTP_CREDENTIAL_INACTIVE","MAILBOX_DOMAIN_NOT_RECEIVING","MAILBOX_DOMAIN_RESERVED","MAILBOX_DOMAIN_DNS_UNAVAILABLE","MAILBOX_ADDRESS_TAKEN","HOSTED_MAILBOX_INACTIVE","MAILBOX_RULE_NOT_APPLICABLE","GIT_SYNC_CONFLICTS_OPEN","GIT_DIFF_STALE","GIT_PROVIDER_UNAVAILABLE","GIT_PROVIDER_RATE_LIMITED","GIT_PROVIDER_AUTH_REQUIRED","CONNECTOR_NOT_ACTIVE","CONNECTOR_SCHEMA_UNSUPPORTED","INBOX_UNAVAILABLE","INBOX_REPLY_NOT_ALLOWED","INBOX_REPLY_NOT_REVIEWABLE","INBOX_SELF_REVIEW","INBOX_ASSIGNEE_INVALID","CHANNEL_PHONE_INVALID","CHANNEL_ENDPOINT_CONFLICT","CHANNEL_SENDER_CONFLICT","CHANNEL_TEMPLATE_INVALID","CHANNEL_TEMPLATE_NOT_APPROVED","CHANNEL_PROVIDER_UNAVAILABLE","CHANNEL_CREDENTIALS_REJECTED","CHANNEL_CONSENT_ENDPOINT_REQUIRED","COUPON_POOL_EXHAUSTED","COUPON_POOL_UNAVAILABLE","LOYALTY_PROGRAM_INACTIVE","LOYALTY_NOT_ENROLLED","LOYALTY_INSUFFICIENT_POINTS","ORGANIZATION_POLICY_FLOOR","ORGANIZATION_NOT_CENTRAL","ORGANIZATION_QUOTA_EXCEEDED","RESTRICTED_FIELD_ACCESS_DENIED","CHANNEL_PUSH_SUBSCRIPTION_INVALID","CHANNEL_SUBSCRIBER_TOKEN_INVALID","CHANNEL_SENDER_NOT_READY","CHANNEL_TEMPLATE_NOT_FROZEN"],"description":"Stable machine error code."},"FieldIssue":{"type":"object","properties":{"path":{"type":"string","description":"Dotted path of the offending field ('' for the root)."},"message":{"type":"string"},"code":{"type":"string","description":"Zod issue code (e.g. invalid_type, too_big)."}},"required":["path","message","code"],"additionalProperties":false},"HealthStatus":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded","unavailable"]},"checks":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["ok","failed"]},"detail":{"type":"string"}},"required":["status"],"additionalProperties":false}}},"required":["status"],"additionalProperties":false},"ContactPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactListItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ContactListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","description":"Normalized identity: local part preserved, domain lowercase IDNA ASCII."},"originalEmail":{"type":"string","description":"Address exactly as supplied."},"emailDomain":{"type":"string"},"identityCollision":{"type":"boolean","description":"Another contact differs only by local-part case: flagged for review, never merged automatically."},"requiresSmtpUtf8":{"type":"boolean"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"phone":{"type":["string","null"]},"locale":{"type":["string","null"]},"timezone":{"type":["string","null"]},"lifecycle":{"$ref":"#/components/schemas/ContactLifecycle"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]}},"protectedFields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"isSet":{"type":"boolean"}},"required":["key","isSet"],"additionalProperties":false},"description":"Encrypted fields: presence only. Values need the audited audience.protected_fields grant."},"restrictedFields":{"description":"Restricted fields hidden from this response: presence only. A single contact read reveals them to holders of audience.restricted_fields (audited).","type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"isSet":{"type":"boolean"}},"required":["key","isSet"],"additionalProperties":false}},"suppressed":{"type":"boolean","description":"An active workspace-wide or platform suppression blocks marketing mail to this address."},"suppressionReason":{"description":"Why marketing mail is blocked (the strongest active suppression): unsubscribe, complaint, hard bounce… null when not suppressed.","anyOf":[{"$ref":"#/components/schemas/SuppressionReason"},{"type":"null"}]},"source":{"type":"string"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"isTopic":{"type":"boolean"}},"required":["id","name","isTopic"],"additionalProperties":false},"description":"Lists and topics the contact is subscribed to or pending on (first ones by name; see listCount)."},"listCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many lists and topics in total (subscribed or pending)."},"lastActivityAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Last message event of the contact (sent, delivered, bounced…); null when never mailed."}},"required":["id","email","originalEmail","emailDomain","identityCollision","requiresSmtpUtf8","firstName","lastName","phone","locale","timezone","lifecycle","fields","protectedFields","suppressed","source","revision","createdAt","updatedAt","lists","listCount","lastActivityAt"],"additionalProperties":false},"Uuid":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$","description":"UUIDv7 entity identifier (RFC 9562), time-ordered.","example":"0199a8a2-7c4e-7d3a-9b1f-3c2d4e5f6a7b"},"ContactLifecycle":{"type":"string","enum":["lead","subscriber","customer","inactive"]},"SuppressionReason":{"type":"string","enum":["unsubscribe","hard_invalid_recipient","hard_invalid_domain","complaint","mailbox_full_temporary","manual","import","privacy_erasure","abuse_safety","privacy_restriction"]},"Revision":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Revision counter; send it back as `If-Match: \"<revision>\"` on PATCH."},"IsoDateTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|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":"ISO 8601 UTC timestamp (e.g. 2026-10-03T08:01:00.000Z)."},"CollectionTotal":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"exact":{"type":"boolean","description":"False when counting was too expensive: `count` is then an estimate (at least the counting budget)."}},"required":["count","exact"],"additionalProperties":false},"CollectionGroupFacet":{"type":"object","properties":{"key":{"type":"string","description":"Group value (`\"\"` for rows without one)."},"label":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"exact":{"description":"False when counting this group was too expensive: `count` is then an estimate (at least the counting budget). Absent = exact.","type":"boolean"}},"required":["key","count"],"additionalProperties":false},"Contact":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","description":"Normalized identity: local part preserved, domain lowercase IDNA ASCII."},"originalEmail":{"type":"string","description":"Address exactly as supplied."},"emailDomain":{"type":"string"},"identityCollision":{"type":"boolean","description":"Another contact differs only by local-part case: flagged for review, never merged automatically."},"requiresSmtpUtf8":{"type":"boolean"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"phone":{"type":["string","null"]},"locale":{"type":["string","null"]},"timezone":{"type":["string","null"]},"lifecycle":{"$ref":"#/components/schemas/ContactLifecycle"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]}},"protectedFields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"isSet":{"type":"boolean"}},"required":["key","isSet"],"additionalProperties":false},"description":"Encrypted fields: presence only. Values need the audited audience.protected_fields grant."},"restrictedFields":{"description":"Restricted fields hidden from this response: presence only. A single contact read reveals them to holders of audience.restricted_fields (audited).","type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"isSet":{"type":"boolean"}},"required":["key","isSet"],"additionalProperties":false}},"suppressed":{"type":"boolean","description":"An active workspace-wide or platform suppression blocks marketing mail to this address."},"suppressionReason":{"description":"Why marketing mail is blocked (the strongest active suppression): unsubscribe, complaint, hard bounce… null when not suppressed.","anyOf":[{"$ref":"#/components/schemas/SuppressionReason"},{"type":"null"}]},"source":{"type":"string"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","email","originalEmail","emailDomain","identityCollision","requiresSmtpUtf8","firstName","lastName","phone","locale","timezone","lifecycle","fields","protectedFields","suppressed","source","revision","createdAt","updatedAt"],"additionalProperties":false},"CreateContactInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320},"firstName":{"type":"string","minLength":1,"maxLength":200},"lastName":{"type":"string","minLength":1,"maxLength":200},"phone":{"type":"string","pattern":"^[+]?[0-9 ().-]{4,32}$"},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"lifecycle":{"$ref":"#/components/schemas/ContactLifecycle"},"fields":{"description":"Typed by the workspace's field definitions; missing fields take their default.","type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]}},"identities":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ExternalIdentityInput"}},"source":{"default":"api","description":"Where the contact came from (api, form:<id>, import:<id>…).","type":"string","minLength":1,"maxLength":100}},"required":["email"],"additionalProperties":false},"ExternalIdentityInput":{"type":"object","properties":{"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9_.-]{0,62}$"},"externalId":{"type":"string","minLength":1,"maxLength":200}},"required":["source","externalId"],"additionalProperties":false},"UpdateContactInput":{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","pattern":"^[+]?[0-9 ().-]{4,32}$"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"lifecycle":{"$ref":"#/components/schemas/ContactLifecycle"},"fields":{"description":"Merged into existing fields; a null value removes the key.","type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]}}},"additionalProperties":false},"CampaignLifecycle":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"purpose":{"$ref":"#/components/schemas/CampaignPurpose"},"state":{"$ref":"#/components/schemas/CampaignState"},"displayState":{"$ref":"#/components/schemas/CampaignDisplayState"},"pauseReason":{"type":["string","null"]},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["id","name","purpose","state","displayState","pauseReason","senderIdentityId","revision"],"additionalProperties":false},"workspaceRegion":{"$ref":"#/components/schemas/Region"},"fourEyesApproval":{"type":"boolean"},"latestVersion":{"anyOf":[{"$ref":"#/components/schemas/CampaignVersionSummary"},{"type":"null"}]},"latestSnapshot":{"anyOf":[{"$ref":"#/components/schemas/AudienceSnapshot"},{"type":"null"}]},"latestPreflight":{"anyOf":[{"$ref":"#/components/schemas/PreflightReport"},{"type":"null"}]},"currentApproval":{"anyOf":[{"$ref":"#/components/schemas/Approval"},{"type":"null"}]},"approvals":{"type":"array","items":{"$ref":"#/components/schemas/Approval"}},"schedule":{"anyOf":[{"$ref":"#/components/schemas/Schedule"},{"type":"null"}]},"messageCounts":{"type":"object","propertyNames":{"$ref":"#/components/schemas/MessageState"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["eligible","suppressed","reserved","queued","submitting","provider_accepted","reported_delivered","deferred","bounced","complained","failed","cancelled","submission_unknown"]},"progressEstimate":{"default":null,"anyOf":[{"$ref":"#/components/schemas/SendEstimate"},{"type":"null"}]},"allowedActions":{"type":"array","items":{"$ref":"#/components/schemas/LifecycleAction"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["campaign","workspaceRegion","fourEyesApproval","latestVersion","latestSnapshot","latestPreflight","currentApproval","approvals","schedule","messageCounts","progressEstimate","allowedActions","asOf"],"additionalProperties":false},"CampaignPurpose":{"type":"string","enum":["marketing","transactional"]},"CampaignState":{"type":"string","enum":["draft","validating","awaiting_approval","approved","scheduled","dispatching","completed","paused","cancelling","cancelled","failed","completed_with_errors"],"description":"Campaign lifecycle (§8). A readiness loss is `paused` with a recorded pause reason (§8 'paused_with_reason')."},"CampaignDisplayState":{"anyOf":[{"$ref":"#/components/schemas/CampaignState"},{"type":"string","const":"paused_with_reason"}],"description":"State for display: `paused` with a readiness reason shows as paused_with_reason (§8)."},"Region":{"type":"string","enum":["eu","uk","us","ca","sg"],"description":"Data residency region (`sg`: Singapore). Never changed by an ordinary profile edit (Appendix B)."},"CampaignVersionSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"subject":{"type":"string"},"preheader":{"type":["string","null"]},"fromName":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"contentHash":{"type":"string"},"rendererVersion":{"type":"string"},"frozenAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","version","subject","preheader","fromName","fromAddress","replyTo","senderIdentityId","contentHash","rendererVersion","frozenAt","createdAt"],"additionalProperties":false},"AudienceSnapshot":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignVersionId":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["building","completed"]},"definition":{"$ref":"#/components/schemas/AudienceDefinition"},"predicateHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Hash of the normalized definition + cap policy."},"audienceHash":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},{"type":"null"}],"description":"Hash of the ordered eligible recipient keys (null while building)."},"asOf":{"description":"Data as of this instant; no dynamic expansion afterwards.","$ref":"#/components/schemas/IsoDateTime"},"eligibleCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"excludedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"exclusionCounts":{"$ref":"#/components/schemas/ExclusionCounts"},"duplicatesRemoved":{"type":"integer","minimum":0,"maximum":9007199254740991},"unknownTimezoneCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","campaignVersionId","status","definition","predicateHash","audienceHash","asOf","eligibleCount","excludedCount","exclusionCounts","duplicatesRemoved","unknownTimezoneCount","completedAt","createdAt"],"additionalProperties":false},"AudienceDefinition":{"type":"object","properties":{"includeListIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"includeSegmentIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"excludeListIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"excludeSegmentIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["includeListIds","includeSegmentIds","excludeListIds","excludeSegmentIds"],"additionalProperties":false,"description":"Union of included lists/segments minus excluded ones."},"ExclusionCounts":{"type":"object","propertyNames":{"$ref":"#/components/schemas/AudienceExclusionReason"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["unsubscribed","hard_bounce","complaint","missing_basis","invalid_data","frequency_cap","account_limit","suppressed","duplicate"],"description":"Recipients excluded per reason (§8: unsubscribe, hard bounce, complaint, missing basis, invalid data, frequency cap, account limits)."},"AudienceExclusionReason":{"type":"string","enum":["unsubscribed","hard_bounce","complaint","missing_basis","invalid_data","frequency_cap","account_limit","suppressed","duplicate"],"description":"Why a recipient of the union is excluded from the snapshot (§8)."},"PreflightReport":{"type":"object","properties":{"preflightId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"versionId":{"$ref":"#/components/schemas/Uuid"},"snapshotId":{"$ref":"#/components/schemas/Uuid"},"passed":{"type":"boolean"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/PreflightCheck"}},"blockingIssues":{"type":"array","items":{"type":"string"},"description":"Keys of the failed checks."},"contentHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"audienceHash":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},{"type":"null"}]},"routeHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"costCeiling":{"$ref":"#/components/schemas/CostCeiling"},"eligibleCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"deliverability":{"anyOf":[{"$ref":"#/components/schemas/AnalyzerIndicators"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["preflightId","campaignId","versionId","snapshotId","passed","checks","blockingIssues","contentHash","audienceHash","routeHash","costCeiling","eligibleCount","deliverability","createdAt"],"additionalProperties":false,"description":"Same shape as the MCP run_preflight result (Appendix C) plus ids."},"PreflightCheck":{"type":"object","properties":{"key":{"type":"string","description":"Stable check id, e.g. content.subject, sender.verified, audience.fresh."},"area":{"type":"string","enum":["content","sender","audience","entitlement","route","schedule"]},"status":{"type":"string","enum":["pass","warn","fail"]},"detail":{"type":"string"}},"required":["key","area","status","detail"],"additionalProperties":false},"CostCeiling":{"type":"object","properties":{"units":{"type":"integer","minimum":0,"maximum":9007199254740991},"amountMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]}},"required":["units","amountMinor","currency"],"additionalProperties":false,"description":"Upper spend bound: one unit per eligible recipient (billing settles first acceptance once)."},"AnalyzerIndicators":{"type":"object","properties":{"modelVersion":{"type":"string"},"compliance":{"$ref":"#/components/schemas/ComplianceVerdict"},"spamRisk":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"spamRiskBand":{"$ref":"#/components/schemas/SpamRiskBand"},"spamRiskEstimated":{"type":"boolean"},"readiness":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"readinessBand":{"$ref":"#/components/schemas/ReadinessBand"},"readinessCoverage":{"type":"number","minimum":0,"maximum":1},"action":{"$ref":"#/components/schemas/AnalyzerAction"}},"required":["modelVersion","compliance","spamRisk","spamRiskBand","spamRiskEstimated","readiness","readinessBand","readinessCoverage","action"],"additionalProperties":false},"ComplianceVerdict":{"type":"string","enum":["pass","fail"],"description":"pass = no rule failed; rules that could not be checked are listed in `unverified`, never as passed."},"SpamRiskBand":{"type":"string","enum":["low","medium","high","critical","unavailable"]},"ReadinessBand":{"type":"string","enum":["ready","caution","not_ready","unavailable"]},"AnalyzerAction":{"type":"string","enum":["allow","approval_required","blocked"],"description":"blocked: compliance FAIL or Spam Risk ≥ 85 (staff override only); approval_required: Spam Risk ≥ 60 (four-eyes forced)."},"Approval":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignVersionId":{"$ref":"#/components/schemas/Uuid"},"snapshotId":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/ApprovalStatus"},"contentHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"audienceHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"routeHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"routePolicy":{"$ref":"#/components/schemas/RoutePolicy"},"spendCapUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"budgetCapUnits":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"scheduleStrategy":{"anyOf":[{"$ref":"#/components/schemas/ScheduleStrategy"},{"type":"null"}]},"eligibleCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"requestedBy":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":false},"requestNote":{"type":["string","null"]},"decidedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reason":{"type":["string","null"]},"validUntil":{"$ref":"#/components/schemas/IsoDateTime"},"decidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"invalidatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"invalidationReason":{"description":"Material change kind(s): content, sender, audience, route, schedule_strategy, budget.","type":["string","null"]},"consumedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"requestedSchedule":{"default":null,"anyOf":[{"$ref":"#/components/schemas/RequestedSchedule"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","campaignVersionId","snapshotId","status","contentHash","audienceHash","routeHash","routePolicy","spendCapUnits","budgetCapUnits","senderIdentityId","scheduleStrategy","eligibleCount","requestedBy","requestNote","decidedByUserId","reason","validUntil","decidedAt","invalidatedAt","invalidationReason","consumedAt","requestedSchedule","createdAt"],"additionalProperties":false},"ApprovalStatus":{"type":"string","enum":["requested","approved","rejected","invalidated","expired","consumed"]},"RoutePolicy":{"type":"object","properties":{"region":{"$ref":"#/components/schemas/Region"},"poolId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"trackingMode":{"anyOf":[{"$ref":"#/components/schemas/TrackingMode"},{"type":"null"}]},"quietHours":{"anyOf":[{"$ref":"#/components/schemas/QuietHours"},{"type":"null"}]},"frequencyCap":{"anyOf":[{"$ref":"#/components/schemas/FrequencyCap"},{"type":"null"}]}},"required":["region","poolId","trackingMode","quietHours","frequencyCap"],"additionalProperties":false,"description":"Canonical input of `routeHash`."},"TrackingMode":{"type":"string","enum":["off","minimal","aggregate","individual_consented","individual_restricted"],"description":"Five tracking modes; new workspaces default to off; the stricter policy wins (§14)."},"QuietHours":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"anyOf":[{"type":"string","const":"recipient"},{"type":"string","minLength":1,"maxLength":64}]}},"required":["start","end","timezone"],"additionalProperties":false},"FrequencyCap":{"type":"object","properties":{"maxMessages":{"type":"integer","minimum":1,"maximum":100},"windowHours":{"type":"integer","minimum":1,"maximum":744}},"required":["maxMessages","windowHours"],"additionalProperties":false},"ScheduleStrategy":{"type":"string","enum":["immediate","at_time","recipient_local"]},"ActorType":{"type":"string","enum":["user","api_key","mcp_agent","system","platform_staff","oauth_app"],"description":"Who performed an audited action. `oauth_app`: a third-party application acting through a person's OAuth grant (ADR 0071; the actor id is the grant)."},"RequestedSchedule":{"type":"object","properties":{"strategy":{"$ref":"#/components/schemas/ScheduleStrategy"},"localTime":{"type":["string","null"]},"timezone":{"type":"string"},"dstResolution":{"anyOf":[{"type":"string","enum":["earlier","later"]},{"type":"null"}]},"fallbackTimezone":{"type":["string","null"]},"deadline":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"pace":{"default":null,"anyOf":[{"$ref":"#/components/schemas/SendPace"},{"type":"null"}]},"requesterMayPublish":{"type":"boolean"}},"required":["strategy","localTime","timezone","dstResolution","fallbackTimezone","deadline","pace","requesterMayPublish"],"additionalProperties":false},"SendPace":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"fastest"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"spread"},"durationMinutes":{"type":"integer","minimum":15,"maximum":1380}},"required":["kind","durationMinutes"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"per_hour"},"perHour":{"type":"integer","minimum":1,"maximum":1000000}},"required":["kind","perHour"],"additionalProperties":false}],"description":"How fast the send may go: as fast as allowed (default), spread over a duration, or at most N per hour (ADR 0048)."},"Schedule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"approvalId":{"$ref":"#/components/schemas/Uuid"},"strategy":{"$ref":"#/components/schemas/ScheduleStrategy"},"runAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"timezone":{"type":"string"},"localTime":{"type":["string","null"]},"dstResolution":{"anyOf":[{"$ref":"#/components/schemas/DstChoice"},{"type":"null"}]},"fallbackTimezone":{"type":["string","null"]},"deadlineAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"quietHours":{"anyOf":[{"$ref":"#/components/schemas/QuietHours"},{"type":"null"}]},"frequencyCap":{"anyOf":[{"$ref":"#/components/schemas/FrequencyCap"},{"type":"null"}]},"pace":{"default":{"kind":"fastest"},"$ref":"#/components/schemas/SendPace"},"paceRatePerHour":{"default":null,"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"state":{"$ref":"#/components/schemas/ScheduleState"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","approvalId","strategy","runAt","timezone","localTime","dstResolution","fallbackTimezone","deadlineAt","quietHours","frequencyCap","pace","paceRatePerHour","state","createdAt"],"additionalProperties":false},"DstChoice":{"type":"string","enum":["earlier","later"]},"ScheduleState":{"type":"string","enum":["pending","due","dispatched","cancelled"]},"MessageState":{"type":"string","enum":["eligible","suppressed","reserved","queued","submitting","provider_accepted","reported_delivered","deferred","bounced","complained","failed","cancelled","submission_unknown"],"description":"Per-recipient message state (§11). provider_accepted is NOT delivery; submission_unknown is never blindly retried."},"SendEstimate":{"type":"object","properties":{"isEstimate":{"type":"boolean","const":true},"basis":{"type":"string","enum":["planned","observed"]},"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"recipientsExact":{"type":"boolean"},"seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"limitingFactor":{"type":"string","pattern":"^(pace|workspace_rate|trust_tier|sender_domain|pool|engine|warmup|credits|plan_cap|deadline|expiry|entitlement|none|observed_rate|starter|starter_month|domain_ramp|provider:(gmail|microsoft|yahoo|other)|warmup:(gmail|microsoft|yahoo|other)|domain_ramp:(gmail|microsoft|yahoo|other))$"},"detail":{"type":"string"},"limits":{"type":"array","items":{"$ref":"#/components/schemas/EstimateLimit"}},"held":{"type":"array","items":{"$ref":"#/components/schemas/EstimateHeld"}},"byProvider":{"type":"array","items":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/MailboxProvider"},"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","recipients"],"additionalProperties":false}},"providerSplit":{"type":"string","enum":["snapshot","sample","none"]},"observedPerHour":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"spread":{"anyOf":[{"type":"object","properties":{"days":{"type":"integer","minimum":2,"maximum":9007199254740991},"domain":{"type":"string"},"engagedFirst":{"type":"boolean","const":true}},"required":["days","domain","engagedFirst"],"additionalProperties":false},{"type":"null"}]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["isEstimate","basis","recipients","recipientsExact","seconds","limitingFactor","detail","limits","held","byProvider","providerSplit","observedPerHour","asOf"],"additionalProperties":false,"description":"Estimated send duration and its limiting factor (ADR 0048). Every figure is an estimate."},"EstimateLimit":{"type":"object","properties":{"factor":{"type":"string","pattern":"^(pace|workspace_rate|trust_tier|sender_domain|pool|engine|warmup|credits|plan_cap|deadline|expiry|entitlement|none|observed_rate|starter|starter_month|domain_ramp|provider:(gmail|microsoft|yahoo|other)|warmup:(gmail|microsoft|yahoo|other)|domain_ramp:(gmail|microsoft|yahoo|other))$"},"perHour":{"type":"number","minimum":0},"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["factor","perHour","recipients","seconds"],"additionalProperties":false},"EstimateHeld":{"type":"object","properties":{"factor":{"type":"string","pattern":"^(pace|workspace_rate|trust_tier|sender_domain|pool|engine|warmup|credits|plan_cap|deadline|expiry|entitlement|none|observed_rate|starter|starter_month|domain_ramp|provider:(gmail|microsoft|yahoo|other)|warmup:(gmail|microsoft|yahoo|other)|domain_ramp:(gmail|microsoft|yahoo|other))$"},"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"detail":{"type":"string"}},"required":["factor","recipients","detail"],"additionalProperties":false},"MailboxProvider":{"type":"string","enum":["gmail","microsoft","yahoo","other"]},"LifecycleAction":{"type":"string","enum":["build_audience","run_preflight","send_test","request_approval","approve","schedule","pause","resume","cancel","retry_failed"]},"AudienceSourceList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AudienceSource"}},"segmentsAvailable":{"type":"boolean"},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","segmentsAvailable","asOf"],"additionalProperties":false},"AudienceSource":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["list","segment"]},"name":{"type":"string"},"memberCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","kind","name","memberCount"],"additionalProperties":false},"AudienceEstimate":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"exact":{"type":"boolean"},"budget":{"type":"integer","minimum":1,"maximum":9007199254740991},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["count","exact","budget","asOf"],"additionalProperties":false},"EstimateAudienceInput":{"type":"object","properties":{"audience":{"$ref":"#/components/schemas/AudienceDefinitionInput"}},"required":["audience"],"additionalProperties":false},"AudienceDefinitionInput":{"type":"object","properties":{"includeListIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"includeSegmentIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"excludeListIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"excludeSegmentIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"additionalProperties":false,"description":"Union of included lists/segments minus excluded ones."},"AudienceSnapshotAccepted":{"type":"object","properties":{"jobId":{"$ref":"#/components/schemas/Uuid"},"statusUrl":{"type":"string"},"snapshot":{"$ref":"#/components/schemas/AudienceSnapshot"}},"required":["jobId","statusUrl","snapshot"],"additionalProperties":false,"description":"202: the snapshot is recorded; `status` says whether it is complete."},"CreateAudienceSnapshotInput":{"type":"object","properties":{"versionId":{"description":"Campaign version the snapshot is materialized for.","$ref":"#/components/schemas/Uuid"},"audience":{"$ref":"#/components/schemas/AudienceDefinitionInput"}},"required":["versionId","audience"],"additionalProperties":false},"DeliverySettings":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"routeRegion":{"anyOf":[{"$ref":"#/components/schemas/Region"},{"type":"null"}],"description":"Null = the workspace region (the only accepted value today)."},"poolId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"trackingMode":{"anyOf":[{"$ref":"#/components/schemas/TrackingMode"},{"type":"null"}],"description":"Stored choice; semantics owned by the events module (§14)."},"scheduleStrategy":{"anyOf":[{"$ref":"#/components/schemas/ScheduleStrategy"},{"type":"null"}]},"quietHours":{"anyOf":[{"$ref":"#/components/schemas/QuietHours"},{"type":"null"}]},"frequencyCap":{"anyOf":[{"$ref":"#/components/schemas/FrequencyCap"},{"type":"null"}]},"spendCapUnits":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Budget: max billable units."},"sendTimeOptimization":{"anyOf":[{"$ref":"#/components/schemas/SendTimeOptimization"},{"type":"null"}],"description":"R048 (ADR 0077): send at each recipient's best hour within the window (null = off). Material: part of the approved route."},"sendTimePlan":{"anyOf":[{"$ref":"#/components/schemas/SendTimePlanSummary"},{"type":"null"}],"description":"What send-time optimization decided for the latest approved send (null = not used or not sent yet)."},"workspaceRegion":{"$ref":"#/components/schemas/Region"},"stream":{"description":"The campaign's stream: a pool must carry it.","$ref":"#/components/schemas/Stream"},"senderDomain":{"description":"The campaign's From domain the pool's servers must authorize (null = no sender yet).","type":["string","null"]},"pools":{"type":"array","items":{"$ref":"#/components/schemas/DeliverySettingsPool"}},"revision":{"description":"1 = defaults never edited.","$ref":"#/components/schemas/Revision"},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["campaignId","routeRegion","poolId","trackingMode","scheduleStrategy","quietHours","frequencyCap","spendCapUnits","sendTimeOptimization","sendTimePlan","workspaceRegion","stream","senderDomain","pools","revision","updatedAt"],"additionalProperties":false},"SendTimeOptimization":{"type":"object","properties":{"windowHours":{"type":"integer","minimum":1,"maximum":72}},"required":["windowHours"],"additionalProperties":false},"SendTimePlanSummary":{"type":"object","properties":{"approvalId":{"$ref":"#/components/schemas/Uuid"},"windowHours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"modelVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fallbackReason":{"anyOf":[{"type":"string","enum":["no_model","insufficient_data","turned_off","experiment","training_off","window_over"]},{"type":"null"}]},"contactCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workspaceCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"campaignCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"firstAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["approvalId","windowHours","modelVersion","fallbackReason","contactCount","workspaceCount","campaignCount","firstAt","lastAt"],"additionalProperties":false},"Stream":{"type":"string","enum":["marketing","transactional"]},"DeliverySettingsPool":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"stream":{"type":"string"},"offered":{"type":"boolean","description":"False = choosing it is refused (and would fail the preflight): `notOfferedReasons` says why."},"notOfferedReasons":{"type":"array","items":{"$ref":"#/components/schemas/PoolNotOfferedReason"}}},"required":["id","name","region","stream","offered","notOfferedReasons"],"additionalProperties":false},"PoolNotOfferedReason":{"type":"string","enum":["region_mismatch","stream_mismatch","sender_not_authorized"]},"UpdateDeliverySettingsInput":{"type":"object","properties":{"routeRegion":{"anyOf":[{"$ref":"#/components/schemas/Region"},{"type":"null"}]},"poolId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"trackingMode":{"anyOf":[{"$ref":"#/components/schemas/TrackingMode"},{"type":"null"}]},"scheduleStrategy":{"anyOf":[{"$ref":"#/components/schemas/ScheduleStrategy"},{"type":"null"}]},"quietHours":{"anyOf":[{"$ref":"#/components/schemas/QuietHours"},{"type":"null"}]},"frequencyCap":{"anyOf":[{"$ref":"#/components/schemas/FrequencyCap"},{"type":"null"}]},"spendCapUnits":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"sendTimeOptimization":{"anyOf":[{"$ref":"#/components/schemas/SendTimeOptimization"},{"type":"null"}]}},"additionalProperties":false},"RunPreflightInput":{"type":"object","properties":{"versionId":{"$ref":"#/components/schemas/Uuid"},"snapshotId":{"$ref":"#/components/schemas/Uuid"}},"required":["versionId","snapshotId"],"additionalProperties":false},"TestRecipientList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TestRecipient"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"TestRecipient":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"label":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","email","label","createdAt"],"additionalProperties":false},"CreateTestRecipientInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["email"],"additionalProperties":false},"TestSendAccepted":{"type":"object","properties":{"jobId":{"$ref":"#/components/schemas/Uuid"},"statusUrl":{"type":"string"},"testSend":{"$ref":"#/components/schemas/TestSend"}},"required":["jobId","statusUrl","testSend"],"additionalProperties":false},"TestSend":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignVersionId":{"$ref":"#/components/schemas/Uuid"},"recipients":{"type":"array","items":{"type":"string"}},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"fixture":{"type":["string","null"]},"variantKey":{"default":null,"anyOf":[{"$ref":"#/components/schemas/ExperimentVariantKey"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/TestSendState"},"sentAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","campaignVersionId","recipients","contactId","fixture","variantKey","state","sentAt","createdAt"],"additionalProperties":false},"ExperimentVariantKey":{"type":"string","enum":["A","B","C","D","E"]},"TestSendState":{"type":"string","enum":["queued","sent","failed"],"description":"Allowlisted test send (R026)."},"TestSendInput":{"type":"object","properties":{"versionId":{"$ref":"#/components/schemas/Uuid"},"recipients":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":3,"maxLength":320}},"contactId":{"$ref":"#/components/schemas/Uuid"},"variantKey":{"$ref":"#/components/schemas/ExperimentVariantKey"}},"required":["versionId","recipients"],"additionalProperties":false},"TestSendList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TestSend"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"RequestApprovalInput":{"type":"object","properties":{"versionId":{"$ref":"#/components/schemas/Uuid"},"snapshotId":{"$ref":"#/components/schemas/Uuid"},"preflightId":{"description":"A passing preflight whose hashes still match (else 409 PREFLIGHT_STALE).","$ref":"#/components/schemas/Uuid"},"audienceHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"spendCeilingUnits":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Must cover the preflight cost ceiling and stay within the budget."},"note":{"type":"string","maxLength":1000}},"required":["versionId","snapshotId","preflightId","audienceHash","spendCeilingUnits"],"additionalProperties":false},"ApproveInput":{"type":"object","properties":{"contentHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"audienceHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"routeHash":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"SHA-256, lowercase hex."},"spendCapUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"validUntil":{"$ref":"#/components/schemas/IsoDateTime"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["contentHash","audienceHash","routeHash","spendCapUnits","validUntil","reason"],"additionalProperties":false,"description":"The exact hashes and cap the approver reviewed (Appendix A)."},"RejectApprovalInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"LocalTimeResolution":{"type":"object","properties":{"kind":{"type":"string","enum":["exact","ambiguous","nonexistent"]},"timezone":{"type":"string"},"localTime":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/LocalTimeOption"}}},"required":["kind","timezone","localTime","options"],"additionalProperties":false,"description":"exact = one instant; ambiguous/nonexistent = the user must choose."},"LocalTimeOption":{"type":"object","properties":{"choice":{"type":"string","enum":["exact","earlier","later"]},"instant":{"$ref":"#/components/schemas/IsoDateTime"},"localDisplay":{"type":"string"},"utcOffset":{"type":"string"}},"required":["choice","instant","localDisplay","utcOffset"],"additionalProperties":false},"ScheduleInput":{"type":"object","properties":{"approvalId":{"$ref":"#/components/schemas/Uuid"},"strategy":{"$ref":"#/components/schemas/ScheduleStrategy"},"localTime":{"type":"string","pattern":"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})$","description":"Wall-clock time in the given time zone, minute precision (YYYY-MM-DDTHH:mm)."},"timezone":{"type":"string","minLength":1,"maxLength":64},"dstResolution":{"$ref":"#/components/schemas/DstChoice"},"fallbackTimezone":{"type":"string","minLength":1,"maxLength":64},"deadline":{"$ref":"#/components/schemas/IsoDateTime"},"pace":{"$ref":"#/components/schemas/SendPace"}},"required":["approvalId","strategy","timezone"],"additionalProperties":false},"ControlAccepted":{"type":"object","properties":{"jobId":{"$ref":"#/components/schemas/Uuid"},"statusUrl":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"}},"required":["jobId","statusUrl","campaignState"],"additionalProperties":false,"description":"202: recorded; the dispatch engine applies it between jobs, never after acceptance."},"PauseInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"ResumeInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"additionalProperties":false},"CancelInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"RetryCandidatePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RetryCandidate"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"RetryCandidate":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"state":{"$ref":"#/components/schemas/MessageState"},"generation":{"type":"integer","minimum":1,"maximum":9007199254740991},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","state","generation","updatedAt"],"additionalProperties":false,"description":"No recipient data: ids and states only."},"RetryFailedInput":{"type":"object","properties":{"approvalId":{"description":"The approval the campaign is running under (re-verified).","$ref":"#/components/schemas/Uuid"},"messageIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["approvalId","messageIds"],"additionalProperties":false},"CampaignCalendar":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/CalendarEntry"}},"collisions":{"type":"array","items":{"$ref":"#/components/schemas/CalendarCollision"}},"truncated":{"type":"boolean"},"publications":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"cadenceLabel":{"type":"string"}},"required":["id","name","cadenceLabel"],"additionalProperties":false}},"digests":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"publicationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"nextRunAt":{"$ref":"#/components/schemas/IsoDateTime"},"state":{"type":"string","enum":["active","paused"]}},"required":["id","name","publicationId","nextRunAt","state"],"additionalProperties":false}},"cutovers":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/CalendarCutover"}},"overlap":{"default":{"pairs":0,"cached":0,"computedMs":0},"type":"object","properties":{"pairs":{"type":"integer","minimum":0,"maximum":9007199254740991},"cached":{"type":"integer","minimum":0,"maximum":9007199254740991},"computedMs":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["pairs","cached","computedMs"],"additionalProperties":false},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to","entries","collisions","truncated","publications","digests","cutovers","overlap","asOf"],"additionalProperties":false},"CalendarEntry":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"state":{"$ref":"#/components/schemas/CampaignState"},"scheduleId":{"$ref":"#/components/schemas/Uuid"},"strategy":{"$ref":"#/components/schemas/ScheduleStrategy"},"runAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"deadlineAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"timezone":{"type":"string"},"localTime":{"type":["string","null"]},"plannedVolume":{"type":"integer","minimum":0,"maximum":9007199254740991},"listIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"frequencyCap":{"anyOf":[{"$ref":"#/components/schemas/FrequencyCap"},{"type":"null"}]},"channel":{"default":"email","type":"string","const":"email"},"publicationId":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["campaignId","name","state","scheduleId","strategy","runAt","deadlineAt","timezone","localTime","plannedVolume","listIds","frequencyCap","channel","publicationId"],"additionalProperties":false},"CalendarCollision":{"type":"object","properties":{"kind":{"type":"string","enum":["audience_overlap","frequency_cap_risk"]},"campaignIds":{"type":"array","prefixItems":[{"$ref":"#/components/schemas/Uuid"},{"$ref":"#/components/schemas/Uuid"}],"items":false,"minItems":2,"maxItems":2},"overlapRecipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"windowHours":{"type":"integer","minimum":1,"maximum":9007199254740991},"message":{"type":"string"}},"required":["kind","campaignIds","overlapRecipients","windowHours","message"],"additionalProperties":false},"CalendarCutover":{"type":"object","properties":{"migrationId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"source":{"$ref":"#/components/schemas/MigrationSource"},"status":{"$ref":"#/components/schemas/MigrationStatus"},"milestone":{"type":"string","enum":["frozen","cut_over","rollback_requested","rollback_approved"]},"at":{"$ref":"#/components/schemas/IsoDateTime"},"inForce":{"type":"boolean"}},"required":["migrationId","name","source","status","milestone","at","inForce"],"additionalProperties":false},"MigrationSource":{"type":"string","enum":["mailchimp","brevo","interspire"]},"MigrationStatus":{"type":"string","enum":["active","frozen","cut_over","rollback_requested","rolled_back"]},"CampaignReadiness":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/CampaignReadinessStatus"},"upToDate":{"type":"boolean"},"requestedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"computedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"draftRevision":{"anyOf":[{"$ref":"#/components/schemas/Revision"},{"type":"null"}]},"items":{"type":"array","items":{"$ref":"#/components/schemas/ReadinessItem"}},"counts":{"type":"object","properties":{"block":{"type":"integer","minimum":0,"maximum":9007199254740991},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"warn":{"type":"integer","minimum":0,"maximum":9007199254740991},"pass":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["block","pending","warn","pass"],"additionalProperties":false},"recipients":{"anyOf":[{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"exact":{"type":"boolean"}},"required":["count","exact"],"additionalProperties":false},{"type":"null"}]},"spamScore":{"anyOf":[{"type":"integer","minimum":0,"maximum":10},{"type":"null"}]},"deliverability":{"anyOf":[{"$ref":"#/components/schemas/CampaignDeliverability"},{"type":"null"}]},"sendMode":{"anyOf":[{"$ref":"#/components/schemas/CampaignSendMode"},{"type":"null"}]},"fourEyesApproval":{"type":"boolean"},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["campaignId","status","upToDate","requestedAt","computedAt","draftRevision","items","counts","recipients","spamScore","deliverability","sendMode","fourEyesApproval","asOf"],"additionalProperties":false,"description":"The unified readiness of a campaign (ADR 0047): content checks and sending preflight in one list."},"CampaignReadinessStatus":{"type":"string","enum":["ready","blocked","pending","closed"]},"ReadinessItem":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":200},"state":{"$ref":"#/components/schemas/ReadinessItemState"},"section":{"anyOf":[{"$ref":"#/components/schemas/ComposerSection"},{"type":"null"}]},"reason":{"type":"string"},"detail":{"type":["string","null"]},"blockId":{"type":["string","null"]},"workspaceFix":{"anyOf":[{"$ref":"#/components/schemas/ReadinessWorkspaceFix"},{"type":"null"}]}},"required":["code","state","section","reason","detail","blockId","workspaceFix"],"additionalProperties":false},"ReadinessItemState":{"type":"string","enum":["block","pending","warn","pass"]},"ComposerSection":{"type":"string","enum":["from","to","subject","content","when","advanced"]},"ReadinessWorkspaceFix":{"type":"string","enum":["domains","servers","billing","assets","settings","deliverability"]},"CampaignDeliverability":{"type":"object","properties":{"indicators":{"$ref":"#/components/schemas/AnalyzerIndicators"},"review":{"$ref":"#/components/schemas/DeliverabilityReview"},"currentModel":{"type":"boolean"},"analyzedAt":{"$ref":"#/components/schemas/IsoDateTime"},"sample":{"$ref":"#/components/schemas/AnalyzerSampleSource"},"routeAdapter":{"type":["string","null"]},"waived":{"type":"array","items":{"type":"string"}},"analysis":{"$ref":"#/components/schemas/DeliverabilityAnalysis"},"contentFingerprint":{"type":"string"},"arms":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/ArmDeliverability"}},"override":{"default":null,"anyOf":[{"$ref":"#/components/schemas/SpamRiskOverride"},{"type":"null"}]}},"required":["indicators","review","currentModel","analyzedAt","sample","routeAdapter","waived","analysis","arms","override"],"additionalProperties":false,"description":"The campaign's pre-send deliverability analysis (ADR 0056) and what the send gate does with it."},"DeliverabilityReview":{"type":"string","enum":["none","approval_required","blocked"],"description":"none: send as usual; approval_required: Spam Risk ≥ 60 — a second person must approve, even with four-eyes off; blocked: a compliance rule failed or Spam Risk ≥ 85."},"AnalyzerSampleSource":{"type":"string","enum":["contact","fixture"],"description":"contact: the first contact of the chosen audience; fixture: synthetic preview data (no audience yet)."},"DeliverabilityAnalysis":{"type":"object","properties":{"modelVersion":{"type":"string"},"analyzedAt":{"type":"string"},"purpose":{"type":"string","enum":["marketing","transactional"]},"compliance":{"type":"object","properties":{"verdict":{"$ref":"#/components/schemas/ComplianceVerdict"},"failed":{"type":"array","items":{"type":"string"}},"unverified":{"type":"array","items":{"type":"string"}}},"required":["verdict","failed","unverified"],"additionalProperties":false},"spamRisk":{"type":"object","properties":{"score":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"band":{"$ref":"#/components/schemas/SpamRiskBand"},"estimated":{"type":"boolean"},"measuredComponents":{"type":"integer","minimum":0,"maximum":9007199254740991},"totalComponents":{"type":"integer","minimum":1,"maximum":9007199254740991},"components":{"type":"array","items":{"type":"object","properties":{"component":{"$ref":"#/components/schemas/SpamRiskComponentKey"},"max":{"type":"number"},"points":{"type":["number","null"]},"measurement":{"$ref":"#/components/schemas/AnalyzerMeasurement"}},"required":["component","max","points","measurement"],"additionalProperties":false}}},"required":["score","band","estimated","measuredComponents","totalComponents","components"],"additionalProperties":false},"readiness":{"type":"object","properties":{"score":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"band":{"$ref":"#/components/schemas/ReadinessBand"},"coverage":{"type":"number","minimum":0,"maximum":1},"groups":{"type":"array","items":{"type":"object","properties":{"group":{"$ref":"#/components/schemas/ReadinessGroupKey"},"max":{"type":"number"},"points":{"type":["number","null"]},"measuredMax":{"type":"number"}},"required":["group","max","points","measuredMax"],"additionalProperties":false}}},"required":["score","band","coverage","groups"],"additionalProperties":false},"enforcement":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/AnalyzerAction"},"reasons":{"type":"array","items":{"type":"string","enum":["compliance_fail","spam_risk_high","spam_risk_critical"]}}},"required":["action","reasons"],"additionalProperties":false},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AnalyzerFinding"}},"recommendations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"code":{"$ref":"#/components/schemas/AnalyzerCheckCode"},"impact":{"type":"number"},"messageKey":{"type":"string"},"fixKey":{"type":["string","null"]},"message":{"type":"string"},"fix":{"type":["string","null"]}},"required":["key","code","impact","messageKey","fixKey","message","fix"],"additionalProperties":false}},"message":{"type":"object","properties":{"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"htmlBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"textBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"subject":{"type":"string"},"fromDomain":{"type":["string","null"]},"linkCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"linkDomains":{"type":"array","items":{"type":"string"}},"imageCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["bytes","htmlBytes","textBytes","subject","fromDomain","linkCount","linkDomains","imageCount"],"additionalProperties":false},"disclaimerKey":{"type":"string"},"disclaimer":{"type":"string"}},"required":["modelVersion","analyzedAt","purpose","compliance","spamRisk","readiness","enforcement","findings","recommendations","message","disclaimerKey","disclaimer"],"additionalProperties":false,"description":"Pre-send analysis of the composed message of a sample recipient (ADR 0056). Indicators are platform policy, never a placement guarantee."},"SpamRiskComponentKey":{"type":"string","enum":["spam_engine","url_reputation","content","presentation","format"]},"AnalyzerMeasurement":{"type":"string","enum":["measured","estimated","unavailable"],"description":"measured = observed now; estimated = inferred (labelled); unavailable = no evidence — never counted as clean."},"ReadinessGroupKey":{"type":"string","enum":["authentication","infrastructure","sender_history","audience"]},"AnalyzerFinding":{"type":"object","properties":{"key":{"type":"string"},"code":{"$ref":"#/components/schemas/AnalyzerCheckCode"},"status":{"$ref":"#/components/schemas/AnalyzerFindingStatus"},"measurement":{"$ref":"#/components/schemas/AnalyzerMeasurement"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}},"compliance":{"type":"boolean"},"spamRisk":{"anyOf":[{"type":"object","properties":{"component":{"$ref":"#/components/schemas/SpamRiskComponentKey"},"points":{"type":"number","minimum":0}},"required":["component","points"],"additionalProperties":false},{"type":"null"}]},"readiness":{"anyOf":[{"type":"object","properties":{"group":{"$ref":"#/components/schemas/ReadinessGroupKey"},"points":{"type":"number","minimum":0},"max":{"type":"number","minimum":0}},"required":["group","points","max"],"additionalProperties":false},{"type":"null"}]},"messageKey":{"type":"string"},"fixKey":{"type":["string","null"]},"message":{"type":"string"},"fix":{"type":["string","null"]}},"required":["key","code","status","measurement","params","compliance","spamRisk","readiness","messageKey","fixKey","message","fix"],"additionalProperties":false},"AnalyzerCheckCode":{"type":"string","enum":["deliv.from_single","deliv.date_present","deliv.message_id","deliv.single_instance","deliv.internal_headers","deliv.free_mail_from","deliv.list_unsubscribe_https","deliv.list_unsubscribe_post","deliv.list_unsubscribe_signed","deliv.list_unsubscribe_mailto","deliv.unsubscribe_visible","deliv.postal_address","deliv.feedback_id","deliv.auth_evidence","deliv.auth_domain_verified","deliv.auth_dkim_aligned","deliv.auth_spf_pass","deliv.auth_return_path_aligned","deliv.auth_dmarc_present","deliv.auth_dmarc_enforcing","deliv.auth_mta_sts","deliv.ip_fcrdns","deliv.blocklist_ip","deliv.blocklist_ips_clean","deliv.blocklist_domain","deliv.blocklist_domains_clean","deliv.sender_standing","deliv.warmup_state","deliv.history_complaints","deliv.history_hard_bounces","deliv.history_deferrals","deliv.history_postmaster","deliv.audience_never_engaged","deliv.audience_role_addresses","deliv.audience_soft_bounces","deliv.audience_no_mx","deliv.audience_confirmed","deliv.spam_engine","deliv.spam_engine_symbol","deliv.url_reputation","deliv.spam_phrase","deliv.hidden_text","deliv.link_text_mismatch","deliv.url_shortener","deliv.insecure_links","deliv.too_many_links","deliv.too_many_link_domains","deliv.image_only","deliv.image_heavy","deliv.subject_all_caps","deliv.subject_exclamations","deliv.subject_fake_reply","deliv.subject_symbols","deliv.display_name_deceptive","deliv.html_clipping","deliv.text_part_missing","deliv.message_size","deliv.mime_unreadable"],"description":"Stable check code (`deliv.*`, ADR 0056)."},"AnalyzerFindingStatus":{"type":"string","enum":["pass","fail","warn","info","unavailable"]},"ArmDeliverability":{"type":"object","properties":{"key":{"type":"string"},"indicators":{"$ref":"#/components/schemas/AnalyzerIndicators"},"review":{"$ref":"#/components/schemas/DeliverabilityReview"},"waived":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"fix":{"type":["string","null"]},"messageKey":{"default":null,"type":["string","null"]},"params":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}}},"required":["key","code","message","fix","messageKey","params"],"additionalProperties":false}},"recommendations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"fix":{"type":["string","null"]},"messageKey":{"default":null,"type":["string","null"]},"params":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}}},"required":["key","code","message","fix","messageKey","params"],"additionalProperties":false}}},"required":["key","indicators","review","waived","failed","recommendations"],"additionalProperties":false,"description":"Pre-send analysis of one A/B arm other than the control (ADR 0069)."},"SpamRiskOverride":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string"},"grantedAt":{"$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"spamRisk":{"type":"integer","minimum":0,"maximum":100}},"required":["id","reason","grantedAt","expiresAt","spamRisk"],"additionalProperties":false},"CampaignSendMode":{"type":"string","enum":["send","request_approval"]},"ReadinessRecomputeAccepted":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"requestedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["campaignId","requestedAt"],"additionalProperties":false},"SendCampaignResult":{"type":"object","properties":{"outcome":{"type":"string","enum":["scheduled","approval_requested"]},"approval":{"$ref":"#/components/schemas/Approval"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/Schedule"},{"type":"null"}]},"preflightId":{"$ref":"#/components/schemas/Uuid"}},"required":["outcome","approval","schedule","preflightId"],"additionalProperties":false},"SendCampaignInput":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/ScheduleChoice"},"note":{"type":"string","maxLength":1000},"campaignRevision":{"$ref":"#/components/schemas/Revision"}},"required":["schedule"],"additionalProperties":false},"ScheduleChoice":{"type":"object","properties":{"strategy":{"$ref":"#/components/schemas/ScheduleStrategy"},"localTime":{"type":"string","pattern":"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})$","description":"Wall-clock time in the given time zone, minute precision (YYYY-MM-DDTHH:mm)."},"timezone":{"type":"string","minLength":1,"maxLength":64},"dstResolution":{"type":"string","enum":["earlier","later"]},"fallbackTimezone":{"type":"string","minLength":1,"maxLength":64},"deadline":{"$ref":"#/components/schemas/IsoDateTime"},"pace":{"$ref":"#/components/schemas/SendPace"}},"required":["strategy","timezone"],"additionalProperties":false},"SendingCapacity":{"type":"object","properties":{"isEstimate":{"type":"boolean","const":true},"todayMessages":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"perHour":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"ceilings":{"type":"array","items":{"$ref":"#/components/schemas/CapacityCeiling"}},"warmups":{"type":"array","items":{"$ref":"#/components/schemas/SendingWarmup"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["isEstimate","todayMessages","perHour","ceilings","asOf"],"additionalProperties":false,"description":"Today's sending ceilings of the workspace in plain words and what raises each (ADR 0048 point 3). Estimates."},"CapacityCeiling":{"type":"object","properties":{"kind":{"type":"string","enum":["plan","credits","warmup","hourly_rate","plan_cap","entitlement"]},"value":{"type":["number","null"]},"unit":{"type":"string","enum":["messages","messages_per_hour","messages_per_day","messages_per_month","none"]},"used":{"type":["number","null"]},"binding":{"type":"boolean"},"raisedBy":{"type":"string","enum":["buy_credits","upgrade_plan","warmup_progress","contact_support","verify_business","ask_agency","add_sending_ips","fix_billing","none"]},"detail":{"type":"string"}},"required":["kind","value","unit","used","binding","raisedBy","detail"],"additionalProperties":false},"SendingWarmup":{"type":"object","properties":{"kind":{"type":"string","enum":["dedicated_ip","domain"]},"subject":{"type":"string"},"state":{"$ref":"#/components/schemas/SendingRampState"},"day":{"type":"integer","minimum":1,"maximum":9007199254740991},"sharePercent":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"todayCeiling":{"anyOf":[{"type":"object","properties":{"gmail":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"microsoft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"yahoo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"other":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["gmail","microsoft","yahoo","other"],"additionalProperties":false},{"type":"null"}]},"startedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["kind","subject","state","day","sharePercent","todayCeiling","startedAt"],"additionalProperties":false},"SendingRampState":{"type":"string","enum":["active","frozen","complete","cancelled"]},"ContactMemberships":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"listId":{"$ref":"#/components/schemas/Uuid"},"contactId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"state":{"$ref":"#/components/schemas/ListMembershipState"},"subscribedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"unsubscribedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"source":{"type":["string","null"]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"listName":{"type":"string"},"isTopic":{"type":"boolean"}},"required":["id","listId","contactId","email","state","subscribedAt","confirmedAt","unsubscribedAt","source","revision","createdAt","updatedAt","listName","isTopic"],"additionalProperties":false}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"ListMembershipState":{"type":"string","enum":["pending_confirmation","subscribed","unsubscribed"]},"ContactConsentState":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ConsentStateItem"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["contactId","items","asOf"],"additionalProperties":false},"ConsentStateItem":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/ConsentChannel"},"purpose":{"$ref":"#/components/schemas/ConsentPurpose"},"state":{"type":"string","enum":["granted","withdrawn","expired","unknown"]},"since":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"eventId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"legalBasis":{"anyOf":[{"$ref":"#/components/schemas/LegalBasis"},{"type":"null"}]},"noticeVersion":{"type":["string","null"]},"source":{"type":["string","null"]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["channel","purpose","state","since","eventId","legalBasis","noticeVersion","source","expiresAt"],"additionalProperties":false},"ConsentChannel":{"type":"string","enum":["email","sms","whatsapp","web_push","mobile_push","wallet"]},"ConsentPurpose":{"type":"string","enum":["marketing","transactional","tracking","profiling"]},"LegalBasis":{"type":"string","enum":["consent","legitimate_interest","contract","legal_obligation"]},"ProtectedFieldValue":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":["string","number","null"]}},"required":["key","value"],"additionalProperties":false},"ErasureResult":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"erasedAt":{"type":"string"},"tombstoneSuppressionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["contactId","erasedAt","tombstoneSuppressionId"],"additionalProperties":false},"EraseContactInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"suppress":{"default":true,"type":"boolean"}},"required":["reason"],"additionalProperties":false},"AsyncJobAccepted":{"type":"object","properties":{"jobId":{"$ref":"#/components/schemas/Uuid"},"statusUrl":{"type":"string","description":"Relative URL of the job status resource."}},"required":["jobId","statusUrl"],"additionalProperties":false,"description":"202 Accepted body: the job is queued, not complete."},"BulkAddToListInput":{"type":"object","properties":{"selection":{"$ref":"#/components/schemas/ContactSelection"},"listId":{"$ref":"#/components/schemas/Uuid"},"evidence":{"$ref":"#/components/schemas/ConsentEvidence"}},"required":["selection","listId","evidence"],"additionalProperties":false},"ContactSelection":{"anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["ids"],"additionalProperties":false},{"type":"object","properties":{"all":{"type":"boolean","const":true},"q":{"type":"string","minLength":1,"maxLength":200},"filter":{"description":"A filter group of the contacts collection (same fields and operators as listContacts' `filter`)."}},"required":["all"],"additionalProperties":false}],"description":"Explicit contact ids, or every contact matching the list's search and filter at request time."},"ConsentEvidence":{"type":"object","properties":{"method":{"type":"string","enum":["web_form","double_opt_in","api","import","preference_center","unsubscribe_link","list_unsubscribe_one_click","verbal","paper","support_request","operator"]},"capturedAt":{"$ref":"#/components/schemas/IsoDateTime"},"formId":{"type":"string","maxLength":200},"pageUrl":{"type":"string","maxLength":2048,"format":"uri"},"statement":{"type":"string","maxLength":2000},"ipHash":{"type":"string","maxLength":128},"userAgentHash":{"type":"string","maxLength":128},"reference":{"description":"Ticket, import id, token id…","type":"string","maxLength":200}},"required":["method","capturedAt"],"additionalProperties":false},"BulkUnsubscribeInput":{"type":"object","properties":{"selection":{"$ref":"#/components/schemas/ContactSelection"},"reason":{"type":"string","maxLength":500}},"required":["selection"],"additionalProperties":false},"BulkEraseInput":{"type":"object","properties":{"selection":{"$ref":"#/components/schemas/ContactSelection"},"reason":{"type":"string","minLength":3,"maxLength":500},"expectedCount":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["selection","reason","expectedCount"],"additionalProperties":false},"ContactBulkJob":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"action":{"$ref":"#/components/schemas/ContactBulkAction"},"status":{"$ref":"#/components/schemas/ContactBulkStatus"},"total":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"processed":{"type":"integer","minimum":0,"maximum":9007199254740991},"succeeded":{"type":"integer","minimum":0,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["code","count"],"additionalProperties":false}},"listId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"errorCode":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"finishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","action","status","total","processed","succeeded","skipped","failed","errors","listId","errorCode","createdAt","updatedAt","finishedAt"],"additionalProperties":false},"ContactBulkAction":{"type":"string","enum":["add_to_list","unsubscribe","erase"]},"ContactBulkStatus":{"type":"string","enum":["queued","running","succeeded","failed"]},"FieldDefinitionList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FieldDefinition"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"FieldDefinition":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"label":{"type":"string"},"type":{"$ref":"#/components/schemas/FieldType"},"protection":{"$ref":"#/components/schemas/FieldProtection"},"validation":{"type":"object","properties":{"maxLength":{"type":"integer","minimum":1,"maximum":2000},"min":{"type":"number"},"max":{"type":"number"},"integer":{"type":"boolean"},"options":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"maxSelected":{"type":"integer","minimum":1,"maximum":100},"minDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"referenceTo":{"type":"string","const":"contact"}},"additionalProperties":false},"required":{"type":"boolean"},"defaultValue":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}],"description":"Applied when a contact is created (API or import) without this field."},"purpose":{"type":["string","null"]},"mergeAllowed":{"type":"boolean"},"blindIndexed":{"type":"boolean"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"revision":{"$ref":"#/components/schemas/Revision"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","key","label","type","protection","validation","required","defaultValue","purpose","mergeAllowed","blindIndexed","version","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"FieldType":{"type":"string","enum":["text","number","boolean","enum","multiselect","date","url","reference"]},"FieldProtection":{"type":"string","enum":["standard","restricted","encrypted"],"description":"encrypted = per-tenant envelope encryption; never in merge tags, AI prompts, exports or logs (§7)."},"FieldDefinitionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FieldDefinition"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"CreateFieldDefinitionInput":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"label":{"type":"string","minLength":1,"maxLength":100},"type":{"$ref":"#/components/schemas/FieldType"},"protection":{"default":"standard","$ref":"#/components/schemas/FieldProtection"},"validation":{"default":{},"type":"object","properties":{"maxLength":{"type":"integer","minimum":1,"maximum":2000},"min":{"type":"number"},"max":{"type":"number"},"integer":{"type":"boolean"},"options":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"maxSelected":{"type":"integer","minimum":1,"maximum":100},"minDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"referenceTo":{"type":"string","const":"contact"}},"additionalProperties":false},"required":{"default":false,"type":"boolean"},"defaultValue":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"purpose":{"type":"string","minLength":1,"maxLength":200},"mergeAllowed":{"default":true,"type":"boolean"},"blindIndexed":{"default":false,"description":"Encrypted fields only. Enables exact-match search, and discloses which contacts share a value.","type":"boolean"}},"required":["key","label","type"],"additionalProperties":false},"FieldDefinitionDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"label":{"type":"string"},"type":{"$ref":"#/components/schemas/FieldType"},"protection":{"$ref":"#/components/schemas/FieldProtection"},"validation":{"type":"object","properties":{"maxLength":{"type":"integer","minimum":1,"maximum":2000},"min":{"type":"number"},"max":{"type":"number"},"integer":{"type":"boolean"},"options":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"maxSelected":{"type":"integer","minimum":1,"maximum":100},"minDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"referenceTo":{"type":"string","const":"contact"}},"additionalProperties":false},"required":{"type":"boolean"},"defaultValue":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}],"description":"Applied when a contact is created (API or import) without this field."},"purpose":{"type":["string","null"]},"mergeAllowed":{"type":"boolean"},"blindIndexed":{"type":"boolean"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"revision":{"$ref":"#/components/schemas/Revision"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/FieldDefinitionVersion"}}},"required":["id","key","label","type","protection","validation","required","defaultValue","purpose","mergeAllowed","blindIndexed","version","revision","archivedAt","createdAt","updatedAt","versions"],"additionalProperties":false},"FieldDefinitionVersion":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"validation":{"type":"object","properties":{"maxLength":{"type":"integer","minimum":1,"maximum":2000},"min":{"type":"number"},"max":{"type":"number"},"integer":{"type":"boolean"},"options":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"maxSelected":{"type":"integer","minimum":1,"maximum":100},"minDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"referenceTo":{"type":"string","const":"contact"}},"additionalProperties":false},"required":{"type":"boolean"},"defaultValue":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"purpose":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["version","validation","required","defaultValue","purpose","createdAt"],"additionalProperties":false},"UpdateFieldDefinitionInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"validation":{"type":"object","properties":{"maxLength":{"type":"integer","minimum":1,"maximum":2000},"min":{"type":"number"},"max":{"type":"number"},"integer":{"type":"boolean"},"options":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"maxSelected":{"type":"integer","minimum":1,"maximum":100},"minDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"referenceTo":{"type":"string","const":"contact"}},"additionalProperties":false},"required":{"type":"boolean"},"defaultValue":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"null"}]},"purpose":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"mergeAllowed":{"type":"boolean"},"archived":{"type":"boolean"}},"additionalProperties":false},"ListPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/List"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"List":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"isTopic":{"type":"boolean","description":"Topic lists receive topic-scoped opt-outs."},"doubleOptIn":{"type":"boolean"},"confirmationTtlHours":{"type":"integer","minimum":1,"maximum":9007199254740991},"noticeVersion":{"description":"Privacy notice version shown on the confirmation page.","type":["string","null"]},"trackingMode":{"anyOf":[{"$ref":"#/components/schemas/TrackingMode"},{"type":"null"}],"description":"Stricter list-level tracking policy; null inherits the workspace."},"counts":{"type":"object","properties":{"subscribed":{"type":"integer","minimum":0,"maximum":9007199254740991},"pendingConfirmation":{"type":"integer","minimum":0,"maximum":9007199254740991},"unsubscribed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["subscribed","pendingConfirmation","unsubscribed"],"additionalProperties":false},"revision":{"$ref":"#/components/schemas/Revision"},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","description","isTopic","doubleOptIn","confirmationTtlHours","noticeVersion","trackingMode","counts","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CreateListInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":1000},"isTopic":{"default":false,"type":"boolean"},"doubleOptIn":{"default":false,"type":"boolean"},"confirmationTtlHours":{"default":72,"type":"integer","minimum":1,"maximum":720},"noticeVersion":{"type":"string","minLength":1,"maxLength":100},"trackingMode":{"$ref":"#/components/schemas/TrackingMode"}},"required":["name"],"additionalProperties":false},"UpdateListInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"doubleOptIn":{"type":"boolean"},"confirmationTtlHours":{"type":"integer","minimum":1,"maximum":720},"noticeVersion":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"trackingMode":{"anyOf":[{"$ref":"#/components/schemas/TrackingMode"},{"type":"null"}]},"archived":{"type":"boolean"}},"additionalProperties":false},"MembershipPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ListMembership"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ListMembership":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"listId":{"$ref":"#/components/schemas/Uuid"},"contactId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"state":{"$ref":"#/components/schemas/ListMembershipState"},"subscribedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"unsubscribedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"source":{"type":["string","null"]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","listId","contactId","email","state","subscribedAt","confirmedAt","unsubscribedAt","source","revision","createdAt","updatedAt"],"additionalProperties":false},"SubscribeResult":{"type":"object","properties":{"membership":{"$ref":"#/components/schemas/ListMembership"},"confirmationRequired":{"type":"boolean"},"confirmationTokenId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"unchanged":{"type":"boolean"}},"required":["membership","confirmationRequired","confirmationTokenId","unchanged"],"additionalProperties":false},"SubscribeInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","minLength":3,"maxLength":320},"evidence":{"$ref":"#/components/schemas/ConsentEvidence"},"source":{"default":"api","type":"string","minLength":1,"maxLength":100}},"required":["evidence"],"additionalProperties":false},"UnsubscribeInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"evidence":{"$ref":"#/components/schemas/ConsentEvidence"},"source":{"default":"api","type":"string","minLength":1,"maxLength":100}},"required":["contactId","evidence"],"additionalProperties":false},"ImportUpload":{"type":"object","properties":{"objectKey":{"type":"string"},"uploadUrl":{"type":"string","format":"uri"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Headers the upload must send verbatim."},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["objectKey","uploadUrl","method","headers","expiresAt"],"additionalProperties":false},"CreateImportUploadInput":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\.(csv|txt|xlsx)$"},"sizeBytes":{"type":"integer","minimum":1,"maximum":536870912}},"required":["fileName","sizeBytes"],"additionalProperties":false},"ImportInspection":{"type":"object","properties":{"objectKey":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"format":{"type":"string","enum":["csv","xlsx"],"description":"xlsx: the FIRST worksheet is read; delimiter and BOM do not apply."},"sheetName":{"description":"Name of the worksheet read (xlsx only).","type":["string","null"]},"hasBom":{"type":"boolean"},"delimiter":{"type":"string","enum":[",",";","\t","|"]},"delimiterDetected":{"type":"boolean"},"headers":{"type":"array","items":{"type":"string"}},"sampleRows":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"At most 5 rows (CSV: from the first 64 KiB)."},"suggestedMapping":{"type":"array","items":{"type":"object","properties":{"column":{"type":"integer","minimum":0,"maximum":199},"header":{"type":"string","maxLength":200},"target":{"type":"string","pattern":"^(ignore|email|first_name|last_name|phone|locale|timezone|lifecycle|consent_captured_at|field:[a-z][a-z0-9_]{0,62}|identity:[a-z0-9][a-z0-9_.-]{0,62})$"}},"required":["column","target"],"additionalProperties":false}}},"required":["objectKey","sizeBytes","format","sheetName","hasBom","delimiter","delimiterDetected","headers","sampleRows","suggestedMapping"],"additionalProperties":false},"InspectImportInput":{"type":"object","properties":{"objectKey":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[A-Za-z0-9/_.-]+$"},"delimiter":{"description":"Omit to get a suggestion; the preview always needs it explicitly.","type":"string","enum":[",",";","\t","|"]}},"required":["objectKey"],"additionalProperties":false},"PreviewImportInput":{"type":"object","properties":{"objectKey":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[A-Za-z0-9/_.-]+$"},"checksum":{"type":"string","pattern":"^[0-9a-f]{64}$"},"fileName":{"type":"string","minLength":1,"maxLength":255},"delimiter":{"type":"string","enum":[",",";","\t","|"],"description":"CSV only; ignored for an XLSX workbook (send the inspected value)."},"encoding":{"default":"utf-8","description":"UTF-8 (a BOM is accepted). An XLSX workbook is always UTF-8 XML.","type":"string","const":"utf-8"},"hasHeader":{"default":true,"type":"boolean"},"mapping":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"column":{"type":"integer","minimum":0,"maximum":199},"header":{"type":"string","maxLength":200},"target":{"type":"string","pattern":"^(ignore|email|first_name|last_name|phone|locale|timezone|lifecycle|consent_captured_at|field:[a-z][a-z0-9_]{0,62}|identity:[a-z0-9][a-z0-9_.-]{0,62})$"}},"required":["column","target"],"additionalProperties":false}},"mode":{"$ref":"#/components/schemas/ImportMode"},"overwriteFields":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","pattern":"^(ignore|email|first_name|last_name|phone|locale|timezone|lifecycle|consent_captured_at|field:[a-z][a-z0-9_]{0,62}|identity:[a-z0-9][a-z0-9_.-]{0,62})$"}},"listId":{"$ref":"#/components/schemas/Uuid"},"consent":{"$ref":"#/components/schemas/ImportConsentDeclaration"}},"required":["objectKey","checksum","fileName","delimiter","mapping","mode"],"additionalProperties":false},"ImportMode":{"type":"string","enum":["create_only","fill_missing","overwrite_selected"],"description":"How rows matching an existing contact are applied (§7). Never reactivates a suppressed contact."},"ImportConsentDeclaration":{"type":"object","properties":{"basis":{"$ref":"#/components/schemas/LegalBasis"},"source":{"type":"string","minLength":3,"maxLength":500,"description":"Where and how these people gave permission (form, event, contract…)."},"noticeVersion":{"type":"string","minLength":1,"maxLength":100},"capturedAt":{"description":"Used when no consent_captured_at column is mapped.","$ref":"#/components/schemas/IsoDateTime"}},"required":["basis","source"],"additionalProperties":false},"ImportPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ImportJob"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ImportJob":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/ImportStatus"},"fileName":{"type":"string"},"checksum":{"type":"string"},"sizeBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"delimiter":{"type":"string","enum":[",",";","\t","|"]},"hasHeader":{"type":"boolean"},"mapping":{"type":"array","items":{"type":"object","properties":{"column":{"type":"integer","minimum":0,"maximum":199},"header":{"type":"string","maxLength":200},"target":{"type":"string","pattern":"^(ignore|email|first_name|last_name|phone|locale|timezone|lifecycle|consent_captured_at|field:[a-z][a-z0-9_]{0,62}|identity:[a-z0-9][a-z0-9_.-]{0,62})$"}},"required":["column","target"],"additionalProperties":false}},"mappingVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Field-definition versions the mapping was validated against (hash-bound)."},"mode":{"$ref":"#/components/schemas/ImportMode"},"overwriteFields":{"type":"array","items":{"type":"string"}},"listId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"consent":{"anyOf":[{"$ref":"#/components/schemas/ImportConsentDeclaration"},{"type":"null"}]},"counters":{"anyOf":[{"type":"object","properties":{"rowsScanned":{"type":"integer","minimum":0,"maximum":9007199254740991},"eligible":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Rows the commit will apply: newContacts + updates."},"newContacts":{"type":"integer","minimum":0,"maximum":9007199254740991},"updates":{"type":"integer","minimum":0,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":0,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":0,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":0,"maximum":9007199254740991},"existingSkipped":{"type":"integer","minimum":0,"maximum":9007199254740991},"warnings":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["rowsScanned","eligible","newContacts","updates","unchanged","invalid","duplicates","suppressed","existingSkipped","warnings"],"additionalProperties":false},{"type":"null"}]},"issuesByCategory":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"previewHash":{"type":["string","null"]},"previewedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"approvedRowCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"enrollJourneys":{"type":"boolean"},"progress":{"type":"object","properties":{"processedRows":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Durable retry cursor: rows fully applied."},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"updated":{"type":"integer","minimum":0,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":0,"maximum":9007199254740991},"membershipsCreated":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["processedRows","created","updated","skipped","membershipsCreated"],"additionalProperties":false},"rollback":{"anyOf":[{"type":"object","properties":{"reverted":{"type":"integer","minimum":0,"maximum":9007199254740991},"keptModified":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Changed since the import (e.g. a later unsubscribe): left as is."}},"required":["reverted","keptModified"],"additionalProperties":false},{"type":"null"}]},"errorCode":{"type":["string","null"]},"errorDetail":{"type":["string","null"]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","status","fileName","checksum","sizeBytes","delimiter","hasHeader","mapping","mappingVersion","mode","overwriteFields","listId","consent","counters","issuesByCategory","previewHash","previewedAt","approvedRowCount","enrollJourneys","progress","rollback","errorCode","errorDetail","revision","createdAt","updatedAt"],"additionalProperties":false},"ImportStatus":{"type":"string","enum":["previewing","previewed","committing","committed","rolling_back","rolled_back","failed","cancelled"]},"ImportIssuePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ImportIssue"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ImportIssue":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"rowNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"1-based data row number (the header is row 0)."},"category":{"$ref":"#/components/schemas/ImportIssueCategory"},"column":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"message":{"type":"string"}},"required":["id","rowNumber","category","column","message"],"additionalProperties":false},"ImportIssueCategory":{"type":"string","enum":["invalid_email","duplicate_in_file","suppressed","invalid_field_value","missing_required_field","malformed_row","existing_skipped","unsubscribed_kept","identity_collision"],"description":"Every category the preview reports (§7 'display every error category')."},"CommitImportInput":{"type":"object","properties":{"previewHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"approvedRowCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Must equal the preview's eligible count."},"enrollJourneys":{"default":false,"description":"Must stay false: a commit never starts automations. Enrollment is a separate, reviewed and audited act after the commit (GET/POST /imports/{importId}/journey-enrollment).","type":"boolean"}},"required":["previewHash","approvedRowCount"],"additionalProperties":false},"RollbackImportInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"ImportConfirmationReview":{"type":"object","properties":{"importId":{"$ref":"#/components/schemas/Uuid"},"listId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"doubleOptIn":{"type":"boolean"},"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"eligible":{"type":"integer","minimum":0,"maximum":9007199254740991},"alreadyRequested":{"type":"integer","minimum":0,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":0,"maximum":9007199254740991},"consentWithdrawn":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["importId","listId","doubleOptIn","pending","eligible","alreadyRequested","suppressed","consentWithdrawn"],"additionalProperties":false},"ImportConfirmationsSent":{"type":"object","properties":{"requested":{"type":"integer","minimum":0,"maximum":9007199254740991},"alreadyRequested":{"type":"integer","minimum":0,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":0,"maximum":9007199254740991},"consentWithdrawn":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["requested","alreadyRequested","suppressed","consentWithdrawn"],"additionalProperties":false},"SendImportConfirmationsInput":{"type":"object","properties":{"expectedCount":{"type":"integer","minimum":1,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["expectedCount","reason"],"additionalProperties":false},"CreateExportInput":{"type":"object","properties":{"resource":{"$ref":"#/components/schemas/ExportResource"},"fields":{"minItems":1,"maxItems":150,"type":"array","items":{"type":"string","pattern":"^([a-z_]+|field:[a-z][a-z0-9_]{0,62})$"}},"protectedFields":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"}},"listId":{"$ref":"#/components/schemas/Uuid"},"segmentId":{"$ref":"#/components/schemas/Uuid"},"selection":{"$ref":"#/components/schemas/ContactSelection"}},"required":["resource","fields"],"additionalProperties":false},"ExportResource":{"type":"string","enum":["contacts","suppressions","consent_events"]},"ExportPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ExportJob"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ExportJob":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"resource":{"$ref":"#/components/schemas/ExportResource"},"status":{"$ref":"#/components/schemas/ExportStatus"},"fields":{"type":"array","items":{"type":"string"}},"protectedFields":{"type":"array","items":{"type":"string"}},"listId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"segmentId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"rowCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sizeBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"checksum":{"type":["string","null"]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"errorCode":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","resource","status","fields","protectedFields","listId","segmentId","rowCount","sizeBytes","checksum","expiresAt","errorCode","createdAt","updatedAt"],"additionalProperties":false},"ExportStatus":{"type":"string","enum":["queued","running","ready","failed","expired"]},"ExportDownloadLink":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["url","expiresAt"],"additionalProperties":false},"ConsentEventPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConsentEvent"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ConsentEvent":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"channel":{"$ref":"#/components/schemas/ConsentChannel"},"purpose":{"$ref":"#/components/schemas/ConsentPurpose"},"choice":{"$ref":"#/components/schemas/ConsentChoice"},"legalBasis":{"anyOf":[{"$ref":"#/components/schemas/LegalBasis"},{"type":"null"}]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"noticeVersion":{"type":["string","null"]},"noticeHash":{"type":["string","null"]},"controllerIdentity":{"type":["string","null"]},"jurisdiction":{"type":["string","null"]},"source":{"type":"string"},"actorType":{"$ref":"#/components/schemas/ActorType"},"actorId":{"type":["string","null"]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"channelEndpointId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["id","contactId","channel","purpose","choice","legalBasis","evidence","noticeVersion","noticeHash","controllerIdentity","jurisdiction","source","actorType","actorId","expiresAt","occurredAt","createdAt"],"additionalProperties":false},"ConsentChoice":{"type":"string","enum":["granted","withdrawn"]},"RecordConsentInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","minLength":3,"maxLength":320},"channel":{"$ref":"#/components/schemas/ConsentChannel"},"purpose":{"$ref":"#/components/schemas/ConsentPurpose"},"choice":{"$ref":"#/components/schemas/ConsentChoice"},"legalBasis":{"$ref":"#/components/schemas/LegalBasis"},"evidence":{"$ref":"#/components/schemas/ConsentEvidence"},"noticeVersion":{"type":"string","minLength":1,"maxLength":100},"noticeHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"controllerIdentity":{"type":"string","minLength":1,"maxLength":200},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}(-[A-Z0-9]{1,3})?$"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"occurredAt":{"description":"When the choice was made; defaults to evidence.capturedAt.","$ref":"#/components/schemas/IsoDateTime"},"source":{"default":"api","type":"string","minLength":1,"maxLength":100}},"required":["channel","purpose","choice"],"additionalProperties":false},"SuppressionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Suppression":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"subjectType":{"$ref":"#/components/schemas/SuppressionSubjectType"},"subjectHint":{"description":"Masked address (j***@example.com) or the domain; null after erasure.","type":["string","null"]},"domain":{"type":["string","null"]},"scope":{"$ref":"#/components/schemas/SuppressionScope"},"topicListId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reason":{"$ref":"#/components/schemas/SuppressionReason"},"source":{"type":["string","null"]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"effectiveAt":{"$ref":"#/components/schemas/IsoDateTime"},"reviewAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Temporary suppressions stop applying at this time."},"liftedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"liftedReason":{"type":["string","null"]},"active":{"type":"boolean"},"createdByType":{"$ref":"#/components/schemas/ActorType"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"channel":{"type":["string","null"]}},"required":["id","subjectType","subjectHint","domain","scope","topicListId","reason","source","evidence","effectiveAt","reviewAt","liftedAt","liftedReason","active","createdByType","createdAt"],"additionalProperties":false},"SuppressionSubjectType":{"type":"string","enum":["email","domain","phone"]},"SuppressionScope":{"type":"string","enum":["platform_safety","workspace_all","workspace_marketing","topic"],"description":"platform_safety and workspace opt-outs override list membership and campaign inclusion (§7)."},"CreateSuppressionInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","minLength":3,"maxLength":320},"domain":{"type":"string","minLength":3,"maxLength":253},"scope":{"$ref":"#/components/schemas/SuppressionScope"},"topicListId":{"$ref":"#/components/schemas/Uuid"},"reason":{"$ref":"#/components/schemas/SuppressionReason"},"evidence":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"effectiveAt":{"$ref":"#/components/schemas/IsoDateTime"},"reviewAt":{"$ref":"#/components/schemas/IsoDateTime"},"source":{"default":"manual","type":"string","minLength":1,"maxLength":100}},"required":["scope","reason"],"additionalProperties":false},"LiftSuppressionInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"evidence":{"$ref":"#/components/schemas/ConsentEvidence"}},"required":["reason"],"additionalProperties":false},"SegmentPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Segment":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"definition":{"$ref":"#/components/schemas/SegmentDefinition"},"revision":{"$ref":"#/components/schemas/Revision"},"lastEstimate":{"anyOf":[{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["count","durationMs","at"],"additionalProperties":false},{"type":"null"}]},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","description","definition","revision","lastEstimate","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"SegmentDefinition":{"type":"object","properties":{"version":{"type":"number","const":1},"root":{"$ref":"#/components/schemas/__schema0"},"excludeSuppressed":{"default":true,"type":"boolean"}},"required":["version","root","excludeSuppressed"],"additionalProperties":false},"__schema0":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"and"},"children":{"minItems":1,"maxItems":60,"type":"array","items":{"$ref":"#/components/schemas/__schema0"}}},"required":["kind","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"or"},"children":{"minItems":1,"maxItems":60,"type":"array","items":{"$ref":"#/components/schemas/__schema0"}}},"required":["kind","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"not"},"child":{"$ref":"#/components/schemas/__schema0"}},"required":["kind","child"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"attribute"},"field":{"type":"string","enum":["email","email_domain","first_name","last_name","locale","timezone","lifecycle","source","created_at","updated_at"]},"op":{"$ref":"#/components/schemas/SegmentOperator"},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"}]},{"maxItems":500,"type":"array","items":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"}]}},{"type":"null"}]}},"required":["kind","field","op"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom_field"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"op":{"$ref":"#/components/schemas/SegmentOperator"},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"}]},{"maxItems":500,"type":"array","items":{"anyOf":[{"type":"string","maxLength":2048},{"type":"number"},{"type":"boolean"}]}},{"type":"null"}]}},"required":["kind","key","op"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"list_membership"},"listId":{"$ref":"#/components/schemas/Uuid"},"state":{"$ref":"#/components/schemas/ListMembershipState"}},"required":["kind","listId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"event_count"},"event":{"type":"string","enum":["delivered","opened","clicked","bounced","complained","unsubscribed"]},"op":{"type":"string","enum":["gte","lte","eq"]},"count":{"type":"integer","minimum":0,"maximum":1000000},"withinDays":{"type":"integer","minimum":1,"maximum":3650}},"required":["kind","event","op","count","withinDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"order_count"},"op":{"type":"string","enum":["gte","lte","eq"]},"count":{"type":"integer","minimum":0,"maximum":1000000},"withinDays":{"type":"integer","minimum":1,"maximum":3650}},"required":["kind","op","count","withinDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"net_revenue"},"op":{"type":"string","enum":["gte","lte"]},"amountMinor":{"type":"integer","minimum":0,"maximum":1000000000000},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"withinDays":{"type":"integer","minimum":1,"maximum":3650}},"required":["kind","op","amountMinor","currency","withinDays"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"prediction"},"model":{"$ref":"#/components/schemas/SegmentablePredictionKind"},"bands":{"minItems":1,"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/PredictionBand"}}},"required":["kind","model","bands"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"loyalty_tier"},"tiers":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/LoyaltyTierKey"}}},"required":["kind","tiers"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"coupon"},"poolId":{"$ref":"#/components/schemas/Uuid"},"state":{"type":"string","enum":["issued","redeemed","unredeemed"]},"withinDays":{"type":"integer","minimum":1,"maximum":3650}},"required":["kind","poolId","state"],"additionalProperties":false}]},"SegmentOperator":{"type":"string","enum":["eq","neq","in","not_in","starts_with","contains","ends_with","gt","gte","lt","lte","between","in_last_days","not_in_last_days","is_set","is_not_set","contains_any","contains_all"]},"CurrencyCode":{"type":"string","pattern":"^[A-Z]{3}$","description":"ISO 4217 currency code (uppercase)."},"SegmentablePredictionKind":{"type":"string","enum":["churn_risk","purchase_propensity"]},"PredictionBand":{"type":"string","enum":["low","medium","high"]},"LoyaltyTierKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"CreateSegmentInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":1000},"definition":{"$ref":"#/components/schemas/SegmentDefinitionInput"}},"required":["name","definition"],"additionalProperties":false},"SegmentDefinitionInput":{"type":"object","properties":{"version":{"type":"number","const":1},"root":{"$ref":"#/components/schemas/__schema0"},"excludeSuppressed":{"default":true,"type":"boolean"}},"required":["version","root"],"additionalProperties":false},"UpdateSegmentInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"definition":{"$ref":"#/components/schemas/SegmentDefinitionInput"},"archived":{"type":"boolean"}},"additionalProperties":false},"DuplicateSegmentInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"additionalProperties":false},"SegmentPreviewJob":{"type":"object","properties":{"jobId":{"$ref":"#/components/schemas/Uuid"},"statusUrl":{"type":"string","description":"Relative URL of this preview result (GET)."},"state":{"description":"`succeeded` today: the budgeted query runs before the 202.","$ref":"#/components/schemas/JobState"},"preview":{"$ref":"#/components/schemas/SegmentPreview"},"expiresAt":{"description":"After this instant the result is gone (404); run a new preview.","$ref":"#/components/schemas/IsoDateTime"}},"required":["jobId","statusUrl","state","preview","expiresAt"],"additionalProperties":false,"description":"202 body and status resource of a segment preview."},"JobState":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"SegmentPreview":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Estimated count NOW; the exact recipients are materialized at approval."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"budgetMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["open_based_predicate","includes_suppressed","estimate_only","unknown_activity","no_order_feed","single_currency_revenue","prediction_unavailable","prediction_estimate","no_loyalty_program"]},"message":{"type":"string"},"params":{"$ref":"#/components/schemas/MessageParams"}},"required":["code","message"],"additionalProperties":false}},"sample":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"}},"required":["id","email"],"additionalProperties":false}}},"required":["count","durationMs","budgetMs","asOf","warnings","sample"],"additionalProperties":false},"MessageParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"type":"string"}}]},"description":"Values of a coded sentence (the console translates `<code>` with them); the English prose beside it stays authoritative for API clients."},"SegmentPreviewInput":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/SegmentDefinitionInput"},"budgetMs":{"default":3000,"type":"integer","minimum":50,"maximum":15000},"sampleSize":{"default":10,"type":"integer","minimum":0,"maximum":20}},"required":["definition"],"additionalProperties":false},"SegmentEstimateInput":{"type":"object","properties":{"budgetMs":{"default":3000,"type":"integer","minimum":50,"maximum":15000}},"additionalProperties":false},"SegmentMemberPage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"lifecycle":{"$ref":"#/components/schemas/ContactLifecycle"}},"required":["id","email","firstName","lastName","lifecycle"],"additionalProperties":false}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ConfirmationPage":{"type":"object","properties":{"state":{"type":"string","enum":["pending","confirmed","expired"]},"listName":{"type":"string"},"emailMasked":{"type":"string"},"noticeVersion":{"type":["string","null"]},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"scope":{"type":"object","properties":{"channel":{"type":"string","const":"email"},"purpose":{"type":"string","const":"marketing"},"isTopic":{"type":"boolean"},"formTitle":{"type":["string","null"]},"otherPurposes":{"type":"array","items":{"type":"string","enum":["tracking","profiling"]}}},"required":["channel","purpose","isTopic","formTitle","otherPurposes"],"additionalProperties":false},"continueUrl":{"type":["string","null"]}},"required":["state","listName","emailMasked","noticeVersion","expiresAt","scope","continueUrl"],"additionalProperties":false},"ConfirmationResult":{"type":"object","properties":{"state":{"type":"string","const":"confirmed"},"alreadyConfirmed":{"type":"boolean"},"listName":{"type":"string"},"confirmedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["state","alreadyConfirmed","listName","confirmedAt"],"additionalProperties":false},"ConfirmSubscriptionInput":{"type":"object","properties":{"choice":{"type":"string","const":"confirm"}},"required":["choice"],"additionalProperties":false},"OAuthAuthorizationStart":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"redirectUri":{"type":"string","format":"uri"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["authorizationUrl","redirectUri","expiresAt","scopes"],"additionalProperties":false},"StartOAuthAuthorizationInput":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/OAuthMailProvider"},"target":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/OAuthTargetKind"},"id":{"$ref":"#/components/schemas/Uuid"}},"required":["kind","id"],"additionalProperties":false},"redirectUri":{"type":"string","maxLength":2048,"format":"uri"}},"required":["provider","target"],"additionalProperties":false},"OAuthMailProvider":{"type":"string","enum":["google","microsoft"]},"OAuthTargetKind":{"type":"string","enum":["sending_endpoint","bounce_source","warmup_mailbox"]},"OAuthAuthorizationResult":{"type":"object","properties":{"target":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/OAuthTargetKind"},"id":{"$ref":"#/components/schemas/Uuid"}},"required":["kind","id"],"additionalProperties":false},"grant":{"$ref":"#/components/schemas/OAuthGrantSummary"},"returnPath":{"type":"string","pattern":"^\\/w\\/[0-9a-f-]{36}\\/[a-z/0-9-]+$"}},"required":["target","grant","returnPath"],"additionalProperties":false},"OAuthGrantSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"provider":{"$ref":"#/components/schemas/OAuthMailProvider"},"subject":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/OAuthGrantStatusValue"},"accessTokenExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastRefreshedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastErrorCode":{"type":["string","null"]},"origin":{"type":"string","enum":["consent","supplied"]},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","provider","subject","scopes","status","accessTokenExpiresAt","lastRefreshedAt","lastErrorCode","origin","updatedAt"],"additionalProperties":false,"description":"An OAuth connection WITHOUT its tokens (write-only)."},"OAuthGrantStatusValue":{"type":"string","enum":["active","needs_reauthorization","revoked"]},"CompleteOAuthAuthorizationInput":{"type":"object","properties":{"state":{"type":"string","pattern":"^[A-Za-z0-9_-]{32,128}$"},"code":{"type":"string","minLength":1,"maxLength":4096},"error":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,64}$"},"iss":{"type":"string","maxLength":512,"format":"uri"}},"required":["state"],"additionalProperties":false},"ProviderCatalog":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProviderCatalogItem"}}},"required":["items"],"additionalProperties":false},"ProviderCatalogItem":{"type":"object","properties":{"adapter":{"$ref":"#/components/schemas/ProviderAdapter"},"label":{"type":"string"},"transport":{"type":"string","enum":["smtp","https_api","managed"]},"status":{"type":"string","enum":["available","development_only","phase_0c","planned"]},"connectable":{"type":"boolean","description":"False when refused here (planned, Phase 0C, or the sink outside development)."},"capabilities":{"$ref":"#/components/schemas/ProviderCapabilities"},"egressControlExplanation":{"type":"string"},"note":{"type":["string","null"]},"managedPools":{"type":"array","items":{"type":"string"}}},"required":["adapter","label","transport","status","connectable","capabilities","egressControlExplanation","note","managedPools"],"additionalProperties":false},"ProviderAdapter":{"type":"string","enum":["smtp","ses","sendgrid","mailgun","postmark","brevo","resend","gmail","microsoft_graph","sink","kumomta"]},"ProviderCapabilities":{"type":"object","properties":{"SMTPUTF8":{"type":"boolean","description":"Internationalized addresses (RFC 6531) can be submitted."},"customReturnPath":{"type":"boolean","description":"The envelope sender (Return-Path) can be on the customer's domain."},"customTrackingDomain":{"type":"boolean"},"selectableIpPool":{"type":"boolean","description":"A recipient-facing egress IP pool can be selected per message or route."},"perMessageIdempotency":{"type":"boolean","description":"The provider deduplicates a retried submission by key."},"eventSignatures":{"type":"boolean","description":"Provider events carry a verifiable signature."},"regionSelection":{"type":"boolean","description":"The provider region (data location) is chosen by configuration."},"maxMessageBytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"availableReceipts":{"type":"array","items":{"$ref":"#/components/schemas/ReceiptKind"}},"egressControl":{"$ref":"#/components/schemas/EgressControl"},"ingestsBounces":{"type":"boolean","description":"Bounces and complaints come back through the provider's own events: no BounceSource needed."}},"required":["SMTPUTF8","customReturnPath","customTrackingDomain","selectableIpPool","perMessageIdempotency","eventSignatures","regionSelection","maxMessageBytes","availableReceipts","egressControl","ingestsBounces"],"additionalProperties":false,"description":"Declared adapter capabilities (Appendix C)."},"ReceiptKind":{"type":"string","enum":["smtp_acceptance","api_acceptance","delivery_event","deferral_event","bounce_event","complaint_event","sink_receipt"]},"EgressControl":{"type":"string","enum":["platform_mta","provider_selectable_pool","provider_shared_pool","customer_server","local_sink"]},"SendingEndpointPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SendingEndpoint"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"SendingEndpoint":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"adapter":{"$ref":"#/components/schemas/ProviderAdapter"},"displayName":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"stream":{"$ref":"#/components/schemas/Stream"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]},"description":"Adapter configuration: scalar settings only, never a secret."},"capabilities":{"$ref":"#/components/schemas/ProviderCapabilities"},"authorizedSenders":{"type":"array","items":{"type":"string"}},"quotas":{"$ref":"#/components/schemas/EndpointQuotas"},"concurrency":{"type":"integer","minimum":1,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/EndpointState"},"readiness":{"$ref":"#/components/schemas/EndpointReadiness"},"secret":{"$ref":"#/components/schemas/SecretSummary"},"oauth":{"anyOf":[{"$ref":"#/components/schemas/OAuthGrantSummary"},{"type":"null"}]},"lastTest":{"anyOf":[{"$ref":"#/components/schemas/ConnectionTest"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","adapter","displayName","region","stream","config","capabilities","authorizedSenders","quotas","concurrency","state","readiness","secret","oauth","lastTest","revision","createdAt","updatedAt"],"additionalProperties":false},"EndpointQuotas":{"type":"object","properties":{"perMinute":{"type":"integer","minimum":1,"maximum":10000000},"perHour":{"type":"integer","minimum":1,"maximum":100000000},"perDay":{"type":"integer","minimum":1,"maximum":1000000000}},"additionalProperties":false},"EndpointState":{"type":"string","enum":["draft","testing","ready","degraded","needs_reauthorization","disabled"]},"EndpointReadiness":{"type":"object","properties":{"ready":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}},"invalidatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["ready","reasons","invalidatedAt"],"additionalProperties":false},"SecretSummary":{"type":"object","properties":{"configured":{"type":"boolean"},"version":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/SecretStatus"},{"type":"null"}]},"rotatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["configured","version","status","rotatedAt"],"additionalProperties":false,"description":"What is known about the credential WITHOUT revealing it."},"SecretStatus":{"type":"string","enum":["active","rotating","revoked"]},"ConnectionTest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"endpointId":{"$ref":"#/components/schemas/Uuid"},"level":{"$ref":"#/components/schemas/ConnectionTestLevel"},"status":{"$ref":"#/components/schemas/ConnectionTestStatus"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionTestStep"}},"credentialVersion":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"endpointRevision":{"$ref":"#/components/schemas/Revision"},"readinessEvidence":{"type":"boolean"},"requestedAt":{"$ref":"#/components/schemas/IsoDateTime"},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"finishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","endpointId","level","status","steps","credentialVersion","endpointRevision","readinessEvidence","requestedAt","startedAt","finishedAt"],"additionalProperties":false},"ConnectionTestLevel":{"type":"string","enum":["connectivity","authentication","send_test"],"description":"connectivity = up to capability; authentication = + auth; send_test = + allowlisted message + downstream evidence."},"ConnectionTestStatus":{"type":"string","enum":["queued","running","passed","failed"]},"ConnectionTestStep":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/ConnectionTestStepName"},"status":{"$ref":"#/components/schemas/ConnectionStepStatus"},"detail":{"type":"string","maxLength":1000},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"type":"string"}}]}}},"required":["name","status","detail","durationMs"],"additionalProperties":false},"ConnectionTestStepName":{"type":"string","enum":["parse_egress","dns","tcp","tls","capability","authentication","test_message","downstream_event"]},"ConnectionStepStatus":{"type":"string","enum":["passed","failed","skipped","not_applicable"]},"CreateSendingEndpointInput":{"oneOf":[{"type":"object","properties":{"adapter":{"type":"string","const":"smtp"},"displayName":{"type":"string","minLength":1,"maxLength":120},"stream":{"default":"marketing","$ref":"#/components/schemas/Stream"},"authorizedSenders":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":320,"pattern":"^[^\\s@]+@[a-z0-9.-]+\\.[a-z0-9-]+$"},"description":"Sender addresses (or `*@domain`) this endpoint may send for; they must also be verified sender identities."},"quotas":{"default":{},"$ref":"#/components/schemas/EndpointQuotas"},"concurrency":{"default":1,"type":"integer","minimum":1,"maximum":500},"config":{"$ref":"#/components/schemas/SmtpEndpointConfig"},"secret":{"$ref":"#/components/schemas/SmtpSecretInput"},"oauthTokens":{"$ref":"#/components/schemas/SuppliedOAuthTokens"}},"required":["adapter","displayName","config"],"additionalProperties":false},{"type":"object","properties":{"adapter":{"type":"string","const":"ses"},"displayName":{"type":"string","minLength":1,"maxLength":120},"stream":{"default":"marketing","$ref":"#/components/schemas/Stream"},"authorizedSenders":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":320,"pattern":"^[^\\s@]+@[a-z0-9.-]+\\.[a-z0-9-]+$"},"description":"Sender addresses (or `*@domain`) this endpoint may send for; they must also be verified sender identities."},"quotas":{"default":{},"$ref":"#/components/schemas/EndpointQuotas"},"concurrency":{"default":1,"type":"integer","minimum":1,"maximum":500},"config":{"$ref":"#/components/schemas/SesEndpointConfig"},"secret":{"$ref":"#/components/schemas/SesSecretInput"}},"required":["adapter","displayName","config"],"additionalProperties":false},{"type":"object","properties":{"adapter":{"type":"string","const":"kumomta"},"displayName":{"type":"string","minLength":1,"maxLength":120},"stream":{"default":"marketing","$ref":"#/components/schemas/Stream"},"authorizedSenders":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":320,"pattern":"^[^\\s@]+@[a-z0-9.-]+\\.[a-z0-9-]+$"},"description":"Sender addresses (or `*@domain`) this endpoint may send for; they must also be verified sender identities."},"quotas":{"default":{},"$ref":"#/components/schemas/EndpointQuotas"},"concurrency":{"default":1,"type":"integer","minimum":1,"maximum":500},"config":{"$ref":"#/components/schemas/KumoEndpointConfig"}},"required":["adapter","displayName","config"],"additionalProperties":false},{"type":"object","properties":{"adapter":{"type":"string","const":"sink"},"displayName":{"type":"string","minLength":1,"maxLength":120},"stream":{"default":"marketing","$ref":"#/components/schemas/Stream"},"authorizedSenders":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":320,"pattern":"^[^\\s@]+@[a-z0-9.-]+\\.[a-z0-9-]+$"},"description":"Sender addresses (or `*@domain`) this endpoint may send for; they must also be verified sender identities."},"quotas":{"default":{},"$ref":"#/components/schemas/EndpointQuotas"},"concurrency":{"default":1,"type":"integer","minimum":1,"maximum":500},"config":{"default":{},"$ref":"#/components/schemas/SinkEndpointConfig"}},"required":["adapter","displayName"],"additionalProperties":false},{"type":"object","properties":{"adapter":{"type":"string","const":"sendgrid"},"displayName":{"type":"string","minLength":1,"maxLength":120},"stream":{"default":"marketing","$ref":"#/components/schemas/Stream"},"authorizedSenders":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":320,"pattern":"^[^\\s@]+@[a-z0-9.-]+\\.[a-z0-9-]+$"},"description":"Sender addresses (or `*@domain`) this endpoint may send for; they must also be verified sender identities."},"quotas":{"default":{},"$ref":"#/components/schemas/EndpointQuotas"},"concurrency":{"default":1,"type":"integer","minimum":1,"maximum":500},"config":{"$ref":"#/components/schemas/SendGridEndpointConfig"},"secret":{"$ref":"#/components/schemas/SendGridSecretInput"}},"required":["adapter","displayName","config"],"additionalProperties":false}]},"SmtpEndpointConfig":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":260,"description":"Hostname, IPv4 or IPv6 literal (bracketed or not)."},"port":{"type":"integer","minimum":1,"maximum":65535},"tlsMode":{"$ref":"#/components/schemas/TlsMode"},"tlsServerName":{"type":"string","minLength":1,"maxLength":253},"username":{"type":"string","minLength":1,"maxLength":256},"authMechanism":{"default":"plain","$ref":"#/components/schemas/SmtpAuthMechanism"},"oauthProvider":{"type":"string","enum":["google","microsoft"]},"heloName":{"type":"string","minLength":1,"maxLength":253}},"required":["host","port","tlsMode"],"additionalProperties":false},"TlsMode":{"type":"string","enum":["implicit","starttls_required"],"description":"There is deliberately no 'none': certificate validation is never disabled (§9)."},"SmtpAuthMechanism":{"type":"string","enum":["plain","login","xoauth2","none"]},"SmtpSecretInput":{"type":"object","properties":{"password":{"type":"string","maxLength":1024}},"additionalProperties":false},"SuppliedOAuthTokens":{"type":"object","properties":{"refreshToken":{"type":"string","minLength":8,"maxLength":4096},"accessToken":{"type":"string","minLength":8,"maxLength":8192},"expiresIn":{"type":"integer","minimum":60,"maximum":86400}},"required":["refreshToken"],"additionalProperties":false},"SesEndpointConfig":{"type":"object","properties":{"awsRegion":{"type":"string","enum":["eu-west-1","eu-west-3","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-2","us-east-1","us-east-2","us-west-1","us-west-2","ca-central-1","ca-west-1","ap-southeast-1"]},"configurationSetName":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"dedicatedIpPool":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"snsTopicArn":{"type":"string","pattern":"^arn:aws(-cn|-us-gov)?:sns:[a-z0-9-]+:\\d{12}:[A-Za-z0-9_-]{1,256}$"}},"required":["awsRegion"],"additionalProperties":false},"SesSecretInput":{"type":"object","properties":{"accessKeyId":{"type":"string","maxLength":128},"secretAccessKey":{"type":"string","maxLength":256},"sessionToken":{"type":"string","maxLength":4096}},"additionalProperties":false},"KumoEndpointConfig":{"type":"object","properties":{"egressPool":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,62}$"}},"required":["egressPool"],"additionalProperties":false},"SinkEndpointConfig":{"type":"object","properties":{},"additionalProperties":false},"SendGridEndpointConfig":{"type":"object","properties":{"region":{"default":"global","type":"string","enum":["global","eu"]},"ipPoolName":{"type":"string","pattern":"^[A-Za-z0-9._-]{2,64}$"},"eventWebhookPublicKey":{"type":"string","pattern":"^[A-Za-z0-9+/]{80,400}={0,2}$"}},"additionalProperties":false},"SendGridSecretInput":{"type":"object","properties":{"apiKey":{"type":"string","maxLength":512}},"additionalProperties":false},"UpdateSendingEndpointInput":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":120},"stream":{"$ref":"#/components/schemas/Stream"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authorizedSenders":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":320,"pattern":"^[^\\s@]+@[a-z0-9.-]+\\.[a-z0-9-]+$"},"description":"Sender addresses (or `*@domain`) this endpoint may send for; they must also be verified sender identities."},"quotas":{"$ref":"#/components/schemas/EndpointQuotas"},"concurrency":{"type":"integer","minimum":1,"maximum":500},"state":{"type":"string","enum":["disabled","draft"]},"secret":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":4096}},"oauthTokens":{"$ref":"#/components/schemas/SuppliedOAuthTokens"}},"additionalProperties":false},"ReplaceEndpointSecretInput":{"type":"object","properties":{"secret":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":4096}},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["secret"],"additionalProperties":false},"RunConnectionTestInput":{"type":"object","properties":{"level":{"default":"authentication","$ref":"#/components/schemas/ConnectionTestLevel"},"seedRecipient":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"additionalProperties":false},"ConnectionTestPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionTest"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"DomainIdentityPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DomainIdentity"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"DomainIdentity":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"verificationStatus":{"$ref":"#/components/schemas/DomainVerificationStatus"},"ownershipRecord":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","const":"TXT"},"value":{"type":"string"}},"required":["name","type","value"],"additionalProperties":false},"dkimSelector":{"type":["string","null"]},"dkimSigning":{"$ref":"#/components/schemas/DkimSigning"},"returnPathDomain":{"type":["string","null"]},"trackingDomain":{"type":["string","null"]},"report":{"anyOf":[{"$ref":"#/components/schemas/DomainCheckReport"},{"type":"null"}]},"managed":{"anyOf":[{"$ref":"#/components/schemas/ManagedDomainSetup"},{"type":"null"}]},"platformSigned":{"type":"boolean"},"verification":{"$ref":"#/components/schemas/DomainVerificationState"},"dnsHost":{"anyOf":[{"$ref":"#/components/schemas/DetectedDnsHost"},{"type":"null"}]},"domainConnect":{"anyOf":[{"$ref":"#/components/schemas/DomainConnectState"},{"type":"null"}]},"mtaSts":{"anyOf":[{"$ref":"#/components/schemas/HostedMtaSts"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","domain","verificationStatus","ownershipRecord","dkimSelector","dkimSigning","returnPathDomain","trackingDomain","report","managed","verification","dnsHost","domainConnect","mtaSts","verifiedAt","lastCheckedAt","revision","createdAt","updatedAt"],"additionalProperties":false},"DomainVerificationStatus":{"type":"string","enum":["pending","verified","failed","revoked"]},"DkimSigning":{"type":"string","enum":["customer_domain","provider_domain"],"description":"Whose d= signs this domain's mail. A provider signature alone is NOT aligned with the From domain (AT-052)."},"DomainCheckReport":{"type":"object","properties":{"checkedAt":{"$ref":"#/components/schemas/IsoDateTime"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/DomainCheck"}},"readyForSending":{"type":"boolean"},"evidenceNote":{"type":"string"}},"required":["checkedAt","checks","readyForSending","evidenceNote"],"additionalProperties":false},"DomainCheck":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/DomainCheckName"},"status":{"$ref":"#/components/schemas/DomainCheckStatus"},"required":{"type":"boolean"},"summary":{"type":"string","maxLength":1000},"summaryCode":{"type":"string","maxLength":64},"summaryParams":{"$ref":"#/components/schemas/MessageParams"},"queried":{"type":"array","items":{"type":"string"}},"observed":{"type":"array","items":{"type":"string"}},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"type":"string"}}]}}},"required":["name","status","required","summary","queried","observed"],"additionalProperties":false},"DomainCheckName":{"type":"string","enum":["ownership","spf","dkim","dmarc","alignment","return_path","tracking","egress_dns","mta_sts","tls_rpt"]},"DomainCheckStatus":{"type":"string","enum":["pass","fail","warn","not_configured"]},"ManagedDomainSetup":{"type":"object","properties":{"selector":{"type":"string"},"records":{"minItems":3,"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/ManagedDnsRecord"}},"signingActive":{"type":"boolean"},"returnPathActive":{"type":"boolean"}},"required":["selector","records","signingActive","returnPathActive"],"additionalProperties":false,"description":"The three DNS records of a managed domain (ADR 0046) and what they enable."},"ManagedDnsRecord":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/ManagedRecordKey"},"type":{"type":"string","enum":["TXT","CNAME"]},"name":{"type":"string"},"value":{"type":"string"},"purpose":{"type":"string"},"state":{"$ref":"#/components/schemas/ManagedRecordState"},"observed":{"type":"array","items":{"type":"string"}},"detail":{"type":["string","null"]}},"required":["key","type","name","value","purpose","state","observed","detail"],"additionalProperties":false},"ManagedRecordKey":{"type":"string","enum":["dkim","return_path","dmarc"]},"ManagedRecordState":{"type":"string","enum":["pending","verified","mismatch","unknown"]},"DomainVerificationState":{"type":"object","properties":{"ready":{"type":"boolean"},"readySince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"nextCheckAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastCheckTrigger":{"anyOf":[{"$ref":"#/components/schemas/DomainCheckTrigger"},{"type":"null"}]}},"required":["ready","readySince","nextCheckAt","lastCheckTrigger"],"additionalProperties":false},"DomainCheckTrigger":{"type":"string","enum":["schedule","manual"]},"DetectedDnsHost":{"type":"object","properties":{"host":{"$ref":"#/components/schemas/DnsHostId"},"zone":{"type":"string"},"nameservers":{"type":"array","items":{"type":"string"}},"detectedAt":{"type":"string"}},"required":["host","zone","nameservers","detectedAt"],"additionalProperties":false},"DnsHostId":{"type":"string","enum":["cloudflare","ovh","godaddy","ionos","gandi","google","route53","namecheap","generic"],"description":"The company hosting a domain's DNS, detected from its NS records (ADR 0046 §4)."},"DomainConnectState":{"type":"object","properties":{"enabled":{"type":"boolean"},"support":{"$ref":"#/components/schemas/DomainConnectSupport"},"providerName":{"type":["string","null"]},"available":{"type":"boolean"},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"discoveredAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["enabled","support","providerName","available","startedAt","discoveredAt"],"additionalProperties":false,"description":"One-click publishing of the managed records at the customer's DNS host (Domain Connect, ADR 0072)."},"DomainConnectSupport":{"type":"string","enum":["supported","template_missing","not_supported","unknown"]},"HostedMtaSts":{"type":"object","properties":{"enabled":{"type":"boolean"},"mode":{"$ref":"#/components/schemas/MtaStsMode"},"maxAge":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"policyId":{"type":["string","null"]},"policy":{"type":["string","null"]},"mxHosts":{"type":"array","items":{"type":"string"}},"records":{"minItems":3,"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/HostedMtaStsRecord"}},"certificate":{"$ref":"#/components/schemas/HostedMtaStsCertificate"},"certificateCode":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"served":{"type":"boolean"},"mxProbes":{"type":"array","items":{"$ref":"#/components/schemas/MxTlsProbe"}},"enforceReady":{"type":"boolean"},"checkedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["enabled","mode","maxAge","policyId","policy","mxHosts","records","certificate","certificateCode","served","mxProbes","enforceReady","checkedAt"],"additionalProperties":false,"description":"Hosted MTA-STS + TLS-RPT of a managed domain (ADR 0092): records to publish, policy, certificate, MX TLS."},"MtaStsMode":{"type":"string","enum":["testing","enforce"],"description":"`testing`: failures are only reported (TLS-RPT); `enforce`: senders refuse to deliver without a valid certificate on a listed MX."},"HostedMtaStsRecord":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/HostedMtaStsRecordKey"},"type":{"type":"string","enum":["TXT","CNAME"]},"name":{"type":"string"},"value":{"type":"string"},"state":{"$ref":"#/components/schemas/ManagedRecordState"},"observed":{"type":"array","items":{"type":"string"}},"detailCode":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["key","type","name","value","state","observed","detailCode"],"additionalProperties":false},"HostedMtaStsRecordKey":{"type":"string","enum":["policy_host","policy_txt","tls_rpt"]},"HostedMtaStsCertificate":{"type":"string","enum":["not_requested","pending","active","failed","unavailable"]},"MxTlsProbe":{"type":"object","properties":{"host":{"type":"string"},"outcome":{"type":"string","maxLength":80},"ok":{"type":"boolean"},"subject":{"type":["string","null"]},"validTo":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["host","outcome","ok","subject","validTo"],"additionalProperties":false},"CreateDomainInput":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/DomainName"},"managed":{"type":"boolean"},"dkimSelector":{"type":"string","maxLength":120,"pattern":"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"},"dkimSigning":{"default":"customer_domain","$ref":"#/components/schemas/DkimSigning"},"returnPathDomain":{"$ref":"#/components/schemas/DomainName"},"trackingDomain":{"$ref":"#/components/schemas/DomainName"}},"required":["domain"],"additionalProperties":false},"DomainName":{"description":"Domain name; stored as lowercase IDNA ASCII.","type":"string","minLength":3,"maxLength":253},"UpdateDomainInput":{"type":"object","properties":{"dkimSelector":{"anyOf":[{"type":"string","maxLength":120,"pattern":"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$"},{"type":"null"}]},"dkimSigning":{"$ref":"#/components/schemas/DkimSigning"},"returnPathDomain":{"anyOf":[{"$ref":"#/components/schemas/DomainName"},{"type":"null"}]},"trackingDomain":{"anyOf":[{"$ref":"#/components/schemas/DomainName"},{"type":"null"}]}},"additionalProperties":false},"DomainDeletionImpact":{"type":"object","properties":{"domainId":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"deletable":{"type":"boolean"},"blockers":{"type":"array","items":{"$ref":"#/components/schemas/DomainDeletionBlocker"}},"senders":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"fromAddress":{"type":"string"}},"required":["id","fromAddress"],"additionalProperties":false}},"draftCampaigns":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"keepsHistory":{"type":"boolean"},"destroysManagedKey":{"type":"boolean"},"truncated":{"type":"boolean"}},"required":["domainId","domain","deletable","blockers","senders","draftCampaigns","keepsHistory","destroysManagedKey","truncated"],"additionalProperties":false},"DomainDeletionBlocker":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/DomainDeletionBlockerKind"},"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"state":{"type":"string"}},"required":["kind","id","name","state"],"additionalProperties":false},"DomainDeletionBlockerKind":{"type":"string","enum":["campaign","journey","transactional_template","landing_page"]},"VerifyDomainInput":{"type":"object","properties":{"checks":{"description":"Subset to run; all by default. Ownership always runs.","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/DomainCheckName"}}},"additionalProperties":false},"UpdateHostedMtaStsInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"mode":{"$ref":"#/components/schemas/MtaStsMode"}},"required":["enabled"],"additionalProperties":false},"DomainHealthOverview":{"type":"object","properties":{"domainId":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"latest":{"anyOf":[{"$ref":"#/components/schemas/DomainHealthReport"},{"type":"null"}]},"history":{"type":"array","items":{"$ref":"#/components/schemas/DomainHealthHistoryPoint"}},"weights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["domainId","domain","latest","history","weights"],"additionalProperties":false},"DomainHealthReport":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"domainId":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"checkedAt":{"$ref":"#/components/schemas/IsoDateTime"},"trigger":{"type":"string","enum":["schedule","manual"]},"score":{"type":"integer","minimum":0,"maximum":100},"grade":{"$ref":"#/components/schemas/DomainHealthGrade"},"earned":{"type":"number"},"possible":{"type":"number"},"capped":{"type":"boolean"},"provider":{"$ref":"#/components/schemas/DomainMailProvider"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/DomainHealthCheck"}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/DomainHealthFinding"}},"regression":{"type":"array","items":{"type":"string","enum":["grade","score","critical"]}}},"required":["id","domainId","domain","checkedAt","trigger","score","grade","earned","possible","capped","provider","checks","findings","regression"],"additionalProperties":false},"DomainHealthGrade":{"type":"string","enum":["A","B","C","D","F"]},"DomainMailProvider":{"type":"string","enum":["microsoft365","google_workspace","arenf","zoho","ovh","ionos","proton","fastmail","yahoo","other","none"]},"DomainHealthCheck":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/DomainHealthCheckKey"},"status":{"$ref":"#/components/schemas/DomainHealthStatus"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"earned":{"type":["number","null"]},"summaryCode":{"type":"string","maxLength":64},"summaryParams":{"$ref":"#/components/schemas/MessageParams"},"summary":{"type":"string","maxLength":1000},"observed":{"maxItems":40,"type":"array","items":{"type":"string","maxLength":1000}}},"required":["key","status","weight","earned","summaryCode","summaryParams","summary","observed"],"additionalProperties":false},"DomainHealthCheckKey":{"type":"string","enum":["spf","dkim","dmarc","mx","mx_tls","mta_sts","tls_rpt","dnssec","caa","bimi","reverse_dns","blocklists","domain_age"]},"DomainHealthStatus":{"type":"string","enum":["pass","warn","fail","unavailable","not_applicable"]},"DomainHealthFinding":{"type":"object","properties":{"check":{"$ref":"#/components/schemas/DomainHealthCheckKey"},"code":{"type":"string","maxLength":64},"severity":{"$ref":"#/components/schemas/DomainHealthSeverity"},"params":{"$ref":"#/components/schemas/MessageParams"},"message":{"type":"string","maxLength":1000},"fix":{"type":"string","maxLength":1000}},"required":["check","code","severity","params","message","fix"],"additionalProperties":false},"DomainHealthSeverity":{"type":"string","enum":["critical","high","medium","low","info"]},"DomainHealthHistoryPoint":{"type":"object","properties":{"checkedAt":{"$ref":"#/components/schemas/IsoDateTime"},"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grade":{"$ref":"#/components/schemas/DomainHealthGrade"}},"required":["checkedAt","score","grade"],"additionalProperties":false},"DomainConnectStart":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"width":{"type":"integer","minimum":200,"maximum":2000},"height":{"type":"integer","minimum":200,"maximum":2000},"providerName":{"type":["string","null"]},"groups":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/DomainConnectGroup"}},"includesDmarc":{"type":"boolean"}},"required":["url","width","height","providerName","groups","includesDmarc"],"additionalProperties":false},"DomainConnectGroup":{"type":"string","enum":["sending","dmarc"]},"StartDomainConnectInput":{"type":"object","properties":{},"additionalProperties":false},"DnsConnection":{"type":"object","properties":{"eligible":{"type":"boolean"},"zone":{"type":["string","null"]},"tokenTemplateUrl":{"type":"string","format":"uri"},"connection":{"anyOf":[{"$ref":"#/components/schemas/DnsConnectionDetails"},{"type":"null"}]}},"required":["eligible","zone","tokenTemplateUrl","connection"],"additionalProperties":false},"DnsConnectionDetails":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/DnsConnectProvider"},"zone":{"type":"string"},"tokenHint":{"type":"string"},"status":{"$ref":"#/components/schemas/DnsConnectionStatus"},"autoPublish":{"type":"boolean"},"connectedAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastPublish":{"anyOf":[{"$ref":"#/components/schemas/DnsPublishSummary"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["provider","zone","tokenHint","status","autoPublish","connectedAt","lastPublish","revision"],"additionalProperties":false},"DnsConnectProvider":{"type":"string","enum":["cloudflare"]},"DnsConnectionStatus":{"type":"string","enum":["active","needs_reauthorization"]},"DnsPublishSummary":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/IsoDateTime"},"trigger":{"type":"string","enum":["person","automatic"]},"written":{"type":"integer","minimum":0,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":0,"maximum":9007199254740991},"conflicts":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["at","trigger","written","unchanged","conflicts","failed"],"additionalProperties":false},"ConnectDnsProviderInput":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/DnsConnectProvider"},"token":{"type":"string","minLength":20,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["provider","token"],"additionalProperties":false},"UpdateDnsConnectionInput":{"type":"object","properties":{"autoPublish":{"type":"boolean"}},"required":["autoPublish"],"additionalProperties":false},"DnsPublishPlan":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/DnsConnectProvider"},"zone":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/DnsPublishItem"}},"fingerprint":{"type":"string"},"hasChanges":{"type":"boolean"},"computedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["provider","zone","items","fingerprint","hasChanges","computedAt"],"additionalProperties":false},"DnsPublishItem":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/DnsPublishRecordKey"},"type":{"type":"string","enum":["TXT","CNAME"]},"name":{"type":"string"},"action":{"$ref":"#/components/schemas/DnsPublishAction"},"current":{"type":["string","null"]},"value":{"type":"string"},"conflict":{"anyOf":[{"$ref":"#/components/schemas/DnsPublishConflict"},{"type":"null"}]}},"required":["key","type","name","action","current","value","conflict"],"additionalProperties":false},"DnsPublishRecordKey":{"type":"string","enum":["dkim","return_path","dmarc","policy_host","policy_txt","tls_rpt"]},"DnsPublishAction":{"type":"string","enum":["create","replace","merge","unchanged","conflict"]},"DnsPublishConflict":{"type":"string","enum":["multiple","other_type"]},"PreviewDnsPublishInput":{"type":"object","properties":{},"additionalProperties":false},"DnsPublishResult":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/DnsConnectProvider"},"zone":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/DnsPublishResultItem"}},"summary":{"$ref":"#/components/schemas/DnsPublishSummary"},"rechecked":{"type":"boolean"}},"required":["provider","zone","items","summary","rechecked"],"additionalProperties":false},"DnsPublishResultItem":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/DnsPublishRecordKey"},"type":{"type":"string","enum":["TXT","CNAME"]},"name":{"type":"string"},"action":{"$ref":"#/components/schemas/DnsPublishAction"},"current":{"type":["string","null"]},"value":{"type":"string"},"conflict":{"anyOf":[{"$ref":"#/components/schemas/DnsPublishConflict"},{"type":"null"}]},"outcome":{"$ref":"#/components/schemas/DnsPublishOutcome"},"errorCode":{"type":["string","null"]}},"required":["key","type","name","action","current","value","conflict","outcome","errorCode"],"additionalProperties":false},"DnsPublishOutcome":{"type":"string","enum":["created","replaced","merged","unchanged","conflict","failed"]},"PublishDnsRecordsInput":{"type":"object","properties":{"fingerprint":{"type":"string","minLength":1,"maxLength":200}},"required":["fingerprint"],"additionalProperties":false},"DomainDmarcSummary":{"type":"object","properties":{"domainId":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"windowDays":{"type":"integer","minimum":1,"maximum":9007199254740991},"reports":{"type":"integer","minimum":0,"maximum":9007199254740991},"reportsTotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"reporters":{"type":"array","items":{"type":"string"}},"messages":{"type":"integer","minimum":0,"maximum":9007199254740991},"alignedPass":{"type":"integer","minimum":0,"maximum":9007199254740991},"alignedPassRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"platformMessages":{"type":"integer","minimum":0,"maximum":9007199254740991},"otherMessages":{"type":"integer","minimum":0,"maximum":9007199254740991},"disposition":{"type":"object","properties":{"none":{"type":"integer","minimum":0,"maximum":9007199254740991},"quarantine":{"type":"integer","minimum":0,"maximum":9007199254740991},"reject":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["none","quarantine","reject"],"additionalProperties":false},"otherSources":{"type":"array","items":{"$ref":"#/components/schemas/DmarcSourceSummary"}},"otherSourcesTotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastReportAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastPeriodEnd":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"reportedPolicy":{"anyOf":[{"$ref":"#/components/schemas/DmarcPolicy"},{"type":"null"}]},"advice":{"$ref":"#/components/schemas/DmarcAdvice"},"thresholds":{"type":"object","properties":{"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysAtPolicy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minAlignedPassRate":{"type":"number"},"minMessages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurringSourceDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["windowDays","daysAtPolicy","minAlignedPassRate","minMessages","recurringSourceDays"],"additionalProperties":false}},"required":["domainId","domain","windowDays","reports","reportsTotal","reporters","messages","alignedPass","alignedPassRate","platformMessages","otherMessages","disposition","otherSources","otherSourcesTotal","lastReportAt","lastPeriodEnd","reportedPolicy","advice","thresholds"],"additionalProperties":false,"description":"What the DMARC aggregate reports say about a managed domain, and the next policy step (ADR 0046 §5)."},"DmarcSourceSummary":{"type":"object","properties":{"sourceIp":{"type":"string"},"messages":{"type":"integer","minimum":0,"maximum":9007199254740991},"alignedPass":{"type":"integer","minimum":0,"maximum":9007199254740991},"failing":{"type":"integer","minimum":0,"maximum":9007199254740991},"days":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastSeen":{"$ref":"#/components/schemas/IsoDateTime"},"headerFrom":{"type":["string","null"]},"blocking":{"type":"boolean"}},"required":["sourceIp","messages","alignedPass","failing","days","lastSeen","headerFrom","blocking"],"additionalProperties":false},"DmarcPolicy":{"type":"string","enum":["none","quarantine","reject"]},"DmarcAdvice":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/DmarcAdviceStatus"},"current":{"anyOf":[{"$ref":"#/components/schemas/DmarcPolicy"},{"type":"null"}]},"next":{"anyOf":[{"$ref":"#/components/schemas/DmarcPolicy"},{"type":"null"}]},"daysAtPolicy":{"type":"integer","minimum":0,"maximum":9007199254740991},"daysRequired":{"type":"integer","minimum":0,"maximum":9007199254740991},"eligibleFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"suggestedRecord":{"type":["string","null"]}},"required":["status","current","next","daysAtPolicy","daysRequired","eligibleFrom","suggestedRecord"],"additionalProperties":false,"description":"The next DMARC policy step the reports support (ADR 0046 §5). Never applied by the platform."},"DmarcAdviceStatus":{"type":"string","enum":["no_record","no_reports","collecting","low_volume","below_threshold","unknown_sources","ready","complete"]},"SendingModeSettings":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/SendingMode"},"storedMode":{"$ref":"#/components/schemas/SendingMode"},"managedAvailable":{"type":"boolean"},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"advancedConfiguration":{"$ref":"#/components/schemas/AdvancedConfiguration"}},"required":["mode","storedMode","managedAvailable","revision","updatedAt","advancedConfiguration"],"additionalProperties":false,"description":"Managed (default) or advanced sending (ADR 0046)."},"SendingMode":{"type":"string","enum":["managed","advanced"],"description":"managed = platform sending, three generated DNS records (default); advanced = own endpoints, pools, routing (ADR 0046)."},"AdvancedConfiguration":{"type":"object","properties":{"ownEndpoints":{"type":"integer","minimum":0,"maximum":9007199254740991},"pools":{"type":"integer","minimum":0,"maximum":9007199254740991},"bounceSources":{"type":"integer","minimum":0,"maximum":9007199254740991},"customerEgressIps":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["ownEndpoints","pools","bounceSources","customerEgressIps"],"additionalProperties":false},"UpdateSendingModeInput":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/SendingMode"}},"required":["mode"],"additionalProperties":false},"KumoSigningDomain":{"type":"object","properties":{"domain":{"type":"string"},"selector":{"type":"string"},"privateKeyPem":{"type":"string"},"returnPathDomain":{"type":["string","null"]}},"required":["domain","selector","privateKeyPem","returnPathDomain"],"additionalProperties":false,"description":"Internal: what KumoMTA needs to sign a managed domain's mail (ADR 0046 §3)."},"KumoWarmup":{"type":"object","properties":{"sources":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"google":{"type":"integer","minimum":0,"maximum":9007199254740991},"yahoo":{"type":"integer","minimum":0,"maximum":9007199254740991},"microsoft":{"type":"integer","minimum":0,"maximum":9007199254740991},"other":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["google","yahoo","microsoft","other"],"additionalProperties":false}},"generatedAt":{"type":"string"}},"required":["sources","generatedAt"],"additionalProperties":false,"description":"Internal: the warm-up stage of every platform sending IP per provider group, decided by the product (ADR 0063)."},"StarterAddress":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/StarterAddressState"},"suggestion":{"type":["string","null"]},"slug":{"type":["string","null"]},"starterDomain":{"type":["string","null"]},"domain":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"fromName":{"type":["string","null"]},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"address":{"type":"string"},"verifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"confirmationSentAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["address","verifiedAt","confirmationSentAt"],"additionalProperties":false},{"type":"null"}]},"blockedReason":{"anyOf":[{"$ref":"#/components/schemas/StarterBlockedReason"},{"type":"null"}]},"limits":{"type":"object","properties":{"perDay":{"type":"integer","minimum":1,"maximum":9007199254740991},"perMonth":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["perDay","perMonth"],"additionalProperties":false},"suspendedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"suspendedReason":{"type":["string","null"]},"revision":{"anyOf":[{"$ref":"#/components/schemas/Revision"},{"type":"null"}]},"createdAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["state","suggestion","slug","starterDomain","domain","fromAddress","fromName","senderIdentityId","replyTo","blockedReason","limits","suspendedAt","suspendedReason","revision","createdAt"],"additionalProperties":false,"description":"The workspace's shared starter sending address (ADR 0050 §1)."},"StarterAddressState":{"type":"string","enum":["unavailable","not_claimed","active","suspended"]},"StarterBlockedReason":{"type":"string","enum":["reply_to_unverified","suspended","review_pending"]},"StarterSlugCheck":{"type":"object","properties":{"slug":{"type":"string"},"available":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["length","characters","reserved","brand","taken"]},{"type":"null"}]},"detail":{"type":["string","null"]},"domain":{"type":["string","null"]}},"required":["slug","available","reason","detail","domain"],"additionalProperties":false},"ClaimStarterAddressInput":{"type":"object","properties":{"slug":{"type":"string"},"localPart":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$"},"fromName":{"type":"string","minLength":1,"maxLength":200},"replyTo":{"type":"string","minLength":3,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["slug","replyTo"],"additionalProperties":false},"SetStarterReplyToInput":{"type":"object","properties":{"replyTo":{"type":"string","minLength":3,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["replyTo"],"additionalProperties":false},"StarterReplyToConfirmation":{"type":"object","properties":{"address":{"type":"string"},"fromAddress":{"type":"string"},"confirmedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["address","fromAddress","confirmedAt"],"additionalProperties":false},"ConfirmStarterReplyToInput":{"type":"object","properties":{"token":{"type":"string","pattern":"^[A-Za-z0-9_-]{20,128}$"}},"required":["token"],"additionalProperties":false},"SenderIdentityPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SenderIdentity"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"SenderIdentity":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"domainIdentityId":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"fromAddress":{"type":"string"},"fromName":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"verifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"readiness":{"$ref":"#/components/schemas/SenderReadiness"},"starter":{"type":"boolean"},"replyMailbox":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"address":{"type":"string"}},"required":["id","address"],"additionalProperties":false},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","domainIdentityId","domain","fromAddress","fromName","replyTo","verifiedAt","readiness","revision","createdAt","updatedAt"],"additionalProperties":false},"SenderReadiness":{"type":"object","properties":{"ready":{"type":"boolean"},"failing":{"type":"array","items":{"$ref":"#/components/schemas/DomainCheckName"}},"note":{"type":"string"},"starterBlockedReason":{"anyOf":[{"$ref":"#/components/schemas/StarterBlockedReason"},{"type":"null"}]}},"required":["ready","failing","note"],"additionalProperties":false},"CreateSenderIdentityInput":{"type":"object","properties":{"fromAddress":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"fromName":{"type":"string","minLength":1,"maxLength":200},"replyTo":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["fromAddress"],"additionalProperties":false},"UpdateSenderIdentityInput":{"type":"object","properties":{"fromAddress":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"fromName":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},{"type":"null"}]}},"additionalProperties":false},"EgressIpPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EgressIp"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"EgressIp":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"address":{"type":"string"},"heloName":{"type":["string","null"]},"controlledBy":{"$ref":"#/components/schemas/EgressIpController"},"ptrVerifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","address","heloName","controlledBy","ptrVerifiedAt","quarantinedAt","createdAt"],"additionalProperties":false},"EgressIpController":{"type":"string","enum":["platform_mta","customer_mta"]},"CreateEgressIpInput":{"type":"object","properties":{"address":{"type":"string"},"heloName":{"type":"string","minLength":1,"maxLength":253}},"required":["address"],"additionalProperties":false,"description":"A customer-controlled MTA's egress IP (platform IPs are assigned by the platform)."},"PoolPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Pool"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Pool":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/PoolKind"},"name":{"type":"string"},"strategy":{"$ref":"#/components/schemas/RoutingStrategy"},"stream":{"$ref":"#/components/schemas/Stream"},"region":{"$ref":"#/components/schemas/Region"},"constraints":{"$ref":"#/components/schemas/PoolConstraints"},"members":{"type":"array","items":{"$ref":"#/components/schemas/PoolMember"}},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","kind","name","strategy","stream","region","constraints","members","revision","createdAt","updatedAt"],"additionalProperties":false},"PoolKind":{"type":"string","enum":["server","egress_ip"],"description":"Server pools and recipient-facing egress IP pools are distinct objects (§10, invariant 8)."},"RoutingStrategy":{"type":"string","enum":["weighted_round_robin","sticky","priority_failover","least_cost","experiment"]},"PoolConstraints":{"type":"object","properties":{"egressIpPoolId":{"$ref":"#/components/schemas/Uuid"},"fixedEgressIpId":{"$ref":"#/components/schemas/Uuid"},"dailyCeiling":{"type":"integer","minimum":1,"maximum":1000000000},"brand":{"type":"string","minLength":1,"maxLength":120}},"additionalProperties":false},"PoolMember":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"endpointId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"egressIpId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"label":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limits":{"$ref":"#/components/schemas/PoolMemberLimits"},"enabled":{"type":"boolean"},"egressControl":{"type":["string","null"]},"memberState":{"type":["string","null"]}},"required":["id","endpointId","egressIpId","label","weight","limits","enabled","egressControl","memberState"],"additionalProperties":false},"PoolMemberLimits":{"type":"object","properties":{"dailyCeiling":{"type":"integer","minimum":1,"maximum":1000000000},"hourlyCeiling":{"type":"integer","minimum":1,"maximum":100000000},"maxConcurrency":{"type":"integer","minimum":1,"maximum":500}},"additionalProperties":false},"CreatePoolInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/PoolKind"},"name":{"type":"string","minLength":1,"maxLength":120},"strategy":{"default":"weighted_round_robin","$ref":"#/components/schemas/RoutingStrategy"},"stream":{"default":"marketing","$ref":"#/components/schemas/Stream"},"constraints":{"default":{},"$ref":"#/components/schemas/PoolConstraints"},"members":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"endpointId":{"$ref":"#/components/schemas/Uuid"},"egressIpId":{"$ref":"#/components/schemas/Uuid"},"weight":{"default":1,"type":"integer","minimum":0,"maximum":1000},"limits":{"default":{},"$ref":"#/components/schemas/PoolMemberLimits"},"enabled":{"default":true,"type":"boolean"}},"additionalProperties":false}}},"required":["kind","name"],"additionalProperties":false},"UpdatePoolInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"strategy":{"$ref":"#/components/schemas/RoutingStrategy"},"constraints":{"$ref":"#/components/schemas/PoolConstraints"},"members":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"endpointId":{"$ref":"#/components/schemas/Uuid"},"egressIpId":{"$ref":"#/components/schemas/Uuid"},"weight":{"default":1,"type":"integer","minimum":0,"maximum":1000},"limits":{"default":{},"$ref":"#/components/schemas/PoolMemberLimits"},"enabled":{"default":true,"type":"boolean"}},"additionalProperties":false}}},"additionalProperties":false},"IngestAccepted":{"type":"object","properties":{"ingressId":{"type":"string"},"records":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicate":{"type":"boolean","description":"True when this exact body was already ingested (replay)."}},"required":["ingressId","records","duplicate"],"additionalProperties":false,"description":"Durably recorded; normalization may still be in progress."},"IngestProvider":{"type":"string","enum":["kumomta","sink"]},"EndpointIngestProvider":{"type":"string","enum":["ses","sendgrid"]},"UnsubscribeResult":{"type":"object","properties":{"status":{"type":"string","const":"unsubscribed"},"scope":{"type":"string","const":"workspace_marketing"},"effectiveAt":{"$ref":"#/components/schemas/IsoDateTime"},"alreadyUnsubscribed":{"type":"boolean"}},"required":["status","scope","effectiveAt","alreadyUnsubscribed"],"additionalProperties":false,"description":"Returned only after the suppression is durably committed."},"RecipientPreferences":{"type":"object","properties":{"senderName":{"type":"string","description":"Workspace display name (who the recipient is dealing with)."},"maskedAddress":{"type":"string","description":"e.g. a•••@example.com — never the full address."},"unsubscribed":{"type":"boolean"},"topics":{"type":"array","items":{"type":"object","properties":{"listId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"subscribed":{"type":"boolean"}},"required":["listId","name","subscribed"],"additionalProperties":false}},"tracking":{"type":"object","properties":{"allowed":{"type":"boolean"},"senderTracks":{"type":"boolean"}},"required":["allowed","senderTracks"],"additionalProperties":false}},"required":["senderName","maskedAddress","unsubscribed","topics","tracking"],"additionalProperties":false},"UpdateRecipientPreferencesInput":{"type":"object","properties":{"topics":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"listId":{"$ref":"#/components/schemas/Uuid"},"subscribed":{"type":"boolean"}},"required":["listId","subscribed"]}},"trackingAllowed":{"type":"boolean"},"unsubscribeAll":{"type":"boolean","const":true}},"additionalProperties":false},"CampaignReport":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"trackingMode":{"$ref":"#/components/schemas/TrackingMode"},"view":{"$ref":"#/components/schemas/ReportView"},"freshness":{"type":"object","properties":{"asOf":{"description":"When the report was computed.","$ref":"#/components/schemas/IsoDateTime"},"lastEventReceivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Most recent ingested event of the scope (data freshness)."},"classifierVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Bot/privacy-proxy rule set version of the filtered view."},"realtime":{"type":"boolean","description":"Computed from the event store at request time (no batch lag)."}},"required":["asOf","lastEventReceivedAt","classifierVersion","realtime"],"additionalProperties":false},"delivery":{"type":"object","properties":{"attempted":{"$ref":"#/components/schemas/Metric"},"providerAccepted":{"$ref":"#/components/schemas/Metric"},"reportedDelivered":{"$ref":"#/components/schemas/Metric"},"deferred":{"$ref":"#/components/schemas/Metric"},"bounced":{"$ref":"#/components/schemas/Metric"},"complained":{"$ref":"#/components/schemas/Metric"},"unsubscribed":{"$ref":"#/components/schemas/Metric"},"failed":{"$ref":"#/components/schemas/Metric"}},"required":["attempted","providerAccepted","reportedDelivered","deferred","bounced","complained","unsubscribed","failed"],"additionalProperties":false},"rates":{"type":"object","properties":{"acceptanceRate":{"$ref":"#/components/schemas/Metric"},"reportedDeliveryRate":{"$ref":"#/components/schemas/Metric"},"uniqueHumanClickRate":{"$ref":"#/components/schemas/Metric"},"complaintRate":{"$ref":"#/components/schemas/Metric"}},"required":["acceptanceRate","reportedDeliveryRate","uniqueHumanClickRate","complaintRate"],"additionalProperties":false},"engagement":{"type":"object","properties":{"opens":{"$ref":"#/components/schemas/Metric"},"likelyHumanOpens":{"$ref":"#/components/schemas/Metric"},"totalOpens":{"$ref":"#/components/schemas/Metric"},"privacyProxyOpens":{"$ref":"#/components/schemas/Metric"},"uniqueOpeners":{"$ref":"#/components/schemas/Metric"},"clicks":{"$ref":"#/components/schemas/Metric"},"uniqueClickers":{"$ref":"#/components/schemas/Metric"},"nonHumanClicks":{"$ref":"#/components/schemas/Metric"}},"required":["opens","likelyHumanOpens","totalOpens","privacyProxyOpens","uniqueOpeners","clicks","uniqueClickers","nonHumanClicks"],"additionalProperties":false},"revenue":{"type":"object","properties":{"attributedRevenue":{"$ref":"#/components/schemas/Metric"}},"required":["attributedRevenue"],"additionalProperties":false},"bounces":{"type":"array","items":{"type":"object","properties":{"class":{"$ref":"#/components/schemas/BounceClass"},"messages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["class","messages"],"additionalProperties":false}},"timeline":{"type":"array","items":{"type":"object","properties":{"bucketStart":{"$ref":"#/components/schemas/IsoDateTime"},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"reportedDelivered":{"type":"integer","minimum":0,"maximum":9007199254740991},"bounced":{"type":"integer","minimum":0,"maximum":9007199254740991},"clicks":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Clicks in the selected view; null when tracking is off."}},"required":["bucketStart","accepted","reportedDelivered","bounced","clicks"],"additionalProperties":false}},"openInvestigations":{"type":"integer","minimum":0,"maximum":9007199254740991},"placement":{"$ref":"#/components/schemas/CampaignPlacement"},"replies":{"type":"object","properties":{"received":{"$ref":"#/components/schemas/Metric"},"repliers":{"$ref":"#/components/schemas/Metric"}},"required":["received","repliers"],"additionalProperties":false}},"required":["workspaceId","campaignId","campaignName","campaignState","trackingMode","view","freshness","delivery","rates","engagement","revenue","bounces","timeline","openInvestigations"],"additionalProperties":false},"ReportView":{"type":"string","enum":["raw","filtered"],"description":"raw = every observed event; filtered = after bot/scanner/privacy-proxy classification (human-likely, never 'human')."},"Metric":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["count","rate"]},"status":{"type":"string","enum":["available","unavailable"]},"value":{"type":["number","null"]},"numerator":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"denominator":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"numeratorLabel":{"type":["string","null"]},"denominatorLabel":{"type":["string","null"]},"unavailableReason":{"anyOf":[{"$ref":"#/components/schemas/MetricUnavailableReason"},{"type":"null"}]},"note":{"type":["string","null"]}},"required":["key","label","kind","status","value","numerator","denominator","numeratorLabel","denominatorLabel","unavailableReason","note"],"additionalProperties":false,"description":"A number with its definition, denominator and availability (§14)."},"MetricUnavailableReason":{"type":"string","enum":["tracking_off","tracking_aggregate","tracking_minimal","no_observable_routes","no_delivered_messages","no_attempts","not_configured"]},"BounceClass":{"type":"string","enum":["hard_invalid_recipient","hard_invalid_domain","soft_mailbox_full","soft_transient_network","soft_rate_limited","blocked_policy","authentication_failure","content_rejected","complaint","unsubscribe","out_of_office","unknown"],"description":"Normalized bounce classification (§12)."},"CampaignPlacement":{"type":"object","properties":{"status":{"type":"string","enum":["not_configured","not_sampled","scheduled","pending","complete","failed"]},"adapter":{"anyOf":[{"$ref":"#/components/schemas/PlacementAdapter"},{"type":"null"}]},"adapters":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/PlacementAdapter"}},"runs":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/CampaignPlacementRun"}},"synthetic":{"type":"boolean"},"sampleSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"byProvider":{"type":"array","items":{"$ref":"#/components/schemas/PlacementProviderResult"}},"observedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"error":{"type":["string","null"]}},"required":["status","adapter","adapters","runs","synthetic","sampleSize","byProvider","observedAt","error"],"additionalProperties":false,"description":"Inbox / promotions / spam per mailbox provider from hidden seed copies of the campaign (ADR 0050 §5). A sample, never the whole audience."},"PlacementAdapter":{"type":"string","enum":["fake","google_workspace","microsoft_365","placement_api"]},"CampaignPlacementRun":{"type":"object","properties":{"adapter":{"$ref":"#/components/schemas/PlacementAdapter"},"status":{"type":"string","enum":["pending","complete","failed"]},"synthetic":{"type":"boolean"},"sampleSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"observedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"error":{"type":["string","null"]}},"required":["adapter","status","synthetic","sampleSize","observedAt","error"],"additionalProperties":false},"PlacementProviderResult":{"type":"object","properties":{"provider":{"type":"string"},"inbox":{"type":"integer","minimum":0,"maximum":9007199254740991},"promotions":{"type":"integer","minimum":0,"maximum":9007199254740991},"spam":{"type":"integer","minimum":0,"maximum":9007199254740991},"missing":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","inbox","promotions","spam","missing"],"additionalProperties":false},"WorkspaceOverview":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"workspaceTrackingMode":{"$ref":"#/components/schemas/TrackingMode"},"range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to"],"additionalProperties":false},"freshness":{"type":"object","properties":{"asOf":{"description":"When the report was computed.","$ref":"#/components/schemas/IsoDateTime"},"lastEventReceivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Most recent ingested event of the scope (data freshness)."},"classifierVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Bot/privacy-proxy rule set version of the filtered view."},"realtime":{"type":"boolean","description":"Computed from the event store at request time (no batch lag)."}},"required":["asOf","lastEventReceivedAt","classifierVersion","realtime"],"additionalProperties":false},"totals":{"type":"object","properties":{"providerAccepted":{"$ref":"#/components/schemas/Metric"},"reportedDelivered":{"$ref":"#/components/schemas/Metric"},"humanClicks":{"$ref":"#/components/schemas/Metric"},"humanClickRate":{"$ref":"#/components/schemas/Metric"},"likelyHumanOpens":{"$ref":"#/components/schemas/Metric"},"totalOpens":{"$ref":"#/components/schemas/Metric"},"attributedRevenue":{"$ref":"#/components/schemas/Metric"}},"required":["providerAccepted","reportedDelivered","humanClicks","humanClickRate","likelyHumanOpens","totalOpens","attributedRevenue"],"additionalProperties":false},"campaigns":{"type":"array","items":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"trackingMode":{"$ref":"#/components/schemas/TrackingMode"},"attempted":{"type":"integer","minimum":0,"maximum":9007199254740991},"providerAccepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"reportedDelivered":{"$ref":"#/components/schemas/Metric"},"acceptanceRate":{"$ref":"#/components/schemas/Metric"},"reportedDeliveryRate":{"$ref":"#/components/schemas/Metric"},"clicks":{"$ref":"#/components/schemas/Metric"},"uniqueHumanClickRate":{"$ref":"#/components/schemas/Metric"},"complaintRate":{"$ref":"#/components/schemas/Metric"},"lastEventAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["campaignId","campaignName","campaignState","trackingMode","attempted","providerAccepted","reportedDelivered","acceptanceRate","reportedDeliveryRate","clicks","uniqueHumanClickRate","complaintRate","lastEventAt"],"additionalProperties":false}}},"required":["workspaceId","workspaceTrackingMode","range","freshness","totals","campaigns"],"additionalProperties":false},"WorkspaceSendingSummary":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to"],"additionalProperties":false},"freshness":{"type":"object","properties":{"asOf":{"description":"When the report was computed.","$ref":"#/components/schemas/IsoDateTime"},"lastEventReceivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Most recent ingested event of the scope (data freshness)."},"classifierVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Bot/privacy-proxy rule set version of the filtered view."},"realtime":{"type":"boolean","description":"Computed from the event store at request time (no batch lag)."}},"required":["asOf","lastEventReceivedAt","classifierVersion","realtime"],"additionalProperties":false},"modules":{"type":"array","items":{"$ref":"#/components/schemas/SendingModuleTotals"}},"days":{"type":"array","items":{"$ref":"#/components/schemas/SendingDay"}},"latency":{"type":"array","items":{"$ref":"#/components/schemas/SendingLatency"}}},"required":["workspaceId","range","freshness","modules","days","latency"],"additionalProperties":false},"SendingModuleTotals":{"type":"object","properties":{"module":{"$ref":"#/components/schemas/SendingModule"},"campaigns":{"type":"integer","minimum":0,"maximum":9007199254740991},"attempted":{"type":"integer","minimum":0,"maximum":9007199254740991},"providerAccepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"reportedDelivered":{"type":"integer","minimum":0,"maximum":9007199254740991},"acceptedObservable":{"type":"integer","minimum":0,"maximum":9007199254740991},"deferred":{"type":"integer","minimum":0,"maximum":9007199254740991},"bounced":{"type":"integer","minimum":0,"maximum":9007199254740991},"complained":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["module","campaigns","attempted","providerAccepted","reportedDelivered","acceptedObservable","deferred","bounced","complained","failed"],"additionalProperties":false},"SendingModule":{"type":"string","enum":["campaigns","automations","transactional_api","smtp_relay"]},"SendingDay":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"accepted":{"type":"object","propertyNames":{"$ref":"#/components/schemas/SendingModule"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"required":["campaigns","automations","transactional_api","smtp_relay"]},"bounced":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","accepted","bounced"],"additionalProperties":false},"SendingLatency":{"type":"object","properties":{"module":{"type":"string","enum":["transactional_api","smtp_relay"]},"samples":{"type":"integer","minimum":0,"maximum":9007199254740991},"p50Ms":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"p95Ms":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["module","samples","p50Ms","p95Ms"],"additionalProperties":false},"AnalyticsOverview":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to"],"additionalProperties":false},"view":{"$ref":"#/components/schemas/ReportView"},"freshness":{"type":"object","properties":{"asOf":{"description":"When the report was computed.","$ref":"#/components/schemas/IsoDateTime"},"lastEventReceivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Most recent ingested event of the scope (data freshness)."},"classifierVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Bot/privacy-proxy rule set version of the filtered view."},"realtime":{"type":"boolean","description":"Computed from the event store at request time (no batch lag)."}},"required":["asOf","lastEventReceivedAt","classifierVersion","realtime"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"trackingMode":{"$ref":"#/components/schemas/TrackingMode"},"attempted":{"type":"integer","minimum":0,"maximum":9007199254740991},"providerAccepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"reportedDelivered":{"$ref":"#/components/schemas/Metric"},"acceptanceRate":{"$ref":"#/components/schemas/Metric"},"reportedDeliveryRate":{"$ref":"#/components/schemas/Metric"},"clicks":{"$ref":"#/components/schemas/Metric"},"uniqueHumanClickRate":{"$ref":"#/components/schemas/Metric"},"complaintRate":{"$ref":"#/components/schemas/Metric"},"lastEventAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["campaignId","campaignName","campaignState","trackingMode","attempted","providerAccepted","reportedDelivered","acceptanceRate","reportedDeliveryRate","clicks","uniqueHumanClickRate","complaintRate","lastEventAt"],"additionalProperties":false}},"totals":{"type":"object","properties":{"attempted":{"type":"integer","minimum":0,"maximum":9007199254740991},"providerAccepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"reportedDelivered":{"type":"integer","minimum":0,"maximum":9007199254740991},"complaints":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["attempted","providerAccepted","reportedDelivered","complaints"],"additionalProperties":false}},"required":["workspaceId","range","view","freshness","rows","totals"],"additionalProperties":false},"DeliveryInvestigationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryInvestigation"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"DeliveryInvestigation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"messageId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string"},"detail":{"type":"string"},"eventIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"status":{"type":"string","enum":["open","resolved"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","messageId","campaignId","kind","detail","eventIds","status","createdAt"],"additionalProperties":false},"ContactActivityPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactActivityItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ContactActivityItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["delivery","tracking"]},"type":{"anyOf":[{"$ref":"#/components/schemas/DeliveryEventType"},{"$ref":"#/components/schemas/TrackingEventType"}]},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignName":{"type":["string","null"]},"messageId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"bounceClass":{"anyOf":[{"$ref":"#/components/schemas/BounceClass"},{"type":"null"}]},"smtpCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"botClass":{"anyOf":[{"$ref":"#/components/schemas/BotClass"},{"type":"null"}]}},"required":["id","kind","type","occurredAt","campaignId","campaignName","messageId","bounceClass","smtpCode","botClass"],"additionalProperties":false},"DeliveryEventType":{"type":"string","enum":["accepted","rejected","deferred","reported_delivered","bounced","complained","unsubscribed","failed"],"description":"Immutable delivery facts; they may arrive out of order (§11)."},"TrackingEventType":{"type":"string","enum":["open","click"]},"BotClass":{"type":"string","enum":["human_likely","bot","security_scanner","privacy_proxy","unknown"]},"VerificationRequested":{"type":"object","properties":{"status":{"type":"string","const":"verification_requested"},"expiresInMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["status","expiresInMinutes"],"additionalProperties":false},"SignUpInput":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"password":{"type":"string","minLength":12,"maxLength":256},"acceptTerms":{"type":"boolean","const":true}},"required":["displayName","email","password","acceptTerms"],"additionalProperties":false},"ResendVerificationInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["email"],"additionalProperties":false},"AuthSession":{"type":"object","properties":{"sessionId":{"$ref":"#/components/schemas/Uuid"},"userId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"displayName":{"type":"string"},"platformStaff":{"type":"boolean"},"assurance":{"$ref":"#/components/schemas/AuthAssurance"},"stepUpUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"ssoSession":{"type":"boolean"},"persistent":{"type":"boolean"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"mfa":{"type":"object","properties":{"totp":{"type":"boolean"},"passkeys":{"type":"integer","minimum":0,"maximum":9007199254740991},"recoveryCodesRemaining":{"type":"integer","minimum":0,"maximum":9007199254740991},"enrollmentRequired":{"type":"boolean"}},"required":["totp","passkeys","recoveryCodesRemaining","enrollmentRequired"],"additionalProperties":false},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/SessionWorkspace"}},"csrfToken":{"type":"string"},"preferences":{"type":"object","properties":{"language":{"anyOf":[{"$ref":"#/components/schemas/UiLanguage"},{"type":"null"}]},"locale":{"type":["string","null"]},"timeZone":{"type":["string","null"]},"recordSurfaces":{"$ref":"#/components/schemas/RecordSurfacePreferences"},"display":{"$ref":"#/components/schemas/DisplayPreferences"}},"required":["language","locale","timeZone"],"additionalProperties":false},"deployment":{"$ref":"#/components/schemas/SessionDeployment"},"integrations":{"$ref":"#/components/schemas/SessionIntegrations"}},"required":["sessionId","userId","email","displayName","platformStaff","assurance","stepUpUntil","expiresAt","mfa","workspaces","csrfToken"],"additionalProperties":false},"AuthAssurance":{"type":"string","enum":["password","mfa"],"description":"password = one factor; mfa = TOTP, recovery code, passkey or a remembered device after MFA."},"SessionWorkspace":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"organizationName":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"status":{"$ref":"#/components/schemas/WorkspaceStatus"},"roles":{"type":"array","items":{"type":"string"}},"permissions":{"type":"array","items":{"type":"string"}},"timezone":{"type":"string"},"locale":{"type":"string"},"supportAccess":{"type":"object","properties":{"viaGrant":{"type":"boolean"},"grantId":{"$ref":"#/components/schemas/Uuid"},"reason":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"staffDisplayName":{"type":"string"}},"required":["viaGrant","grantId","reason","expiresAt","staffDisplayName"],"additionalProperties":false},"organizationType":{"type":"string","enum":["direct","agency","reseller","institution","enterprise"]},"agencyAccess":{"type":"object","properties":{"delegationId":{"$ref":"#/components/schemas/Uuid"},"agencyWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"agencyName":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["delegationId","agencyWorkspaceId","agencyName","permissions","expiresAt"],"additionalProperties":false},"sendingMode":{"$ref":"#/components/schemas/SendingMode"}},"required":["id","name","organizationName","region","status","roles"],"additionalProperties":false},"WorkspaceStatus":{"type":"string","enum":["provisioning","trial","active","suspended","closed"],"description":"Suspension removes operator access but recipient opt-out keeps working (§6, invariant 10)."},"UiLanguage":{"type":"string","enum":["en","fr"],"description":"Console interface language (a shipped message catalog)."},"RecordSurfacePreferences":{"type":"object","properties":{"view":{"anyOf":[{"$ref":"#/components/schemas/RecordSurfaceMode"},{"type":"null"}],"description":"Viewing a record; null: sheet."},"edit":{"anyOf":[{"$ref":"#/components/schemas/RecordSurfaceMode"},{"type":"null"}],"description":"Creating or editing a record; null: sheet."}},"required":["view","edit"],"additionalProperties":false},"RecordSurfaceMode":{"type":"string","enum":["sheet","modal","page"]},"DisplayPreferences":{"type":"object","properties":{"sidebar":{"anyOf":[{"$ref":"#/components/schemas/SidebarMode"},{"type":"null"}],"description":"Side navigation at desktop sizes; null: expanded."},"motion":{"anyOf":[{"$ref":"#/components/schemas/MotionPreference"},{"type":"null"}],"description":"Animations; null: system (follow the operating system)."},"textSize":{"anyOf":[{"$ref":"#/components/schemas/TextSize"},{"type":"null"}],"description":"Interface text size; null: default."},"theme":{"description":"Deprecated and ignored: the product has one light theme (ADR 0095). Kept for compatibility; to be removed.","deprecated":true,"anyOf":[{"$ref":"#/components/schemas/ThemePreference"},{"type":"null"}]},"advancedOptions":{"description":"Advanced options of the campaign composer; null: folded.","anyOf":[{"$ref":"#/components/schemas/AdvancedOptionsPreference"},{"type":"null"}]}},"required":["sidebar","motion","textSize"],"additionalProperties":false},"SidebarMode":{"type":"string","enum":["expanded","rail"]},"MotionPreference":{"type":"string","enum":["system","reduce"]},"TextSize":{"type":"string","enum":["default","large"]},"ThemePreference":{"type":"string","enum":["system","light","dark"]},"AdvancedOptionsPreference":{"type":"string","enum":["folded","shown"]},"SessionDeployment":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/DeploymentProfile"},"key":{"type":"string"}},"required":["profile","key"],"additionalProperties":false},"DeploymentProfile":{"type":"string","enum":["saas","dedicated","private"]},"SessionIntegrations":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/IntegrationStatus"},"description":"Per platform integration: whether THIS deployment has its credentials (presence only, never a value)."},"IntegrationStatus":{"type":"string","enum":["configured","not_configured"]},"VerifyEmailInput":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["token"],"additionalProperties":false},"SignInResult":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"authenticated"},"session":{"$ref":"#/components/schemas/AuthSession"}},"required":["status","session"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"mfa_required"},"methods":{"type":"array","items":{"$ref":"#/components/schemas/MfaMethod"}},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["status","methods","expiresAt"],"additionalProperties":false}]},"MfaMethod":{"type":"string","enum":["totp","recovery_code","passkey"]},"SignInInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"password":{"type":"string","minLength":1,"maxLength":256},"persistent":{"default":false,"type":"boolean"}},"required":["email","password"],"additionalProperties":false},"TotpChallengeInput":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"},"trustDevice":{"default":false,"type":"boolean"}},"required":["code"],"additionalProperties":false},"RecoveryCodeChallengeInput":{"type":"object","properties":{"code":{"type":"string","minLength":10,"maxLength":20}},"required":["code"],"additionalProperties":false},"PasskeyOptionsJson":{"type":"object","properties":{"challenge":{"type":"string"}},"required":["challenge"],"additionalProperties":{},"description":"PublicKeyCredentialCreationOptionsJSON or RequestOptionsJSON."},"PasskeyAuthenticateInput":{"type":"object","properties":{"response":{"$ref":"#/components/schemas/PasskeyCredentialJson"},"trustDevice":{"default":false,"type":"boolean"},"persistent":{"default":false,"type":"boolean"}},"required":["response"],"additionalProperties":false},"PasskeyCredentialJson":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":1024},"rawId":{"type":"string","minLength":1,"maxLength":1024},"type":{"type":"string","const":"public-key"},"response":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"clientExtensionResults":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authenticatorAttachment":{"type":"string","enum":["platform","cross-platform"]}},"required":["id","rawId","type","response"],"additionalProperties":{},"description":"PublicKeyCredential.toJSON() output."},"RecoveryRequested":{"type":"object","properties":{"status":{"type":"string","const":"recovery_requested"}},"required":["status"],"additionalProperties":false},"RecoveryRequestInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["email"],"additionalProperties":false},"PasswordReset":{"type":"object","properties":{"status":{"type":"string","const":"password_reset"}},"required":["status"],"additionalProperties":false},"RecoveryResetInput":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"},"newPassword":{"type":"string","minLength":12,"maxLength":256}},"required":["token","newPassword"],"additionalProperties":false},"InvitationPreview":{"type":"object","properties":{"workspaceName":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"emailHint":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["workspaceName","roles","emailHint","expiresAt"],"additionalProperties":false},"InvitationTokenInput":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":200,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["token"],"additionalProperties":false},"SessionList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SessionInfo"}}},"required":["items"],"additionalProperties":false},"SessionInfo":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"current":{"type":"boolean"},"userAgent":{"type":["string","null"]},"assurance":{"$ref":"#/components/schemas/AuthAssurance"},"persistent":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastSeenAt":{"$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","current","userAgent","assurance","createdAt","lastSeenAt","expiresAt"],"additionalProperties":false},"TotpEnrollment":{"type":"object","properties":{"secret":{"type":"string"},"otpauthUri":{"type":"string"}},"required":["secret","otpauthUri"],"additionalProperties":false},"RecoveryCodes":{"type":"object","properties":{"codes":{"type":"array","items":{"type":"string"}},"generatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["codes","generatedAt"],"additionalProperties":false},"TotpActivateInput":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"],"additionalProperties":false},"Passkey":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"deviceType":{"type":"string","enum":["singleDevice","multiDevice"]},"backedUp":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastUsedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","name","deviceType","backedUp","createdAt","lastUsedAt"],"additionalProperties":false},"RegisterPasskeyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"response":{"$ref":"#/components/schemas/PasskeyCredentialJson"}},"required":["name","response"],"additionalProperties":false},"PasskeyList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Passkey"}}},"required":["items"],"additionalProperties":false},"StepUpResult":{"type":"object","properties":{"stepUpUntil":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["stepUpUntil"],"additionalProperties":false},"StepUpInput":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","const":"password"},"password":{"type":"string","minLength":1,"maxLength":256}},"required":["method","password"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","const":"totp"},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["method","code"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","const":"passkey"},"response":{"$ref":"#/components/schemas/PasskeyCredentialJson"}},"required":["method","response"],"additionalProperties":false}]},"ServedRegions":{"type":"object","properties":{"regions":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Region"}}},"required":["regions"],"additionalProperties":false},"Workspace":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"organizationId":{"$ref":"#/components/schemas/Uuid"},"organizationName":{"type":"string"},"name":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"status":{"$ref":"#/components/schemas/WorkspaceStatus"},"timezone":{"type":"string"},"locale":{"type":"string"},"fourEyesApproval":{"type":"boolean"},"sendingMode":{"$ref":"#/components/schemas/SendingMode"},"billingOwnerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","organizationId","organizationName","name","region","status","timezone","locale","fourEyesApproval","billingOwnerUserId","revision","createdAt","updatedAt"],"additionalProperties":false},"CreateWorkspaceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"legalName":{"type":"string","minLength":1,"maxLength":200},"region":{"$ref":"#/components/schemas/Region"},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"locale":{"default":"en","type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"}},"required":["name","region"],"additionalProperties":false},"AcceptedInvitation":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"membershipId":{"$ref":"#/components/schemas/Uuid"},"roles":{"type":"array","items":{"type":"string"}}},"required":["workspaceId","membershipId","roles"],"additionalProperties":false},"UpdateWorkspaceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"}},"additionalProperties":false},"MemberPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Member":{"type":"object","properties":{"membershipId":{"$ref":"#/components/schemas/Uuid"},"userId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"displayName":{"type":["string","null"]},"roles":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/MembershipStatus"},"mfa":{"$ref":"#/components/schemas/MemberMfa"},"lastActiveAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"joinedAt":{"$ref":"#/components/schemas/IsoDateTime"},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["membershipId","userId","email","displayName","roles","status","mfa","lastActiveAt","joinedAt","revision"],"additionalProperties":false},"MembershipStatus":{"type":"string","enum":["invited","active","suspended","revoked"]},"MemberMfa":{"type":"string","enum":["passkey","totp","none"],"description":"Strongest second factor the member has enrolled."},"UpdateMemberInput":{"type":"object","properties":{"roles":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"}}},"required":["roles"],"additionalProperties":false},"InvitationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Invitation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/InvitationStatus"},"invitedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","email","roles","status","invitedByUserId","expiresAt","createdAt"],"additionalProperties":false},"InvitationStatus":{"type":"string","enum":["pending","accepted","revoked","expired"]},"CreateInvitationInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"roles":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"}}},"required":["email","roles"],"additionalProperties":false},"OwnershipTransferResult":{"type":"object","properties":{"fromMembershipId":{"$ref":"#/components/schemas/Uuid"},"toMembershipId":{"$ref":"#/components/schemas/Uuid"}},"required":["fromMembershipId","toMembershipId"],"additionalProperties":false},"OwnershipTransferInput":{"type":"object","properties":{"toMembershipId":{"$ref":"#/components/schemas/Uuid"}},"required":["toMembershipId"],"additionalProperties":false},"BillingOwner":{"type":"object","properties":{"organizationId":{"$ref":"#/components/schemas/Uuid"},"billingOwnerUserId":{"$ref":"#/components/schemas/Uuid"}},"required":["organizationId","billingOwnerUserId"],"additionalProperties":false},"BillingOwnerInput":{"type":"object","properties":{"userId":{"$ref":"#/components/schemas/Uuid"}},"required":["userId"],"additionalProperties":false},"RoleList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RoleDefinition"}}},"required":["items"],"additionalProperties":false},"RoleDefinition":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"key":{"type":"string"},"name":{"type":"string"},"builtIn":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"string","enum":["workspace.read","workspace.manage","workspace.delete","workspace.ownership.transfer","membership.read","membership.manage","audience.read","audience.write","audience.import","audience.export","audience.protected_fields","consent.read","consent.write","consent.override","suppression.read","suppression.write","template.read","template.edit","asset.manage","campaign.read","campaign.create","campaign.edit","campaign.test","campaign.approve","campaign.publish","campaign.pause","message.read","transactional.send","journey.read","journey.edit","journey.publish","growth.read","growth.edit","growth.publish","survey.responses.read","report.read","report.export","infrastructure.read","infrastructure.manage","billing.read","billing.manage","integrations.read","integrations.manage","api_keys.manage","agent.grants.manage","smtp.read","smtp.manage","mailboxes.read","mailboxes.manage","privacy.manage","audit.read","support.grants.manage","agency.clients.read","agency.clients.manage","brand.manage","inbox.read","inbox.reply","inbox.review","inbox.manage","channels.read","channels.manage","commerce.read","commerce.manage","organization.read","organization.manage","audience.restricted_fields"]}},"revision":{"$ref":"#/components/schemas/Revision"},"assignedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","key","name","builtIn","permissions","revision","assignedCount"],"additionalProperties":false},"CreateRoleInput":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"name":{"type":"string","minLength":1,"maxLength":80},"permissions":{"minItems":1,"maxItems":66,"type":"array","items":{"type":"string","enum":["workspace.read","workspace.manage","workspace.delete","workspace.ownership.transfer","membership.read","membership.manage","audience.read","audience.write","audience.import","audience.export","audience.protected_fields","consent.read","consent.write","consent.override","suppression.read","suppression.write","template.read","template.edit","asset.manage","campaign.read","campaign.create","campaign.edit","campaign.test","campaign.approve","campaign.publish","campaign.pause","message.read","transactional.send","journey.read","journey.edit","journey.publish","growth.read","growth.edit","growth.publish","survey.responses.read","report.read","report.export","infrastructure.read","infrastructure.manage","billing.read","billing.manage","integrations.read","integrations.manage","api_keys.manage","agent.grants.manage","smtp.read","smtp.manage","mailboxes.read","mailboxes.manage","privacy.manage","audit.read","support.grants.manage","agency.clients.read","agency.clients.manage","brand.manage","inbox.read","inbox.reply","inbox.review","inbox.manage","channels.read","channels.manage","commerce.read","commerce.manage","organization.read","organization.manage","audience.restricted_fields"]}}},"required":["key","name","permissions"],"additionalProperties":false},"UpdateRoleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"permissions":{"minItems":1,"maxItems":66,"type":"array","items":{"type":"string","enum":["workspace.read","workspace.manage","workspace.delete","workspace.ownership.transfer","membership.read","membership.manage","audience.read","audience.write","audience.import","audience.export","audience.protected_fields","consent.read","consent.write","consent.override","suppression.read","suppression.write","template.read","template.edit","asset.manage","campaign.read","campaign.create","campaign.edit","campaign.test","campaign.approve","campaign.publish","campaign.pause","message.read","transactional.send","journey.read","journey.edit","journey.publish","growth.read","growth.edit","growth.publish","survey.responses.read","report.read","report.export","infrastructure.read","infrastructure.manage","billing.read","billing.manage","integrations.read","integrations.manage","api_keys.manage","agent.grants.manage","smtp.read","smtp.manage","mailboxes.read","mailboxes.manage","privacy.manage","audit.read","support.grants.manage","agency.clients.read","agency.clients.manage","brand.manage","inbox.read","inbox.reply","inbox.review","inbox.manage","channels.read","channels.manage","commerce.read","commerce.manage","organization.read","organization.manage","audience.restricted_fields"]}}},"additionalProperties":false},"SecurityPolicy":{"type":"object","properties":{"ipAllowlist":{"type":"array","items":{"type":"string"}},"mfaRequired":{"type":"boolean"},"fourEyesApproval":{"type":"boolean"},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["ipAllowlist","mfaRequired","fourEyesApproval","revision","updatedAt"],"additionalProperties":false},"UpdateSecurityPolicyInput":{"type":"object","properties":{"ipAllowlist":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}},"mfaRequired":{"type":"boolean"},"fourEyesApproval":{"type":"boolean"}},"additionalProperties":false},"AuditEventPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"AuditEvent":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"actorType":{"$ref":"#/components/schemas/ActorType"},"actorId":{"type":["string","null"]},"action":{"type":"string"},"resourceType":{"type":"string"},"resourceId":{"type":["string","null"]},"result":{"type":"string","enum":["success","denied","failure"]},"requestId":{"type":["string","null"]},"beforeHash":{"type":["string","null"]},"afterHash":{"type":["string","null"]},"reason":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","occurredAt","actorType","actorId","action","resourceType","resourceId","result","requestId","beforeHash","afterHash","reason","metadata"],"additionalProperties":false},"CampaignPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"CampaignSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/CampaignType"},"purpose":{"$ref":"#/components/schemas/CampaignPurpose"},"state":{"$ref":"#/components/schemas/CampaignState"},"subject":{"type":"string"},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"folder":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"trackingMode":{"$ref":"#/components/schemas/TrackingMode"},"revision":{"$ref":"#/components/schemas/Revision"},"latestVersion":{"anyOf":[{"$ref":"#/components/schemas/CampaignVersionRef"},{"type":"null"}]},"clonedFromCampaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","type","purpose","state","subject","senderIdentityId","ownerUserId","folder","tags","trackingMode","revision","latestVersion","clonedFromCampaignId","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CampaignType":{"type":"string","enum":["broadcast","newsletter","ab_experiment","recurring_digest","transactional_template","automation","smtp_relay"],"description":"`automation`: content sent ONLY by journeys/autoresponders/triggers (one message per run step), never approved or scheduled as a broadcast. `smtp_relay`: the backing campaign of an SMTP relay credential (ADR 0085 §4) — transactional, approved by the credential's activation, never listed with campaigns."},"CampaignVersionRef":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"contentHash":{"type":"string"},"frozenAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","version","contentHash","frozenAt","createdAt"],"additionalProperties":false},"Campaign":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/CampaignType"},"purpose":{"$ref":"#/components/schemas/CampaignPurpose"},"state":{"$ref":"#/components/schemas/CampaignState"},"subject":{"type":"string"},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"folder":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"trackingMode":{"$ref":"#/components/schemas/TrackingMode"},"revision":{"$ref":"#/components/schemas/Revision"},"latestVersion":{"anyOf":[{"$ref":"#/components/schemas/CampaignVersionRef"},{"type":"null"}]},"clonedFromCampaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"draft":{"$ref":"#/components/schemas/CampaignDraft"},"templateVersionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"editable":{"type":"boolean"}},"required":["id","name","type","purpose","state","subject","senderIdentityId","ownerUserId","folder","tags","trackingMode","revision","latestVersion","clonedFromCampaignId","archivedAt","createdAt","updatedAt","draft","templateVersionId","editable"],"additionalProperties":false},"CampaignDraft":{"type":"object","properties":{"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"fromName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string","maxLength":320,"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,}$"},{"type":"null"}]},"document":{"$ref":"#/components/schemas/EmailDocument"}},"required":["subject","preheader","fromName","replyTo","document"],"additionalProperties":false},"EmailDocument":{"type":"object","properties":{"schemaVersion":{"type":"number","const":1},"settings":{"default":{"width":600,"backgroundColor":"#F4F6FA","contentBackgroundColor":"#FFFFFF","textColor":"#16243B","linkColor":"#335CFF","fontFamily":"system","fontSize":16,"direction":"ltr"},"type":"object","properties":{"width":{"default":600,"type":"integer","minimum":320,"maximum":800},"backgroundColor":{"default":"#F4F6FA","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"contentBackgroundColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#16243B","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"linkColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fontFamily":{"default":"system","type":"string","enum":["system","serif","mono"]},"fontSize":{"default":16,"type":"integer","minimum":12,"maximum":22},"direction":{"default":"ltr","type":"string","enum":["ltr","rtl"]},"language":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"}},"required":["width","backgroundColor","contentBackgroundColor","textColor","linkColor","fontFamily","fontSize","direction"],"additionalProperties":false},"blocks":{"maxItems":200,"type":"array","items":{"anyOf":[{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type","alt","decorative","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href","align","backgroundColor","textColor","fullWidth"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type","color","thickness"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type","height"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","text","showPreferencesLink","showViewOnline","unsubscribeLabel","preferencesLabel","viewOnlineLabel","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl","maxItems","showSummary","emptyText"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source","maxItems","emptyText"],"additionalProperties":false}]},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"columns"},"columns":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"width":{"type":"integer","minimum":10,"maximum":100},"blocks":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type","alt","decorative","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href","align","backgroundColor","textColor","fullWidth"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type","color","thickness"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type","height"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","text","showPreferencesLink","showViewOnline","unsubscribeLabel","preferencesLabel","viewOnlineLabel","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl","maxItems","showSummary","emptyText"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source","maxItems","emptyText"],"additionalProperties":false}]}}},"required":["blocks"],"additionalProperties":false}},"stackOnMobile":{"default":true,"type":"boolean"},"gap":{"default":16,"type":"integer","minimum":0,"maximum":48}},"required":["id","type","columns","stackOnMobile","gap"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"section"},"name":{"type":"string","maxLength":500},"sourceTemplateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"blocks":{"maxItems":50,"type":"array","items":{"anyOf":[{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type","alt","decorative","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href","align","backgroundColor","textColor","fullWidth"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type","color","thickness"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type","height"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","text","showPreferencesLink","showViewOnline","unsubscribeLabel","preferencesLabel","viewOnlineLabel","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl","maxItems","showSummary","emptyText"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source","maxItems","emptyText"],"additionalProperties":false}]},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"columns"},"columns":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"width":{"type":"integer","minimum":10,"maximum":100},"blocks":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type","alt","decorative","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href","align","backgroundColor","textColor","fullWidth"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type","color","thickness"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type","height"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","text","showPreferencesLink","showViewOnline","unsubscribeLabel","preferencesLabel","viewOnlineLabel","align"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl","maxItems","showSummary","emptyText"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source","maxItems","emptyText"],"additionalProperties":false}]}}},"required":["blocks"],"additionalProperties":false}},"stackOnMobile":{"default":true,"type":"boolean"},"gap":{"default":16,"type":"integer","minimum":0,"maximum":48}},"required":["id","type","columns","stackOnMobile","gap"],"additionalProperties":false}]}}},"required":["id","type","name","blocks"],"additionalProperties":false}]}},"text":{"default":{"mode":"auto"},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","custom"]},"custom":{"type":"string","maxLength":100000}},"required":["mode"],"additionalProperties":false},"preservedSources":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","const":"html_import"},"html":{"type":"string","maxLength":256000},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["id","kind","html","sha256"],"additionalProperties":false}},"attachments":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["assetId"],"additionalProperties":false}},"recipientLinks":{"type":"object","properties":{"profileFormId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"surveyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["schemaVersion","settings","blocks","text","preservedSources"],"additionalProperties":false,"description":"Canonical block JSON (schema v1) compiled by @mailer/email-renderer. Portable: export/import as is."},"CreateCampaignInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"type":{"default":"broadcast","$ref":"#/components/schemas/CampaignType"},"purpose":{"default":"marketing","$ref":"#/components/schemas/CampaignPurpose"},"senderIdentityId":{"description":"Must be a VERIFIED sender identity of the workspace (422 SENDER_UNVERIFIED).","$ref":"#/components/schemas/Uuid"},"folder":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^/\\\\]+(\\/[^/\\\\]+){0,4}$"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N} _.-]+$"}},"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"templateVersionId":{"$ref":"#/components/schemas/Uuid"},"document":{"$ref":"#/components/schemas/EmailDocumentInput"}},"required":["name"],"additionalProperties":false},"EmailDocumentInput":{"type":"object","properties":{"schemaVersion":{"type":"number","const":1},"settings":{"default":{"width":600,"backgroundColor":"#F4F6FA","contentBackgroundColor":"#FFFFFF","textColor":"#16243B","linkColor":"#335CFF","fontFamily":"system","fontSize":16,"direction":"ltr"},"type":"object","properties":{"width":{"default":600,"type":"integer","minimum":320,"maximum":800},"backgroundColor":{"default":"#F4F6FA","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"contentBackgroundColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#16243B","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"linkColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fontFamily":{"default":"system","type":"string","enum":["system","serif","mono"]},"fontSize":{"default":16,"type":"integer","minimum":12,"maximum":22},"direction":{"default":"ltr","type":"string","enum":["ltr","rtl"]},"language":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"}},"additionalProperties":false},"blocks":{"maxItems":200,"type":"array","items":{"anyOf":[{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source"],"additionalProperties":false}]},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"columns"},"columns":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"width":{"type":"integer","minimum":10,"maximum":100},"blocks":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source"],"additionalProperties":false}]}}},"required":["blocks"],"additionalProperties":false}},"stackOnMobile":{"default":true,"type":"boolean"},"gap":{"default":16,"type":"integer","minimum":0,"maximum":48}},"required":["id","type","columns"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"section"},"name":{"type":"string","maxLength":500},"sourceTemplateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"backgroundColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"blocks":{"maxItems":50,"type":"array","items":{"anyOf":[{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source"],"additionalProperties":false}]},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"columns"},"columns":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"width":{"type":"integer","minimum":10,"maximum":100},"blocks":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"heading"},"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","level","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"paragraph"},"text":{"type":"string","maxLength":20000},"align":{"default":"left","type":"string","enum":["left","center","right"]}},"required":["id","type","text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"image"},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"src":{"type":"string","maxLength":2048},"alt":{"default":"","type":"string","maxLength":500},"decorative":{"default":false,"type":"boolean"},"width":{"type":"integer","minimum":16,"maximum":1200},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"delivery":{"type":"string","enum":["hosted","inline"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"button"},"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048},"align":{"default":"center","type":"string","enum":["left","center","right"]},"backgroundColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fullWidth":{"default":false,"type":"boolean"}},"required":["id","type","label","href"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"divider"},"color":{"default":"#DCE3EE","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"thickness":{"default":1,"type":"integer","minimum":1,"maximum":8}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"spacer"},"height":{"default":24,"type":"integer","minimum":4,"maximum":160}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"social"},"links":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"network":{"type":"string","enum":["facebook","x","linkedin","instagram","youtube","tiktok","mastodon","website"]},"href":{"type":"string","maxLength":2048},"label":{"type":"string","maxLength":500}},"required":["network","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"navigation"},"links":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":500},"href":{"type":"string","maxLength":2048}},"required":["label","href"],"additionalProperties":false}},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type","links"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"footer"},"text":{"default":"","type":"string","maxLength":20000},"showPreferencesLink":{"default":true,"type":"boolean"},"showViewOnline":{"default":false,"type":"boolean"},"unsubscribeLabel":{"default":"Unsubscribe","type":"string","minLength":1,"maxLength":100},"preferencesLabel":{"default":"Manage preferences","type":"string","minLength":1,"maxLength":100},"viewOnlineLabel":{"default":"View in browser","type":"string","minLength":1,"maxLength":100},"align":{"default":"center","type":"string","enum":["left","center","right"]}},"required":["id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"html"},"html":{"type":"string","maxLength":256000}},"required":["id","type","html"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"rss"},"feedUrl":{"type":"string","maxLength":2048},"maxItems":{"default":5,"type":"integer","minimum":1,"maximum":20},"showSummary":{"default":true,"type":"boolean"},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","feedUrl"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visibility":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"rules":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^(contact\\.[a-z][a-z0-9_]{0,62}|segment)$"},"op":{"type":"string","enum":["exists","missing","equals","not_equals","contains","not_contains","in","gt","lt","in_segment","not_in_segment"]},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":200}}]}},"required":["field","op"],"additionalProperties":false}},"label":{"type":"string","maxLength":500}},"required":["match","rules"],"additionalProperties":false},"type":{"type":"string","const":"product"},"source":{"type":"string","maxLength":500},"maxItems":{"default":3,"type":"integer","minimum":1,"maximum":12},"emptyText":{"default":"","type":"string","maxLength":500}},"required":["id","type","source"],"additionalProperties":false}]}}},"required":["blocks"],"additionalProperties":false}},"stackOnMobile":{"default":true,"type":"boolean"},"gap":{"default":16,"type":"integer","minimum":0,"maximum":48}},"required":["id","type","columns"],"additionalProperties":false}]}}},"required":["id","type","name","blocks"],"additionalProperties":false}]}},"text":{"default":{"mode":"auto"},"type":"object","properties":{"mode":{"default":"auto","type":"string","enum":["auto","custom"]},"custom":{"type":"string","maxLength":100000}},"additionalProperties":false},"preservedSources":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","const":"html_import"},"html":{"type":"string","maxLength":256000},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["id","kind","html","sha256"],"additionalProperties":false}},"attachments":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["assetId"],"additionalProperties":false}},"recipientLinks":{"type":"object","properties":{"profileFormId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"surveyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false}},"required":["schemaVersion","blocks"],"additionalProperties":false,"description":"Canonical block JSON (schema v1) compiled by @mailer/email-renderer. Portable: export/import as is."},"UpdateCampaignInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"type":{"$ref":"#/components/schemas/CampaignType"},"purpose":{"$ref":"#/components/schemas/CampaignPurpose"},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"folder":{"anyOf":[{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^/\\\\]+(\\/[^/\\\\]+){0,4}$"},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N} _.-]+$"}},"archived":{"type":"boolean"},"draft":{"$ref":"#/components/schemas/CampaignDraftPatch"},"saveKind":{"default":"save","type":"string","enum":["autosave","save"]}},"additionalProperties":false},"CampaignDraftPatch":{"type":"object","properties":{"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"fromName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string","maxLength":320,"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,}$"},{"type":"null"}]},"document":{"$ref":"#/components/schemas/EmailDocumentInput"}},"additionalProperties":false},"CloneCampaignInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false},"PreviewResult":{"type":"object","properties":{"kind":{"type":"string","const":"browser_preview"},"html":{"type":"string"},"text":{"type":"string"},"subject":{"type":"string"},"preheader":{"type":"string"},"rendererVersion":{"type":"string"},"contentHash":{"type":"string"},"recipient":{"type":"object","properties":{"source":{"type":"string","enum":["reference","fixture","contact"]},"id":{"type":["string","null"]},"label":{"type":"string"}},"required":["source","id","label"],"additionalProperties":false},"checks":{"$ref":"#/components/schemas/ContentChecks"}},"required":["kind","html","text","subject","preheader","rendererVersion","contentHash","recipient","checks"],"additionalProperties":false},"ContentChecks":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/ContentIssue"}},"blocking":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spamScore":{"type":"integer","minimum":0,"maximum":10}},"required":["issues","blocking","warnings","spamScore"],"additionalProperties":false},"ContentIssue":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["blocking","warning","info"]},"category":{"type":"string","enum":["content","compliance","links","accessibility","personalization","deliverability","size","sender","assets"]},"message":{"type":"string"},"explanation":{"type":"string"},"blockId":{"type":"string"}},"required":["code","severity","category","message"],"additionalProperties":false},"PreviewInput":{"type":"object","properties":{"fixtureId":{"type":"string","maxLength":40},"contactId":{"$ref":"#/components/schemas/Uuid"},"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"document":{"$ref":"#/components/schemas/EmailDocumentInput"}},"additionalProperties":false},"ContentRevisionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ContentRevisionSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ContentRevisionSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"revision":{"$ref":"#/components/schemas/Revision"},"reason":{"type":"string","enum":["create","autosave","save","restore","clone","import"]},"snapshotHash":{"type":"string"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","revision","reason","snapshotHash","createdByUserId","createdAt"],"additionalProperties":false},"ContentRevision":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"revision":{"$ref":"#/components/schemas/Revision"},"reason":{"type":"string","enum":["create","autosave","save","restore","clone","import"]},"snapshotHash":{"type":"string"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"snapshot":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","revision","reason","snapshotHash","createdByUserId","createdAt","snapshot"],"additionalProperties":false},"CampaignVersionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignVersionListItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"CampaignVersionListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"subject":{"type":"string"},"preheader":{"type":["string","null"]},"fromName":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"rendererVersion":{"type":"string"},"contentHash":{"type":"string"},"assetIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"frozenAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","version","subject","preheader","fromName","fromAddress","replyTo","senderIdentityId","rendererVersion","contentHash","assetIds","frozenAt","createdByUserId","createdAt"],"additionalProperties":false},"CampaignVersion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"subject":{"type":"string"},"preheader":{"type":["string","null"]},"fromName":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"rendererVersion":{"type":"string"},"contentHash":{"type":"string"},"assetIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"frozenAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"document":{"$ref":"#/components/schemas/EmailDocument"},"html":{"type":"string"},"text":{"type":"string"}},"required":["id","campaignId","version","subject","preheader","fromName","fromAddress","replyTo","senderIdentityId","rendererVersion","contentHash","assetIds","frozenAt","createdByUserId","createdAt","document","html","text"],"additionalProperties":false},"CreateCampaignVersionInput":{"type":"object","properties":{"note":{"type":"string","maxLength":500}},"additionalProperties":false},"MergeFieldCatalog":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/MergeFieldOption"}},"system":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"label":{"type":"string"}},"required":["tag","label"],"additionalProperties":false}}},"required":["fields","system"],"additionalProperties":false},"MergeFieldOption":{"type":"object","properties":{"tag":{"type":"string","description":"e.g. contact.first_name"},"label":{"type":"string"},"type":{"$ref":"#/components/schemas/FieldType"},"protection":{"$ref":"#/components/schemas/FieldProtection"},"mergeable":{"type":"boolean"},"builtIn":{"type":"boolean"}},"required":["tag","label","type","protection","mergeable","builtIn"],"additionalProperties":false},"SenderOptionList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SenderOption"}}},"required":["items"],"additionalProperties":false},"SenderOption":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"fromAddress":{"type":"string"},"fromName":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"verified":{"type":"boolean"},"starter":{"type":"boolean"},"starterBlockedReason":{"anyOf":[{"$ref":"#/components/schemas/StarterBlockedReason"},{"type":"null"}]}},"required":["id","fromAddress","fromName","replyTo","verified"],"additionalProperties":false},"HtmlImportResult":{"type":"object","properties":{"sanitizedHtml":{"type":"string"},"originalSha256":{"type":"string"},"report":{"type":"object","properties":{"removedElements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"removedAttributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"blockedUrls":{"type":"number"},"removedComments":{"type":"number"},"removedStyles":{"type":"number"},"truncated":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["removedElements","removedAttributes","blockedUrls","removedComments","removedStyles","truncated","changed"],"additionalProperties":false},"conversion":{"type":"object","properties":{"blocks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"exact":{"type":"boolean"},"unsupported":{"type":"array","items":{"type":"string"}}},"required":["blocks","exact","unsupported"],"additionalProperties":false}},"required":["sanitizedHtml","originalSha256","report","conversion"],"additionalProperties":false},"HtmlImportInput":{"type":"object","properties":{"html":{"type":"string","minLength":1,"maxLength":256000}},"required":["html"],"additionalProperties":false},"ContentSettings":{"type":"object","properties":{"postalAddress":{"type":"string","description":"Sender's physical postal address, printed in every marketing email footer."},"companyName":{"type":"string"},"designTokens":{"default":null,"anyOf":[{"$ref":"#/components/schemas/DesignTokens"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["postalAddress","companyName","designTokens","revision","updatedAt"],"additionalProperties":false},"DesignTokens":{"type":"object","properties":{"width":{"default":600,"type":"integer","minimum":320,"maximum":800},"backgroundColor":{"default":"#F4F6FA","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"contentBackgroundColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#16243B","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"linkColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fontFamily":{"default":"system","type":"string","enum":["system","serif","mono"]},"fontSize":{"default":16,"type":"integer","minimum":12,"maximum":22}},"required":["width","backgroundColor","contentBackgroundColor","textColor","linkColor","fontFamily","fontSize"],"additionalProperties":false},"UpdateContentSettingsInput":{"type":"object","properties":{"postalAddress":{"type":"string","maxLength":500},"companyName":{"type":"string","maxLength":200},"designTokens":{"anyOf":[{"$ref":"#/components/schemas/DesignTokensInput"},{"type":"null"}]}},"additionalProperties":false},"DesignTokensInput":{"type":"object","properties":{"width":{"default":600,"type":"integer","minimum":320,"maximum":800},"backgroundColor":{"default":"#F4F6FA","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"contentBackgroundColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"textColor":{"default":"#16243B","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"linkColor":{"default":"#335CFF","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fontFamily":{"default":"system","type":"string","enum":["system","serif","mono"]},"fontSize":{"default":16,"type":"integer","minimum":12,"maximum":22}},"additionalProperties":false},"TemplatePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TemplateListItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"TemplateListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/TemplateKind"},"description":{"type":"string"},"folder":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"shared":{"type":"boolean"},"ownerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"latestVersion":{"anyOf":[{"$ref":"#/components/schemas/TemplateVersionRef"},{"type":"null"}]},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"draft":{"$ref":"#/components/schemas/TemplateDraft"}},"required":["id","name","kind","description","folder","tags","shared","ownerUserId","revision","latestVersion","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"TemplateKind":{"type":"string","enum":["email","section"],"description":"section = reusable branded section (R020)."},"TemplateVersionRef":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"contentHash":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","version","contentHash","createdAt"],"additionalProperties":false},"TemplateDraft":{"type":"object","properties":{"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"document":{"$ref":"#/components/schemas/EmailDocument"}},"required":["subject","preheader","document"],"additionalProperties":false},"Template":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/TemplateKind"},"description":{"type":"string"},"folder":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"shared":{"type":"boolean"},"ownerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"latestVersion":{"anyOf":[{"$ref":"#/components/schemas/TemplateVersionRef"},{"type":"null"}]},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"draft":{"$ref":"#/components/schemas/TemplateDraft"},"usage":{"type":"object","properties":{"campaigns":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["campaigns"],"additionalProperties":false}},"required":["id","name","kind","description","folder","tags","shared","ownerUserId","revision","latestVersion","archivedAt","createdAt","updatedAt","draft"],"additionalProperties":false},"CreateTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"default":"email","$ref":"#/components/schemas/TemplateKind"},"description":{"type":"string","maxLength":2000},"folder":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^/\\\\]+(\\/[^/\\\\]+){0,4}$"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N} _.-]+$"}},"shared":{"default":true,"type":"boolean"},"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"document":{"$ref":"#/components/schemas/EmailDocumentInput"},"fromCampaignId":{"$ref":"#/components/schemas/Uuid"},"fromTemplateId":{"$ref":"#/components/schemas/Uuid"}},"required":["name"],"additionalProperties":false},"UpdateTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"folder":{"anyOf":[{"type":"string","minLength":1,"maxLength":120,"pattern":"^[^/\\\\]+(\\/[^/\\\\]+){0,4}$"},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N} _.-]+$"}},"shared":{"type":"boolean"},"archived":{"type":"boolean"},"draft":{"type":"object","properties":{"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"document":{"$ref":"#/components/schemas/EmailDocumentInput"}},"additionalProperties":false},"saveKind":{"default":"save","type":"string","enum":["autosave","save"]}},"additionalProperties":false},"PreviewInputInput":{"type":"object","properties":{"fixtureId":{"type":"string","maxLength":40},"contactId":{"$ref":"#/components/schemas/Uuid"},"subject":{"type":"string","maxLength":998},"preheader":{"type":"string","maxLength":500},"document":{"$ref":"#/components/schemas/EmailDocumentInput"}},"additionalProperties":false},"TemplateVersionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TemplateVersionSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"TemplateVersionSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"templateId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"rendererVersion":{"type":["string","null"]},"contentHash":{"type":"string"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","templateId","version","rendererVersion","contentHash","createdByUserId","createdAt"],"additionalProperties":false},"TemplateVersion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"templateId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"rendererVersion":{"type":["string","null"]},"contentHash":{"type":"string"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"subject":{"type":"string"},"preheader":{"type":"string"},"document":{"$ref":"#/components/schemas/EmailDocument"},"html":{"type":["string","null"]},"text":{"type":["string","null"]}},"required":["id","templateId","version","rendererVersion","contentHash","createdByUserId","createdAt","subject","preheader","document","html","text"],"additionalProperties":false},"AssetCapabilities":{"type":"object","properties":{"publishing":{"type":"boolean"},"scanning":{"type":"boolean"}},"required":["publishing","scanning"],"additionalProperties":false},"AssetPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AssetListItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"AssetListItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/AssetKind"},"fileName":{"type":"string"},"contentType":{"type":"string","description":"Sniffed type the asset is served with (never the uploader's claim)."},"declaredContentType":{"type":"string"},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"altText":{"type":"string"},"status":{"$ref":"#/components/schemas/AssetStatus"},"statusReason":{"type":["string","null"]},"checksumSha256":{"type":"string"},"publicUrl":{"type":["string","null"]},"publishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"uploadedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"deletedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"previewUrl":{"description":"Signed, short-lived URL of the processed image (members only, never recipients).","type":["string","null"]}},"required":["id","kind","fileName","contentType","declaredContentType","byteSize","width","height","altText","status","statusReason","checksumSha256","publicUrl","publishedAt","uploadedByUserId","deletedAt","revision","createdAt","updatedAt","previewUrl"],"additionalProperties":false},"AssetKind":{"type":"string","enum":["image","attachment"]},"AssetStatus":{"type":"string","enum":["uploading","pending_scan","clean","quarantined","scan_unavailable","deleted"],"description":"scan_unavailable = no malware scanner answered: usable in drafts/previews, never publishable or approvable (R024, R092)."},"AssetUploadTicket":{"type":"object","properties":{"asset":{"$ref":"#/components/schemas/Asset"},"upload":{"type":"object","properties":{"method":{"type":"string","const":"PUT"},"url":{"type":"string","description":"Short-lived signed URL of the private bucket (workspace prefix)."},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["method","url","headers","expiresAt"],"additionalProperties":false}},"required":["asset","upload"],"additionalProperties":false},"Asset":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/AssetKind"},"fileName":{"type":"string"},"contentType":{"type":"string","description":"Sniffed type the asset is served with (never the uploader's claim)."},"declaredContentType":{"type":"string"},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"altText":{"type":"string"},"status":{"$ref":"#/components/schemas/AssetStatus"},"statusReason":{"type":["string","null"]},"checksumSha256":{"type":"string"},"publicUrl":{"type":["string","null"]},"publishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"uploadedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"deletedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","kind","fileName","contentType","declaredContentType","byteSize","width","height","altText","status","statusReason","checksumSha256","publicUrl","publishedAt","uploadedByUserId","deletedAt","revision","createdAt","updatedAt"],"additionalProperties":false},"CreateAssetUploadInput":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^/\\\\\\u0000-\\u001f]+$"},"contentType":{"type":"string","minLength":3,"maxLength":100},"byteSize":{"type":"integer","minimum":1,"maximum":9007199254740991},"kind":{"default":"image","$ref":"#/components/schemas/AssetKind"},"altText":{"type":"string","maxLength":500}},"required":["fileName","contentType","byteSize"],"additionalProperties":false},"AssetDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/AssetKind"},"fileName":{"type":"string"},"contentType":{"type":"string","description":"Sniffed type the asset is served with (never the uploader's claim)."},"declaredContentType":{"type":"string"},"byteSize":{"type":"integer","minimum":0,"maximum":9007199254740991},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"altText":{"type":"string"},"status":{"$ref":"#/components/schemas/AssetStatus"},"statusReason":{"type":["string","null"]},"checksumSha256":{"type":"string"},"publicUrl":{"type":["string","null"]},"publishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"uploadedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"deletedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"usage":{"type":"object","properties":{"campaignDrafts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"campaignVersions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"templates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["campaignDrafts","campaignVersions","templates"],"additionalProperties":false}},"required":["id","kind","fileName","contentType","declaredContentType","byteSize","width","height","altText","status","statusReason","checksumSha256","publicUrl","publishedAt","uploadedByUserId","deletedAt","revision","createdAt","updatedAt","usage"],"additionalProperties":false},"UpdateAssetInput":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255},"altText":{"type":"string","maxLength":500}},"additionalProperties":false},"AssetDownload":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"contentType":{"type":"string"},"disposition":{"type":"string","enum":["inline","attachment"]}},"required":["url","expiresAt","contentType","disposition"],"additionalProperties":false},"RoutingSimulation":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"policyVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stream":{"$ref":"#/components/schemas/Stream"},"region":{"type":"string"},"senderDomain":{"type":["string","null"]},"senderVerified":{"type":"boolean"},"globalReasons":{"type":"array","items":{"type":"string"}},"routes":{"type":"array","items":{"$ref":"#/components/schemas/SimulatedRoute"}},"distribution":{"type":"object","properties":{"sampleSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shares":{"type":"array","items":{"type":"object","properties":{"endpointId":{"$ref":"#/components/schemas/Uuid"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"number"}},"required":["endpointId","count","share"],"additionalProperties":false}}},"required":["sampleSize","shares"],"additionalProperties":false},"recipientDomains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"selectedEndpointId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"mailboxProvider":{"$ref":"#/components/schemas/MailboxProvider"},"mxScope":{"type":"string"}},"required":["domain","selectedEndpointId","reasons","mailboxProvider","mxScope"],"additionalProperties":false}}},"required":["asOf","policyVersion","stream","region","senderDomain","senderVerified","globalReasons","routes","distribution","recipientDomains"],"additionalProperties":false},"SimulatedRoute":{"type":"object","properties":{"poolId":{"$ref":"#/components/schemas/Uuid"},"poolName":{"type":"string"},"strategy":{"$ref":"#/components/schemas/RoutingStrategy"},"endpointId":{"$ref":"#/components/schemas/Uuid"},"endpointName":{"type":"string"},"adapter":{"type":"string"},"region":{"type":"string"},"weight":{"type":"number"},"eligible":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"},"description":"Machine reason codes (@mailer/routing ROUTE_REASONS)."}},"required":["poolId","poolName","strategy","endpointId","endpointName","adapter","region","weight","eligible","reasons"],"additionalProperties":false},"SimulateRoutingInput":{"type":"object","properties":{"campaignId":{"description":"Simulate with this campaign's stream, sender and route constraints.","$ref":"#/components/schemas/Uuid"},"stream":{"$ref":"#/components/schemas/Stream"},"senderDomain":{"description":"From domain when no campaign is given.","type":"string","minLength":3,"maxLength":253},"recipientDomains":{"default":[],"description":"Recipient domains (never addresses: the simulation handles no PII).","maxItems":20,"type":"array","items":{"type":"string","minLength":3,"maxLength":253}},"sampleSize":{"default":1000,"description":"Synthetic messages used to estimate the traffic split across eligible routes.","type":"integer","minimum":1,"maximum":20000},"messageBytes":{"default":50000,"type":"integer","minimum":1,"maximum":50000000}},"additionalProperties":false},"DispatchQuotas":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"buckets":{"type":"object","properties":{"source":{"type":"string","enum":["redis","unavailable"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/QuotaBucket"}},"truncated":{"type":"boolean"}},"required":["source","items","truncated"],"additionalProperties":false},"warmups":{"type":"array","items":{"$ref":"#/components/schemas/WarmupQuota"}}},"required":["asOf","buckets","warmups"],"additionalProperties":false},"QuotaBucket":{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/RateScope"},"key":{"type":"string"},"label":{"type":"string"},"window":{"type":"string","enum":["second","minute"]},"limit":{"type":"integer","minimum":0,"maximum":9007199254740991},"used":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["bucket","configuration"]}},"required":["scope","key","label","window","limit","used","source"],"additionalProperties":false},"RateScope":{"type":"string","enum":["workspace","trust_tier","sender_domain","pool","endpoint","egress_ip","recipient_mx","campaign","starter_address"]},"WarmupQuota":{"type":"object","properties":{"scheduleId":{"$ref":"#/components/schemas/Uuid"},"scheduleName":{"type":"string"},"memberId":{"$ref":"#/components/schemas/Uuid"},"label":{"type":"string"},"state":{"type":"string","enum":["active","frozen"]},"dailyCeiling":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sentToday":{"type":"integer","minimum":0,"maximum":9007199254740991},"providers":{"type":"array","items":{"$ref":"#/components/schemas/WarmupProviderUsage"}}},"required":["scheduleId","scheduleName","memberId","label","state","dailyCeiling","sentToday","providers"],"additionalProperties":false},"WarmupProviderUsage":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/MailboxProvider"},"ceiling":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sentToday":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","ceiling","sentToday"],"additionalProperties":false},"MessagePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MessageSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"MessageSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignVersionId":{"$ref":"#/components/schemas/Uuid"},"generation":{"type":"integer","minimum":1,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/MessageState"},"stream":{"$ref":"#/components/schemas/Stream"},"recipient":{"type":"string","description":"Recipient address; masked unless the caller holds audience.read."},"recipientRedacted":{"type":"boolean"},"attemptCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerMessageId":{"type":["string","null"]},"acceptedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"terminalReason":{"type":["string","null"]},"lastErrorClass":{"type":["string","null"]},"transactionalTemplateKey":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","campaignVersionId","generation","state","stream","recipient","recipientRedacted","attemptCount","providerMessageId","acceptedAt","nextAttemptAt","quarantinedAt","terminalReason","lastErrorClass","createdAt","updatedAt"],"additionalProperties":false},"MessageDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignVersionId":{"$ref":"#/components/schemas/Uuid"},"generation":{"type":"integer","minimum":1,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/MessageState"},"stream":{"$ref":"#/components/schemas/Stream"},"recipient":{"type":"string","description":"Recipient address; masked unless the caller holds audience.read."},"recipientRedacted":{"type":"boolean"},"attemptCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providerMessageId":{"type":["string","null"]},"acceptedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"quarantinedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"terminalReason":{"type":["string","null"]},"lastErrorClass":{"type":["string","null"]},"transactionalTemplateKey":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"approvalId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"quarantineReason":{"type":["string","null"]},"resendOfMessageId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"duplicationRisk":{"type":"boolean","description":"True while the outcome is unknown: a resend may duplicate it."},"reservation":{"anyOf":[{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ReservationStatus"},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"planVersionId":{"$ref":"#/components/schemas/Uuid"},"unitPriceMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"settledAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"releasedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["status","units","planVersionId","unitPriceMinor","currency","settledAt","releasedAt"],"additionalProperties":false},{"type":"null"}]},"attempts":{"type":"array","items":{"$ref":"#/components/schemas/SendAttemptView"}},"routeDecisions":{"type":"array","items":{"$ref":"#/components/schemas/RouteDecisionView"}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"receivedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","type","occurredAt","receivedAt"],"additionalProperties":false}}},"required":["id","campaignId","campaignVersionId","generation","state","stream","recipient","recipientRedacted","attemptCount","providerMessageId","acceptedAt","nextAttemptAt","quarantinedAt","terminalReason","lastErrorClass","createdAt","updatedAt","approvalId","expiresAt","quarantineReason","resendOfMessageId","duplicationRisk","reservation","attempts","routeDecisions","events"],"additionalProperties":false},"ReservationStatus":{"type":"string","enum":["held","settled","released","held_unknown"],"description":"held_unknown: submission outcome unknown; kept, never invoiced without evidence (§16, invariant 6)."},"SendAttemptView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"attemptNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/SendAttemptState"},"endpointId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"routeDecisionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"policyVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leaseEpoch":{"type":"string","description":"Fencing token of the worker that owned the attempt (bigint as string)."},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"gateCheckedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Dispatch decision point: suppression/approval/expiry re-checked."},"finishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"smtpCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"enhancedStatus":{"type":["string","null"]},"providerMessageId":{"type":["string","null"]},"errorClass":{"type":["string","null"]},"evidence":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","attemptNumber","state","endpointId","routeDecisionId","policyVersion","leaseEpoch","startedAt","gateCheckedAt","finishedAt","smtpCode","enhancedStatus","providerMessageId","errorClass","evidence"],"additionalProperties":false},"SendAttemptState":{"type":"string","enum":["leased","submitting","accepted","rejected_retryable","rejected_permanent","unknown","abandoned"]},"RouteDecisionView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"poolId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"endpointId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"egressIpId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"strategy":{"$ref":"#/components/schemas/RoutingStrategy"},"reasonCodes":{"type":"array","items":{"type":"string"}},"policyVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scores":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"decidedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","poolId","endpointId","egressIpId","strategy","reasonCodes","policyVersion","scores","decidedAt"],"additionalProperties":false},"ResendAccepted":{"type":"object","properties":{"messageId":{"$ref":"#/components/schemas/Uuid"},"previousMessageId":{"$ref":"#/components/schemas/Uuid"},"generation":{"type":"integer","minimum":2,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/MessageState"},"duplicationWarning":{"type":"boolean"}},"required":["messageId","previousMessageId","generation","state","duplicationWarning"],"additionalProperties":false},"ResendMessageInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500},"acknowledgeDuplicateRisk":{"default":false,"description":"Required (true) when the original outcome is unknown: the recipient may receive the message twice.","type":"boolean"}},"required":["reason"],"additionalProperties":false},"UsageSummary":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"unit":{"type":"string","const":"email_unit"},"balances":{"type":"object","properties":{"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"settled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["available","reserved","settled"],"additionalProperties":false},"reservations":{"type":"object","properties":{"held":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"heldUnknown":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"settled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"released":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["held","heldUnknown","settled","released"],"additionalProperties":false},"period":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"},"settledUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"releasedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["from","to","settledUnits","releasedUnits"],"additionalProperties":false},"byRoute":{"type":"object","properties":{"managed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unknown":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["managed","byos","unknown"],"additionalProperties":false},"stripe":{"type":"object","properties":{"status":{"type":"string","enum":["not_connected","in_sync","pending","drift","unavailable"]},"detail":{"type":"string"},"unbatchedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pendingBatchUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acknowledgedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastReconciledAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["status","detail","unbatchedUnits","pendingBatchUnits","acknowledgedUnits","lastReconciledAt"],"additionalProperties":false,"description":"Local journal vs Stripe meters (R072)."}},"required":["asOf","unit","balances","reservations","period","byRoute","stripe"],"additionalProperties":false},"ReservationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReservationView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ReservationView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"messageId":{"$ref":"#/components/schemas/Uuid"},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"$ref":"#/components/schemas/ReservationStatus"},"planVersionId":{"$ref":"#/components/schemas/Uuid"},"unitPriceMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"settledAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"releasedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"routeType":{"anyOf":[{"type":"string","enum":["managed","byos"]},{"type":"null"}]},"meterBatchId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"refundedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","messageId","units","status","planVersionId","unitPriceMinor","currency","createdAt","settledAt","releasedAt","routeType","meterBatchId","refundedAt"],"additionalProperties":false},"LedgerTransactionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LedgerTransactionView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"LedgerTransactionView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"type":{"$ref":"#/components/schemas/LedgerEntryType"},"idempotencyKey":{"type":"string"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"entries":{"type":"array","items":{"type":"object","properties":{"accountKind":{"$ref":"#/components/schemas/LedgerAccountKind"},"entryType":{"$ref":"#/components/schemas/LedgerEntryType"},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["accountKind","entryType","units"],"additionalProperties":false}}},"required":["id","type","idempotencyKey","occurredAt","evidence","entries"],"additionalProperties":false},"LedgerEntryType":{"type":"string","enum":["credit_grant","credit_purchase","reservation","reservation_release","usage_settlement","adjustment","refund"]},"LedgerAccountKind":{"type":"string","enum":["credits_source","credits_available","credits_reserved","usage_settled","adjustments"],"description":"Accounts of the append-only double-entry ledger (§16)."},"ApiKeyPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ApiKey":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"prefix":{"type":"string","description":"Visible handle (`mck_<prefix>_…`). Never enough to authenticate."},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"ipAllowlist":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/ApiKeyStatusView"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Updated at most once a minute."},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","name","prefix","scopes","ipAllowlist","status","createdByUserId","createdAt","expiresAt","lastUsedAt","revokedAt"],"additionalProperties":false},"Permission":{"type":"string","enum":["workspace.read","workspace.manage","workspace.delete","workspace.ownership.transfer","membership.read","membership.manage","audience.read","audience.write","audience.import","audience.export","audience.protected_fields","consent.read","consent.write","consent.override","suppression.read","suppression.write","template.read","template.edit","asset.manage","campaign.read","campaign.create","campaign.edit","campaign.test","campaign.approve","campaign.publish","campaign.pause","message.read","transactional.send","journey.read","journey.edit","journey.publish","growth.read","growth.edit","growth.publish","survey.responses.read","report.read","report.export","infrastructure.read","infrastructure.manage","billing.read","billing.manage","integrations.read","integrations.manage","api_keys.manage","agent.grants.manage","smtp.read","smtp.manage","mailboxes.read","mailboxes.manage","privacy.manage","audit.read","support.grants.manage","agency.clients.read","agency.clients.manage","brand.manage","inbox.read","inbox.reply","inbox.review","inbox.manage","channels.read","channels.manage","commerce.read","commerce.manage","organization.read","organization.manage","audience.restricted_fields"]},"ApiKeyStatusView":{"type":"string","enum":["active","expired","revoked"],"description":"`expired` is derived from expiresAt; a stored key is only ever active or revoked."},"CreatedApiKey":{"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiKey"},"secret":{"type":"string","description":"The full key. Shown ONCE; only its hash is stored."}},"required":["apiKey","secret"],"additionalProperties":false},"CreateApiKeyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"minItems":1,"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"ipAllowlist":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":64}}},"required":["name","scopes","expiresAt"]},"RevokeInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]},"WebhookEndpointPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"url":{"type":"string"},"description":{"type":["string","null"]},"eventTypes":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"status":{"$ref":"#/components/schemas/WebhookEndpointStatusView"},"verifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"secretHint":{"type":["string","null"]},"previousSecretExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastDelivery":{"anyOf":[{"type":"object","properties":{"state":{"type":"string"},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"at":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["state","responseStatus","at"],"additionalProperties":false},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","url","description","eventTypes","status","verifiedAt","secretHint","previousSecretExpiresAt","lastDelivery","revision","createdAt","updatedAt"],"additionalProperties":false},"WebhookEventType":{"type":"string","enum":["contact.created","contact.updated","suppression.created","campaign.approved","campaign.scheduled","campaign.paused","campaign.completed","campaign.materialized","campaign.dispatch_blocked","campaign.deleted","campaign.archived","campaign.unarchived","campaign.experiment_decided","message.accepted","message.rejected","message.deferred","message.delivered","message.bounced","message.complained","message.unsubscribed","message.submission_unknown","message.suppressed","message.failed","tracking.opened","tracking.clicked","bounce_source.unavailable","bounce_source.needs_reauthorization","bounce_source.recovered","oauth_grant.needs_reauthorization","list.member_subscribed","form.submitted","journey.webhook","survey.response_submitted","warmup.frozen","warmup.step_advanced","warmup.completed","warmup.reviewed","transactional.requested","smtp_credential.activated","smtp_credential.revoked","hosted_mailbox.created","hosted_mailbox.revoked","git_sync.pull_request_opened","git_sync.imported","connector.batch_applied","workspace.sending_mode_changed","domain.verification_changed","domain.dmarc_report_received","domain.health_regressed","domain.deleted","sender_identity.deleted","form.deleted","survey.deleted","landing_page.deleted","membership.deprovisioned","inbox.reply_received","inbox.reply_sent","channel.opted_out","channel.help_requested","channel.sender_verified","commerce.product_purchased","loyalty.tier_entered","loyalty.tier_exited","commerce.cart_abandoned","commerce.product_viewed"]},"WebhookEndpointStatusView":{"type":"string","enum":["pending_verification","active","disabled"]},"WebhookSecretIssued":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"signingSecret":{"type":"string","description":"`whsec_<base64url>`. Shown ONCE; stored encrypted (needed to sign)."}},"required":["endpoint","signingSecret"],"additionalProperties":false},"CreateWebhookEndpointInput":{"type":"object","properties":{"url":{"type":"string","maxLength":2048},"description":{"type":"string","maxLength":200},"eventTypes":{"minItems":1,"maxItems":65,"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}}},"required":["url","eventTypes"]},"UpdateWebhookEndpointInput":{"type":"object","properties":{"url":{"type":"string","maxLength":2048},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"eventTypes":{"minItems":1,"maxItems":65,"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"status":{"type":"string","const":"disabled"}}},"WebhookVerificationResult":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"verified":{"type":"boolean"},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"failure":{"description":"Why verification failed (egress refusal, TLS, status, wrong echo).","type":["string","null"]}},"required":["endpoint","verified","responseStatus","failure"],"additionalProperties":false},"RotateWebhookSecretInput":{"type":"object","properties":{"overlapHours":{"default":24,"type":"integer","minimum":0,"maximum":168}}},"WebhookDeliveryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"endpointId":{"$ref":"#/components/schemas/Uuid"},"eventId":{"$ref":"#/components/schemas/Uuid"},"eventType":{"type":"string"},"subjectId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/WebhookDeliveryState"},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"nextAttemptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastResponseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lastError":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","endpointId","eventId","eventType","subjectId","state","attempts","nextAttemptAt","lastResponseStatus","lastError","createdAt","updatedAt"],"additionalProperties":false},"WebhookDeliveryState":{"type":"string","enum":["pending","retrying","succeeded","dead_lettered"],"description":"One event for one endpoint: retried with backoff, then dead-lettered (replayable, same event id)."},"WebhookAttemptPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookAttempt"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"WebhookAttempt":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"deliveryId":{"$ref":"#/components/schemas/Uuid"},"endpointId":{"$ref":"#/components/schemas/Uuid"},"eventId":{"$ref":"#/components/schemas/Uuid"},"eventType":{"type":"string"},"attemptNumber":{"type":"integer","minimum":1,"maximum":9007199254740991},"state":{"type":"string","enum":["pending","succeeded","failed","dead_lettered"]},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"nextAttemptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"replayOf":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}],"description":"Attempt this replay was requested from."},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","deliveryId","endpointId","eventId","eventType","attemptNumber","state","responseStatus","durationMs","error","nextAttemptAt","replayOf","createdAt"],"additionalProperties":false},"WebhookReplayAccepted":{"type":"object","properties":{"deliveryId":{"$ref":"#/components/schemas/Uuid"},"eventId":{"description":"The ORIGINAL event id: receivers dedupe on it.","$ref":"#/components/schemas/Uuid"},"state":{"$ref":"#/components/schemas/WebhookDeliveryState"},"statusUrl":{"type":"string"}},"required":["deliveryId","eventId","state","statusUrl"],"additionalProperties":false},"ReplayWebhookInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"]},"AgentConnectionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AgentConnection"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"AgentConnection":{"type":"object","properties":{"id":{"description":"Also the `clientId` an approval grant is bound to.","$ref":"#/components/schemas/Uuid"},"clientName":{"type":"string"},"oauthClientId":{"type":"string"},"userId":{"description":"The person who connected the agent; it never exceeds their permissions.","$ref":"#/components/schemas/Uuid"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"approvalPolicy":{"$ref":"#/components/schemas/AgentApprovalPolicy"},"budgets":{"$ref":"#/components/schemas/AgentBudgets"},"usage":{"type":"object","properties":{"callsThisHour":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"draftsToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["callsThisHour","draftsToday"],"additionalProperties":false},"resource":{"type":"string","description":"Audience of the tokens (the MCP server's canonical URI)."},"tokenTtlMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"$ref":"#/components/schemas/AgentConnectionStatus"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastUsedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","clientName","oauthClientId","userId","scopes","approvalPolicy","budgets","usage","resource","tokenTtlMinutes","status","expiresAt","lastUsedAt","revokedAt","revision","createdAt"],"additionalProperties":false},"AgentApprovalPolicy":{"type":"string","enum":["read_only","draft","execute_with_grant"],"description":"read_only: read tools only; draft: + drafts and approval requests; execute_with_grant: + execution with a human one-use grant."},"AgentBudgets":{"type":"object","properties":{"maxCallsPerHour":{"type":"integer","minimum":1,"maximum":10000},"maxDraftsPerDay":{"type":"integer","minimum":0,"maximum":1000},"maxSpendUnits":{"type":"integer","minimum":0,"maximum":10000000,"description":"Ceiling of the spend cap of any approval the agent may request or execute (credits)."}},"required":["maxCallsPerHour","maxDraftsPerDay","maxSpendUnits"],"additionalProperties":false},"AgentConnectionStatus":{"type":"string","enum":["active","expired","revoked"]},"UpdateAgentConnectionInput":{"type":"object","properties":{"approvalPolicy":{"$ref":"#/components/schemas/AgentApprovalPolicy"},"budgets":{"type":"object","properties":{"maxCallsPerHour":{"type":"integer","minimum":1,"maximum":10000},"maxDraftsPerDay":{"type":"integer","minimum":0,"maximum":1000},"maxSpendUnits":{"type":"integer","minimum":0,"maximum":10000000,"description":"Ceiling of the spend cap of any approval the agent may request or execute (credits)."}}},"scopes":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Permission"}}}},"AgentToolCallPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AgentToolCall"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"AgentToolCall":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"connectionId":{"$ref":"#/components/schemas/Uuid"},"tool":{"type":"string"},"outcome":{"$ref":"#/components/schemas/AgentToolOutcome"},"errorCode":{"type":["string","null"]},"argsHash":{"type":"string","description":"SHA-256 of the canonical arguments (the arguments themselves are not stored)."},"durationMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requestId":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","connectionId","tool","outcome","errorCode","argsHash","durationMs","requestId","createdAt"],"additionalProperties":false},"AgentToolOutcome":{"type":"string","enum":["ok","denied","budget_exceeded","invalid_input","failed"]},"McpGrantPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/McpGrant"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"McpGrant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"clientId":{"description":"The agent connection the grant is bound to.","$ref":"#/components/schemas/Uuid"},"approvalId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"scopeHash":{"type":"string","description":"SHA-256 over workspace, approval, version, content/audience/route hashes and spend cap."},"issuedByUserId":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/McpGrantStatus"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"usedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","clientId","approvalId","campaignId","scopeHash","issuedByUserId","status","expiresAt","usedAt","revokedAt","createdAt"],"additionalProperties":false},"McpGrantStatus":{"type":"string","enum":["unused","used","revoked","expired"]},"CreatedMcpGrant":{"type":"object","properties":{"grant":{"$ref":"#/components/schemas/McpGrant"},"token":{"type":"string","description":"`mcg_…` one-use token. Shown ONCE; stored hashed. Hand it to the agent."}},"required":["grant","token"],"additionalProperties":false},"CreateMcpGrantInput":{"type":"object","properties":{"approvalId":{"$ref":"#/components/schemas/Uuid"},"clientId":{"$ref":"#/components/schemas/Uuid"},"expiresInMinutes":{"default":15,"type":"integer","minimum":1,"maximum":60},"scopes":{"default":["execute_approved_campaign"],"minItems":1,"maxItems":1,"type":"array","items":{"type":"string","const":"execute_approved_campaign"}}},"required":["approvalId","clientId"]},"AuthorizationServerMetadata":{"type":"object","properties":{"issuer":{"type":"string"},"authorization_endpoint":{"type":"string"},"token_endpoint":{"type":"string"},"registration_endpoint":{"type":"string"},"revocation_endpoint":{"type":"string"},"scopes_supported":{"type":"array","items":{"type":"string"}},"response_types_supported":{"type":"array","items":{"type":"string"}},"grant_types_supported":{"type":"array","items":{"type":"string"}},"code_challenge_methods_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"revocation_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"authorization_response_iss_parameter_supported":{"type":"boolean"},"client_id_metadata_document_supported":{"type":"boolean"},"resource_indicators_supported":{"type":"boolean"}},"required":["issuer","authorization_endpoint","token_endpoint","registration_endpoint","revocation_endpoint","scopes_supported","response_types_supported","grant_types_supported","code_challenge_methods_supported","token_endpoint_auth_methods_supported","revocation_endpoint_auth_methods_supported","authorization_response_iss_parameter_supported","client_id_metadata_document_supported"],"additionalProperties":false},"ClientRegistrationInput":{"type":"object","properties":{"client_name":{"type":"string","minLength":1,"maxLength":120},"redirect_uris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","maxLength":2048}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string"},"application_type":{"type":"string"},"scope":{"type":"string","maxLength":2000},"client_uri":{"type":"string","maxLength":2048},"logo_uri":{"type":"string","maxLength":2048}},"required":["redirect_uris"],"additionalProperties":{}},"AuthorizationRequestView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["agent","application"]},"clientId":{"type":"string"},"clientName":{"type":"string"},"clientKind":{"type":"string","enum":["dynamic","metadata_document","preregistered","application"]},"application":{"anyOf":[{"type":"object","properties":{"publisherWorkspaceName":{"type":"string"},"description":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"clientType":{"type":"string","enum":["confidential","public"]}},"required":["publisherWorkspaceName","description","homepageUrl","clientType"],"additionalProperties":false},{"type":"null"}]},"redirectOrigin":{"type":"string","description":"Where the browser goes back to after the decision."},"requestedScopes":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"unknownScopes":{"type":"array","items":{"type":"string"}},"resource":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"grantable":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}}},"required":["id","name","grantable"],"additionalProperties":false}}},"required":["id","kind","clientId","clientName","clientKind","application","redirectOrigin","requestedScopes","unknownScopes","resource","expiresAt","workspaces"],"additionalProperties":false},"AuthorizationDecisionResult":{"type":"object","properties":{"redirectUrl":{"type":"string","description":"The client's redirect URI with code (or error), state and iss."},"connectionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["redirectUrl","connectionId"],"additionalProperties":false},"AuthorizationDecisionInput":{"oneOf":[{"type":"object","properties":{"decision":{"type":"string","const":"approve"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"scopes":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"approvalPolicy":{"$ref":"#/components/schemas/AgentApprovalPolicy"},"budgets":{"$ref":"#/components/schemas/AgentBudgetsInput"},"tokenTtlMinutes":{"default":60,"type":"integer","minimum":5,"maximum":1440},"connectionTtlDays":{"default":30,"type":"integer","minimum":1,"maximum":90}},"required":["decision","workspaceId","scopes","approvalPolicy","budgets"]},{"type":"object","properties":{"decision":{"type":"string","const":"approve_application"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"scopes":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"tokenTtlMinutes":{"default":60,"type":"integer","minimum":5,"maximum":1440},"grantTtlDays":{"default":90,"type":"integer","minimum":1,"maximum":365}},"required":["decision","workspaceId","scopes"]},{"type":"object","properties":{"decision":{"type":"string","const":"deny"}},"required":["decision"]}]},"AgentBudgetsInput":{"type":"object","properties":{"maxCallsPerHour":{"type":"integer","minimum":1,"maximum":10000},"maxDraftsPerDay":{"type":"integer","minimum":0,"maximum":1000},"maxSpendUnits":{"type":"integer","minimum":0,"maximum":10000000,"description":"Ceiling of the spend cap of any approval the agent may request or execute (credits)."}},"required":["maxCallsPerHour","maxDraftsPerDay","maxSpendUnits"]},"OAuthApplicationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OAuthApplication"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"OAuthApplication":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"clientId":{"type":"string","description":"`mcapp_…`, public: what the application sends as `client_id`."},"name":{"type":"string"},"description":{"type":["string","null"]},"homepageUrl":{"type":["string","null"]},"clientType":{"$ref":"#/components/schemas/OAuthClientType"},"redirectUris":{"type":"array","items":{"type":"string"}},"allowedScopes":{"type":"array","items":{"$ref":"#/components/schemas/Permission"},"description":"The most any grant of this application can hold (narrowing it narrows existing grants on their next request)."},"audience":{"$ref":"#/components/schemas/OAuthApplicationAudience"},"status":{"$ref":"#/components/schemas/OAuthApplicationStatus"},"secretHint":{"type":["string","null"]},"secretRotatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"disabledAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","clientId","name","description","homepageUrl","clientType","redirectUris","allowedScopes","audience","status","secretHint","secretRotatedAt","createdByUserId","disabledAt","revision","createdAt","updatedAt"],"additionalProperties":false},"OAuthClientType":{"type":"string","enum":["confidential","public"]},"OAuthApplicationAudience":{"type":"string","enum":["own_workspace","any_workspace"]},"OAuthApplicationStatus":{"type":"string","enum":["active","disabled"]},"OAuthApplicationIssued":{"type":"object","properties":{"application":{"$ref":"#/components/schemas/OAuthApplication"},"clientSecret":{"description":"`mcos_…` for a confidential application (null for a public one). Shown ONCE; only its SHA-256 is stored.","type":["string","null"]}},"required":["application","clientSecret"],"additionalProperties":false},"CreateOAuthApplicationInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":300},"homepageUrl":{"type":"string","maxLength":2048},"clientType":{"default":"confidential","$ref":"#/components/schemas/OAuthClientType"},"redirectUris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","maxLength":2048}},"allowedScopes":{"minItems":1,"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"audience":{"default":"own_workspace","$ref":"#/components/schemas/OAuthApplicationAudience"}},"required":["name","redirectUris","allowedScopes"]},"UpdateOAuthApplicationInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"homepageUrl":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"redirectUris":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","maxLength":2048}},"allowedScopes":{"minItems":1,"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"audience":{"$ref":"#/components/schemas/OAuthApplicationAudience"}}},"OAuthAppGrantPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OAuthAppGrant"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"OAuthAppGrant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"applicationId":{"$ref":"#/components/schemas/Uuid"},"clientId":{"type":"string"},"applicationName":{"type":"string","description":"The application's name when the person consented."},"publisherWorkspaceName":{"description":"Who registered the application (null when it is this workspace).","type":["string","null"]},"userId":{"description":"The person who consented: the application acts as them, narrowed to the scopes.","$ref":"#/components/schemas/Uuid"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Permission"}},"status":{"$ref":"#/components/schemas/OAuthAppGrantStatus"},"applicationStatus":{"$ref":"#/components/schemas/OAuthApplicationStatus"},"tokenTtlMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastUsedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Updated at most once a minute."},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","applicationId","clientId","applicationName","publisherWorkspaceName","userId","scopes","status","applicationStatus","tokenTtlMinutes","expiresAt","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false},"OAuthAppGrantStatus":{"type":"string","enum":["active","expired","revoked"]},"ProtectedResourceMetadata":{"type":"object","properties":{"resource":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"resource_name":{"type":"string"},"resource_documentation":{"type":"string"}},"required":["resource","authorization_servers","scopes_supported","bearer_methods_supported"],"additionalProperties":false},"PlatformWorkspacePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformWorkspace"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"PlatformWorkspace":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"workspaceName":{"type":"string"},"workspaceStatus":{"$ref":"#/components/schemas/WorkspaceStatus"},"region":{"$ref":"#/components/schemas/Region"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"owners":{"type":"array","items":{"type":"string"}},"planState":{"$ref":"#/components/schemas/PlatformPlanState"},"plan":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"stripe":{"type":"boolean"}},"required":["key","name","version","status","stripe"],"additionalProperties":false},{"type":"null"}]},"availableUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["workspaceId","workspaceName","workspaceStatus","region","createdAt","owners","planState","plan","availableUnits"],"additionalProperties":false},"PlatformPlanState":{"type":"string","enum":["entitled","none","lapsed"]},"PlatformWorkspaceDetail":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"workspaceName":{"type":"string"},"workspaceStatus":{"$ref":"#/components/schemas/WorkspaceStatus"},"region":{"$ref":"#/components/schemas/Region"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"owners":{"type":"array","items":{"type":"string"}},"planState":{"$ref":"#/components/schemas/PlatformPlanState"},"plan":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string"},"stripe":{"type":"boolean"}},"required":["key","name","version","status","stripe"],"additionalProperties":false},{"type":"null"}]},"availableUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"object","properties":{"start":{"$ref":"#/components/schemas/IsoDateTime"},"end":{"$ref":"#/components/schemas/IsoDateTime"},"allowanceUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["start","end","allowanceUnits"],"additionalProperties":false},{"type":"null"}]},"addons":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dailyCapPerUnit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inUse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"startedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["key","quantity","dailyCapPerUnit","inUse","startedAt"],"additionalProperties":false}},"channelBalances":{"type":"array","items":{"type":"object","properties":{"unit":{"type":"string","enum":["sms_unit","whatsapp_unit","web_push_unit","mobile_push_unit","wallet_unit"]},"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"settled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["unit","available","reserved","settled"],"additionalProperties":false}},"activeSmtpCredentials":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hostedMailboxes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"plans":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"includedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"internal":{"type":"boolean"}},"required":["key","name","version","includedUnits","internal"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"action":{"type":"string"},"result":{"type":"string"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"actor":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["id","action","result","occurredAt","actor","reason"],"additionalProperties":false}}},"required":["workspaceId","workspaceName","workspaceStatus","region","createdAt","owners","planState","plan","availableUnits","period","addons","channelBalances","activeSmtpCredentials","hostedMailboxes","plans","history"],"additionalProperties":false},"GrantWorkspacePlanInput":{"type":"object","properties":{"planKey":{"type":"string","minLength":1,"maxLength":64},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["planKey","reason"],"additionalProperties":false},"SetWorkspaceAddonInput":{"type":"object","properties":{"addonKey":{"type":"string","enum":["warmup-network"]},"quantity":{"type":"integer","minimum":0,"maximum":1000},"dailyCap":{"type":"integer","minimum":1,"maximum":1000},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["addonKey","quantity","reason"],"additionalProperties":false},"GrantWorkspaceChannelCreditsInput":{"type":"object","properties":{"unit":{"type":"string","enum":["sms_unit","whatsapp_unit","web_push_unit","mobile_push_unit","wallet_unit"]},"units":{"type":"integer","minimum":1,"maximum":10000000},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["unit","units","reason"],"additionalProperties":false},"ChangeWorkspaceRegionInput":{"type":"object","properties":{"region":{"$ref":"#/components/schemas/Region"},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["region","reason"],"additionalProperties":false},"PlatformSending":{"type":"object","properties":{"generatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"ips":{"type":"array","items":{"$ref":"#/components/schemas/PlatformEgressIp"}},"tierPools":{"type":"object","properties":{"transactional":{"type":["string","null"]},"new":{"type":["string","null"]},"established":{"type":["string","null"]},"quarantine":{"type":["string","null"]}},"required":["transactional","new","established","quarantine"],"additionalProperties":false},"tiers":{"type":"array","items":{"type":"object","properties":{"tier":{"$ref":"#/components/schemas/SendingTier"},"workspaces":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["tier","workspaces"],"additionalProperties":false}},"recentMoves":{"type":"array","items":{"$ref":"#/components/schemas/SendingTierMove"}},"starter":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"active":{"type":"integer","minimum":0,"maximum":9007199254740991},"suspended":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["domain","active","suspended"],"additionalProperties":false}},"ramps":{"type":"array","items":{"$ref":"#/components/schemas/PlatformRamp"}}},"required":["generatedAt","ips","tierPools","tiers","recentMoves","starter"],"additionalProperties":false,"description":"Platform egress IPs, tier pools and starter addresses (ADR 0050, staff only)."},"PlatformEgressIp":{"type":"object","properties":{"address":{"type":"string"},"sourceName":{"type":"string"},"helo":{"type":"string"},"host":{"type":"string"},"state":{"$ref":"#/components/schemas/EgressIpState"},"pool":{"type":["string","null"]},"sourcePool":{"type":["string","null"]},"dedicatedWorkspace":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"note":{"type":["string","null"]},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"history":{"type":"array","items":{"$ref":"#/components/schemas/PlatformEgressIpEvent"}}},"required":["address","sourceName","helo","host","state","pool","dedicatedWorkspace","note","updatedAt","history"],"additionalProperties":false},"EgressIpState":{"type":"string","enum":["available","warming","shared","dedicated","quarantined"]},"PlatformEgressIpEvent":{"type":"object","properties":{"from":{"anyOf":[{"$ref":"#/components/schemas/EgressIpState"},{"type":"null"}]},"to":{"$ref":"#/components/schemas/EgressIpState"},"pool":{"type":["string","null"]},"workspaceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reason":{"type":"string"},"actor":{"type":"string"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to","pool","workspaceId","reason","actor","occurredAt"],"additionalProperties":false},"SendingTier":{"type":"string","enum":["new","established","quarantine"],"description":"Shared pool tier of a managed workspace (ADR 0050 §2): new accounts, established senders, quarantine."},"SendingTierMove":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"workspaceName":{"type":"string"},"from":{"anyOf":[{"$ref":"#/components/schemas/SendingTier"},{"type":"null"}]},"to":{"$ref":"#/components/schemas/SendingTier"},"source":{"type":"string","enum":["automatic","operator"]},"reason":{"type":"string"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["workspaceId","workspaceName","from","to","source","reason","occurredAt"],"additionalProperties":false},"PlatformRamp":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/RampKind"},"subject":{"type":"string"},"workspace":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"senderDomain":{"type":["string","null"]},"state":{"type":"string","enum":["active","frozen","complete","cancelled"]},"sendingDays":{"type":"integer","minimum":0,"maximum":9007199254740991},"todayCeiling":{"type":"object","properties":{"gmail":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"microsoft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"yahoo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"other":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["gmail","microsoft","yahoo","other"],"additionalProperties":false},"frozenReasons":{"type":"array","items":{"type":"string"}},"lastDay":{"anyOf":[{"type":"object","properties":{"day":{"type":"string"},"onRamp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"overflow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hardBounces":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complaints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deferrals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","onRamp","overflow","hardBounces","complaints","deferrals"],"additionalProperties":false},{"type":"null"}]},"startedAt":{"$ref":"#/components/schemas/IsoDateTime"},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","kind","subject","workspace","state","sendingDays","todayCeiling","frozenReasons","lastDay","startedAt","completedAt"],"additionalProperties":false},"RampKind":{"type":"string","enum":["dedicated_ip","domain","shared_ip"]},"DedicateIpInput":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"sourcePool":{"type":"string","pattern":"^[A-Za-z0-9._:@-]{1,128}$","description":"A KumoMTA pool name of `mta_pools`."},"senderDomain":{"description":"A sender domain of the workspace the IP is reserved to; absent = unscoped.","anyOf":[{"type":"string","pattern":"^(?=.{3,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"},{"type":"null"}]},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["workspaceId","sourcePool","reason"],"additionalProperties":false},"WarmIpInput":{"type":"object","properties":{"pool":{"type":"string","pattern":"^[A-Za-z0-9._:@-]{1,128}$","description":"A KumoMTA pool name of `mta_pools`."},"sourcePool":{"type":"string","pattern":"^[A-Za-z0-9._:@-]{1,128}$","description":"A KumoMTA pool name of `mta_pools`."},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["pool","sourcePool","reason"],"additionalProperties":false},"ReleaseIpInput":{"type":"object","properties":{"to":{"type":"string","enum":["available","quarantined"]},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["to","reason"],"additionalProperties":false},"ReviewRampInput":{"type":"object","properties":{"decision":{"$ref":"#/components/schemas/RampReviewDecision"},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why — mandatory, kept in the audit trail (at least 10 characters)."}},"required":["decision","reason"],"additionalProperties":false},"RampReviewDecision":{"type":"string","enum":["resume","hold","step_back","cancel","complete"]},"PlatformOverview":{"type":"object","properties":{"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))$"},"release":{"type":"object","properties":{"service":{"type":"string"},"release":{"type":"string"}},"required":["service","release"],"additionalProperties":false},"regions":{"type":"array","items":{"$ref":"#/components/schemas/RegionAuthority"}},"workers":{"type":"array","items":{"$ref":"#/components/schemas/WorkerStatus"}},"queues":{"type":"array","items":{"$ref":"#/components/schemas/QueueLaneStatus"}},"tenants":{"type":"array","items":{"$ref":"#/components/schemas/TenantHealth"}},"providers":{"type":"array","items":{"$ref":"#/components/schemas/ProviderHealth"}},"ingest":{"$ref":"#/components/schemas/IngestHealth"},"costs":{"type":"object","properties":{"currency":{"type":"string"},"windowHours":{"type":"number","const":1},"estimatedTotal":{"type":"number","minimum":0},"basis":{"type":"string","const":"estimate"}},"required":["currency","windowHours","estimatedTotal","basis"],"additionalProperties":false},"cutovers":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/PlatformCutover"}}},"required":["generatedAt","release","regions","workers","queues","tenants","providers","ingest","costs","cutovers"],"additionalProperties":false},"RegionAuthority":{"type":"object","properties":{"region":{"$ref":"#/components/schemas/Region"},"epoch":{"$ref":"#/components/schemas/EpochString"},"status":{"$ref":"#/components/schemas/DispatchAuthorityStatus"},"servedRegions":{"type":"array","items":{"$ref":"#/components/schemas/Region"}},"location":{"type":"string"},"boundToThisDatabase":{"type":"boolean"},"activatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"activatedBy":{"type":"string"},"reason":{"type":"string"},"liveWorkers":{"type":"integer","minimum":0,"maximum":9007199254740991},"fencedWorkers":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["region","epoch","status","servedRegions","location","boundToThisDatabase","activatedAt","activatedBy","reason","liveWorkers","fencedWorkers"],"additionalProperties":false},"EpochString":{"type":"string","pattern":"^\\d{1,19}$"},"DispatchAuthorityStatus":{"type":"string","enum":["active","fenced"]},"WorkerStatus":{"type":"object","properties":{"workerId":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"epoch":{"$ref":"#/components/schemas/EpochString"},"release":{"type":"string"},"state":{"$ref":"#/components/schemas/WorkerState"},"fenceReason":{"type":["string","null"]},"live":{"type":"boolean"},"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))$"},"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))$"},"concurrency":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["workerId","region","epoch","release","state","fenceReason","live","startedAt","lastSeenAt","concurrency"],"additionalProperties":false},"WorkerState":{"type":"string","enum":["running","fenced","stopped"]},"QueueLaneStatus":{"type":"object","properties":{"lane":{"type":"string"},"due":{"type":"integer","minimum":0,"maximum":9007199254740991},"oldestDueAgeSeconds":{"type":"number","minimum":0},"unconsumed":{"type":"integer","minimum":0,"maximum":9007199254740991},"oldestUnconsumedAgeSeconds":{"type":"number","minimum":0}},"required":["lane","due","oldestDueAgeSeconds","unconsumed","oldestUnconsumedAgeSeconds"],"additionalProperties":false},"TenantHealth":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"status":{"type":"string"},"queued":{"type":"integer","minimum":0,"maximum":9007199254740991},"deferred":{"type":"integer","minimum":0,"maximum":9007199254740991},"submitting":{"type":"integer","minimum":0,"maximum":9007199254740991},"submissionUnknown":{"type":"integer","minimum":0,"maximum":9007199254740991},"heldUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"acceptedLastHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejectedLastHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"complaintsLastHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"openCircuits":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["workspaceId","name","region","status","queued","deferred","submitting","submissionUnknown","heldUnits","acceptedLastHour","rejectedLastHour","complaintsLastHour","openCircuits"],"additionalProperties":false},"ProviderHealth":{"type":"object","properties":{"provider":{"type":"string"},"endpoints":{"type":"integer","minimum":0,"maximum":9007199254740991},"acceptedLastHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejectedLastHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"unknownLastHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"errorRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"estimatedCostLastHour":{"type":"number","minimum":0}},"required":["provider","endpoints","acceptedLastHour","rejectedLastHour","unknownLastHour","errorRate","estimatedCostLastHour"],"additionalProperties":false},"IngestHealth":{"type":"object","properties":{"pendingEnvelopes":{"type":"integer","minimum":0,"maximum":9007199254740991},"failedEnvelopes":{"type":"integer","minimum":0,"maximum":9007199254740991},"oldestPendingAgeSeconds":{"type":"number","minimum":0},"normalizationP95Seconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"quarantinedLastHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"bounceSourcesActive":{"type":"integer","minimum":0,"maximum":9007199254740991},"bounceSourcesLagging":{"type":"integer","minimum":0,"maximum":9007199254740991},"worstBounceLagSeconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["pendingEnvelopes","failedEnvelopes","oldestPendingAgeSeconds","normalizationP95Seconds","quarantinedLastHour","bounceSourcesActive","bounceSourcesLagging","worstBounceLagSeconds"],"additionalProperties":false},"PlatformCutover":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"workspaceName":{"type":"string"},"migrationId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"source":{"$ref":"#/components/schemas/MigrationSource"},"status":{"$ref":"#/components/schemas/MigrationStatus"},"frozenAt":{"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"}]},"cutOverAt":{"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"}]},"rollbackRequestedAt":{"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"}]},"rollbackApprovedAt":{"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"}]},"rollbackExcludedMessages":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"attention":{"type":"string","enum":["rollback_awaiting_approval","frozen","recent_cutover","recent_rollback"]}},"required":["workspaceId","workspaceName","migrationId","name","source","status","frozenAt","cutOverAt","rollbackRequestedAt","rollbackApprovedAt","rollbackExcludedMessages","attention"],"additionalProperties":false},"PlatformRecovery":{"type":"object","properties":{"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))$"},"targets":{"type":"object","properties":{"rpoSeconds":{"type":"number"},"rtoSeconds":{"type":"number"},"source":{"type":"string"}},"required":["rpoSeconds","rtoSeconds","source"],"additionalProperties":false},"release":{"type":"object","properties":{"api":{"type":"object","properties":{"release":{"type":"string"},"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))$"}},"required":["release","startedAt"],"additionalProperties":false},"workers":{"type":"array","items":{"type":"object","properties":{"release":{"type":"string"},"live":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["release","live"],"additionalProperties":false}},"migrations":{"type":"object","properties":{"applied":{"type":"integer","minimum":0,"maximum":9007199254740991},"latest":{"type":["string","null"]},"latestAppliedAt":{"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":["applied","latest","latestAppliedAt"],"additionalProperties":false}},"required":["api","workers","migrations"],"additionalProperties":false},"regions":{"type":"array","items":{"$ref":"#/components/schemas/RegionAuthority"}},"authorityHistory":{"type":"array","items":{"$ref":"#/components/schemas/AuthorityEvent"}},"drills":{"type":"array","items":{"$ref":"#/components/schemas/RestoreDrill"}},"measured":{"type":"object","properties":{"lastPassedAt":{"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"}]},"lastRecoverySeconds":{"type":["number","null"]},"lastRestorePointAgeSeconds":{"type":["number","null"]},"recoveryWithinTarget":{"type":["boolean","null"]},"drillOverdue":{"type":"boolean"}},"required":["lastPassedAt","lastRecoverySeconds","lastRestorePointAgeSeconds","recoveryWithinTarget","drillOverdue"],"additionalProperties":false}},"required":["generatedAt","targets","release","regions","authorityHistory","drills","measured"],"additionalProperties":false},"AuthorityEvent":{"type":"object","properties":{"region":{"$ref":"#/components/schemas/Region"},"action":{"type":"string","enum":["seed","activate","fence"]},"fromEpoch":{"anyOf":[{"$ref":"#/components/schemas/EpochString"},{"type":"null"}]},"toEpoch":{"$ref":"#/components/schemas/EpochString"},"location":{"type":"string"},"actor":{"type":"string"},"reason":{"type":"string"},"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))$"}},"required":["region","action","fromEpoch","toEpoch","location","actor","reason","occurredAt"],"additionalProperties":false},"RestoreDrill":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/RestoreDrillStatus"},"requestedBy":{"type":"string"},"reason":{"type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"startedAt":{"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"}]},"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"}]},"restorePointAt":{"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"}]},"backupBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"backupSeconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"restoreSeconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"verifySeconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"recoverySeconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"restorePointAgeSeconds":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"checks":{"type":"array","items":{"$ref":"#/components/schemas/RestoreDrillCheck"}},"error":{"type":["string","null"]}},"required":["id","status","requestedBy","reason","requestedAt","startedAt","finishedAt","restorePointAt","backupBytes","backupSeconds","restoreSeconds","verifySeconds","recoverySeconds","restorePointAgeSeconds","checks","error"],"additionalProperties":false},"RestoreDrillStatus":{"type":"string","enum":["requested","running","passed","failed"]},"RestoreDrillCheck":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","enum":["passed","failed","skipped"]},"detail":{"type":"string"}},"required":["name","status","detail"],"additionalProperties":false},"RequestRestoreDrillInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"],"additionalProperties":false},"ActivateDispatchAuthorityInput":{"type":"object","properties":{"expectedEpoch":{"$ref":"#/components/schemas/EpochString"},"location":{"type":"string","minLength":2,"maxLength":120},"servedRegions":{"minItems":1,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/Region"}},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["expectedEpoch","location","servedRegions","reason"],"additionalProperties":false},"FenceDispatchAuthorityInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"],"additionalProperties":false},"NotificationPreferenceList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/NotificationPreference"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"NotificationPreference":{"type":"object","properties":{"event":{"$ref":"#/components/schemas/NotificationEvent"},"label":{"type":"string"},"description":{"type":"string"},"critical":{"type":"boolean"},"inApp":{"type":"boolean","const":true},"email":{"type":"boolean"},"emailOffered":{"type":"boolean"},"push":{"type":"boolean"},"pushOffered":{"type":"boolean"},"recipients":{"$ref":"#/components/schemas/NotificationAudience"},"threshold":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"thresholdApplies":{"type":"boolean"},"configured":{"type":"boolean"},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["event","label","description","critical","inApp","email","emailOffered","push","pushOffered","recipients","threshold","thresholdApplies","configured","revision","updatedAt"],"additionalProperties":false},"NotificationEvent":{"type":"string","enum":["billing.payment","billing.subscription","billing.spend","account.alert","account.notice","campaign.sending","campaign.approval","domain.verification","audience.import"]},"NotificationAudience":{"type":"string","enum":["default","owners","billing_managers","workspace_managers","operators","approvers"]},"UpdateNotificationPreferenceInput":{"type":"object","properties":{"email":{"type":"boolean"},"push":{"type":"boolean"},"recipients":{"$ref":"#/components/schemas/NotificationAudience"},"threshold":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]}},"additionalProperties":false},"SupportCasePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SupportCase"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"SupportCase":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"subject":{"type":"string"},"category":{"$ref":"#/components/schemas/SupportCaseCategory"},"severity":{"$ref":"#/components/schemas/SupportCaseSeverity"},"description":{"type":"string"},"status":{"$ref":"#/components/schemas/SupportCaseStatus"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reply":{"type":["string","null"]},"repliedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"closedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"closeReason":{"type":["string","null"]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","workspaceId","subject","category","severity","description","status","createdByUserId","reply","repliedAt","closedAt","closeReason","revision","createdAt","updatedAt"],"additionalProperties":false},"SupportCaseCategory":{"type":"string","enum":["billing","deliverability","account","technical","other"]},"SupportCaseSeverity":{"type":"string","enum":["low","normal","urgent"]},"SupportCaseStatus":{"type":"string","enum":["open","answered","closed"]},"CreateSupportCaseInput":{"type":"object","properties":{"subject":{"type":"string","minLength":3,"maxLength":160},"category":{"$ref":"#/components/schemas/SupportCaseCategory"},"severity":{"default":"normal","$ref":"#/components/schemas/SupportCaseSeverity"},"description":{"type":"string","minLength":10,"maxLength":4000}},"required":["subject","category","description"],"additionalProperties":false},"CloseSupportCaseInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"PlatformSupportCasePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlatformSupportCase"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"PlatformSupportCase":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"subject":{"type":"string"},"category":{"$ref":"#/components/schemas/SupportCaseCategory"},"severity":{"$ref":"#/components/schemas/SupportCaseSeverity"},"description":{"type":"string"},"status":{"$ref":"#/components/schemas/SupportCaseStatus"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reply":{"type":["string","null"]},"repliedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"closedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"closeReason":{"type":["string","null"]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"workspaceName":{"type":"string"}},"required":["id","workspaceId","subject","category","severity","description","status","createdByUserId","reply","repliedAt","closedAt","closeReason","revision","createdAt","updatedAt","workspaceName"],"additionalProperties":false},"ReplySupportCaseInput":{"type":"object","properties":{"reply":{"type":"string","minLength":3,"maxLength":4000}},"required":["reply"],"additionalProperties":false},"PushSettings":{"type":"object","properties":{"available":{"type":"boolean"},"vapidPublicKey":{"type":["string","null"]},"devices":{"type":"array","items":{"$ref":"#/components/schemas/PushDevice"}}},"required":["available","vapidPublicKey","devices"],"additionalProperties":false},"PushDevice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"label":{"type":"string"},"endpointSha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastSuccessAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastFailureAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","label","endpointSha256","createdAt","lastSuccessAt","lastFailureAt"],"additionalProperties":false},"CreatePushDeviceInput":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":2048,"format":"uri"},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":80,"maxLength":100,"pattern":"^[A-Za-z0-9_-]+={0,2}$"},"auth":{"type":"string","minLength":16,"maxLength":32,"pattern":"^[A-Za-z0-9_-]+={0,2}$"}},"required":["p256dh","auth"]},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["endpoint","keys","label"],"additionalProperties":false},"PlanList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlanView"}},"annualAvailable":{"type":"boolean"},"notice":{"type":"string"},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","annualAvailable","notice","asOf"],"additionalProperties":false},"PlanView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"planKey":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"billingMode":{"$ref":"#/components/schemas/BillingMode"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"interval":{"type":"string","enum":["month","year"]},"monthlyPriceMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"includedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Managed accepted messages included per period."},"overagePerThousandMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Managed messages beyond the allowance, per 1,000."},"byosPerThousandMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Platform rate of own-server (BYOS) messages, per 1,000 — provider delivery charges excluded."},"childWorkspaces":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundBouncedUnits":{"type":"boolean","description":"Whether a bounce after acceptance refunds the unit (§16: only when the plan says so)."},"illustrative":{"type":"boolean","description":"True for §16 illustrative prices: never present them as approved."},"purchaseMode":{"type":"string","enum":["self_serve","quote","internal"]},"purchasable":{"type":"boolean"}},"required":["id","planKey","version","name","billingMode","currency","interval","monthlyPriceMinor","includedUnits","overagePerThousandMinor","byosPerThousandMinor","childWorkspaces","refundBouncedUnits","illustrative","purchaseMode","purchasable"],"additionalProperties":false},"BillingMode":{"type":"string","enum":["managed","byos"]},"BillingOverview":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"stripeConfigured":{"type":"boolean"},"subscription":{"anyOf":[{"$ref":"#/components/schemas/BillingSubscriptionView"},{"type":"null"}]},"entitlement":{"type":"object","properties":{"marketing":{"type":"object","properties":{"allowed":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["allowed","reason"],"additionalProperties":false},"transactional":{"type":"object","properties":{"allowed":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["allowed","reason"],"additionalProperties":false},"inGrace":{"type":"boolean"},"recipientChoicesUnaffected":{"type":"boolean","const":true}},"required":["marketing","transactional","inGrace","recipientChoicesUnaffected"],"additionalProperties":false},"credits":{"type":"object","properties":{"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"reserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"allowanceUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"headroomUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."}},"required":["available","reserved","allowanceUnits","headroomUnits"],"additionalProperties":false},"period":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"start":{"$ref":"#/components/schemas/IsoDateTime"},"end":{"$ref":"#/components/schemas/IsoDateTime"},"state":{"type":"string","enum":["open","closing","closed"]},"managedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"byosUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"estimate":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/CurrencyCode"},"subscriptionMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"managedOverageMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"byosPlatformMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"totalBeforeTaxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."}},"required":["currency","subscriptionMinor","managedOverageMinor","byosPlatformMinor","totalBeforeTaxMinor"],"additionalProperties":false}},"required":["id","start","end","state","managedUnits","byosUnits","estimate"],"additionalProperties":false},{"type":"null"}]},"limits":{"$ref":"#/components/schemas/BillingLimits"},"account":{"type":"object","properties":{"legalName":{"type":["string","null"]},"taxCountry":{"type":["string","null"]},"customerLinked":{"type":"boolean"}},"required":["legalName","taxCountry","customerLinked"],"additionalProperties":false},"notices":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"state":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["kind","state","createdAt"],"additionalProperties":false}},"addons":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceAddonView"}}},"required":["asOf","stripeConfigured","subscription","entitlement","credits","period","limits","account","notices","addons"],"additionalProperties":false},"BillingSubscriptionView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"stripeStatus":{"type":["string","null"]},"managedByStripe":{"type":"boolean"},"plan":{"$ref":"#/components/schemas/PlanView"},"currentPeriodStart":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"currentPeriodEnd":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"graceEndsAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"paymentFailedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"cancelAtPeriodEnd":{"type":"boolean"},"cancelAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"cancelledAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"trialEndsAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","status","stripeStatus","managedByStripe","plan","currentPeriodStart","currentPeriodEnd","graceEndsAt","paymentFailedAt","cancelAtPeriodEnd","cancelAt","cancelledAt","trialEndsAt","lastSyncedAt"],"additionalProperties":false},"SubscriptionStatus":{"type":"string","enum":["trialing","active","past_due","unpaid","paused","cancelled"]},"BillingLimits":{"type":"object","properties":{"spendCapMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},{"type":"null"}]},"alertThresholds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["spendCapMinor","alertThresholds","currency","revision"],"additionalProperties":false},"WorkspaceAddonView":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/AddonKey"},"name":{"type":"string"},"unit":{"type":"string","const":"mailbox"},"status":{"$ref":"#/components/schemas/AddonStatus"},"quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"inUse":{"type":"integer","minimum":0,"maximum":9007199254740991},"dailyCapPerUnit":{"type":"integer","minimum":1,"maximum":9007199254740991},"startedAt":{"$ref":"#/components/schemas/IsoDateTime"},"cancelledAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"managedByStripe":{"type":"boolean","const":false}},"required":["key","name","unit","status","quantity","inUse","dailyCapPerUnit","startedAt","cancelledAt","managedByStripe"],"additionalProperties":false},"AddonKey":{"type":"string","enum":["warmup-network"]},"AddonStatus":{"type":"string","enum":["active","cancelled"]},"CheckoutSessionView":{"type":"object","properties":{"sessionId":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["sessionId","url","expiresAt"],"additionalProperties":false},"CreateCheckoutInput":{"type":"object","properties":{"planVersionId":{"$ref":"#/components/schemas/Uuid"},"legalName":{"type":"string","minLength":2,"maxLength":200},"taxCountry":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 (Stripe Tax)."}},"required":["planVersionId","legalName","taxCountry"],"additionalProperties":false},"PortalSessionView":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false},"CreatePortalInput":{"type":"object","properties":{"returnUrl":{"type":"string","maxLength":2000,"format":"uri"}},"required":["returnUrl"],"additionalProperties":false},"UpdateBillingLimitsInput":{"type":"object","properties":{"spendCapMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"alertThresholds":{"maxItems":5,"type":"array","items":{"anyOf":[{"type":"number","const":50},{"type":"number","const":75},{"type":"number","const":80},{"type":"number","const":90},{"type":"number","const":100}]}}},"required":["spendCapMinor","alertThresholds"],"additionalProperties":false},"InvoicePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"InvoiceView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"stripeInvoiceId":{"type":"string"},"number":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"periodStart":{"$ref":"#/components/schemas/IsoDateTime"},"periodEnd":{"$ref":"#/components/schemas/IsoDateTime"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"subtotalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"taxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"amountDueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"amountPaidMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"hostedUrl":{"type":["string","null"]},"pdfUrl":{"type":["string","null"]},"attemptCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextPaymentAttempt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"kind":{"type":"string","enum":["subscription","managed_usage","byos_usage","adjustment","tax","other"]},"quantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"periodStart":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"periodEnd":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["description","kind","quantity","amountMinor","periodStart","periodEnd"],"additionalProperties":false}},"creditNotes":{"type":"array","items":{"$ref":"#/components/schemas/CreditNoteView"}},"byosProviderChargesExcluded":{"type":"boolean"}},"required":["id","stripeInvoiceId","number","status","periodStart","periodEnd","currency","subtotalMinor","taxMinor","totalMinor","amountDueMinor","amountPaidMinor","hostedUrl","pdfUrl","attemptCount","nextPaymentAttempt","lines","creditNotes","byosProviderChargesExcluded"],"additionalProperties":false},"InvoiceStatus":{"type":"string","enum":["draft","open","paid","void","uncollectible"]},"CreditNoteView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"number":{"type":["string","null"]},"status":{"type":"string"},"reason":{"type":["string","null"]},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"pdfUrl":{"type":["string","null"]},"issuedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","number","status","reason","totalMinor","currency","pdfUrl","issuedAt"],"additionalProperties":false},"BillingAdjustmentPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BillingAdjustmentView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"BillingAdjustmentView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["late_usage","bounce_refund","reconciliation"]},"routeType":{"$ref":"#/components/schemas/BillingRouteType"},"units":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents)."},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"reason":{"type":"string"},"closePolicyVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"type":"string","enum":["pending","submitted","failed"]},"stripeObjectId":{"type":["string","null"]},"periodStart":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","kind","routeType","units","amountMinor","currency","reason","closePolicyVersion","state","stripeObjectId","periodStart","createdAt"],"additionalProperties":false},"BillingRouteType":{"type":"string","enum":["managed","byos"],"description":"managed = the platform's MTA delivered (managed rate); byos = the customer's own server/provider (platform rate; the provider bills delivery separately)."},"MeterBatchPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MeterBatchView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"MeterBatchView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"batchKey":{"type":"string","description":"Deterministic, immutable; the Stripe idempotency key and meter-event identifier."},"meter":{"type":"string"},"routeType":{"$ref":"#/components/schemas/BillingRouteType"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"state":{"$ref":"#/components/schemas/MeterBatchState"},"periodStart":{"$ref":"#/components/schemas/IsoDateTime"},"periodEnd":{"$ref":"#/components/schemas/IsoDateTime"},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"submittedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"acknowledgedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","batchKey","meter","routeType","quantity","state","periodStart","periodEnd","attempts","submittedAt","acknowledgedAt","createdAt"],"additionalProperties":false},"MeterBatchState":{"type":"string","enum":["open","sealed","submitted","acknowledged","failed"]},"BillingReconciliationView":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationRow"}}},"required":["asOf","rows"],"additionalProperties":false},"ReconciliationRow":{"type":"object","properties":{"periodId":{"$ref":"#/components/schemas/Uuid"},"periodStart":{"$ref":"#/components/schemas/IsoDateTime"},"periodEnd":{"$ref":"#/components/schemas/IsoDateTime"},"day":{"type":"string","description":"YYYY-MM-DD (UTC) of the run."},"routeType":{"$ref":"#/components/schemas/BillingRouteType"},"localUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"batchedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"acknowledgedUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"stripeUnits":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},{"type":"null"}]},"adjustmentUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer email units (one per accepted message generation)."},"status":{"type":"string","enum":["matched","pending","discrepancy","stripe_unavailable"]},"detail":{"type":["string","null"]}},"required":["periodId","periodStart","periodEnd","day","routeType","localUnits","batchedUnits","acknowledgedUnits","stripeUnits","adjustmentUnits","status","detail"],"additionalProperties":false},"StripeIngestAccepted":{"type":"object","properties":{"received":{"type":"boolean","const":true},"duplicate":{"type":"boolean"}},"required":["received","duplicate"],"additionalProperties":false},"RetentionPolicy":{"type":"object","properties":{"rawEvidenceDays":{"type":"integer","minimum":7,"maximum":90},"eventDetailDays":{"type":"integer","minimum":30,"maximum":730},"aggregateDays":{"type":"integer","minimum":90,"maximum":1095},"auditDays":{"type":"integer","minimum":365,"maximum":2555},"exportFileDays":{"type":"integer","minimum":1,"maximum":30},"importFileDays":{"type":"integer","minimum":1,"maximum":90},"inactiveContactDays":{"anyOf":[{"type":"integer","minimum":180,"maximum":3650},{"type":"null"}]},"legalHold":{"type":"boolean"},"legalHoldReason":{"type":["string","null"]},"region":{"type":"string"},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Null while the platform defaults apply (never saved)."},"bounds":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"},"default":{"type":["number","null"]}},"required":["min","max","default"],"additionalProperties":false}}},"required":["rawEvidenceDays","eventDetailDays","aggregateDays","auditDays","exportFileDays","importFileDays","inactiveContactDays","legalHold","legalHoldReason","region","revision","updatedAt","bounds"],"additionalProperties":false},"UpdateRetentionPolicyInput":{"type":"object","properties":{"rawEvidenceDays":{"type":"integer","minimum":7,"maximum":90},"eventDetailDays":{"type":"integer","minimum":30,"maximum":730},"aggregateDays":{"type":"integer","minimum":90,"maximum":1095},"auditDays":{"type":"integer","minimum":365,"maximum":2555},"exportFileDays":{"type":"integer","minimum":1,"maximum":30},"importFileDays":{"type":"integer","minimum":1,"maximum":90},"inactiveContactDays":{"anyOf":[{"type":"integer","minimum":180,"maximum":3650},{"type":"null"}]},"legalHold":{"type":"boolean"},"legalHoldReason":{"anyOf":[{"type":"string","minLength":3,"maxLength":500},{"type":"null"}]}},"additionalProperties":false},"RetentionJobPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RetentionJob"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"RetentionJob":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"dataClass":{"$ref":"#/components/schemas/RetentionDataClass"},"retentionDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"listId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/RetentionJobStatus"},"held":{"type":"boolean"},"trigger":{"type":"string","enum":["schedule","manual"]},"report":{"$ref":"#/components/schemas/RetentionReport"},"deletedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"error":{"type":["string","null"]},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"finishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","dataClass","retentionDays","listId","status","held","trigger","report","deletedCount","error","startedAt","finishedAt","createdAt"],"additionalProperties":false},"RetentionDataClass":{"type":"string","enum":["raw_evidence","event_detail","aggregate","audit","export_files","import_files","contact","list_hygiene"],"description":"raw_evidence = DSN/webhook bodies; event_detail = per-recipient event rows (tracking rolled up, delivery diagnostics scrubbed, recipients pseudonymized); aggregate = non-PII rollups; audit = audit trail; export_files / import_files = objects in storage; contact = unsubscribed, inactive contacts; list_hygiene = per-list cleanup rules."},"RetentionJobStatus":{"type":"string","enum":["scheduled","running","completed","failed"]},"RetentionReport":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Affected counts per store, e.g. { trackingEventsRolledUp: 120, evidenceObjectsDeleted: 4, suppressionsPreserved: 2 }."},"RetentionRunAccepted":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/RetentionJob"}}},"required":["jobs"],"additionalProperties":false,"description":"202: the jobs are queued, not complete."},"RunRetentionInput":{"type":"object","properties":{"dataClass":{"$ref":"#/components/schemas/RetentionDataClass"}},"additionalProperties":false},"PrivacyRequestPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PrivacyRequest"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"PrivacyRequest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"type":{"$ref":"#/components/schemas/PrivacyRequestType"},"status":{"$ref":"#/components/schemas/PrivacyRequestStatus"},"subjectHint":{"type":"string","description":"Masked address (j***@example.com)."},"contactFound":{"type":"boolean","description":"Whether a contact matched the subject when the request was received."},"deadlineAt":{"$ref":"#/components/schemas/IsoDateTime"},"overdue":{"type":"boolean"},"legalHold":{"type":"boolean"},"legalHoldReason":{"type":["string","null"]},"verificationMethod":{"anyOf":[{"$ref":"#/components/schemas/PrivacyVerificationMethod"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"verifiedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"requestedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"rejectionReason":{"type":["string","null"]},"note":{"type":["string","null"]},"report":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"type":"null"}]},"resultExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","type","status","subjectHint","contactFound","deadlineAt","overdue","legalHold","legalHoldReason","verificationMethod","verifiedAt","verifiedByUserId","requestedByUserId","rejectionReason","note","report","resultExpiresAt","completedAt","revision","createdAt","updatedAt"],"additionalProperties":false},"PrivacyRequestType":{"type":"string","enum":["access","export","rectification","restriction","deletion"]},"PrivacyRequestStatus":{"type":"string","enum":["received","verifying","in_progress","completed","rejected","on_legal_hold"]},"PrivacyVerificationMethod":{"type":"string","enum":["authenticated_account","email_reply_match","document_check","controller_attestation","email_link"],"description":"authenticated_account = the subject asked from an account we already authenticate; email_reply_match = a reply from the subject's address to our challenge; document_check = an identity document checked and NOT stored; controller_attestation = the controller (customer) attests the request on the subject's behalf; email_link = the subject opened the signed, single-use link the platform emailed to the address and confirmed (recorded by the platform itself, never by an operator)."},"CreatePrivacyRequestInput":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/PrivacyRequestType"},"subjectEmail":{"type":"string","minLength":3,"maxLength":320},"deadlineDays":{"default":30,"type":"integer","minimum":1,"maximum":90},"legalHold":{"default":false,"type":"boolean"},"legalHoldReason":{"type":"string","minLength":3,"maxLength":500},"rectification":{"$ref":"#/components/schemas/RectificationChanges"},"note":{"type":"string","maxLength":1000}},"required":["type","subjectEmail"],"additionalProperties":false},"RectificationChanges":{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"locale":{"anyOf":[{"type":"string","maxLength":35},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"additionalProperties":false},"VerifyPrivacyRequestInput":{"type":"object","properties":{"method":{"$ref":"#/components/schemas/ManualPrivacyVerificationMethod"},"evidenceNote":{"type":"string","minLength":3,"maxLength":1000}},"required":["method","evidenceNote"],"additionalProperties":false},"ManualPrivacyVerificationMethod":{"type":"string","enum":["authenticated_account","email_reply_match","document_check","controller_attestation"]},"PrivacyVerificationLinkSent":{"type":"object","properties":{"requestId":{"$ref":"#/components/schemas/Uuid"},"sentAt":{"$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"linksSent":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["requestId","sentAt","expiresAt","linksSent"],"additionalProperties":false,"description":"202: the email is handed to the platform mail path after commit."},"SendPrivacyVerificationLinkInput":{"type":"object","properties":{"subjectEmail":{"type":"string","minLength":3,"maxLength":320}},"required":["subjectEmail"],"additionalProperties":false},"PrivacyVerificationPage":{"type":"object","properties":{"state":{"type":"string","enum":["pending","verified","expired","superseded"]},"workspaceName":{"type":"string"},"requestType":{"$ref":"#/components/schemas/PrivacyRequestType"},"subjectHint":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["state","workspaceName","requestType","subjectHint","expiresAt"],"additionalProperties":false},"PrivacyVerificationResult":{"type":"object","properties":{"state":{"type":"string","const":"verified"},"alreadyVerified":{"type":"boolean"},"requestType":{"$ref":"#/components/schemas/PrivacyRequestType"},"verifiedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["state","alreadyVerified","requestType","verifiedAt"],"additionalProperties":false},"ConfirmPrivacyVerificationInput":{"type":"object","properties":{"choice":{"type":"string","const":"confirm"}},"required":["choice"],"additionalProperties":false},"RejectPrivacyRequestInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":1000}},"required":["reason"],"additionalProperties":false},"PrivacyLegalHoldInput":{"type":"object","properties":{"hold":{"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["hold","reason"],"additionalProperties":false},"PrivacyResultLink":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["url","expiresAt"],"additionalProperties":false},"ListHygienePolicy":{"type":"object","properties":{"listId":{"$ref":"#/components/schemas/Uuid"},"unconfirmedExpiryDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"null"}]},"removeHardBounced":{"type":"boolean"},"removeComplained":{"type":"boolean"},"inactiveDays":{"anyOf":[{"type":"integer","minimum":30,"maximum":1095},{"type":"null"}]},"inactiveMinMessages":{"type":"integer","minimum":1,"maximum":100},"lastRunAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["listId","unconfirmedExpiryDays","removeHardBounced","removeComplained","inactiveDays","inactiveMinMessages","lastRunAt","revision"],"additionalProperties":false},"UpdateListHygieneInput":{"type":"object","properties":{"unconfirmedExpiryDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"null"}]},"removeHardBounced":{"type":"boolean"},"removeComplained":{"type":"boolean"},"inactiveDays":{"anyOf":[{"type":"integer","minimum":30,"maximum":1095},{"type":"null"}]},"inactiveMinMessages":{"type":"integer","minimum":1,"maximum":100}},"additionalProperties":false},"SupportGrantPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SupportGrant"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"SupportGrant":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"staffUserId":{"$ref":"#/components/schemas/Uuid"},"staffDisplayName":{"type":"string"},"grantedByUserId":{"$ref":"#/components/schemas/Uuid"},"reason":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/SupportGrantablePermission"}},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"active":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","staffUserId","staffDisplayName","grantedByUserId","reason","scopes","expiresAt","revokedAt","active","createdAt"],"additionalProperties":false},"SupportGrantablePermission":{"type":"string","enum":["workspace.read","membership.read","audience.read","consent.read","suppression.read","template.read","campaign.read","message.read","journey.read","report.read","infrastructure.read","infrastructure.manage","campaign.pause","billing.read","integrations.read","audit.read"]},"CreateSupportGrantInput":{"type":"object","properties":{"staffEmail":{"type":"string","minLength":3,"maxLength":320},"reason":{"type":"string","minLength":10,"maxLength":500},"scopes":{"minItems":1,"maxItems":16,"type":"array","items":{"$ref":"#/components/schemas/SupportGrantablePermission"}},"durationHours":{"default":4,"type":"integer","minimum":1,"maximum":72}},"required":["staffEmail","reason","scopes"],"additionalProperties":false},"RevokeSupportGrantInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"TrustProfile":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"businessName":{"type":["string","null"]},"website":{"type":["string","null"]},"businessStatus":{"$ref":"#/components/schemas/BusinessVerificationStatus"},"businessReviewReason":{"type":["string","null"]},"businessReviewedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"verifiedDomains":{"type":"integer","minimum":0,"maximum":9007199254740991},"riskTier":{"$ref":"#/components/schemas/RiskTier"},"workspaceStatus":{"$ref":"#/components/schemas/WorkspaceStatus"},"openCases":{"type":"integer","minimum":0,"maximum":9007199254740991},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["workspaceId","businessName","website","businessStatus","businessReviewReason","businessReviewedAt","verifiedDomains","riskTier","workspaceStatus","openCases","revision"],"additionalProperties":false},"BusinessVerificationStatus":{"type":"string","enum":["unverified","pending","verified","rejected"]},"RiskTier":{"type":"string","enum":["trial","standard","elevated","restricted"],"description":"Shared-pool risk tier (§18 'Shared pools isolate risk tiers'); trials stay on low quotas."},"SubmitBusinessVerificationInput":{"type":"object","properties":{"businessName":{"type":"string","minLength":2,"maxLength":200},"website":{"type":"string","maxLength":300,"format":"uri"},"description":{"type":"string","minLength":20,"maxLength":2000}},"required":["businessName","website","description"],"additionalProperties":false},"AbuseCasePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AbuseCase"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"AbuseCase":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"workspaceName":{"description":"Platform views only (null in tenant views).","type":["string","null"]},"signal":{"$ref":"#/components/schemas/TrustSignalKind"},"evidence":{"$ref":"#/components/schemas/TrustEvidence"},"status":{"$ref":"#/components/schemas/AbuseCaseStatus"},"decision":{"anyOf":[{"$ref":"#/components/schemas/TrustRestriction"},{"type":"null"}]},"reason":{"type":["string","null"]},"reviewerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"decidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"appealStatement":{"type":["string","null"]},"appealedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"appealOutcome":{"anyOf":[{"$ref":"#/components/schemas/AppealOutcome"},{"type":"null"}]},"appealReason":{"type":["string","null"]},"appealReviewerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"appealDecidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"openedBy":{"$ref":"#/components/schemas/ActorType"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","workspaceId","workspaceName","signal","evidence","status","decision","reason","reviewerUserId","decidedAt","appealStatement","appealedAt","appealOutcome","appealReason","appealReviewerUserId","appealDecidedAt","openedBy","revision","createdAt","updatedAt"],"additionalProperties":false},"TrustSignalKind":{"type":"string","enum":["complaint_rate","hard_bounce_rate","volume_spike","unverified_business_sending","compromised_credentials","manual_report","abuse_report"]},"TrustEvidence":{"type":"object","properties":{"windowHours":{"type":"integer","minimum":1,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"complaints":{"type":"integer","minimum":0,"maximum":9007199254740991},"hardBounces":{"type":"integer","minimum":0,"maximum":9007199254740991},"rate":{"type":"number","minimum":0,"maximum":1},"threshold":{"type":"number","minimum":0},"baselineDailyAverage":{"type":"number","minimum":0},"observed":{"type":"number","minimum":0},"notes":{"type":"array","items":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/IsoDateTime"},"by":{"type":"string"},"text":{"type":"string"}},"required":["at","by","text"],"additionalProperties":false}},"latest":{"type":"object","properties":{"windowHours":{"type":"integer","minimum":1,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"complaints":{"type":"integer","minimum":0,"maximum":9007199254740991},"hardBounces":{"type":"integer","minimum":0,"maximum":9007199254740991},"rate":{"type":"number","minimum":0,"maximum":1},"threshold":{"type":"number","minimum":0},"baselineDailyAverage":{"type":"number","minimum":0},"observed":{"type":"number","minimum":0}},"additionalProperties":false}},"additionalProperties":false},"AbuseCaseStatus":{"type":"string","enum":["open","under_review","actioned","appealed","closed"]},"TrustRestriction":{"type":"string","enum":["none","warning","quota_reduced","marketing_paused","suspended"]},"AppealOutcome":{"type":"string","enum":["upheld","overturned"]},"AppealAbuseCaseInput":{"type":"object","properties":{"statement":{"type":"string","minLength":20,"maxLength":5000}},"required":["statement"],"additionalProperties":false},"TrustTenantPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TrustTenant"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"TrustTenant":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"businessName":{"type":["string","null"]},"website":{"type":["string","null"]},"businessStatus":{"$ref":"#/components/schemas/BusinessVerificationStatus"},"businessReviewReason":{"type":["string","null"]},"businessReviewedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"verifiedDomains":{"type":"integer","minimum":0,"maximum":9007199254740991},"riskTier":{"$ref":"#/components/schemas/RiskTier"},"workspaceStatus":{"$ref":"#/components/schemas/WorkspaceStatus"},"openCases":{"type":"integer","minimum":0,"maximum":9007199254740991},"revision":{"$ref":"#/components/schemas/Revision"},"workspaceName":{"type":"string"},"businessDescription":{"type":["string","null"]},"signals":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/TrustSignalKind"},"value":{"type":"number"},"threshold":{"type":"number"},"breached":{"type":"boolean"}},"required":["kind","value","threshold","breached"],"additionalProperties":false}}},"required":["workspaceId","businessName","website","businessStatus","businessReviewReason","businessReviewedAt","verifiedDomains","riskTier","workspaceStatus","openCases","revision","workspaceName","businessDescription","signals"],"additionalProperties":false},"ReviewBusinessVerificationInput":{"type":"object","properties":{"status":{"type":"string","enum":["verified","rejected"]},"reason":{"type":"string","minLength":10,"maxLength":2000},"riskTier":{"$ref":"#/components/schemas/RiskTier"}},"required":["status","reason"],"additionalProperties":false},"PlatformAbuseCasePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AbuseCase"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"OpenAbuseCaseInput":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"signal":{"$ref":"#/components/schemas/TrustSignalKind"},"note":{"type":"string","minLength":10,"maxLength":2000}},"required":["workspaceId","signal","note"],"additionalProperties":false},"DecideAbuseCaseInput":{"type":"object","properties":{"decision":{"$ref":"#/components/schemas/TrustRestriction"},"reason":{"type":"string","minLength":10,"maxLength":2000}},"required":["decision","reason"],"additionalProperties":false},"DecideAppealInput":{"type":"object","properties":{"outcome":{"$ref":"#/components/schemas/AppealOutcome"},"reason":{"type":"string","minLength":10,"maxLength":2000}},"required":["outcome","reason"],"additionalProperties":false},"EvaluateSignalsResult":{"type":"object","properties":{"evaluatedWorkspaces":{"type":"integer","minimum":0,"maximum":9007199254740991},"casesOpened":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["evaluatedWorkspaces","casesOpened"],"additionalProperties":false},"BounceSourcePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BounceSource"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"BounceSource":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"transport":{"$ref":"#/components/schemas/BounceTransport"},"displayName":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"endpointId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"endpointName":{"type":["string","null"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"accessScope":{"$ref":"#/components/schemas/MailboxAccessScope"},"requiredOAuthScopes":{"type":"array","items":{"type":"string"}},"requiredForDispatch":{"type":"boolean"},"secret":{"type":"object","properties":{"configured":{"type":"boolean"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["active","rotating","revoked"]},{"type":"null"}]}},"required":["configured","version","status"],"additionalProperties":false},"oauth":{"anyOf":[{"$ref":"#/components/schemas/OAuthGrantSummary"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/BounceSourceState"},"cursorSummary":{"type":["string","null"]},"parserVersion":{"type":"string"},"health":{"$ref":"#/components/schemas/BounceSourceHealth"},"lastTest":{"anyOf":[{"$ref":"#/components/schemas/BounceSourceTest"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","transport","displayName","region","endpointId","endpointName","config","accessScope","requiredOAuthScopes","requiredForDispatch","secret","oauth","state","cursorSummary","parserVersion","health","lastTest","revision","createdAt","updatedAt"],"additionalProperties":false},"BounceTransport":{"type":"string","enum":["provider_events","hosted_inbound_dsn","gmail_api","microsoft_graph","imap","pop3_legacy"]},"MailboxAccessScope":{"type":"string","enum":["read","modify"]},"BounceSourceState":{"type":"string","enum":["draft","active","degraded","needs_reauthorization","disabled"]},"BounceSourceHealth":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/BounceSourceHealthStatus"},"lastSuccessAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastAttemptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lagSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unavailableSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastErrorCode":{"type":["string","null"]},"consecutiveFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credentialExpiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"parserFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unrecognized":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quarantined":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cursorResets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dispatch":{"type":"object","properties":{"required":{"type":"boolean"},"pauseAfterMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pauseAfterOrigin":{"$ref":"#/components/schemas/BounceRuleOrigin"},"blocking":{"type":"boolean"},"blockingSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"reason":{"type":["string","null"]}},"required":["required","pauseAfterMinutes","pauseAfterOrigin","blocking","blockingSince","reason"],"additionalProperties":false}},"required":["status","lastSuccessAt","lastAttemptAt","lagSeconds","unavailableSince","lastErrorCode","consecutiveFailures","credentialExpiresAt","parserFailures","unrecognized","quarantined","processed","cursorResets","dispatch"],"additionalProperties":false},"BounceSourceHealthStatus":{"type":"string","enum":["healthy","lagging","unavailable","needs_reauthorization","disabled","draft","event_driven"]},"BounceRuleOrigin":{"type":"string","enum":["platform_floor","platform_default","workspace","server","campaign"],"description":"Where an effective value comes from. `platform_floor` values cannot be overridden by any scope."},"BounceSourceTest":{"type":"object","properties":{"status":{"type":"string","enum":["passed","failed"]},"readOnly":{"type":"boolean","const":true},"credentialVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/BounceTestStep"}},"capabilities":{"type":"object","properties":{"canMove":{"type":"boolean"},"canDelete":{"type":"boolean"},"folderExists":{"type":"boolean"},"messageCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["canMove","canDelete","folderExists","messageCount"],"additionalProperties":false},"errorCode":{"type":["string","null"]},"ranAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["status","readOnly","credentialVersion","steps","capabilities","errorCode","ranAt"],"additionalProperties":false},"BounceTestStep":{"type":"object","properties":{"name":{"type":"string","enum":["config","egress","dns","tcp","tls","authentication","folder","capabilities","api"]},"status":{"type":"string","enum":["ok","failed","skipped"]},"detail":{"type":"string","maxLength":500}},"required":["name","status","detail"],"additionalProperties":false},"CreateBounceSourceInput":{"oneOf":[{"type":"object","properties":{"transport":{"type":"string","const":"imap"},"displayName":{"type":"string","minLength":1,"maxLength":120},"endpointId":{"$ref":"#/components/schemas/Uuid"},"requiredForDispatch":{"default":true,"type":"boolean"},"accessScope":{"default":"read","$ref":"#/components/schemas/MailboxAccessScope"},"config":{"$ref":"#/components/schemas/ImapSourceConfig"},"secret":{"anyOf":[{"$ref":"#/components/schemas/BouncePasswordSecretInput"},{"$ref":"#/components/schemas/BounceOAuthSecretInput"}]}},"required":["transport","displayName","config"],"additionalProperties":false},{"type":"object","properties":{"transport":{"type":"string","const":"pop3_legacy"},"displayName":{"type":"string","minLength":1,"maxLength":120},"endpointId":{"$ref":"#/components/schemas/Uuid"},"requiredForDispatch":{"default":true,"type":"boolean"},"accessScope":{"default":"read","$ref":"#/components/schemas/MailboxAccessScope"},"config":{"$ref":"#/components/schemas/Pop3SourceConfig"},"secret":{"$ref":"#/components/schemas/BouncePasswordSecretInput"}},"required":["transport","displayName","config"],"additionalProperties":false},{"type":"object","properties":{"transport":{"type":"string","const":"gmail_api"},"displayName":{"type":"string","minLength":1,"maxLength":120},"endpointId":{"$ref":"#/components/schemas/Uuid"},"requiredForDispatch":{"default":true,"type":"boolean"},"accessScope":{"default":"read","$ref":"#/components/schemas/MailboxAccessScope"},"config":{"$ref":"#/components/schemas/GmailSourceConfig"},"secret":{"$ref":"#/components/schemas/BounceOAuthSecretInput"}},"required":["transport","displayName","config"],"additionalProperties":false},{"type":"object","properties":{"transport":{"type":"string","const":"microsoft_graph"},"displayName":{"type":"string","minLength":1,"maxLength":120},"endpointId":{"$ref":"#/components/schemas/Uuid"},"requiredForDispatch":{"default":true,"type":"boolean"},"accessScope":{"default":"read","$ref":"#/components/schemas/MailboxAccessScope"},"config":{"$ref":"#/components/schemas/GraphSourceConfig"},"secret":{"$ref":"#/components/schemas/BounceOAuthSecretInput"}},"required":["transport","displayName","config"],"additionalProperties":false},{"type":"object","properties":{"transport":{"type":"string","const":"provider_events"},"displayName":{"type":"string","minLength":1,"maxLength":120},"endpointId":{"$ref":"#/components/schemas/Uuid"},"requiredForDispatch":{"default":true,"type":"boolean"},"accessScope":{"default":"read","$ref":"#/components/schemas/MailboxAccessScope"},"config":{"default":{},"type":"object","properties":{},"additionalProperties":false}},"required":["transport","displayName","endpointId"],"additionalProperties":false},{"type":"object","properties":{"transport":{"type":"string","const":"hosted_inbound_dsn"},"displayName":{"type":"string","minLength":1,"maxLength":120},"endpointId":{"$ref":"#/components/schemas/Uuid"},"requiredForDispatch":{"default":true,"type":"boolean"},"accessScope":{"default":"read","$ref":"#/components/schemas/MailboxAccessScope"},"config":{"default":{},"type":"object","properties":{},"additionalProperties":false}},"required":["transport","displayName"],"additionalProperties":false}]},"ImapSourceConfig":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":255},"port":{"default":993,"type":"integer","minimum":1,"maximum":65535},"tlsServerName":{"type":"string","minLength":1,"maxLength":255},"username":{"type":"string","minLength":1,"maxLength":320,"pattern":"^[^\\r\\n\\0]+$"},"authMethod":{"default":"password","type":"string","enum":["password","xoauth2"]},"oauthProvider":{"$ref":"#/components/schemas/MailboxOAuthProvider"},"folder":{"default":"INBOX","type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n\\0*%]+$"}},"required":["host","username"],"additionalProperties":false},"MailboxOAuthProvider":{"type":"string","enum":["google","microsoft"]},"BouncePasswordSecretInput":{"type":"object","properties":{"password":{"type":"string","maxLength":1024}},"additionalProperties":false},"BounceOAuthSecretInput":{"type":"object","properties":{"accessToken":{"type":"string","maxLength":4096},"refreshToken":{"type":"string","maxLength":4096},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"additionalProperties":false},"Pop3SourceConfig":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":255},"port":{"default":995,"type":"integer","minimum":1,"maximum":65535},"tlsServerName":{"type":"string","minLength":1,"maxLength":255},"username":{"type":"string","minLength":1,"maxLength":320,"pattern":"^[^\\r\\n\\0]+$"}},"required":["host","username"],"additionalProperties":false},"GmailSourceConfig":{"type":"object","properties":{"mailbox":{"default":"me","type":"string","minLength":1,"maxLength":320},"labelId":{"default":"INBOX","type":"string","minLength":1,"maxLength":200}},"additionalProperties":false},"GraphSourceConfig":{"type":"object","properties":{"mailbox":{"type":"string","minLength":1,"maxLength":320},"folder":{"default":"inbox","type":"string","minLength":1,"maxLength":200}},"required":["mailbox"],"additionalProperties":false},"UpdateBounceSourceInput":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":120},"endpointId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"requiredForDispatch":{"type":"boolean"},"accessScope":{"$ref":"#/components/schemas/MailboxAccessScope"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secret":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":4096}},"state":{"type":"string","enum":["active","disabled"]}},"additionalProperties":false},"TestBounceSourceInput":{"type":"object","properties":{"credentialVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"readOnly":{"default":true,"type":"boolean","const":true}},"additionalProperties":false},"PollBounceSourceResult":{"type":"object","properties":{"sourceId":{"$ref":"#/components/schemas/Uuid"},"scheduledAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["sourceId","scheduledAt"],"additionalProperties":false},"BouncePolicyOverview":{"type":"object","properties":{"platform":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rules":{"type":"array","items":{"type":"object","properties":{"bounceClass":{"$ref":"#/components/schemas/BounceClass"},"action":{"$ref":"#/components/schemas/BounceRuleAction"},"allowedActions":{"type":"array","items":{"$ref":"#/components/schemas/BounceRuleAction"}},"floor":{"type":"boolean"},"distinctMessages":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"windowDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reviewAfterDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["bounceClass","action","allowedActions","floor","distinctMessages","windowDays","reviewAfterDays"],"additionalProperties":false}},"rawEvidenceRetentionDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rawEvidenceRetentionCeilingDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sourceOutagePauseMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retrySchedule":{"type":"array","items":{"type":"string"}}},"required":["version","rules","rawEvidenceRetentionDays","rawEvidenceRetentionCeilingDays","sourceOutagePauseMinutes","retrySchedule"],"additionalProperties":false},"layers":{"type":"array","items":{"$ref":"#/components/schemas/BouncePolicyLayer"}},"effective":{"$ref":"#/components/schemas/EffectiveBouncePolicyBody"}},"required":["platform","layers","effective"],"additionalProperties":false},"BounceRuleAction":{"type":"string","enum":["suppress","suppress_marketing","suppress_temporary","throttle_route","pause_route_review","retry","review","quarantine","ignore"]},"BouncePolicyLayer":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"scope":{"$ref":"#/components/schemas/BouncePolicyLayerScope"},"scopeId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"scopeName":{"type":["string","null"]},"document":{"$ref":"#/components/schemas/BouncePolicyDocument"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","scope","scopeId","scopeName","document","version","createdAt"],"additionalProperties":false},"BouncePolicyLayerScope":{"type":"string","enum":["workspace","server","campaign"]},"BouncePolicyDocument":{"type":"object","properties":{"rules":{"type":"object","propertyNames":{"$ref":"#/components/schemas/BounceClass"},"additionalProperties":{"$ref":"#/components/schemas/BounceRulePatch"}},"mailboxDisposition":{"$ref":"#/components/schemas/MailboxDispositionPatch"},"rawEvidenceRetentionDays":{"type":"integer","minimum":1,"maximum":1000},"sourceOutagePauseMinutes":{"type":"integer","minimum":1,"maximum":1440},"signatureVerification":{"type":"boolean"},"tlsRequired":{"type":"boolean"}},"additionalProperties":false,"description":"One policy layer; absent fields inherit from the scope above."},"BounceRulePatch":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/BounceRuleAction"},"distinctMessages":{"type":"integer","minimum":1,"maximum":20},"windowDays":{"type":"integer","minimum":1,"maximum":30},"reviewAfterDays":{"type":"integer","minimum":1,"maximum":90}},"additionalProperties":false},"MailboxDispositionPatch":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/MailboxDispositionAction"},"folder":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n\\0*%]+$"},"retentionDays":{"type":"integer","minimum":7,"maximum":365}},"additionalProperties":false},"MailboxDispositionAction":{"type":"string","enum":["keep","move_after_commit","delete_after_retention"],"description":"After-processing behaviour. There is no 'empty the mailbox' (§12). Deletion only after durable processing AND the retention interval."},"EffectiveBouncePolicyBody":{"type":"object","properties":{"rules":{"type":"object","propertyNames":{"$ref":"#/components/schemas/BounceClass"},"additionalProperties":{"$ref":"#/components/schemas/EffectiveBounceRule"},"required":["hard_invalid_recipient","hard_invalid_domain","soft_mailbox_full","soft_transient_network","soft_rate_limited","blocked_policy","authentication_failure","content_rejected","complaint","unsubscribe","out_of_office","unknown"]},"mailboxDisposition":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/MailboxDispositionAction"},"folder":{"type":["string","null"]},"retentionDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"origin":{"$ref":"#/components/schemas/BounceRuleOrigin"}},"required":["action","folder","retentionDays","origin"],"additionalProperties":false},"rawEvidenceRetentionDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sourceOutagePauseMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"signatureVerification":{"type":"boolean","const":true},"tlsRequired":{"type":"boolean","const":true},"provenance":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/BounceRuleOrigin"}}},"required":["rules","mailboxDisposition","rawEvidenceRetentionDays","sourceOutagePauseMinutes","signatureVerification","tlsRequired","provenance"],"additionalProperties":false},"EffectiveBounceRule":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/BounceRuleAction"},"scope":{"type":"string","enum":["workspace","workspace_marketing"]},"distinctMessages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reviewAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"origin":{"$ref":"#/components/schemas/BounceRuleOrigin"},"fieldOrigins":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/BounceRuleOrigin"}},"locked":{"type":"boolean"}},"required":["action","origin","locked"],"additionalProperties":false},"CreateBouncePolicyInput":{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/BouncePolicyLayerScope"},"scopeId":{"$ref":"#/components/schemas/Uuid"},"document":{"$ref":"#/components/schemas/BouncePolicyDocument"}},"required":["scope","document"],"additionalProperties":false},"UpdateBouncePolicyInput":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/BouncePolicyDocument"}},"required":["document"],"additionalProperties":false},"EffectiveBouncePolicy":{"type":"object","properties":{"rules":{"type":"object","propertyNames":{"$ref":"#/components/schemas/BounceClass"},"additionalProperties":{"$ref":"#/components/schemas/EffectiveBounceRule"},"required":["hard_invalid_recipient","hard_invalid_domain","soft_mailbox_full","soft_transient_network","soft_rate_limited","blocked_policy","authentication_failure","content_rejected","complaint","unsubscribe","out_of_office","unknown"]},"mailboxDisposition":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/MailboxDispositionAction"},"folder":{"type":["string","null"]},"retentionDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"origin":{"$ref":"#/components/schemas/BounceRuleOrigin"}},"required":["action","folder","retentionDays","origin"],"additionalProperties":false},"rawEvidenceRetentionDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sourceOutagePauseMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"signatureVerification":{"type":"boolean","const":true},"tlsRequired":{"type":"boolean","const":true},"provenance":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/BounceRuleOrigin"}},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"hash":{"type":"string"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"serverId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"sourceBindings":{"type":"array","items":{"type":"object","properties":{"serverId":{"$ref":"#/components/schemas/Uuid"},"bounceSourceId":{"$ref":"#/components/schemas/Uuid"},"required":{"type":"boolean"}},"required":["serverId","bounceSourceId","required"],"additionalProperties":false}},"layers":{"type":"object","properties":{"workspace":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"server":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"campaign":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["workspace","server","campaign"],"additionalProperties":false}},"required":["rules","mailboxDisposition","rawEvidenceRetentionDays","sourceOutagePauseMinutes","signatureVerification","tlsRequired","provenance","version","hash","workspaceId","serverId","campaignId","sourceBindings","layers"],"additionalProperties":false},"ResolveBouncePolicyInput":{"type":"object","properties":{"serverId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"}},"additionalProperties":false},"CampaignBouncePolicy":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"layer":{"anyOf":[{"$ref":"#/components/schemas/BouncePolicyLayer"},{"type":"null"}]},"effective":{"$ref":"#/components/schemas/EffectiveBouncePolicy"},"servers":{"type":"array","items":{"type":"object","properties":{"serverId":{"$ref":"#/components/schemas/Uuid"},"serverName":{"type":"string"},"effective":{"$ref":"#/components/schemas/EffectiveBouncePolicy"}},"required":["serverId","serverName","effective"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"displayName":{"type":"string"},"transport":{"$ref":"#/components/schemas/BounceTransport"},"serverId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"health":{"$ref":"#/components/schemas/BounceSourceHealth"}},"required":["id","displayName","transport","serverId","health"],"additionalProperties":false}}},"required":["campaignId","campaignName","layer","effective","servers","sources"],"additionalProperties":false},"BounceEventPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BounceEvent"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"BounceEvent":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"sourceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"sourceName":{"type":["string","null"]},"transport":{"$ref":"#/components/schemas/BounceTransport"},"kind":{"$ref":"#/components/schemas/BounceEvidenceKind"},"recipientHint":{"type":["string","null"]},"messageId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignName":{"type":["string","null"]},"serverId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"smtpCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"enhancedStatus":{"type":["string","null"]},"diagnostic":{"type":["string","null"]},"bounceClass":{"anyOf":[{"$ref":"#/components/schemas/BounceClass"},{"type":"null"}]},"confidence":{"anyOf":[{"$ref":"#/components/schemas/EvidenceConfidence"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/BounceEventStatus"},"reason":{"type":["string","null"]},"action":{"anyOf":[{"$ref":"#/components/schemas/BounceRuleAction"},{"type":"null"}]},"feedbackType":{"type":["string","null"]},"parserVersion":{"type":"string"},"policyVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"supersedesId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"receivedAt":{"$ref":"#/components/schemas/IsoDateTime"},"reviewedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"reviewNote":{"type":["string","null"]}},"required":["id","sourceId","sourceName","transport","kind","recipientHint","messageId","campaignId","campaignName","serverId","smtpCode","enhancedStatus","diagnostic","bounceClass","confidence","status","reason","action","feedbackType","parserVersion","policyVersion","supersedesId","occurredAt","receivedAt","reviewedAt","reviewNote"],"additionalProperties":false},"BounceEvidenceKind":{"type":"string","enum":["dsn","arf","provider_event","auto_reply","human_reply","unrecognized","malformed","rejected_unsafe"]},"EvidenceConfidence":{"type":"string","enum":["verified_provider_event","verified_verp","original_envelope_id","message_id_match","unverified"],"description":"Correlation strength of inbound evidence, strongest first (§12)."},"BounceEventStatus":{"type":"string","enum":["applied","quarantined","ignored","duplicate","superseded","dismissed"]},"ReviewBounceEventInput":{"type":"object","properties":{"decision":{"type":"string","const":"dismiss"},"note":{"type":"string","minLength":1,"maxLength":500}},"required":["decision","note"],"additionalProperties":false},"BounceReprocessJob":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"status":{"type":"string","enum":["dry_run_ready","applied","failed"]},"dryRun":{"type":"boolean"},"parserVersion":{"type":"string"},"eventCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"diff":{"type":"array","items":{"type":"object","properties":{"eventId":{"$ref":"#/components/schemas/Uuid"},"changed":{"type":"boolean"},"evidenceAvailable":{"type":"boolean"},"before":{"type":"object","properties":{"bounceClass":{"anyOf":[{"$ref":"#/components/schemas/BounceClass"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/BounceEventStatus"},"parserVersion":{"type":"string"}},"required":["bounceClass","status","parserVersion"],"additionalProperties":false},"after":{"anyOf":[{"type":"object","properties":{"bounceClass":{"anyOf":[{"$ref":"#/components/schemas/BounceClass"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/BounceEventStatus"},"parserVersion":{"type":"string"}},"required":["bounceClass","status","parserVersion"],"additionalProperties":false},{"type":"null"}]},"proposedEffects":{"type":"array","items":{"type":"string"}}},"required":["eventId","changed","evidenceAvailable","before","after","proposedEffects"],"additionalProperties":false}},"summary":{"type":"object","properties":{"changed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unavailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"proposedSuppressions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"suppressionReviews":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["changed","unchanged","unavailable","proposedSuppressions","suppressionReviews"],"additionalProperties":false},"appliedFromJobId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"appliedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","status","dryRun","parserVersion","eventCount","diff","summary","appliedFromJobId","createdAt","appliedAt"],"additionalProperties":false},"ReprocessBounceEventsInput":{"type":"object","properties":{"eventIds":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"parserVersion":{"type":"string","minLength":1,"maxLength":40},"dryRun":{"default":true,"type":"boolean"},"dryRunJobId":{"$ref":"#/components/schemas/Uuid"}},"required":["eventIds"],"additionalProperties":false},"ComplaintPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Complaint"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Complaint":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"messageId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignName":{"type":["string","null"]},"provider":{"type":["string","null"]},"feedbackType":{"type":["string","null"]},"recipientHint":{"type":["string","null"]},"suppression":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"state":{"type":"string","enum":["active","lifted","pending"]}},"required":["id","state"],"additionalProperties":false},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"receivedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","messageId","campaignId","campaignName","provider","feedbackType","recipientHint","suppression","occurredAt","receivedAt"],"additionalProperties":false},"JourneyPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/JourneySummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"JourneySummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/JourneyKind"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/JourneyStatus"},"revision":{"$ref":"#/components/schemas/Revision"},"entryKind":{"type":["string","null"]},"activeVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"hasUnpublishedChanges":{"type":"boolean"},"stats":{"$ref":"#/components/schemas/JourneyStats"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","kind","name","description","status","revision","entryKind","activeVersion","hasUnpublishedChanges","stats","updatedAt","createdAt"],"additionalProperties":false},"JourneyKind":{"type":"string","enum":["journey","autoresponder","trigger"]},"JourneyStatus":{"type":"string","enum":["draft","published","paused","archived"]},"JourneyStats":{"type":"object","properties":{"entered":{"type":"integer","minimum":0,"maximum":9007199254740991},"active":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Runs active or waiting (S38 'Active contacts')."},"completed":{"type":"integer","minimum":0,"maximum":9007199254740991},"exited":{"type":"integer","minimum":0,"maximum":9007199254740991},"goalReached":{"type":"integer","minimum":0,"maximum":9007199254740991},"goalRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["entered","active","completed","exited","goalReached","goalRate"],"additionalProperties":false},"Journey":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/JourneyKind"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/JourneyStatus"},"revision":{"$ref":"#/components/schemas/Revision"},"entryKind":{"type":["string","null"]},"activeVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"hasUnpublishedChanges":{"type":"boolean"},"stats":{"$ref":"#/components/schemas/JourneyStats"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"draftGraph":{"$ref":"#/components/schemas/JourneyDraftGraph"},"draftSettings":{"$ref":"#/components/schemas/JourneySettings"},"draftHash":{"type":["string","null"]},"draftIssues":{"type":"array","items":{"$ref":"#/components/schemas/JourneyIssue"}},"updatedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"activeVersionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/JourneyVersionSummary"}}},"required":["id","kind","name","description","status","revision","entryKind","activeVersion","hasUnpublishedChanges","stats","updatedAt","createdAt","draftGraph","draftSettings","draftHash","draftIssues","updatedByUserId","activeVersionId","versions"],"additionalProperties":false},"JourneyDraftGraph":{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"nodes":{"default":[],"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/JourneyDraftNode"}},"edges":{"default":[],"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/JourneyEdge"}}},"required":["schemaVersion","nodes","edges"],"additionalProperties":false},"JourneyDraftNode":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"type":{"$ref":"#/components/schemas/JourneyNodeType"},"label":{"type":"string","maxLength":80},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"additionalProperties":false},"config":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","config"],"additionalProperties":false},"JourneyNodeType":{"type":"string","enum":["entry","delay","wait_until","condition","random_split","send_email","send_channel","update_field","list_membership","notify","webhook","exit"]},"JourneyEdge":{"type":"object","properties":{"from":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"to":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"branch":{"default":"next","$ref":"#/components/schemas/JourneyBranch"}},"required":["from","to","branch"],"additionalProperties":false},"JourneyBranch":{"type":"string","enum":["next","yes","no","unknown","a","b","met","timeout"]},"JourneySettings":{"type":"object","properties":{"reentry":{"default":"never","type":"string","enum":["never","after_exit","always","restart"]},"dedupeWindowHours":{"default":24,"type":"integer","minimum":0,"maximum":8760},"maxRunDays":{"default":90,"type":"integer","minimum":1,"maximum":730},"catchUp":{"default":{"mode":"fire_late","maxLatenessHours":24},"type":"object","properties":{"mode":{"default":"fire_late","type":"string","enum":["fire_late","exit_if_late"]},"maxLatenessHours":{"default":24,"type":"integer","minimum":1,"maximum":720}},"required":["mode","maxLatenessHours"],"additionalProperties":false},"goal":{"default":null,"anyOf":[{"$ref":"#/components/schemas/JourneyPredicate"},{"type":"null"}]},"entryFilter":{"default":null,"anyOf":[{"$ref":"#/components/schemas/JourneyPredicate"},{"type":"null"}]},"exitWhenNotSubscribedToListId":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["reentry","dedupeWindowHours","maxRunDays","catchUp","goal","entryFilter","exitWhenNotSubscribedToListId"],"additionalProperties":false},"JourneyPredicate":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"rule"},"rule":{"$ref":"#/components/schemas/__schema0"}},"required":["kind","rule"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"segment"},"segmentId":{"$ref":"#/components/schemas/Uuid"}},"required":["kind","segmentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"engagement"},"event":{"type":"string","enum":["opened","clicked"]},"nodeId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"}},"required":["kind","event","nodeId"],"additionalProperties":false}]},"JourneyIssue":{"type":"object","properties":{"code":{"type":"string","enum":["schema","no_entry","multiple_entries","duplicate_node_id","unknown_node","duplicate_branch","branch_not_allowed","missing_branch","edge_into_entry","cycle","unreachable","invalid_config","engagement_not_upstream","kind_shape","reference","too_large"]},"nodeId":{"type":["string","null"]},"path":{"description":"Config path inside the node (e.g. `config.amount`).","type":["string","null"]},"message":{"type":"string"}},"required":["code","nodeId","path","message"],"additionalProperties":false},"JourneyVersionSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"graphHash":{"type":"string"},"publishedAt":{"$ref":"#/components/schemas/IsoDateTime"},"publishedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"note":{"type":["string","null"]},"liveRuns":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","version","graphHash","publishedAt","publishedByUserId","note","liveRuns"],"additionalProperties":false},"CreateJourneyInput":{"type":"object","properties":{"kind":{"default":"journey","$ref":"#/components/schemas/JourneyKind"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"graph":{"$ref":"#/components/schemas/JourneyDraftGraphInput"},"settings":{"type":"object","properties":{"reentry":{"default":"never","type":"string","enum":["never","after_exit","always","restart"]},"dedupeWindowHours":{"default":24,"type":"integer","minimum":0,"maximum":8760},"maxRunDays":{"default":90,"type":"integer","minimum":1,"maximum":730},"catchUp":{"default":{"mode":"fire_late","maxLatenessHours":24},"type":"object","properties":{"mode":{"default":"fire_late","type":"string","enum":["fire_late","exit_if_late"]},"maxLatenessHours":{"default":24,"type":"integer","minimum":1,"maximum":720}},"additionalProperties":false},"goal":{"default":null,"anyOf":[{"$ref":"#/components/schemas/JourneyPredicate"},{"type":"null"}]},"entryFilter":{"default":null,"anyOf":[{"$ref":"#/components/schemas/JourneyPredicate"},{"type":"null"}]},"exitWhenNotSubscribedToListId":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"additionalProperties":false}},"required":["name"],"additionalProperties":false},"JourneyDraftGraphInput":{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"nodes":{"default":[],"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/JourneyDraftNodeInput"}},"edges":{"default":[],"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/JourneyEdgeInput"}}},"additionalProperties":false},"JourneyDraftNodeInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"type":{"$ref":"#/components/schemas/JourneyNodeType"},"label":{"type":"string","maxLength":80},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"additionalProperties":false},"config":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type"],"additionalProperties":false},"JourneyEdgeInput":{"type":"object","properties":{"from":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"to":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"branch":{"default":"next","$ref":"#/components/schemas/JourneyBranch"}},"required":["from","to"],"additionalProperties":false},"DuplicateJourneyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"additionalProperties":false},"UpdateJourneyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"graph":{"$ref":"#/components/schemas/JourneyDraftGraphInput"},"settings":{"type":"object","properties":{"reentry":{"default":"never","type":"string","enum":["never","after_exit","always","restart"]},"dedupeWindowHours":{"default":24,"type":"integer","minimum":0,"maximum":8760},"maxRunDays":{"default":90,"type":"integer","minimum":1,"maximum":730},"catchUp":{"default":{"mode":"fire_late","maxLatenessHours":24},"type":"object","properties":{"mode":{"default":"fire_late","type":"string","enum":["fire_late","exit_if_late"]},"maxLatenessHours":{"default":24,"type":"integer","minimum":1,"maximum":720}},"additionalProperties":false},"goal":{"default":null,"anyOf":[{"$ref":"#/components/schemas/JourneyPredicate"},{"type":"null"}]},"entryFilter":{"default":null,"anyOf":[{"$ref":"#/components/schemas/JourneyPredicate"},{"type":"null"}]},"exitWhenNotSubscribedToListId":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false},"JourneyValidationReport":{"type":"object","properties":{"valid":{"type":"boolean"},"graphHash":{"type":["string","null"]},"issues":{"type":"array","items":{"$ref":"#/components/schemas/JourneyIssue"}},"contentBindings":{"type":"array","items":{"$ref":"#/components/schemas/JourneyContentBinding"}}},"required":["valid","graphHash","issues","contentBindings"],"additionalProperties":false},"JourneyContentBinding":{"type":"object","properties":{"nodeId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignVersionId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":"string"},"contentHash":{"type":"string"},"quietHours":{"default":null,"anyOf":[{"$ref":"#/components/schemas/QuietHours"},{"type":"null"}]},"frequencyCap":{"default":null,"anyOf":[{"$ref":"#/components/schemas/FrequencyCap"},{"type":"null"}]},"channel":{"default":"email","type":"string","enum":["email","sms","whatsapp","web_push","mobile_push","wallet"]},"senderId":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["nodeId","campaignId","campaignVersionId","version","subject","contentHash","quietHours","frequencyCap","channel","senderId"],"additionalProperties":false},"JourneyVersion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"graphHash":{"type":"string"},"publishedAt":{"$ref":"#/components/schemas/IsoDateTime"},"publishedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"note":{"type":["string","null"]},"liveRuns":{"type":"integer","minimum":0,"maximum":9007199254740991},"graph":{"$ref":"#/components/schemas/JourneyDraftGraph"},"settings":{"$ref":"#/components/schemas/JourneySettings"},"contentBindings":{"type":"array","items":{"$ref":"#/components/schemas/JourneyContentBinding"}}},"required":["id","version","graphHash","publishedAt","publishedByUserId","note","liveRuns","graph","settings","contentBindings"],"additionalProperties":false},"PublishJourneyInput":{"type":"object","properties":{"graphHash":{"type":"string","minLength":16,"maxLength":128},"note":{"type":"string","maxLength":500}},"required":["graphHash"],"additionalProperties":false},"JourneyControlInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["reason"],"additionalProperties":false},"EnrollContactResult":{"type":"object","properties":{"commandId":{"type":"string"},"queuedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["commandId","queuedAt"],"additionalProperties":false},"EnrollContactInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"}},"required":["contactId"],"additionalProperties":false},"ImportJourneyEnrollmentPreview":{"type":"object","properties":{"importId":{"$ref":"#/components/schemas/Uuid"},"listId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"importStatus":{"type":"string"},"enrollable":{"type":"boolean"},"journeys":{"type":"array","items":{"$ref":"#/components/schemas/ImportJourneyCandidate"}},"reviewHash":{"type":"string"},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["importId","listId","importStatus","enrollable","journeys","reviewHash","asOf"],"additionalProperties":false},"ImportJourneyCandidate":{"type":"object","properties":{"journeyId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/JourneyKind"},"status":{"$ref":"#/components/schemas/JourneyStatus"},"versionId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"candidates":{"type":"integer","minimum":0,"maximum":9007199254740991},"wouldStart":{"type":"integer","minimum":0,"maximum":9007199254740991},"blockedByEntryRules":{"type":"integer","minimum":0,"maximum":9007199254740991},"entryFilter":{"type":"boolean"},"enrollment":{"anyOf":[{"$ref":"#/components/schemas/ImportJourneyEnrollment"},{"type":"null"}]}},"required":["journeyId","name","kind","status","versionId","version","candidates","wouldStart","blockedByEntryRules","entryFilter","enrollment"],"additionalProperties":false},"ImportJourneyEnrollment":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"importId":{"$ref":"#/components/schemas/Uuid"},"journeyId":{"$ref":"#/components/schemas/Uuid"},"journeyVersionId":{"$ref":"#/components/schemas/Uuid"},"state":{"type":"string","enum":["queued","running","completed","failed"]},"acknowledgedRuns":{"type":"integer","minimum":0,"maximum":9007199254740991},"started":{"type":"integer","minimum":0,"maximum":9007199254740991},"refused":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Contacts the journey's entry rules refused at start (re-entry, dedupe window, entry filter, erased)."},"requestedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"finishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","importId","journeyId","journeyVersionId","state","acknowledgedRuns","started","refused","requestedByUserId","createdAt","finishedAt"],"additionalProperties":false},"EnrollImportInput":{"type":"object","properties":{"journeyId":{"$ref":"#/components/schemas/Uuid"},"reviewHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"acknowledgedRuns":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["journeyId","reviewHash","acknowledgedRuns"],"additionalProperties":false},"JourneyRunPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/JourneyRunSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"JourneyRunSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"journeyId":{"$ref":"#/components/schemas/Uuid"},"journeyVersionId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contactId":{"$ref":"#/components/schemas/Uuid"},"contactHint":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/JourneyRunState"},"currentNodeId":{"type":["string","null"]},"entrySource":{"type":"string"},"exitReason":{"type":["string","null"]},"waitingUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"startedAt":{"$ref":"#/components/schemas/IsoDateTime"},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","journeyId","journeyVersionId","version","contactId","contactHint","state","currentNodeId","entrySource","exitReason","waitingUntil","startedAt","endedAt"],"additionalProperties":false},"JourneyRunState":{"type":"string","enum":["active","waiting","completed","exited","cancelled","failed"]},"JourneyRunDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"journeyId":{"$ref":"#/components/schemas/Uuid"},"journeyVersionId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contactId":{"$ref":"#/components/schemas/Uuid"},"contactHint":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/JourneyRunState"},"currentNodeId":{"type":["string","null"]},"entrySource":{"type":"string"},"exitReason":{"type":["string","null"]},"waitingUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"startedAt":{"$ref":"#/components/schemas/IsoDateTime"},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"entryEventKey":{"type":"string"},"executions":{"type":"array","items":{"$ref":"#/components/schemas/NodeExecutionView"}},"timers":{"type":"array","items":{"$ref":"#/components/schemas/DurableTimerView"}},"graph":{"$ref":"#/components/schemas/JourneyDraftGraph"},"retryableNodeIds":{"type":"array","items":{"type":"string"}}},"required":["id","journeyId","journeyVersionId","version","contactId","contactHint","state","currentNodeId","entrySource","exitReason","waitingUntil","startedAt","endedAt","entryEventKey","executions","timers","graph","retryableNodeIds"],"additionalProperties":false},"NodeExecutionView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"nodeId":{"type":"string"},"nodeType":{"type":"string"},"iteration":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/NodeExecutionState"},"branch":{"anyOf":[{"$ref":"#/components/schemas/JourneyBranch"},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"messageId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"error":{"type":["string","null"]},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"finishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","nodeId","nodeType","iteration","state","branch","result","messageId","error","startedAt","finishedAt"],"additionalProperties":false},"NodeExecutionState":{"type":"string","enum":["pending","running","succeeded","failed","skipped"]},"DurableTimerView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"nodeId":{"type":"string"},"dueAt":{"$ref":"#/components/schemas/IsoDateTime"},"state":{"$ref":"#/components/schemas/TimerState"},"catchUpPolicy":{"type":"string"},"firedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","nodeId","dueAt","state","catchUpPolicy","firedAt"],"additionalProperties":false},"TimerState":{"type":"string","enum":["pending","claimed","fired","cancelled"]},"RetryRunStepInput":{"type":"object","properties":{"nodeId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["nodeId","reason"],"additionalProperties":false},"JourneyReport":{"type":"object","properties":{"journeyId":{"$ref":"#/components/schemas/Uuid"},"journeyVersionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stats":{"$ref":"#/components/schemas/JourneyStats"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/JourneyStepReport"}},"exitReasons":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["journeyId","journeyVersionId","version","stats","steps","exitReasons","asOf"],"additionalProperties":false},"JourneyStepReport":{"type":"object","properties":{"nodeId":{"type":"string"},"type":{"type":"string"},"label":{"type":["string","null"]},"entered":{"type":"integer","minimum":0,"maximum":9007199254740991},"succeeded":{"type":"integer","minimum":0,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"waiting":{"type":"integer","minimum":0,"maximum":9007199254740991},"branches":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"messages":{"anyOf":[{"type":"object","properties":{"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"delivered":{"type":"integer","minimum":0,"maximum":9007199254740991},"bounced":{"type":"integer","minimum":0,"maximum":9007199254740991},"suppressed":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"opened":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"clicked":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["created","accepted","delivered","bounced","suppressed","failed","opened","clicked"],"additionalProperties":false},{"type":"null"}]}},"required":["nodeId","type","label","entered","succeeded","skipped","failed","waiting","branches","messages"],"additionalProperties":false},"FormPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Form"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Form":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/FormKind"},"status":{"$ref":"#/components/schemas/GrowthStatus"},"draft":{"$ref":"#/components/schemas/FormDefinition"},"draftChanged":{"type":"boolean"},"liveVersion":{"anyOf":[{"$ref":"#/components/schemas/GrowthLiveVersion"},{"type":"null"}]},"embed":{"$ref":"#/components/schemas/FormEmbed"},"stats":{"$ref":"#/components/schemas/FormStats"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","kind","status","draft","draftChanged","liveVersion","embed","stats","revision","createdAt","updatedAt"],"additionalProperties":false},"FormKind":{"type":"string","enum":["subscribe","profile_update","unsubscribe"]},"GrowthStatus":{"type":"string","enum":["draft","published","archived"],"description":"draft = never collected anything; published = a live immutable version answers publicly; archived = stopped, history kept."},"FormDefinition":{"type":"object","properties":{"kind":{"type":"string","enum":["profile_update","unsubscribe"]},"title":{"type":"string","minLength":1,"maxLength":200},"intro":{"type":"string","maxLength":2000},"submitLabel":{"default":"Subscribe","type":"string","minLength":1,"maxLength":60},"fields":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FormField"}},"listIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"noticeVersion":{"type":"string","minLength":1,"maxLength":100},"noticeUrl":{"type":"string","maxLength":2048,"format":"uri"},"controllerIdentity":{"type":"string","minLength":1,"maxLength":200},"challenge":{"default":"none","type":"string","enum":["none","turnstile"]},"allowedOrigins":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"success":{"default":{"type":"message","message":"Thank you, you are subscribed."},"$ref":"#/components/schemas/FormSuccess"},"pendingMessage":{"default":"Almost done: check your inbox and confirm your subscription.","type":"string","minLength":1,"maxLength":1000},"errorMessage":{"default":"We could not save your subscription. Please check the form and try again.","type":"string","minLength":1,"maxLength":1000},"confirmedRedirectUrl":{"type":"string","maxLength":2048}},"required":["title","submitLabel","fields","listIds","challenge","allowedOrigins","success","pendingMessage","errorMessage"],"additionalProperties":false},"FormField":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"email"},"key":{"type":"string","const":"email"},"label":{"type":"string","minLength":1,"maxLength":200},"helpText":{"type":"string","maxLength":500},"required":{"default":true,"type":"boolean","const":true}},"required":["type","key","label","required"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"contact_field"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":200},"helpText":{"type":"string","maxLength":500},"required":{"default":false,"type":"boolean"},"fieldKey":{"type":"string","minLength":1,"maxLength":64}},"required":["type","key","label","required","fieldKey"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"consent"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"purpose":{"type":"string","enum":["marketing","tracking","profiling"]},"statement":{"type":"string","minLength":1,"maxLength":1000},"required":{"default":false,"type":"boolean"}},"required":["type","key","purpose","statement","required"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"list_choice"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":200},"helpText":{"type":"string","maxLength":500},"listIds":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"required":{"default":false,"type":"boolean"}},"required":["type","key","label","listIds","required"],"additionalProperties":false}]},"FormSuccess":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"message":{"type":"string","minLength":1,"maxLength":1000}},"required":["type","message"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"redirect"},"url":{"type":"string","maxLength":2048}},"required":["type","url"],"additionalProperties":false}]},"GrowthLiveVersion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"definitionHash":{"type":"string"},"publishedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","version","definitionHash","publishedAt"],"additionalProperties":false},"FormEmbed":{"type":"object","properties":{"hostedUrl":{"type":"string"},"submitUrl":{"type":"string"},"iframeSnippet":{"type":"string"},"htmlSnippet":{"type":"string"}},"required":["hostedUrl","submitUrl","iframeSnippet","htmlSnippet"],"additionalProperties":false},"FormStats":{"type":"object","properties":{"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"submissions":{"type":"integer","minimum":0,"maximum":9007199254740991},"confirmedSignups":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["views","submissions","confirmedSignups"],"additionalProperties":false,"description":"All-time counters (views = renders of the hosted/embedded form, not people)."},"CreateFormInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"default":"subscribe","$ref":"#/components/schemas/FormKind"},"listIds":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["name"],"additionalProperties":false},"UpdateFormInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"draft":{"$ref":"#/components/schemas/FormDefinitionInput"}},"additionalProperties":false},"FormDefinitionInput":{"type":"object","properties":{"kind":{"type":"string","enum":["profile_update","unsubscribe"]},"title":{"type":"string","minLength":1,"maxLength":200},"intro":{"type":"string","maxLength":2000},"submitLabel":{"default":"Subscribe","type":"string","minLength":1,"maxLength":60},"fields":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FormFieldInput"}},"listIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"noticeVersion":{"type":"string","minLength":1,"maxLength":100},"noticeUrl":{"type":"string","maxLength":2048,"format":"uri"},"controllerIdentity":{"type":"string","minLength":1,"maxLength":200},"challenge":{"default":"none","type":"string","enum":["none","turnstile"]},"allowedOrigins":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":200}},"success":{"default":{"type":"message","message":"Thank you, you are subscribed."},"$ref":"#/components/schemas/FormSuccess"},"pendingMessage":{"default":"Almost done: check your inbox and confirm your subscription.","type":"string","minLength":1,"maxLength":1000},"errorMessage":{"default":"We could not save your subscription. Please check the form and try again.","type":"string","minLength":1,"maxLength":1000},"confirmedRedirectUrl":{"type":"string","maxLength":2048}},"required":["title","fields","listIds"],"additionalProperties":false},"FormFieldInput":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"email"},"key":{"type":"string","const":"email"},"label":{"type":"string","minLength":1,"maxLength":200},"helpText":{"type":"string","maxLength":500},"required":{"default":true,"type":"boolean","const":true}},"required":["type","key","label"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"contact_field"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":200},"helpText":{"type":"string","maxLength":500},"required":{"default":false,"type":"boolean"},"fieldKey":{"type":"string","minLength":1,"maxLength":64}},"required":["type","key","label","fieldKey"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"consent"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"purpose":{"type":"string","enum":["marketing","tracking","profiling"]},"statement":{"type":"string","minLength":1,"maxLength":1000},"required":{"default":false,"type":"boolean"}},"required":["type","key","purpose","statement"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"list_choice"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":200},"helpText":{"type":"string","maxLength":500},"listIds":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"required":{"default":false,"type":"boolean"}},"required":["type","key","label","listIds"],"additionalProperties":false}]},"PublishGrowthInput":{"type":"object","properties":{"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["revision"],"additionalProperties":false},"UnpublishGrowthInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"DuplicateGrowthInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"additionalProperties":false},"GrowthVersionList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GrowthVersion"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"GrowthVersion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"definitionHash":{"type":"string"},"publishedAt":{"$ref":"#/components/schemas/IsoDateTime"},"publishedBy":{"type":["string","null"]},"live":{"type":"boolean"}},"required":["id","version","definitionHash","publishedAt","publishedBy","live"],"additionalProperties":false},"FormAnalytics":{"type":"object","properties":{"formId":{"$ref":"#/components/schemas/Uuid"},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"views":{"$ref":"#/components/schemas/Metric"},"submissions":{"$ref":"#/components/schemas/Metric"},"confirmedSignups":{"$ref":"#/components/schemas/Metric"},"pendingConfirmations":{"$ref":"#/components/schemas/Metric"},"conversion":{"$ref":"#/components/schemas/Metric"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"submissions":{"type":"integer","minimum":0,"maximum":9007199254740991},"confirmed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["day","views","submissions","confirmed"],"additionalProperties":false}}},"required":["formId","asOf","views","submissions","confirmedSignups","pendingConfirmations","conversion","days"],"additionalProperties":false},"PublicForm":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"kind":{"default":"subscribe","$ref":"#/components/schemas/FormKind"},"recipient":{"default":null,"anyOf":[{"type":"object","properties":{"maskedAddress":{"type":"string"}},"required":["maskedAddress"],"additionalProperties":false},{"type":"null"}]},"title":{"type":"string"},"intro":{"type":["string","null"]},"submitLabel":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/PublicFormField"}},"honeypotField":{"type":"string","const":"_hp"},"challenge":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"turnstile"},"siteKey":{"type":"string"},"field":{"type":"string","const":"cf-turnstile-response"}},"required":["type","siteKey","field"],"additionalProperties":false}]},"noticeVersion":{"type":["string","null"]},"noticeUrl":{"type":["string","null"]},"controllerIdentity":{"type":["string","null"]},"embedOrigins":{"type":"array","items":{"type":"string"}},"submitPath":{"type":"string"},"errorMessage":{"type":"string"}},"required":["id","version","kind","recipient","title","intro","submitLabel","fields","honeypotField","challenge","noticeVersion","noticeUrl","controllerIdentity","embedOrigins","submitPath","errorMessage"],"additionalProperties":false},"PublicFormField":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"email"},"key":{"type":"string","const":"email"},"label":{"type":"string"},"helpText":{"type":["string","null"]},"required":{"type":"boolean","const":true}},"required":["type","key","label","helpText","required"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"input"},"key":{"type":"string"},"label":{"type":"string"},"helpText":{"type":["string","null"]},"required":{"type":"boolean"},"inputType":{"type":"string","enum":["text","number","date","url"]},"maxLength":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["type","key","label","helpText","required","inputType","maxLength"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"select"},"key":{"type":"string"},"label":{"type":"string"},"helpText":{"type":["string","null"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}}},"required":["type","key","label","helpText","required","options"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"consent"},"key":{"type":"string"},"purpose":{"type":"string","enum":["marketing","tracking","profiling"]},"statement":{"type":"string"},"required":{"type":"boolean"}},"required":["type","key","purpose","statement","required"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"list_choice"},"key":{"type":"string"},"label":{"type":"string"},"helpText":{"type":["string","null"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"listName":{"type":"string"},"description":{"type":["string","null"]}},"required":["name","listName","description"],"additionalProperties":false}}},"required":["type","key","label","helpText","required","options"],"additionalProperties":false}]},"FormSubmissionReceipt":{"type":"object","properties":{"status":{"type":"string","const":"received"},"next":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"message"},"kind":{"type":"string","enum":["pending_confirmation","done"]},"message":{"type":"string"}},"required":["type","kind","message"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"redirect"},"url":{"type":"string"}},"required":["type","url"],"additionalProperties":false}]}},"required":["status","next"],"additionalProperties":false},"FormSubmissionInput":{"type":"object","properties":{"fields":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":100},"additionalProperties":{"type":"string","maxLength":2000}}},"required":["fields"],"additionalProperties":false},"SurveyPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Survey"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Survey":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"purpose":{"$ref":"#/components/schemas/SurveyPurpose"},"status":{"$ref":"#/components/schemas/GrowthStatus"},"draft":{"$ref":"#/components/schemas/SurveyDefinition"},"draftChanged":{"type":"boolean"},"liveVersion":{"anyOf":[{"$ref":"#/components/schemas/GrowthLiveVersion"},{"type":"null"}]},"publicUrl":{"type":["string","null"]},"stats":{"$ref":"#/components/schemas/SurveyStats"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","purpose","status","draft","draftChanged","liveVersion","publicUrl","stats","revision","createdAt","updatedAt"],"additionalProperties":false},"SurveyPurpose":{"type":"string","enum":["feedback","unsubscribe"],"description":"unsubscribe surveys are offered on S51 AFTER the suppression succeeded, always optional (R040)."},"SurveyDefinition":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"intro":{"type":"string","maxLength":2000},"sections":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/SurveySection"}},"anonymous":{"default":true,"type":"boolean"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"thankYouMessage":{"default":"Thank you for your answers.","type":"string","minLength":1,"maxLength":1000},"submitLabel":{"default":"Send","type":"string","minLength":1,"maxLength":60},"notifyEvent":{"default":false,"type":"boolean"},"listIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"notifyMemberUserIds":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["title","sections","anonymous","thankYouMessage","submitLabel","notifyEvent","listIds"],"additionalProperties":false},"SurveySection":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":1000},"questions":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/SurveyQuestion"}},"rules":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/SurveyRule"}}},"required":["id","questions","rules"],"additionalProperties":false},"SurveyQuestion":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"$ref":"#/components/schemas/SurveyQuestionType"},"label":{"type":"string","minLength":1,"maxLength":500},"helpText":{"type":"string","maxLength":500},"required":{"default":false,"type":"boolean"},"options":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":200}},"required":["value","label"],"additionalProperties":false}},"maxLength":{"type":"integer","minimum":1,"maximum":10000},"scale":{"type":"object","properties":{"min":{"anyOf":[{"type":"number","const":0},{"type":"number","const":1}]},"max":{"type":"integer","minimum":2,"maximum":10},"minLabel":{"type":"string","maxLength":60},"maxLabel":{"type":"string","maxLength":60}},"required":["min","max"],"additionalProperties":false},"upload":{"type":"object","properties":{"accept":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["image/png","image/jpeg","application/pdf","text/plain"]}},"maxBytes":{"type":"integer","minimum":1024,"maximum":10485760}},"required":["accept","maxBytes"],"additionalProperties":false}},"required":["id","type","label","required"],"additionalProperties":false},"SurveyQuestionType":{"type":"string","enum":["short_text","long_text","single_choice","multi_choice","dropdown","country","rating","file_upload"]},"SurveyRule":{"type":"object","properties":{"when":{"type":"object","properties":{"questionId":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"op":{"type":"string","enum":["equals","not_equals","includes","answered","not_answered"]},"value":{"type":"string","maxLength":200}},"required":["questionId","op"],"additionalProperties":false},"goTo":{"type":"string","pattern":"^(end|[a-z][a-z0-9_]{0,39})$"}},"required":["when","goTo"],"additionalProperties":false},"SurveyStats":{"type":"object","properties":{"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"responses":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["views","responses"],"additionalProperties":false},"CreateSurveyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"purpose":{"$ref":"#/components/schemas/SurveyPurpose"},"listIds":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["name","purpose"],"additionalProperties":false},"UpdateSurveyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"draft":{"$ref":"#/components/schemas/SurveyDefinitionInput"}},"additionalProperties":false},"SurveyDefinitionInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"intro":{"type":"string","maxLength":2000},"sections":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/SurveySectionInput"}},"anonymous":{"default":true,"type":"boolean"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"thankYouMessage":{"default":"Thank you for your answers.","type":"string","minLength":1,"maxLength":1000},"submitLabel":{"default":"Send","type":"string","minLength":1,"maxLength":60},"notifyEvent":{"default":false,"type":"boolean"},"listIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"notifyMemberUserIds":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["title","sections"],"additionalProperties":false},"SurveySectionInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":1000},"questions":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/SurveyQuestionInput"}},"rules":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/SurveyRule"}}},"required":["id","questions"],"additionalProperties":false},"SurveyQuestionInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"$ref":"#/components/schemas/SurveyQuestionType"},"label":{"type":"string","minLength":1,"maxLength":500},"helpText":{"type":"string","maxLength":500},"required":{"default":false,"type":"boolean"},"options":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":200}},"required":["value","label"],"additionalProperties":false}},"maxLength":{"type":"integer","minimum":1,"maximum":10000},"scale":{"type":"object","properties":{"min":{"anyOf":[{"type":"number","const":0},{"type":"number","const":1}]},"max":{"type":"integer","minimum":2,"maximum":10},"minLabel":{"type":"string","maxLength":60},"maxLabel":{"type":"string","maxLength":60}},"required":["min","max"],"additionalProperties":false},"upload":{"type":"object","properties":{"accept":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["image/png","image/jpeg","application/pdf","text/plain"]}},"maxBytes":{"type":"integer","minimum":1024,"maximum":10485760}},"required":["accept","maxBytes"],"additionalProperties":false}},"required":["id","type","label"],"additionalProperties":false},"SurveyResults":{"type":"object","properties":{"surveyId":{"$ref":"#/components/schemas/Uuid"},"purpose":{"$ref":"#/components/schemas/SurveyPurpose"},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"views":{"$ref":"#/components/schemas/Metric"},"responses":{"$ref":"#/components/schemas/Metric"},"completion":{"$ref":"#/components/schemas/Metric"},"anonymous":{"type":"boolean"},"linkedResponses":{"type":"integer","minimum":0,"maximum":9007199254740991},"questions":{"type":"array","items":{"$ref":"#/components/schemas/SurveyQuestionResult"}}},"required":["surveyId","purpose","asOf","views","responses","completion","anonymous","linkedResponses","questions"],"additionalProperties":false},"SurveyQuestionResult":{"type":"object","properties":{"questionId":{"type":"string"},"sectionId":{"type":"string"},"label":{"type":"string"},"type":{"$ref":"#/components/schemas/SurveyQuestionType"},"reached":{"type":"integer","minimum":0,"maximum":9007199254740991},"answered":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"share":{"$ref":"#/components/schemas/Metric"}},"required":["value","label","count","share"],"additionalProperties":false}},{"type":"null"}]},"rating":{"anyOf":[{"type":"object","properties":{"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"average":{"$ref":"#/components/schemas/Metric"},"distribution":{"type":"array","items":{"type":"object","properties":{"score":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["score","count"],"additionalProperties":false}}},"required":["min","max","average","distribution"],"additionalProperties":false},{"type":"null"}]},"textAnswers":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["questionId","sectionId","label","type","reached","answered","options","rating","textAnswers"],"additionalProperties":false},"SurveyResponsePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SurveyResponse"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"SurveyResponse":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"surveyVersion":{"type":"integer","minimum":1,"maximum":9007199254740991},"source":{"type":"string","enum":["hosted","unsubscribe"]},"submittedAt":{"$ref":"#/components/schemas/IsoDateTime"},"contact":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"emailMasked":{"type":"string"}},"required":["id","emailMasked"],"additionalProperties":false},{"type":"null"}]},"path":{"type":"array","items":{"type":"string"}},"answers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"maxItems":30,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"}]}},"uploads":{"type":"array","items":{"$ref":"#/components/schemas/SurveyUploadSummary"}}},"required":["id","surveyVersion","source","submittedAt","contact","path","answers","uploads"],"additionalProperties":false},"SurveyUploadSummary":{"type":"object","properties":{"uploadId":{"$ref":"#/components/schemas/Uuid"},"questionId":{"type":"string"},"status":{"$ref":"#/components/schemas/SurveyUploadStatus"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["uploadId","questionId","status","contentType","sizeBytes"],"additionalProperties":false},"SurveyUploadStatus":{"type":"string","enum":["pending_upload","pending_scan","clean","infected","scan_unavailable","rejected"],"description":"Only `clean` uploads are ever downloadable (AT-039)."},"SurveyUploadLink":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["url","expiresAt"],"additionalProperties":false},"PublicSurvey":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"definition":{"$ref":"#/components/schemas/SurveyDefinition"},"submitPath":{"type":"string"},"uploadPath":{"type":["string","null"]}},"required":["id","version","definition","submitPath","uploadPath"],"additionalProperties":false},"SurveyResponseReceipt":{"type":"object","properties":{"status":{"type":"string","const":"received"},"message":{"type":"string"}},"required":["status","message"],"additionalProperties":false},"SubmitSurveyResponseInput":{"type":"object","properties":{"answers":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"anyOf":[{"type":"string","maxLength":10000},{"maxItems":30,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"}]}},"recipientToken":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"}},"required":["answers"],"additionalProperties":false},"SurveyUploadTicket":{"type":"object","properties":{"uploadId":{"$ref":"#/components/schemas/Uuid"},"method":{"type":"string","const":"PUT"},"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["uploadId","method","url","headers","expiresAt"],"additionalProperties":false},"CreateSurveyUploadInput":{"type":"object","properties":{"questionId":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"contentType":{"type":"string","enum":["image/png","image/jpeg","application/pdf","text/plain"]},"sizeBytes":{"type":"integer","minimum":1,"maximum":10485760}},"required":["questionId","contentType","sizeBytes"],"additionalProperties":false},"SurveyUploadState":{"type":"object","properties":{"uploadId":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/SurveyUploadStatus"}},"required":["uploadId","status"],"additionalProperties":false},"UnsubscribeSurveyOffer":{"type":"object","properties":{"unsubscribed":{"type":"boolean"},"survey":{"anyOf":[{"$ref":"#/components/schemas/PublicSurvey"},{"type":"null"}]}},"required":["unsubscribed","survey"],"additionalProperties":false},"LandingPagePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LandingPage"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"LandingPage":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/GrowthStatus"},"domain":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"ownershipVerified":{"type":"boolean"}},"required":["id","domain","ownershipVerified"],"additionalProperties":false},"path":{"type":"string","maxLength":200,"pattern":"^\\/([a-z0-9]+(-[a-z0-9]+)*(\\/[a-z0-9]+(-[a-z0-9]+)*)*)?$"},"url":{"type":"string"},"draft":{"$ref":"#/components/schemas/PageDefinition"},"draftChanged":{"type":"boolean"},"liveVersion":{"anyOf":[{"$ref":"#/components/schemas/GrowthLiveVersion"},{"type":"null"}]},"stats":{"type":"object","properties":{"views":{"type":"integer","minimum":0,"maximum":9007199254740991},"visitors":{"type":"integer","minimum":0,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["views","visitors","conversions"],"additionalProperties":false},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","status","domain","path","url","draft","draftChanged","liveVersion","stats","revision","createdAt","updatedAt"],"additionalProperties":false},"PageDefinition":{"type":"object","properties":{"seo":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":70},"description":{"type":"string","maxLength":160},"noindex":{"default":false,"type":"boolean"}},"required":["title","noindex"],"additionalProperties":false},"sections":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/PageSection"}},"cookieBanner":{"default":{"analytics":true,"text":"We would like to count your visit to improve this page. No advertising, nothing shared."},"type":"object","properties":{"analytics":{"default":true,"type":"boolean"},"text":{"default":"We would like to count your visit to improve this page. No advertising, nothing shared.","type":"string","minLength":1,"maxLength":500}},"required":["analytics","text"],"additionalProperties":false},"conversionFormId":{"$ref":"#/components/schemas/Uuid"},"abTest":{"$ref":"#/components/schemas/PageAbTest"}},"required":["seo","sections","cookieBanner"],"additionalProperties":false},"PageSection":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"hero"},"heading":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","maxLength":2000}},"required":["type","heading"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"text"},"heading":{"type":"string","maxLength":200},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["type","body"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"form"},"formId":{"$ref":"#/components/schemas/Uuid"}},"required":["type","formId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"image"},"assetId":{"$ref":"#/components/schemas/Uuid"},"alt":{"default":"","type":"string","maxLength":300},"decorative":{"default":false,"type":"boolean"},"caption":{"type":"string","maxLength":300}},"required":["type","assetId","alt","decorative"],"additionalProperties":false}]},"PageAbTest":{"type":"object","properties":{"controlLabel":{"type":"string","minLength":1,"maxLength":60},"controlWeight":{"type":"integer","minimum":1,"maximum":100},"variants":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["B","C","D"]},"label":{"type":"string","minLength":1,"maxLength":60},"weight":{"type":"integer","minimum":1,"maximum":100},"sections":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/PageSection"}}},"required":["key","label","weight","sections"],"additionalProperties":false}}},"required":["controlLabel","controlWeight","variants"],"additionalProperties":false},"CreateLandingPageInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"domainId":{"$ref":"#/components/schemas/Uuid"},"path":{"type":"string","maxLength":200,"pattern":"^\\/([a-z0-9]+(-[a-z0-9]+)*(\\/[a-z0-9]+(-[a-z0-9]+)*)*)?$"}},"required":["name","domainId","path"],"additionalProperties":false},"UpdateLandingPageInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"domainId":{"$ref":"#/components/schemas/Uuid"},"path":{"type":"string","maxLength":200,"pattern":"^\\/([a-z0-9]+(-[a-z0-9]+)*(\\/[a-z0-9]+(-[a-z0-9]+)*)*)?$"},"draft":{"$ref":"#/components/schemas/PageDefinitionInput"}},"additionalProperties":false},"PageDefinitionInput":{"type":"object","properties":{"seo":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":70},"description":{"type":"string","maxLength":160},"noindex":{"default":false,"type":"boolean"}},"required":["title"],"additionalProperties":false},"sections":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/PageSectionInput"}},"cookieBanner":{"default":{"analytics":true,"text":"We would like to count your visit to improve this page. No advertising, nothing shared."},"type":"object","properties":{"analytics":{"default":true,"type":"boolean"},"text":{"default":"We would like to count your visit to improve this page. No advertising, nothing shared.","type":"string","minLength":1,"maxLength":500}},"additionalProperties":false},"conversionFormId":{"$ref":"#/components/schemas/Uuid"},"abTest":{"$ref":"#/components/schemas/PageAbTest"}},"required":["seo","sections"],"additionalProperties":false},"PageSectionInput":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"hero"},"heading":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","maxLength":2000}},"required":["type","heading"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"text"},"heading":{"type":"string","maxLength":200},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["type","body"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"form"},"formId":{"$ref":"#/components/schemas/Uuid"}},"required":["type","formId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"image"},"assetId":{"$ref":"#/components/schemas/Uuid"},"alt":{"default":"","type":"string","maxLength":300},"decorative":{"default":false,"type":"boolean"},"caption":{"type":"string","maxLength":300}},"required":["type","assetId"],"additionalProperties":false}]},"RollbackLandingPageInput":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["version","reason"],"additionalProperties":false},"DuplicateLandingPageInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"path":{"type":"string","maxLength":200,"pattern":"^\\/([a-z0-9]+(-[a-z0-9]+)*(\\/[a-z0-9]+(-[a-z0-9]+)*)*)?$"}},"additionalProperties":false},"LandingPageAnalytics":{"type":"object","properties":{"pageId":{"$ref":"#/components/schemas/Uuid"},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"views":{"$ref":"#/components/schemas/Metric"},"consentedVisitors":{"$ref":"#/components/schemas/Metric"},"conversions":{"$ref":"#/components/schemas/Metric"},"conversionRate":{"$ref":"#/components/schemas/Metric"},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visitors":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","views","visitors","conversions"],"additionalProperties":false}},"variants":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["A","B","C","D"]},"label":{"type":"string"},"views":{"$ref":"#/components/schemas/Metric"},"consentedVisitors":{"$ref":"#/components/schemas/Metric"},"conversions":{"$ref":"#/components/schemas/Metric"},"conversionRate":{"$ref":"#/components/schemas/Metric"}},"required":["key","label","views","consentedVisitors","conversions","conversionRate"],"additionalProperties":false}}},"required":["pageId","asOf","views","consentedVisitors","conversions","conversionRate","days","variants"],"additionalProperties":false},"PublicLandingPage":{"type":"object","properties":{"pageId":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"seo":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":["string","null"]},"noindex":{"type":"boolean"}},"required":["title","description","noindex"],"additionalProperties":false},"sections":{"type":"array","items":{"$ref":"#/components/schemas/PublicPageSection"}},"cookieBanner":{"type":"object","properties":{"analytics":{"type":"boolean"},"text":{"type":"string"}},"required":["analytics","text"],"additionalProperties":false},"visitPath":{"type":"string"},"variant":{"default":"A","type":"string","enum":["A","B","C","D"]}},"required":["pageId","version","seo","sections","cookieBanner","visitPath","variant"],"additionalProperties":false},"PublicPageSection":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"hero"},"heading":{"type":"string"},"body":{"type":["string","null"]}},"required":["type","heading","body"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"text"},"heading":{"type":["string","null"]},"body":{"type":"string"}},"required":["type","heading","body"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"form"},"form":{"anyOf":[{"$ref":"#/components/schemas/PublicForm"},{"type":"null"}]}},"required":["type","form"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"image"},"url":{"type":["string","null"]},"alt":{"type":"string"},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"caption":{"type":["string","null"]}},"required":["type","url","alt","width","caption"],"additionalProperties":false}]},"PageVisitRecorded":{"type":"object","properties":{"status":{"type":"string","const":"recorded"}},"required":["status"],"additionalProperties":false},"RecordPageVisitInput":{"type":"object","properties":{"consent":{"type":"string","const":"analytics"},"variant":{"type":"string","enum":["A","B","C","D"]}},"required":["consent"],"additionalProperties":false},"Experiment":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"enabled":{"type":"boolean"},"definition":{"anyOf":[{"$ref":"#/components/schemas/ExperimentDefinition"},{"type":"null"}]},"layout":{"anyOf":[{"$ref":"#/components/schemas/ExperimentLayout"},{"type":"null"}]},"estimate":{"anyOf":[{"$ref":"#/components/schemas/ExperimentEstimate"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["campaignId","campaignState","enabled","definition","layout","estimate","warnings","revision","updatedAt"],"additionalProperties":false},"ExperimentDefinition":{"type":"object","properties":{"variants":{"minItems":2,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ExperimentVariant"}},"testPercent":{"type":"integer","minimum":1,"maximum":100},"holdoutPercent":{"default":0,"type":"integer","minimum":0,"maximum":50},"primaryMetric":{"$ref":"#/components/schemas/ExperimentMetric"},"minSamplePerVariant":{"type":"integer","minimum":1,"maximum":10000000},"decisionWindowHours":{"type":"integer","minimum":1,"maximum":720},"confidenceLevel":{"default":0.95,"$ref":"#/components/schemas/ExperimentConfidence"},"inconclusiveFallback":{"default":"send_control","$ref":"#/components/schemas/ExperimentFallback"}},"required":["variants","testPercent","holdoutPercent","primaryMetric","minSamplePerVariant","decisionWindowHours","confidenceLevel","inconclusiveFallback"],"additionalProperties":false},"ExperimentVariant":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/ExperimentVariantKey"},"label":{"type":"string","minLength":1,"maxLength":80},"weight":{"type":"integer","minimum":1,"maximum":100},"subject":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":250},{"type":"null"}]},"preheader":{"default":null,"anyOf":[{"type":"string","maxLength":250},{"type":"null"}]},"document":{"default":null,"anyOf":[{"$ref":"#/components/schemas/EmailDocument"},{"type":"null"}]}},"required":["key","label","weight","subject","preheader","document"],"additionalProperties":false},"ExperimentMetric":{"type":"string","enum":["unique_human_click_rate","unique_human_open_rate"]},"ExperimentConfidence":{"anyOf":[{"type":"number","const":0.9},{"type":"number","const":0.95},{"type":"number","const":0.99}]},"ExperimentFallback":{"type":"string","enum":["send_control","do_not_send"]},"ExperimentLayout":{"type":"object","properties":{"holdout":{"$ref":"#/components/schemas/BucketRange"},"arms":{"type":"array","items":{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":9007199254740991},"to":{"type":"integer","minimum":0,"maximum":9007199254740991},"key":{"$ref":"#/components/schemas/ExperimentVariantKey"}},"required":["from","to","key"],"additionalProperties":false}},"remainder":{"$ref":"#/components/schemas/BucketRange"}},"required":["holdout","arms","remainder"],"additionalProperties":false,"description":"Allocation of the 10000 buckets: holdout, then each arm, then the remainder."},"BucketRange":{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":9007199254740991},"to":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["from","to"],"additionalProperties":false},"ExperimentEstimate":{"type":"object","properties":{"eligible":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Eligible recipients of the latest completed snapshot (null = none built yet)."},"holdout":{"type":"integer","minimum":0,"maximum":9007199254740991},"arms":{"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/ExperimentVariantKey"},"expected":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","expected"],"additionalProperties":false}},"remainder":{"type":"integer","minimum":0,"maximum":9007199254740991},"underpoweredArms":{"type":"array","items":{"$ref":"#/components/schemas/ExperimentVariantKey"}}},"required":["eligible","holdout","arms","remainder","underpoweredArms"],"additionalProperties":false},"SaveExperimentInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"definition":{"$ref":"#/components/schemas/ExperimentDefinitionInput"}},"required":["enabled","definition"],"additionalProperties":false},"ExperimentDefinitionInput":{"type":"object","properties":{"variants":{"minItems":2,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ExperimentVariantInput"}},"testPercent":{"type":"integer","minimum":1,"maximum":100},"holdoutPercent":{"default":0,"type":"integer","minimum":0,"maximum":50},"primaryMetric":{"$ref":"#/components/schemas/ExperimentMetric"},"minSamplePerVariant":{"type":"integer","minimum":1,"maximum":10000000},"decisionWindowHours":{"type":"integer","minimum":1,"maximum":720},"confidenceLevel":{"default":0.95,"$ref":"#/components/schemas/ExperimentConfidence"},"inconclusiveFallback":{"default":"send_control","$ref":"#/components/schemas/ExperimentFallback"}},"required":["variants","testPercent","primaryMetric","minSamplePerVariant","decisionWindowHours"],"additionalProperties":false},"ExperimentVariantInput":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/ExperimentVariantKey"},"label":{"type":"string","minLength":1,"maxLength":80},"weight":{"type":"integer","minimum":1,"maximum":100},"subject":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":250},{"type":"null"}]},"preheader":{"default":null,"anyOf":[{"type":"string","maxLength":250},{"type":"null"}]},"document":{"default":null,"anyOf":[{"$ref":"#/components/schemas/EmailDocumentInput"},{"type":"null"}]}},"required":["key","label","weight"],"additionalProperties":false},"ExperimentResults":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"run":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"state":{"$ref":"#/components/schemas/ExperimentRunState"},"testStartedAt":{"$ref":"#/components/schemas/IsoDateTime"},"decisionDueAt":{"$ref":"#/components/schemas/IsoDateTime"},"holdoutAssigned":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Eligible recipients of the snapshot in the holdout (never sent)."},"remainderAssigned":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","state","testStartedAt","decisionDueAt","holdoutAssigned","remainderAssigned"],"additionalProperties":false},{"type":"null"}]},"primaryMetric":{"anyOf":[{"$ref":"#/components/schemas/ExperimentMetric"},{"type":"null"}]},"arms":{"type":"array","items":{"$ref":"#/components/schemas/ExperimentArmResult"}},"decision":{"anyOf":[{"$ref":"#/components/schemas/ExperimentDecision"},{"type":"null"}]},"holdoutLift":{"type":"object","properties":{"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"status":{"type":"string","enum":["available","unavailable"]},"unavailableReason":{"anyOf":[{"type":"string","enum":["no_holdout","holdout_too_small","not_requested","no_order_feed"]},{"type":"null"}]},"treatment":{"anyOf":[{"type":"object","properties":{"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netRevenueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revenuePerMemberMinor":{"type":"number"}},"required":["members","netRevenueMinor","revenuePerMemberMinor"],"additionalProperties":false},{"type":"null"}]},"holdout":{"anyOf":[{"type":"object","properties":{"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netRevenueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revenuePerMemberMinor":{"type":"number"}},"required":["members","netRevenueMinor","revenuePerMemberMinor"],"additionalProperties":false},{"type":"null"}]},"incrementalNetRevenueMinor":{"type":["number","null"]},"relativeLift":{"type":["number","null"]},"confidence":{"anyOf":[{"type":"object","properties":{"level":{"type":"number"},"perMemberDifferenceMinor":{"type":"number"},"perMemberIntervalMinor":{"type":"object","properties":{"low":{"type":"number"},"high":{"type":"number"}},"required":["low","high"],"additionalProperties":false},"incrementalIntervalMinor":{"type":"object","properties":{"low":{"type":"number"},"high":{"type":"number"}},"required":["low","high"],"additionalProperties":false},"standardErrorMinor":{"type":"number"},"degreesOfFreedom":{"type":["number","null"]},"pValue":{"type":["number","null"]},"significant":{"type":"boolean"}},"required":["level","perMemberDifferenceMinor","perMemberIntervalMinor","incrementalIntervalMinor","standardErrorMinor","degreesOfFreedom","pValue","significant"],"additionalProperties":false},{"type":"null"}]},"method":{"type":"string","description":"How the lift and its interval were computed (difference in means; Welch's t interval at 95 %)."},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"null"}]},"ordersFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"excludedOtherCurrency":{"type":"integer","minimum":0,"maximum":9007199254740991},"reason":{"type":"string"}},"required":["campaignId","status","unavailableReason","treatment","holdout","incrementalNetRevenueMinor","relativeLift","confidence","method","currency","ordersFrom","excludedOtherCurrency","reason"],"additionalProperties":false},"warnings":{"type":"array","items":{"type":"string"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["campaignId","campaignName","campaignState","run","primaryMetric","arms","decision","holdoutLift","warnings","asOf"],"additionalProperties":false},"ExperimentRunState":{"type":"string","enum":["testing","winner_sending","completed","cancelled"],"description":"Phase of one approved experiment execution: test cohort, decided + remainder sending, done, cancelled before deciding."},"ExperimentArmResult":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/ExperimentVariantKey"},"label":{"type":"string"},"assigned":{"type":"integer","minimum":0,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"converters":{"type":"integer","minimum":0,"maximum":9007199254740991},"rate":{"type":["number","null"]},"pValue":{"type":["number","null"]},"meetsMinimumSample":{"type":"boolean"}},"required":["key","label","assigned","accepted","converters","rate","pValue","meetsMinimumSample"],"additionalProperties":false},"ExperimentDecision":{"type":"object","properties":{"outcome":{"$ref":"#/components/schemas/ExperimentOutcome"},"winnerKey":{"anyOf":[{"$ref":"#/components/schemas/ExperimentVariantKey"},{"type":"null"}]},"appliedKey":{"anyOf":[{"$ref":"#/components/schemas/ExperimentVariantKey"},{"type":"null"}]},"reason":{"anyOf":[{"$ref":"#/components/schemas/InconclusiveReason"},{"type":"null"}]},"explanation":{"type":"string"},"method":{"type":"string","description":"Confidence method (two-proportion z-test, Bonferroni-corrected against the control)."},"alpha":{"type":"number"},"primaryMetric":{"$ref":"#/components/schemas/ExperimentMetric"},"arms":{"type":"array","items":{"$ref":"#/components/schemas/ExperimentArmResult"}},"warnings":{"type":"array","items":{"type":"string"}},"decidedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["outcome","winnerKey","appliedKey","reason","explanation","method","alpha","primaryMetric","arms","warnings","decidedAt"],"additionalProperties":false},"ExperimentOutcome":{"type":"string","enum":["winner","inconclusive"]},"InconclusiveReason":{"type":"string","enum":["below_minimum_sample","not_significant","metric_unavailable","tie"]},"ExperimentPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ExperimentSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ExperimentSummary":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"primaryMetric":{"$ref":"#/components/schemas/ExperimentMetric"},"variants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holdoutPercent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"runState":{"anyOf":[{"$ref":"#/components/schemas/ExperimentRunState"},{"type":"null"}]},"outcome":{"anyOf":[{"$ref":"#/components/schemas/ExperimentOutcome"},{"type":"null"}]},"winnerKey":{"anyOf":[{"$ref":"#/components/schemas/ExperimentVariantKey"},{"type":"null"}]},"decisionDueAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["campaignId","campaignName","campaignState","primaryMetric","variants","holdoutPercent","runState","outcome","winnerKey","decisionDueAt","updatedAt"],"additionalProperties":false},"FieldGrant":{"type":"object","properties":{"campaignId":{"type":"string"},"fieldKeys":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"}},"reason":{"type":["string","null"]},"grantedByUserId":{"type":["string","null"]},"grantableKeys":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false}},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["campaignId","fieldKeys","reason","grantedByUserId","grantableKeys","revision","updatedAt"],"additionalProperties":false},"SaveFieldGrantInput":{"type":"object","properties":{"fieldKeys":{"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"}},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["fieldKeys","reason"],"additionalProperties":false},"PublicationList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Publication"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"Publication":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"slug":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","description":"Public archive URL segment: /news/<slug>."},"name":{"type":"string"},"description":{"type":"string"},"cadenceLabel":{"type":"string"},"archiveEnabled":{"type":"boolean"},"subscribeFormId":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"tierFieldKey":{"default":null,"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","slug","name","description","cadenceLabel","archiveEnabled","subscribeFormId","tierFieldKey","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CreatePublicationInput":{"type":"object","properties":{"slug":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","description":"Public archive URL segment: /news/<slug>."},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"default":"","type":"string","maxLength":500},"cadenceLabel":{"default":"","type":"string","maxLength":120},"archiveEnabled":{"default":true,"type":"boolean"},"subscribeFormId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"tierFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]}},"required":["slug","name"],"additionalProperties":false},"UpdatePublicationInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"cadenceLabel":{"type":"string","maxLength":120},"archiveEnabled":{"type":"boolean"},"archived":{"type":"boolean"},"subscribeFormId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"tierFieldKey":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},{"type":"null"}]}},"additionalProperties":false},"ArchiveIssuePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ArchiveIssue"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ArchiveIssue":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"publicationId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignVersionId":{"$ref":"#/components/schemas/Uuid"},"title":{"type":"string"},"topic":{"type":"string"},"summary":{"type":"string"},"sponsors":{"type":"array","items":{"$ref":"#/components/schemas/SponsorSlot"}},"access":{"default":"free","$ref":"#/components/schemas/PublicationTier"},"publishedAt":{"$ref":"#/components/schemas/IsoDateTime"},"withdrawnAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","publicationId","campaignId","campaignVersionId","title","topic","summary","sponsors","access","publishedAt","withdrawnAt"],"additionalProperties":false},"SponsorSlot":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"}},"required":["name","label"],"additionalProperties":false},"PublicationTier":{"type":"string","enum":["free","premium"]},"PublishIssueInput":{"type":"object","properties":{"publicationId":{"$ref":"#/components/schemas/Uuid"},"title":{"type":"string","minLength":1,"maxLength":200},"topic":{"default":"","type":"string","maxLength":80},"summary":{"default":"","type":"string","maxLength":500},"access":{"default":"free","$ref":"#/components/schemas/PublicationTier"}},"required":["publicationId","title"],"additionalProperties":false},"WithdrawIssueInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"PublicArchive":{"type":"object","properties":{"publication":{"type":"object","properties":{"slug":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","description":"Public archive URL segment: /news/<slug>."},"name":{"type":"string"},"description":{"type":"string"},"subscribeUrl":{"default":null,"type":["string","null"]}},"required":["slug","name","description","subscribeUrl"],"additionalProperties":false},"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicArchiveIssue"}},"topics":{"type":"array","items":{"type":"string"}},"nextCursor":{"type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["publication","items","topics","nextCursor","asOf"],"additionalProperties":false},"PublicArchiveIssue":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"title":{"type":"string"},"topic":{"type":"string"},"summary":{"type":"string"},"publishedAt":{"$ref":"#/components/schemas/IsoDateTime"},"sponsors":{"type":"array","items":{"$ref":"#/components/schemas/SponsorSlot"}},"access":{"default":"free","$ref":"#/components/schemas/PublicationTier"}},"required":["id","title","topic","summary","publishedAt","sponsors","access"],"additionalProperties":false},"PublicArchiveIssueDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"title":{"type":"string"},"topic":{"type":"string"},"summary":{"type":"string"},"publishedAt":{"$ref":"#/components/schemas/IsoDateTime"},"sponsors":{"type":"array","items":{"$ref":"#/components/schemas/SponsorSlot"}},"access":{"default":"free","$ref":"#/components/schemas/PublicationTier"},"html":{"type":["string","null"]},"text":{"type":["string","null"]},"publication":{"type":"object","properties":{"slug":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$","description":"Public archive URL segment: /news/<slug>."},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false}},"required":["id","title","topic","summary","publishedAt","sponsors","access","html","text","publication"],"additionalProperties":false},"RecurringDigestList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RecurringDigest"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"RecurringDigest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"publicationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"sourceCampaignId":{"$ref":"#/components/schemas/Uuid"},"feedUrl":{"type":"string"},"blockId":{"type":"string"},"cadence":{"$ref":"#/components/schemas/DigestCadence"},"maxItems":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/DigestState"},"nextRunAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastRunAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["id","name","publicationId","sourceCampaignId","feedUrl","blockId","cadence","maxItems","state","nextRunAt","lastRunAt","revision"],"additionalProperties":false},"DigestCadence":{"type":"object","properties":{"intervalDays":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["intervalDays","time","timezone"],"additionalProperties":false},"DigestState":{"type":"string","enum":["active","paused"]},"CreateDigestInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"publicationId":{"$ref":"#/components/schemas/Uuid"},"sourceCampaignId":{"$ref":"#/components/schemas/Uuid"},"feedUrl":{"type":"string","maxLength":2048,"format":"uri"},"blockId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"cadence":{"$ref":"#/components/schemas/DigestCadence"},"maxItems":{"default":10,"type":"integer","minimum":1,"maximum":20}},"required":["name","sourceCampaignId","feedUrl","blockId","cadence"],"additionalProperties":false},"UpdateDigestInput":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/DigestState"},"cadence":{"$ref":"#/components/schemas/DigestCadence"},"maxItems":{"type":"integer","minimum":1,"maximum":20}},"additionalProperties":false},"DigestRun":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"digestId":{"$ref":"#/components/schemas/Uuid"},"scheduledFor":{"$ref":"#/components/schemas/IsoDateTime"},"outcome":{"$ref":"#/components/schemas/DigestRunOutcome"},"newItems":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","digestId","scheduledFor","outcome","newItems","campaignId","error","createdAt"],"additionalProperties":false},"DigestRunOutcome":{"type":"string","enum":["created","skipped_unchanged","failed"],"description":"What a recurring digest run did: created a draft issue, skipped an unchanged feed (AT-031), or failed."},"DigestRunList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DigestRun"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"CampaignSponsorList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignSponsor"}}},"required":["items"],"additionalProperties":false},"CampaignSponsor":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"label":{"type":"string"},"blockIds":{"type":"array","items":{"type":"string"}},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","name","label","blockIds","createdAt"],"additionalProperties":false},"CreateSponsorInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"label":{"default":"Sponsor","type":"string","minLength":1,"maxLength":60},"blockIds":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["name","blockIds"],"additionalProperties":false},"SponsorReport":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"trackingMode":{"$ref":"#/components/schemas/TrackingMode"},"accepted":{"$ref":"#/components/schemas/SponsorMetric"},"sponsors":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"label":{"type":"string"},"links":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rawClicks":{"$ref":"#/components/schemas/SponsorMetric"},"botFilteredClicks":{"$ref":"#/components/schemas/SponsorMetric"},"humanLikelyClicks":{"$ref":"#/components/schemas/SponsorMetric"},"uniqueHumanLikelyClickers":{"$ref":"#/components/schemas/SponsorMetric"},"opens":{"$ref":"#/components/schemas/SponsorMetric"}},"required":["id","name","label","links","rawClicks","botFilteredClicks","humanLikelyClicks","uniqueHumanLikelyClickers","opens"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"string"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["campaignId","campaignName","campaignState","trackingMode","accepted","sponsors","notes","asOf"],"additionalProperties":false},"SponsorMetric":{"type":"object","properties":{"status":{"type":"string","enum":["measured","unavailable"]},"value":{"type":["number","null"]},"definition":{"type":"string"},"unavailableReason":{"type":["string","null"]}},"required":["status","value","definition","unavailableReason"],"additionalProperties":false},"SponsoredCampaignPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SponsoredCampaign"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"SponsoredCampaign":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"campaignState":{"$ref":"#/components/schemas/CampaignState"},"sponsors":{"type":"integer","minimum":1,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["campaignId","campaignName","campaignState","sponsors","createdAt"],"additionalProperties":false},"AgencyProfile":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"organizationId":{"$ref":"#/components/schemas/Uuid"},"organizationLegalName":{"type":"string"},"kind":{"anyOf":[{"$ref":"#/components/schemas/AgencyKind"},{"type":"null"}]},"clientCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["workspaceId","organizationId","organizationLegalName","kind","clientCount"],"additionalProperties":false},"AgencyKind":{"type":"string","enum":["agency","reseller"]},"EnableAgencyInput":{"type":"object","properties":{"kind":{"default":"agency","$ref":"#/components/schemas/AgencyKind"}},"additionalProperties":false},"AgencyPortfolioPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AgencyPortfolioItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}},"totals":{"type":"object","properties":{"clients":{"type":"integer","minimum":0,"maximum":9007199254740991},"active":{"type":"integer","minimum":0,"maximum":9007199254740991},"suspended":{"type":"integer","minimum":0,"maximum":9007199254740991},"acceptedThisMonth":{"type":"integer","minimum":0,"maximum":9007199254740991},"needsAttention":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["clients","active","suspended","acceptedThisMonth","needsAttention"],"additionalProperties":false}},"required":["items","nextCursor","asOf","total","totals"],"additionalProperties":false},"AgencyPortfolioItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"agencyWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"clientWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"organizationLegalName":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"workspaceStatus":{"$ref":"#/components/schemas/WorkspaceStatus"},"status":{"$ref":"#/components/schemas/AgencyClientStatus"},"externalRef":{"type":["string","null"]},"limits":{"$ref":"#/components/schemas/AgencyLimits"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"metrics":{"type":"object","properties":{"contacts":{"type":"integer","minimum":0,"maximum":9007199254740991},"acceptedThisMonth":{"type":"integer","minimum":0,"maximum":9007199254740991},"pendingApprovals":{"type":"integer","minimum":0,"maximum":9007199254740991},"activeOwners":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["contacts","acceptedThisMonth","pendingApprovals","activeOwners"],"additionalProperties":false},"health":{"$ref":"#/components/schemas/AgencyClientHealth"},"healthReasons":{"type":"array","items":{"type":"string"}}},"required":["id","agencyWorkspaceId","clientWorkspaceId","name","organizationLegalName","region","workspaceStatus","status","externalRef","limits","revision","createdAt","updatedAt","metrics","health","healthReasons"],"additionalProperties":false},"AgencyClientStatus":{"type":"string","enum":["active","suspended","released"],"description":"Status of the agency↔client LINK. `suspended` also suspends the client workspace (unless trust already did); `released` ends the relationship and every delegation."},"AgencyLimits":{"type":"object","properties":{"monthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"restrictListCreation":{"type":"boolean"},"sendingModel":{"$ref":"#/components/schemas/AgencySendingModel"},"clientPermissionCeiling":{"anyOf":[{"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},{"type":"null"}]}},"required":["monthlySendCap","restrictListCreation","sendingModel","clientPermissionCeiling"],"additionalProperties":false},"AgencySendingModel":{"type":"string","enum":["managed","client_owned"]},"AgencyClientHealth":{"type":"string","enum":["healthy","review","suspended"]},"ProvisionAgencyClientResult":{"type":"object","properties":{"client":{"$ref":"#/components/schemas/AgencyClient"},"provisioning":{"type":"string","enum":["created","existing"]},"invitationSent":{"type":"boolean"}},"required":["client","provisioning","invitationSent"],"additionalProperties":false},"AgencyClient":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"agencyWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"clientWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"organizationLegalName":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"workspaceStatus":{"$ref":"#/components/schemas/WorkspaceStatus"},"status":{"$ref":"#/components/schemas/AgencyClientStatus"},"externalRef":{"type":["string","null"]},"limits":{"$ref":"#/components/schemas/AgencyLimits"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","agencyWorkspaceId","clientWorkspaceId","name","organizationLegalName","region","workspaceStatus","status","externalRef","limits","revision","createdAt","updatedAt"],"additionalProperties":false},"ProvisionAgencyClientInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"legalName":{"type":"string","minLength":1,"maxLength":200},"region":{"$ref":"#/components/schemas/Region"},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"locale":{"default":"en","type":"string","minLength":2,"maxLength":35},"externalRef":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._:@/-]+$"},"limits":{"type":"object","properties":{"monthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"restrictListCreation":{"type":"boolean"},"sendingModel":{"$ref":"#/components/schemas/AgencySendingModel"},"clientPermissionCeiling":{"anyOf":[{"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},{"type":"null"}]}}},"ownerEmail":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["name","region"],"additionalProperties":false},"AgencyClientDetail":{"type":"object","properties":{"client":{"$ref":"#/components/schemas/AgencyClient"},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/AgencyDelegation"}},"checklist":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["workspace_isolation","client_owner","sending_permissions","data_access_separated"]},"passed":{"type":"boolean"},"detail":{"type":"string"}},"required":["key","passed","detail"],"additionalProperties":false}}},"required":["client","delegations","checklist"],"additionalProperties":false},"AgencyDelegation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"clientWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"userId":{"$ref":"#/components/schemas/Uuid"},"displayName":{"type":"string"},"email":{"type":"string"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/AgencyDelegablePermission"}},"dataAccess":{"type":"boolean"},"reason":{"type":"string"},"grantedByUserId":{"$ref":"#/components/schemas/Uuid"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revokedReason":{"type":["string","null"]},"revokedByClient":{"type":["boolean","null"]},"active":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","clientWorkspaceId","userId","displayName","email","permissions","dataAccess","reason","grantedByUserId","expiresAt","revokedAt","revokedReason","revokedByClient","active","createdAt"],"additionalProperties":false},"AgencyDelegablePermission":{"type":"string","enum":["workspace.read","membership.read","audience.read","audience.write","audience.import","audience.export","consent.read","consent.write","suppression.read","suppression.write","template.read","template.edit","asset.manage","campaign.read","campaign.create","campaign.edit","campaign.test","campaign.publish","campaign.pause","message.read","journey.read","journey.edit","journey.publish","report.read","report.export","infrastructure.read","infrastructure.manage","billing.read","integrations.read","audit.read","brand.manage"]},"UpdateAgencyClientInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"status":{"$ref":"#/components/schemas/AgencyClientStatus"},"limits":{"type":"object","properties":{"monthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"restrictListCreation":{"type":"boolean"},"sendingModel":{"$ref":"#/components/schemas/AgencySendingModel"},"clientPermissionCeiling":{"anyOf":[{"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/Permission"}},{"type":"null"}]}}},"reason":{"type":"string","minLength":10,"maxLength":500}},"additionalProperties":false},"SetAgencyDelegationInput":{"type":"object","properties":{"userId":{"$ref":"#/components/schemas/Uuid"},"permissions":{"minItems":1,"maxItems":31,"type":"array","items":{"$ref":"#/components/schemas/AgencyDelegablePermission"}},"dataAccess":{"default":false,"type":"boolean"},"reason":{"type":"string","minLength":10,"maxLength":500},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["userId","permissions","reason"],"additionalProperties":false},"AgencyDelegationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AgencyDelegation"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"RevokeAgencyDelegationInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"],"additionalProperties":false},"SharedTemplate":{"type":"object","properties":{"clientWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"templateId":{"$ref":"#/components/schemas/Uuid"},"versionId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"sourceTemplateId":{"$ref":"#/components/schemas/Uuid"},"sourceVersion":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["clientWorkspaceId","templateId","versionId","name","sourceTemplateId","sourceVersion"],"additionalProperties":false},"ShareTemplateInput":{"type":"object","properties":{"templateId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["templateId"],"additionalProperties":false},"PublishClientNoticeResult":{"type":"object","properties":{"published":{"type":"integer","minimum":0,"maximum":9007199254740991},"noticeIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["published","noticeIds"],"additionalProperties":false},"PublishClientNoticeInput":{"type":"object","properties":{"clientIds":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"severity":{"default":"info","$ref":"#/components/schemas/NoticeSeverity"},"title":{"type":"string","minLength":3,"maxLength":140},"body":{"type":"string","minLength":3,"maxLength":4000},"email":{"default":false,"type":"boolean"}},"required":["clientIds","title","body"],"additionalProperties":false},"NoticeSeverity":{"type":"string","enum":["info","warning","critical"]},"AgencyLink":{"type":"object","properties":{"managed":{"type":"boolean"},"agencyName":{"type":["string","null"]},"status":{"anyOf":[{"$ref":"#/components/schemas/AgencyClientStatus"},{"type":"null"}]},"limits":{"anyOf":[{"$ref":"#/components/schemas/AgencyLimits"},{"type":"null"}]}},"required":["managed","agencyName","status","limits"],"additionalProperties":false},"WorkspaceNoticePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceNotice"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"WorkspaceNotice":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["system_notice","account_alert","activity"]},"severity":{"$ref":"#/components/schemas/NoticeSeverity"},"title":{"type":"string"},"body":{"type":"string"},"source":{"type":"string"},"emailState":{"$ref":"#/components/schemas/NoticeEmailState"},"subjectType":{"default":null,"anyOf":[{"type":"string","enum":["campaign","domain","import","notices"]},{"type":"null"}]},"subjectId":{"default":null,"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","kind","severity","title","body","source","emailState","subjectType","subjectId","createdAt"],"additionalProperties":false},"NoticeEmailState":{"type":"string","enum":["not_requested","pending","sent","failed","skipped"]},"Brand":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"draft":{"type":"object","properties":{"brandName":{"type":"string"},"primaryColor":{"type":"string"},"logoAssetId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"supportEmail":{"type":["string","null"]},"emailFooter":{"type":"string"},"noticeSenderName":{"type":["string","null"]},"loginDomain":{"type":["string","null"]},"trackingDomain":{"type":["string","null"]}},"required":["brandName","primaryColor","logoAssetId","supportEmail","emailFooter","noticeSenderName","loginDomain","trackingDomain"],"additionalProperties":false},"published":{"anyOf":[{"$ref":"#/components/schemas/BrandSnapshot"},{"type":"null"}]},"publishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"unpublishedChanges":{"type":"boolean"},"accessibility":{"type":"object","properties":{"contrastOnWhiteText":{"type":"number"},"minimum":{"type":"number"},"passes":{"type":"boolean"}},"required":["contrastOnWhiteText","minimum","passes"],"additionalProperties":false},"domains":{"type":"object","properties":{"login":{"anyOf":[{"$ref":"#/components/schemas/BrandDomainStatus"},{"type":"null"}]},"tracking":{"anyOf":[{"$ref":"#/components/schemas/BrandDomainStatus"},{"type":"null"}]}},"required":["login","tracking"],"additionalProperties":false},"portalCnameTarget":{"type":"string"},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["workspaceId","draft","published","publishedAt","unpublishedChanges","accessibility","domains","portalCnameTarget","revision"],"additionalProperties":false},"BrandSnapshot":{"type":"object","properties":{"brandName":{"type":"string"},"primaryColor":{"type":"string"},"logoUrl":{"type":["string","null"]},"supportEmail":{"type":["string","null"]},"emailFooter":{"type":"string"},"noticeSenderName":{"type":["string","null"]},"loginDomain":{"type":["string","null"]},"trackingDomain":{"type":["string","null"]}},"required":["brandName","primaryColor","logoUrl","supportEmail","emailFooter","noticeSenderName","loginDomain","trackingDomain"],"additionalProperties":false},"BrandDomainStatus":{"type":"object","properties":{"host":{"type":"string"},"status":{"type":"string","enum":["unchecked","verified","failed","retry"]},"summary":{"type":"string"},"tls":{"type":"string","enum":["external_pending","valid","invalid"]},"tlsDetail":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"checkedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["host","status","summary","tls","checkedAt"],"additionalProperties":false},"UpdateBrandInput":{"type":"object","properties":{"brandName":{"type":"string","minLength":1,"maxLength":80},"primaryColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"logoAssetId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"supportEmail":{"anyOf":[{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},{"type":"null"}]},"emailFooter":{"type":"string","maxLength":500},"noticeSenderName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"loginDomain":{"anyOf":[{"$ref":"#/components/schemas/DomainName"},{"type":"null"}]},"trackingDomain":{"anyOf":[{"$ref":"#/components/schemas/DomainName"},{"type":"null"}]}},"additionalProperties":false},"PublicBrand":{"type":"object","properties":{"host":{"type":"string"},"brandName":{"type":"string"},"primaryColor":{"type":"string"},"logoUrl":{"type":["string","null"]},"supportEmail":{"type":["string","null"]}},"required":["host","brandName","primaryColor","logoUrl","supportEmail"],"additionalProperties":false},"WarmupSchedulePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WarmupSchedule"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"WarmupSchedule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"poolId":{"$ref":"#/components/schemas/Uuid"},"poolName":{"type":"string"},"poolKind":{"type":"string","enum":["server","egress_ip"]},"memberId":{"$ref":"#/components/schemas/Uuid"},"memberLabel":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WarmupStep"}},"currentStep":{"type":"integer","minimum":0,"maximum":9007199254740991},"currentCeiling":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stepStartedAt":{"$ref":"#/components/schemas/IsoDateTime"},"engagedWithinDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"thresholds":{"$ref":"#/components/schemas/WarmupThresholds"},"state":{"$ref":"#/components/schemas/WarmupState"},"frozenAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"frozenReasons":{"type":"array","items":{"$ref":"#/components/schemas/WarmupGateReason"}},"holdReason":{"anyOf":[{"$ref":"#/components/schemas/WarmupGateReason"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastEvaluation":{"anyOf":[{"$ref":"#/components/schemas/WarmupEvaluation"},{"type":"null"}]},"sentToday":{"type":"integer","minimum":0,"maximum":9007199254740991},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","poolId","poolName","poolKind","memberId","memberLabel","steps","currentStep","currentCeiling","stepStartedAt","engagedWithinDays","thresholds","state","frozenAt","frozenReasons","holdReason","lastEvaluatedAt","lastEvaluation","sentToday","completedAt","revision","createdAt","updatedAt"],"additionalProperties":false},"WarmupStep":{"type":"object","properties":{"day":{"type":"integer","minimum":1,"maximum":365,"description":"Schedule day on which this step starts (the first step is day 1)."},"dailyCeiling":{"type":"integer","minimum":1,"maximum":10000000,"description":"Maximum submissions through the member per UTC day while the step is in force."},"providerCeilings":{"description":"Per-mailbox-provider daily ceilings of this step (gmail, microsoft, yahoo, other).","type":"object","properties":{"gmail":{"type":"integer","minimum":0,"maximum":10000000},"microsoft":{"type":"integer","minimum":0,"maximum":10000000},"yahoo":{"type":"integer","minimum":0,"maximum":10000000},"other":{"type":"integer","minimum":0,"maximum":10000000}},"additionalProperties":false}},"required":["day","dailyCeiling"],"additionalProperties":false},"WarmupThresholds":{"type":"object","properties":{"windowHours":{"default":24,"description":"Evaluation window of the health gate.","type":"integer","minimum":1,"maximum":168},"minSample":{"default":200,"description":"Rates are judged, and a step can advance, only once the window holds at least this many messages.","type":"integer","minimum":1,"maximum":1000000},"maxHardBounceRate":{"default":0.02,"description":"Hard bounces / accepted.","type":"number","minimum":0,"maximum":1},"maxComplaintRate":{"default":0.001,"description":"Platform-observed complaints / accepted (not a provider's spam rate).","type":"number","minimum":0,"maximum":1},"maxDeferralRate":{"default":0.1,"description":"Provider deferrals / submitted.","type":"number","minimum":0,"maximum":1},"maxAuthFailures":{"default":0,"description":"Authentication-failure bounces tolerated in the window (none by default).","type":"integer","minimum":0,"maximum":1000}},"required":["windowHours","minSample","maxHardBounceRate","maxComplaintRate","maxDeferralRate","maxAuthFailures"],"additionalProperties":false,"description":"Pause thresholds: crossing any one freezes progression (AT-056)."},"WarmupState":{"type":"string","enum":["active","frozen","completed","cancelled"],"description":"frozen = progression stopped by the health gate until an operator review."},"WarmupGateReason":{"type":"string","enum":["hard_bounce_rate","complaint_rate","deferral_rate","authentication_failures","step_in_progress","insufficient_volume","bounce_ingestion_unhealthy"]},"WarmupEvaluation":{"type":"object","properties":{"evaluatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"action":{"type":"string","enum":["freeze","advance","complete","hold","none"]},"reasons":{"type":"array","items":{"$ref":"#/components/schemas/WarmupGateReason"}},"metrics":{"$ref":"#/components/schemas/WarmupMetrics"},"nextStepDueAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["evaluatedAt","action","reasons","metrics","nextStepDueAt"],"additionalProperties":false},"WarmupMetrics":{"type":"object","properties":{"windowStart":{"$ref":"#/components/schemas/IsoDateTime"},"windowEnd":{"$ref":"#/components/schemas/IsoDateTime"},"submitted":{"type":"integer","minimum":0,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"hardBounces":{"type":"integer","minimum":0,"maximum":9007199254740991},"complaints":{"type":"integer","minimum":0,"maximum":9007199254740991},"deferrals":{"type":"integer","minimum":0,"maximum":9007199254740991},"authFailures":{"type":"integer","minimum":0,"maximum":9007199254740991},"hardBounceRate":{"type":["number","null"]},"complaintRate":{"type":["number","null"]},"deferralRate":{"type":["number","null"]},"bounceIngestion":{"type":"string","enum":["healthy","unhealthy","missing","adapter_events"]}},"required":["windowStart","windowEnd","submitted","accepted","hardBounces","complaints","deferrals","authFailures","hardBounceRate","complaintRate","deferralRate","bounceIngestion"],"additionalProperties":false},"CreateWarmupScheduleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"poolId":{"$ref":"#/components/schemas/Uuid"},"memberId":{"description":"The pool member to warm: an endpoint of a server pool or an IP of an egress IP pool.","$ref":"#/components/schemas/Uuid"},"steps":{"minItems":1,"maxItems":120,"type":"array","items":{"$ref":"#/components/schemas/WarmupStep"}},"thresholds":{"default":{"windowHours":24,"minSample":200,"maxHardBounceRate":0.02,"maxComplaintRate":0.001,"maxDeferralRate":0.1,"maxAuthFailures":0},"$ref":"#/components/schemas/WarmupThresholdsInput"},"engagedWithinDays":{"default":null,"description":"Engaged cohort: the warming member only serves recipients with a human-likely open or click within this many days.","anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]}},"required":["name","poolId","memberId","steps"],"additionalProperties":false},"WarmupThresholdsInput":{"type":"object","properties":{"windowHours":{"default":24,"description":"Evaluation window of the health gate.","type":"integer","minimum":1,"maximum":168},"minSample":{"default":200,"description":"Rates are judged, and a step can advance, only once the window holds at least this many messages.","type":"integer","minimum":1,"maximum":1000000},"maxHardBounceRate":{"default":0.02,"description":"Hard bounces / accepted.","type":"number","minimum":0,"maximum":1},"maxComplaintRate":{"default":0.001,"description":"Platform-observed complaints / accepted (not a provider's spam rate).","type":"number","minimum":0,"maximum":1},"maxDeferralRate":{"default":0.1,"description":"Provider deferrals / submitted.","type":"number","minimum":0,"maximum":1},"maxAuthFailures":{"default":0,"description":"Authentication-failure bounces tolerated in the window (none by default).","type":"integer","minimum":0,"maximum":1000}},"additionalProperties":false,"description":"Pause thresholds: crossing any one freezes progression (AT-056)."},"UpdateWarmupScheduleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"steps":{"minItems":1,"maxItems":120,"type":"array","items":{"$ref":"#/components/schemas/WarmupStep"}},"thresholds":{"$ref":"#/components/schemas/WarmupThresholdsInput"},"engagedWithinDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]}},"additionalProperties":false,"description":"Edits never change the state: a frozen schedule stays frozen until reviewed."},"ReviewWarmupScheduleInput":{"type":"object","properties":{"decision":{"$ref":"#/components/schemas/WarmupReviewDecision"},"reason":{"type":"string","minLength":10,"maxLength":1000,"description":"What was checked and why this decision (kept with the metrics seen)."}},"required":["decision","reason"],"additionalProperties":false},"WarmupReviewDecision":{"type":"string","enum":["resume","hold","step_back","cancel"],"description":"resume: unfreeze at the current step; hold: stay frozen (recorded); step_back: unfreeze one step lower; cancel: stop the schedule (the ceiling no longer applies)."},"WarmupReviewPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WarmupReview"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"WarmupReview":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"scheduleId":{"$ref":"#/components/schemas/Uuid"},"decision":{"$ref":"#/components/schemas/WarmupReviewDecision"},"reason":{"type":"string"},"fromStep":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"toStep":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fromState":{"$ref":"#/components/schemas/WarmupState"},"toState":{"$ref":"#/components/schemas/WarmupState"},"actorUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"metrics":{"anyOf":[{"$ref":"#/components/schemas/WarmupMetrics"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","scheduleId","decision","reason","fromStep","toStep","fromState","toState","actorUserId","metrics","createdAt"],"additionalProperties":false},"DeliverabilityCenter":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"authentication":{"type":"object","properties":{"verified":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"status":{"type":"string"},"spf":{"type":["string","null"]},"dkim":{"type":["string","null"]},"dmarc":{"type":["string","null"]},"checkedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["domain","status","spf","dkim","dmarc","checkedAt"],"additionalProperties":false}}},"required":["verified","total","domains"],"additionalProperties":false},"delivery":{"type":"object","properties":{"attempted":{"$ref":"#/components/schemas/Metric"},"acceptance":{"$ref":"#/components/schemas/Metric"},"reportedDelivery":{"$ref":"#/components/schemas/Metric"},"hardBounces":{"$ref":"#/components/schemas/Metric"},"complaints":{"$ref":"#/components/schemas/Metric"},"deferrals":{"$ref":"#/components/schemas/Metric"}},"required":["attempted","acceptance","reportedDelivery","hardBounces","complaints","deferrals"],"additionalProperties":false},"inboxPlacement":{"type":"object","properties":{"availability":{"type":"string","enum":["sample","unavailable"]},"explanation":{"type":"string"},"explanationCode":{"type":"string","maxLength":64},"explanationParams":{"$ref":"#/components/schemas/MessageParams"},"latestSeedTest":{"anyOf":[{"$ref":"#/components/schemas/SeedTest"},{"type":"null"}]}},"required":["availability","explanation","latestSeedTest"],"additionalProperties":false},"externalSignals":{"type":"array","items":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/ReputationProvider"},"label":{"type":"string"},"freshness":{"$ref":"#/components/schemas/SignalFreshness"}},"required":["provider","label","freshness"],"additionalProperties":false}},"bounceSources":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"state":{"type":"string"},"lagSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"blocking":{"type":"boolean"}},"required":["id","name","state","lagSeconds","blocking"],"additionalProperties":false}},"suppressions":{"type":"object","properties":{"last7Days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"previous7Days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["last7Days","previous7Days"],"additionalProperties":false},"pools":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"kind":{"type":"string","enum":["server","egress_ip"]},"stream":{"type":"string","enum":["marketing","transactional"]},"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabledMembers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warmupsActive":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warmupsFrozen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","kind","stream","members","enabledMembers","warmupsActive","warmupsFrozen"],"additionalProperties":false}},"recommendations":{"type":"array","items":{"$ref":"#/components/schemas/DeliverabilityRecommendation"}}},"required":["asOf","windowDays","authentication","delivery","inboxPlacement","externalSignals","bounceSources","suppressions","pools","recommendations"],"additionalProperties":false},"SeedTest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"vendor":{"type":"string"},"sampleSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"results":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","minLength":1,"maxLength":60,"description":"Mailbox provider of the seed addresses (gmail, outlook, yahoo, …)."},"inbox":{"type":"integer","minimum":0,"maximum":9007199254740991},"promotions":{"type":"integer","minimum":0,"maximum":9007199254740991},"spam":{"type":"integer","minimum":0,"maximum":9007199254740991},"missing":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","inbox","spam","missing"],"additionalProperties":false}},"inboxRate":{"type":"number","description":"inbox / sample size OF THIS SEED LIST."},"observedAt":{"$ref":"#/components/schemas/IsoDateTime"},"notes":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","campaignId","vendor","sampleSize","results","inboxRate","observedAt","notes","createdAt"],"additionalProperties":false},"ReputationProvider":{"type":"string","enum":["google_postmaster","microsoft_snds","yahoo_sender_hub","blocklist_monitor"]},"SignalFreshness":{"type":"object","properties":{"status":{"type":"string","enum":["fresh","stale","unavailable"]},"ageHours":{"type":["number","null"]},"explanation":{"type":"string"},"explanationCode":{"type":"string","maxLength":64},"explanationParams":{"$ref":"#/components/schemas/MessageParams"}},"required":["status","ageHours","explanation"],"additionalProperties":false},"DeliverabilityRecommendation":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/DeliverabilityRecommendationCode"},"severity":{"type":"string","enum":["critical","warning","info"]},"title":{"type":"string"},"detail":{"type":"string"},"params":{"$ref":"#/components/schemas/MessageParams"},"screen":{"type":["string","null"]}},"required":["code","severity","title","detail","screen"],"additionalProperties":false},"DeliverabilityRecommendationCode":{"type":"string","enum":["domain_unverified","dmarc_missing","complaint_rate_high","hard_bounce_rate_high","deferral_rate_high","bounce_source_blocking","warmup_frozen","external_signals_missing","external_signals_stale","seed_test_missing","suppression_growth"]},"MailboxProviderSignals":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"providers":{"type":"array","items":{"$ref":"#/components/schemas/ProviderSignals"}},"latestSeedTests":{"type":"array","items":{"$ref":"#/components/schemas/SeedTest"}},"disclaimers":{"type":"array","items":{"type":"string"}}},"required":["asOf","providers","latestSeedTests","disclaimers"],"additionalProperties":false},"ProviderSignals":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/ReputationProvider"},"label":{"type":"string"},"denominatorNote":{"type":"string"},"apiDependency":{"type":"string"},"availability":{"type":"string","enum":["available","unavailable"]},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/ReputationSource"},"latest":{"type":"array","items":{"type":"object","properties":{"metric":{"$ref":"#/components/schemas/ReputationMetric"},"valueNumber":{"type":["number","null"]},"valueCategory":{"type":["string","null"]},"sampleSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"windowStart":{"$ref":"#/components/schemas/IsoDateTime"},"windowEnd":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["metric","valueNumber","valueCategory","sampleSize","windowStart","windowEnd"],"additionalProperties":false}}},"required":["source","latest"],"additionalProperties":false}}},"required":["provider","label","denominatorNote","apiDependency","availability","sources"],"additionalProperties":false},"ReputationSource":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"provider":{"$ref":"#/components/schemas/ReputationProvider"},"providerLabel":{"type":"string"},"subjectType":{"type":"string","enum":["domain","ip"]},"subject":{"type":"string"},"connectionMode":{"type":"string","enum":["api","manual_import"]},"state":{"$ref":"#/components/schemas/ReputationSourceState"},"stateReason":{"type":["string","null"]},"expectedDelayHours":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastImportAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"latestWindowEnd":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"freshness":{"$ref":"#/components/schemas/SignalFreshness"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","provider","providerLabel","subjectType","subject","connectionMode","state","stateReason","expectedDelayHours","lastImportAt","latestWindowEnd","freshness","revision","createdAt"],"additionalProperties":false},"ReputationSourceState":{"type":"string","enum":["awaiting_authorization","connected","needs_reauthorization","error","disconnected"]},"ReputationMetric":{"type":"string","enum":["domain_reputation","ip_reputation","spam_rate","dkim_success_rate","spf_success_rate","dmarc_success_rate","delivery_error_rate","complaint_rate","trap_hits","blocklisted"]},"ComplianceOverview":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"domains":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceDomain"}},"rates":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceRate"}},"blocklists":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceBlocklist"}},"unsubscribe":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceSignal"}},"hygiene":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceSignal"}},"autoPauses":{"type":"array","items":{"$ref":"#/components/schemas/ComplianceAutoPause"}},"starterGuard":{"anyOf":[{"$ref":"#/components/schemas/ComplianceStarterGuard"},{"type":"null"}]},"policy":{"type":"object","properties":{"autoPauseComplaintRate":{"type":"number"},"autoPauseComplaintMinAccepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"autoPauseEarlyComplaints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"autoPauseBounceRate":{"type":"number"},"autoPauseBounceMinAccepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"authHoldConfirmMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["autoPauseComplaintRate","autoPauseComplaintMinAccepted","autoPauseEarlyComplaints","autoPauseBounceRate","autoPauseBounceMinAccepted","authHoldConfirmMinutes"],"additionalProperties":false}},"required":["asOf","domains","rates","blocklists","unsubscribe","hygiene","autoPauses","starterGuard","policy"],"additionalProperties":false,"description":"Evidence of bulk-sender compliance (Gmail, Yahoo, Microsoft) for the workspace: never a guarantee of compliance or inbox placement."},"ComplianceDomain":{"type":"object","properties":{"domain":{"type":"string"},"kind":{"type":"string","enum":["customer","managed","starter"]},"spf":{"$ref":"#/components/schemas/ComplianceCheck"},"dkim":{"$ref":"#/components/schemas/ComplianceCheck"},"dmarc":{"$ref":"#/components/schemas/ComplianceCheck"},"alignment":{"$ref":"#/components/schemas/ComplianceCheck"},"mtaSts":{"$ref":"#/components/schemas/ComplianceCheck"},"tlsRpt":{"$ref":"#/components/schemas/ComplianceCheck"},"lastCheckedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"nextCheckAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"hold":{"type":"object","properties":{"held":{"type":"boolean"},"failingSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"heldAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"records":{"type":"array","items":{"type":"string"}}},"required":["held","failingSince","heldAt","records"],"additionalProperties":false}},"required":["domain","kind","spf","dkim","dmarc","alignment","mtaSts","tlsRpt","lastCheckedAt","nextCheckAt","hold"],"additionalProperties":false},"ComplianceCheck":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ComplianceStatus"},"measurement":{"$ref":"#/components/schemas/ComplianceMeasurement"},"code":{"$ref":"#/components/schemas/ComplianceCode"},"params":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}},"evidence":{"default":null,"type":["string","null"]}},"required":["status","measurement","code","params","evidence"],"additionalProperties":false},"ComplianceStatus":{"type":"string","enum":["pass","warn","fail","unknown","not_applicable"]},"ComplianceMeasurement":{"type":"string","enum":["measured","estimated","unavailable"],"description":"measured = observed by the platform or the provider; estimated = derived (the assumption is said); unavailable = unknown, never shown as clean."},"ComplianceCode":{"type":"string","enum":["auth.spf_pass","auth.spf_fail","auth.dkim_pass","auth.dkim_fail","auth.dmarc_enforced","auth.dmarc_none","auth.dmarc_missing","auth.aligned","auth.not_aligned","auth.not_checked","auth.dns_temporary","auth.platform_managed","auth.mta_sts_enforce","auth.mta_sts_testing","auth.mta_sts_missing","auth.tls_rpt_present","auth.tls_rpt_missing","auth.inbound_not_ours","auth.held","auth.failing_grace","rate.below_target","rate.above_target","rate.above_max","rate.no_sample","rate.postmaster_unavailable","rate.postmaster_stale","blocklist.clear","blocklist.listed","blocklist.not_configured","blocklist.not_checked","unsubscribe.one_click_ok","unsubscribe.one_click_unused","unsubscribe.within_limit","unsubscribe.over_limit","unsubscribe.no_requests","hygiene.double_opt_in_all","hygiene.double_opt_in_some","hygiene.double_opt_in_none","hygiene.no_lists","hygiene.sunset_set","hygiene.sunset_unset","hygiene.role_low","hygiene.role_high","hygiene.role_unavailable","hygiene.bounce_suppressed","starter.normal","starter.watch","starter.restricted","starter.not_judged"]},"ComplianceRate":{"type":"object","properties":{"key":{"type":"string","enum":["complaint_rate","hard_bounce_rate","postmaster_spam_rate"]},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value":{"type":["number","null"]},"numerator":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"denominator":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"$ref":"#/components/schemas/ComplianceStatus"},"measurement":{"$ref":"#/components/schemas/ComplianceMeasurement"},"code":{"$ref":"#/components/schemas/ComplianceCode"},"source":{"type":"string","enum":["platform","google_postmaster"]},"thresholds":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"label":{"type":"string"},"target":{"type":["number","null"]},"max":{"type":["number","null"]},"source":{"type":"string"}},"required":["provider","label","target","max","source"],"additionalProperties":false}},"observedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["key","windowDays","value","numerator","denominator","status","measurement","code","source","thresholds","observedAt"],"additionalProperties":false},"ComplianceBlocklist":{"type":"object","properties":{"subject":{"type":"string"},"subjectKind":{"type":"string","enum":["ip","domain"]},"status":{"type":"string","enum":["clear","listed","unknown"]},"measurement":{"$ref":"#/components/schemas/ComplianceMeasurement"},"code":{"$ref":"#/components/schemas/ComplianceCode"},"lists":{"type":"array","items":{"type":"string"}},"checkedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["subject","subjectKind","status","measurement","code","lists","checkedAt"],"additionalProperties":false},"ComplianceSignal":{"type":"object","properties":{"key":{"type":"string"},"status":{"$ref":"#/components/schemas/ComplianceStatus"},"measurement":{"$ref":"#/components/schemas/ComplianceMeasurement"},"code":{"$ref":"#/components/schemas/ComplianceCode"},"params":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}},"value":{"type":["number","null"]}},"required":["key","status","measurement","code","params","value"],"additionalProperties":false},"ComplianceAutoPause":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"reason":{"type":"string","enum":["complaint_rate","hard_bounce_rate"]},"rate":{"type":"number"},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complaints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hardBounces":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pausedAt":{"$ref":"#/components/schemas/IsoDateTime"},"resumedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","campaignId","campaignName","reason","rate","accepted","complaints","hardBounces","pausedAt","resumedAt"],"additionalProperties":false},"ComplianceStarterGuard":{"type":"object","properties":{"domain":{"type":"string"},"state":{"type":"string","enum":["normal","watch","restricted"]},"code":{"$ref":"#/components/schemas/ComplianceCode"},"measurement":{"$ref":"#/components/schemas/ComplianceMeasurement"},"complaintRate":{"type":["number","null"]},"bounceRate":{"type":["number","null"]},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"evaluatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["domain","state","code","measurement","complaintRate","bounceRate","accepted","evaluatedAt"],"additionalProperties":false},"ReputationSourcePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReputationSource"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"CreateReputationSourceInput":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/ReputationProvider"},"subjectType":{"type":"string","enum":["domain","ip"]},"subject":{"type":"string","minLength":1,"maxLength":253},"connectionMode":{"default":"manual_import","description":"api: a live provider connection (not available on this deployment: the source waits for authorization). manual_import: the operator imports the provider's own data.","type":"string","enum":["api","manual_import"]}},"required":["provider","subjectType","subject"],"additionalProperties":false},"ImportObservationsResult":{"type":"object","properties":{"inserted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"source":{"$ref":"#/components/schemas/ReputationSource"}},"required":["inserted","duplicates","source"],"additionalProperties":false},"ImportObservationsInput":{"type":"object","properties":{"observations":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"metric":{"$ref":"#/components/schemas/ReputationMetric"},"windowStart":{"$ref":"#/components/schemas/IsoDateTime"},"windowEnd":{"$ref":"#/components/schemas/IsoDateTime"},"valueNumber":{"type":"number","minimum":0,"maximum":1000000},"valueCategory":{"type":"string","minLength":1,"maxLength":40},"sampleSize":{"type":"integer","minimum":0,"maximum":1000000000}},"required":["metric","windowStart","windowEnd"],"additionalProperties":false}}},"required":["observations"],"additionalProperties":false,"description":"Observations copied from the provider's own report: each keeps the provider's window and sample."},"SeedTestPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SeedTest"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"CreateSeedTestInput":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"vendor":{"type":"string","minLength":1,"maxLength":120},"observedAt":{"$ref":"#/components/schemas/IsoDateTime"},"results":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","minLength":1,"maxLength":60,"description":"Mailbox provider of the seed addresses (gmail, outlook, yahoo, …)."},"inbox":{"type":"integer","minimum":0,"maximum":9007199254740991},"promotions":{"type":"integer","minimum":0,"maximum":9007199254740991},"spam":{"type":"integer","minimum":0,"maximum":9007199254740991},"missing":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["provider","inbox","spam","missing"],"additionalProperties":false}},"notes":{"type":"string","maxLength":2000}},"required":["vendor","observedAt","results"],"additionalProperties":false,"description":"A seed placement test: a SAMPLE — never proof for the whole audience (§13)."},"TransactionalTemplatePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TransactionalTemplate"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"TransactionalTemplate":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"state":{"$ref":"#/components/schemas/TransactionalTemplateState"},"stream":{"type":"string","const":"transactional"},"senderIdentityId":{"$ref":"#/components/schemas/Uuid"},"fromAddress":{"type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":{"default":true,"type":"boolean"},"maxLength":{"default":200,"type":"integer","minimum":1,"maximum":2000}},"required":["name","required","maxLength"],"additionalProperties":false}},"activeVersion":{"anyOf":[{"$ref":"#/components/schemas/TransactionalVersion"},{"type":"null"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/TransactionalVersion"}},"activatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"activatedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","key","name","description","state","stream","senderIdentityId","fromAddress","parameters","activeVersion","versions","activatedAt","activatedByUserId","revision","createdAt","updatedAt"],"additionalProperties":false},"TransactionalTemplateState":{"type":"string","enum":["draft","active","disabled"]},"TransactionalVersion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subject":{"type":"string"},"contentHash":{"type":"string"},"active":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","version","subject","contentHash","active","createdAt"],"additionalProperties":false},"CreateTransactionalTemplateInput":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/TransactionalTemplateKey"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"default":"","type":"string","maxLength":1000},"senderIdentityId":{"$ref":"#/components/schemas/Uuid"},"parameters":{"default":[],"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":{"default":true,"type":"boolean"},"maxLength":{"default":200,"type":"integer","minimum":1,"maximum":2000}},"required":["name"],"additionalProperties":false}},"content":{"$ref":"#/components/schemas/TransactionalContent"}},"required":["key","name","senderIdentityId","content"],"additionalProperties":false,"description":"Creates the template in draft with version 1; nothing can be sent until a human activates a version."},"TransactionalTemplateKey":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{1,79}$"},"TransactionalContent":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":250},"html":{"type":"string","minLength":1,"maxLength":200000},"text":{"type":"string","minLength":1,"maxLength":100000}},"required":["subject","html","text"],"additionalProperties":false},"CreateTransactionalVersionInput":{"type":"object","properties":{"content":{"$ref":"#/components/schemas/TransactionalContent"}},"required":["content"],"additionalProperties":false,"description":"A NEW immutable version; the active one keeps sending until another is activated."},"ActivateTransactionalVersionInput":{"type":"object","properties":{"versionId":{"$ref":"#/components/schemas/Uuid"},"reason":{"type":"string","minLength":10,"maxLength":1000}},"required":["versionId","reason"],"additionalProperties":false},"DisableTransactionalTemplateInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":1000}},"required":["reason"],"additionalProperties":false,"description":"Stops the template: queued messages are cancelled at their next dispatch check."},"TransactionalSendAccepted":{"type":"object","properties":{"requestId":{"$ref":"#/components/schemas/Uuid"},"messageId":{"$ref":"#/components/schemas/Uuid"},"templateKey":{"type":"string"},"versionId":{"$ref":"#/components/schemas/Uuid"},"state":{"$ref":"#/components/schemas/MessageState"},"replayed":{"type":"boolean"},"statusUrl":{"type":"string","description":"GET it for the message's attempts and events (S74)."}},"required":["requestId","messageId","templateKey","versionId","state","replayed","statusUrl"],"additionalProperties":false},"SendTransactionalInput":{"type":"object","properties":{"templateKey":{"$ref":"#/components/schemas/TransactionalTemplateKey"},"to":{"type":"string","minLength":3,"maxLength":320},"parameters":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}}},"required":["templateKey","to"],"additionalProperties":false,"description":"One service message. Strict: no list, consent, journey or contact field can be set through this operation (AT-085)."},"TransactionalRequestPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TransactionalRequestSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"TransactionalRequestSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"templateKey":{"type":"string"},"messageId":{"$ref":"#/components/schemas/Uuid"},"messageState":{"$ref":"#/components/schemas/MessageState"},"idempotencyKey":{"type":"string"},"recipient":{"type":"string"},"recipientRedacted":{"type":"boolean"},"requestedByType":{"type":"string"},"parametersClearedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","templateKey","messageId","messageState","idempotencyKey","recipient","recipientRedacted","requestedByType","parametersClearedAt","createdAt"],"additionalProperties":false},"SmtpCredentialPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SmtpCredential"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"SmtpCredential":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"username":{"type":"string","description":"The SMTP AUTH username (`smtp_…`). Public: never enough to authenticate."},"state":{"$ref":"#/components/schemas/SmtpCredentialState"},"senderIdentityIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"},"description":"Verified sender identities this credential may send as (exact addresses)."},"domainIdentityIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"},"description":"Verified domains: any address of the domain may be used."},"ipAllowlist":{"type":"array","items":{"type":"string"},"description":"Client networks allowed to authenticate (empty = any)."},"limits":{"$ref":"#/components/schemas/SmtpCredentialLimits"},"campaignId":{"description":"The backing `smtp_relay` campaign: relayed messages are listed under it.","$ref":"#/components/schemas/Uuid"},"activatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"activatedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"rotatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"previousSecretValidUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"After a rotation, the previous secret keeps working until then."},"lastUsedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Last successful authentication (written at most once a minute)."},"lastClientAddress":{"type":["string","null"]},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revokedReason":{"type":["string","null"]},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","username","state","senderIdentityIds","domainIdentityIds","ipAllowlist","limits","campaignId","activatedAt","activatedByUserId","expiresAt","rotatedAt","previousSecretValidUntil","lastUsedAt","lastClientAddress","revokedAt","revokedReason","createdByUserId","revision","createdAt","updatedAt"],"additionalProperties":false},"SmtpCredentialState":{"type":"string","enum":["pending_activation","active","expired","revoked"]},"SmtpCredentialLimits":{"type":"object","properties":{"perHour":{"type":"integer","minimum":1,"maximum":100000},"perDay":{"type":"integer","minimum":1,"maximum":1000000}},"required":["perHour","perDay"],"additionalProperties":false,"description":"Messages accepted per credential (the relay answers 451 4.7.1 beyond)."},"CreatedSmtpCredential":{"type":"object","properties":{"credential":{"$ref":"#/components/schemas/SmtpCredential"},"secret":{"type":"string","description":"The SMTP password. Shown ONCE; only its hash is stored."},"connection":{"$ref":"#/components/schemas/SmtpConnectionSettings"}},"required":["credential","secret","connection"],"additionalProperties":false},"SmtpConnectionSettings":{"type":"object","properties":{"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"security":{"type":"string","enum":["starttls","implicit_tls"]}},"required":["port","security"],"additionalProperties":false}},"username":{"type":"string"},"authMechanisms":{"type":"array","items":{"type":"string","enum":["PLAIN","LOGIN"]}}},"required":["ports","username","authMechanisms"],"additionalProperties":false},"CreateSmtpCredentialInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"senderIdentityIds":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"domainIdentityIds":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"ipAllowlist":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":64}},"limits":{"$ref":"#/components/schemas/SmtpCredentialLimits"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"UpdateSmtpCredentialInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"senderIdentityIds":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"domainIdentityIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"ipAllowlist":{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":64}},"limits":{"$ref":"#/components/schemas/SmtpCredentialLimits"}},"additionalProperties":false,"description":"Narrowing (fewer senders or networks, lower limits, a new name) is open to any caller with smtp.manage; WIDENING (a new sender or domain, a new network or an emptied allow-list, a higher limit) is a person's act, and new senders need a new activation."},"RotateSmtpCredentialInput":{"type":"object","properties":{"graceHours":{"default":24,"type":"integer","minimum":0,"maximum":168}},"additionalProperties":false,"description":"The previous secret keeps working for `graceHours` (0 = refused at once)."},"RevokeSmtpCredentialInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"ActivateSmtpCredentialInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":1000}},"required":["reason"],"additionalProperties":false,"description":"The approval of what the credential may send (ADR 0085 §4): a person with campaign.approve."},"HostedMailboxPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HostedMailbox"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"HostedMailbox":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"address":{"type":"string"},"domain":{"type":"string"},"domainIdentityId":{"$ref":"#/components/schemas/Uuid"},"displayName":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/HostedMailboxState"},"quotaMb":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"usageBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Size of every folder, as last measured on the mail host."},"passwordSetAt":{"$ref":"#/components/schemas/IsoDateTime"},"passwordOrigin":{"type":"string","enum":["generated","imported"]},"sync":{"$ref":"#/components/schemas/HostedMailboxSync"},"domainReserved":{"type":"boolean"},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revokedReason":{"type":["string","null"]},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","address","domain","domainIdentityId","displayName","state","quotaMb","usageBytes","passwordSetAt","passwordOrigin","sync","domainReserved","revokedAt","revokedReason","createdByUserId","revision","createdAt","updatedAt"],"additionalProperties":false},"HostedMailboxState":{"type":"string","enum":["active","revoked"]},"HostedMailboxSync":{"type":"object","properties":{"desiredSieveDigest":{"type":["string","null"]},"appliedSieveDigest":{"type":["string","null"]},"appliedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"reportedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"rulesInSync":{"type":"boolean"}},"required":["desiredSieveDigest","appliedSieveDigest","appliedAt","reportedAt","rulesInSync"],"additionalProperties":false},"CreatedHostedMailbox":{"type":"object","properties":{"mailbox":{"$ref":"#/components/schemas/HostedMailbox"},"password":{"type":"string","description":"The IMAP password. Shown ONCE; only its hash is stored."},"connection":{"$ref":"#/components/schemas/MailboxConnectionSettings"},"senderIdentityId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["mailbox","password","connection"],"additionalProperties":false},"MailboxConnectionSettings":{"type":"object","properties":{"imap":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"security":{"type":"string","const":"implicit_tls"}},"required":["host","port","security"],"additionalProperties":false},"username":{"type":"string"}},"required":["imap","username"],"additionalProperties":false},"CreateHostedMailboxInput":{"type":"object","properties":{"localPart":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9._+-]{0,62}[a-z0-9])?$"},"domainIdentityId":{"$ref":"#/components/schemas/Uuid"},"displayName":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"quotaMb":{"anyOf":[{"type":"integer","minimum":10,"maximum":102400},{"type":"null"}]},"asSender":{"type":"boolean"}},"required":["localPart","domainIdentityId"],"additionalProperties":false},"UpdateHostedMailboxInput":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"quotaMb":{"anyOf":[{"type":"integer","minimum":10,"maximum":102400},{"type":"null"}]}},"additionalProperties":false},"RotateHostedMailboxPasswordInput":{"type":"object","properties":{},"additionalProperties":false,"description":"The old password stops working at the next sync (no grace: one reader per mailbox)."},"RevokeHostedMailboxInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"HostedMailboxRuleList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HostedMailboxRule"}},"sieve":{"type":["string","null"]},"sync":{"$ref":"#/components/schemas/HostedMailboxSync"}},"required":["items","sieve","sync"],"additionalProperties":false},"HostedMailboxRule":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"mailboxId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enabled":{"type":"boolean"},"match":{"$ref":"#/components/schemas/MailboxRuleMatch"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/MailboxRuleCondition"}},"actions":{"$ref":"#/components/schemas/MailboxRuleActions"},"applicableToExisting":{"type":"boolean"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","mailboxId","name","position","enabled","match","conditions","actions","applicableToExisting","createdByUserId","revision","createdAt","updatedAt"],"additionalProperties":false},"MailboxRuleMatch":{"type":"string","enum":["all","any"]},"MailboxRuleCondition":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/MailboxRuleField"},"header":{"type":"string","pattern":"^[A-Za-z0-9-]{1,76}$"},"operator":{"$ref":"#/components/schemas/MailboxRuleOperator"},"value":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\u0000-\\u001f\\u007f]*$"}},"required":["field","operator","value"],"additionalProperties":false},"MailboxRuleField":{"type":"string","enum":["from","to","cc","subject","body","header"]},"MailboxRuleOperator":{"type":"string","enum":["contains","is","matches"]},"MailboxRuleActions":{"type":"object","properties":{"moveTo":{"default":null,"anyOf":[{"$ref":"#/components/schemas/MailboxFolderName"},{"type":"null"}]},"markRead":{"default":false,"type":"boolean"},"flag":{"default":false,"type":"boolean"},"stopProcessing":{"default":true,"type":"boolean"}},"required":["moveTo","markRead","flag","stopProcessing"],"additionalProperties":false,"description":"No forward (ADR 0091 §4): forwarding others' mail breaks their DMARC through our signer."},"MailboxFolderName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[^\\u0000-\\u001f\\u007f/\\\\*%\"]+$"},"CreateHostedMailboxRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"default":true,"type":"boolean"},"match":{"default":"all","$ref":"#/components/schemas/MailboxRuleMatch"},"conditions":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/MailboxRuleCondition"}},"actions":{"$ref":"#/components/schemas/MailboxRuleActionsInput"},"position":{"type":"integer","minimum":0,"maximum":50}},"required":["name","conditions","actions"],"additionalProperties":false},"MailboxRuleActionsInput":{"type":"object","properties":{"moveTo":{"default":null,"anyOf":[{"$ref":"#/components/schemas/MailboxFolderName"},{"type":"null"}]},"markRead":{"default":false,"type":"boolean"},"flag":{"default":false,"type":"boolean"},"stopProcessing":{"default":true,"type":"boolean"}},"additionalProperties":false,"description":"No forward (ADR 0091 §4): forwarding others' mail breaks their DMARC through our signer."},"UpdateHostedMailboxRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean"},"match":{"$ref":"#/components/schemas/MailboxRuleMatch"},"conditions":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/MailboxRuleCondition"}},"actions":{"$ref":"#/components/schemas/MailboxRuleActionsInput"},"position":{"type":"integer","minimum":0,"maximum":50}},"additionalProperties":false},"HostedMailboxRuleRun":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"mailboxId":{"$ref":"#/components/schemas/Uuid"},"ruleId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"ruleName":{"type":"string"},"sourceFolder":{"type":"string"},"maxMessages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"$ref":"#/components/schemas/MailboxRuleRunState"},"matched":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"applied":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"requestedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"requestedAt":{"$ref":"#/components/schemas/IsoDateTime"},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"finishedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","mailboxId","ruleId","ruleName","sourceFolder","maxMessages","state","matched","applied","error","requestedByUserId","requestedAt","startedAt","finishedAt"],"additionalProperties":false},"MailboxRuleRunState":{"type":"string","enum":["pending","running","succeeded","failed"]},"ApplyHostedMailboxRuleInput":{"type":"object","properties":{"maxMessages":{"default":1000,"type":"integer","minimum":1,"maximum":5000}},"additionalProperties":false,"description":"Runs the rule ONCE on the messages already in INBOX (bounded, audited)."},"HostedMailboxRuleRunList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HostedMailboxRuleRun"}}},"required":["items"],"additionalProperties":false},"HostedMailboxFolderList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HostedMailboxFolder"}},"reportedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["items","reportedAt"],"additionalProperties":false},"HostedMailboxFolder":{"type":"object","properties":{"name":{"type":"string"},"state":{"type":"string","enum":["requested","present"]},"messages":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sizeBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"observedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["name","state","messages","sizeBytes","observedAt"],"additionalProperties":false},"CreateHostedMailboxFolderInput":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/MailboxFolderName"}},"required":["name"],"additionalProperties":false},"HostedMailboxDomainList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HostedMailboxDomain"}},"inboundHosts":{"type":"array","items":{"type":"string"}}},"required":["items","inboundHosts"],"additionalProperties":false},"HostedMailboxDomain":{"type":"object","properties":{"domainIdentityId":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"verified":{"type":"boolean"},"receiving":{"$ref":"#/components/schemas/MailboxReceivingState"},"soleMx":{"type":"boolean"},"declared":{"type":"boolean"},"available":{"type":"boolean"},"blocker":{"anyOf":[{"$ref":"#/components/schemas/MailboxDomainBlocker"},{"type":"null"}]},"observedMx":{"type":"array","items":{"$ref":"#/components/schemas/MailboxMxRecord"}},"checkedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"receivingSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"requiredRecord":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"MX"},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value":{"type":"string"}},"required":["type","name","priority","value"],"additionalProperties":false},{"type":"null"}]}},"required":["domainIdentityId","domain","verified","receiving","soleMx","declared","available","blocker","observedMx","checkedAt","receivingSince","requiredRecord"],"additionalProperties":false},"MailboxReceivingState":{"type":"string","enum":["receiving","not_receiving","unchecked"]},"MailboxDomainBlocker":{"type":"string","enum":["unverified","mx_missing","unchecked","reserved"]},"MailboxMxRecord":{"type":"object","properties":{"priority":{"type":"integer","minimum":0,"maximum":65535},"host":{"type":"string"}},"required":["priority","host"],"additionalProperties":false},"RecheckHostedMailboxDomainInput":{"type":"object","properties":{},"additionalProperties":false},"KumoMailboxes":{"type":"object","properties":{"mailboxes":{"type":"array","items":{"type":"string"}},"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"soleMx":{"type":"boolean"}},"required":["domain","soleMx"],"additionalProperties":false}},"generatedAt":{"type":"string"}},"required":["mailboxes","domains","generatedAt"],"additionalProperties":false,"description":"Internal (KumoMTA only): the recipients its inbound listeners accept for hosted mailboxes."},"MailboxSyncState":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"passwordHash":{"type":"string"},"quotaMb":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sieve":{"anyOf":[{"type":"object","properties":{"digest":{"type":"string"},"script":{"type":"string"}},"required":["digest","script"],"additionalProperties":false},{"type":"null"}]},"createFolders":{"type":"array","items":{"type":"string"}}},"required":["address","passwordHash","quotaMb","sieve","createFolders"],"additionalProperties":false}},"revoked":{"type":"array","items":{"type":"string"}},"domains":{"type":"array","items":{"type":"string"}},"runs":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"address":{"type":"string"},"sourceFolder":{"type":"string"},"search":{"type":"array","items":{"type":"string"}},"moveTo":{"type":["string","null"]},"markRead":{"type":"boolean"},"flag":{"type":"boolean"},"maxMessages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","address","sourceFolder","search","moveTo","markRead","flag","maxMessages"],"additionalProperties":false}},"generatedAt":{"type":"string"}},"required":["accounts","revoked","domains","runs","generatedAt"],"additionalProperties":false,"description":"Internal (the mail host's sync agent only): the hosted mailboxes' desired state."},"MailboxSyncAck":{"type":"object","properties":{"accepted":{"type":"boolean"}},"required":["accepted"],"additionalProperties":false},"MailboxSyncReport":{"type":"object","properties":{"agent":{"type":"string","maxLength":80},"mailboxes":{"maxItems":10000,"type":"array","items":{"type":"object","properties":{"address":{"type":"string","maxLength":320},"sieveDigest":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"folders":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"messages":{"type":"integer","minimum":0,"maximum":9007199254740991},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["name","messages","sizeBytes"]}}},"required":["address","sieveDigest","folders"]}},"runs":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"ok":{"type":"boolean"},"matched":{"type":"integer","minimum":0,"maximum":9007199254740991},"applied":{"type":"integer","minimum":0,"maximum":9007199254740991},"error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["id","ok","matched","applied","error"]}},"revoked":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","maxLength":320}}},"required":["agent","mailboxes","runs"],"additionalProperties":false},"GitConnectionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GitConnection"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"GitConnection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"provider":{"$ref":"#/components/schemas/GitConnectionProvider"},"method":{"$ref":"#/components/schemas/GitConnectionMethod"},"baseUrl":{"type":["string","null"]},"account":{"type":["string","null"]},"installationId":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/GitConnectionState"},"stateReason":{"type":["string","null"]},"bindings":{"type":"integer","minimum":0,"maximum":9007199254740991},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","provider","method","baseUrl","account","installationId","state","stateReason","bindings","revision","createdAt","updatedAt"],"additionalProperties":false},"GitConnectionProvider":{"type":"string","enum":["github","gitlab","bitbucket"]},"GitConnectionMethod":{"type":"string","enum":["github_app","oauth","access_token"],"description":"github_app = the platform's GitHub App installation; oauth = GitLab / Bitbucket consent; access_token = a token the customer supplied (self-managed GitLab, Bitbucket access tokens)."},"GitConnectionState":{"type":"string","enum":["active","needs_reauthorization","revoked"]},"CreateGitTokenConnectionInput":{"type":"object","properties":{"provider":{"type":"string","enum":["gitlab","bitbucket"]},"baseUrl":{"type":"string","maxLength":200,"format":"uri"},"accessToken":{"type":"string","minLength":16,"maxLength":512,"pattern":"^[\\x21-\\x7e]+$"}},"required":["provider","accessToken"],"additionalProperties":false},"RevokeGitConnectionInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"GitAuthorizationStart":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"redirectUri":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["authorizationUrl","redirectUri","expiresAt"],"additionalProperties":false},"StartGitAuthorizationInput":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/GitConnectionProvider"},"redirectUri":{"type":"string","maxLength":500,"format":"uri"}},"required":["provider"],"additionalProperties":false},"CompleteGitAuthorizationInput":{"type":"object","properties":{"state":{"type":"string","minLength":16,"maxLength":200},"code":{"type":"string","minLength":1,"maxLength":4096},"installationId":{"type":"string","pattern":"^[0-9]{1,20}$"},"setupAction":{"type":"string","enum":["install","update","request"]},"error":{"type":"string","maxLength":64}},"required":["state"],"additionalProperties":false},"GitRemoteRepositoryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GitRemoteRepository"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false},"GitRemoteRepository":{"type":"object","properties":{"fullName":{"type":"string"},"defaultBranch":{"type":["string","null"]},"private":{"type":"boolean"},"webUrl":{"type":["string","null"]}},"required":["fullName","defaultBranch","private","webUrl"],"additionalProperties":false},"GitRemoteBranchPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GitRemoteBranch"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false},"GitRemoteBranch":{"type":"object","properties":{"name":{"type":"string"},"commit":{"type":"string"}},"required":["name","commit"],"additionalProperties":false},"GitWebhookAccepted":{"type":"object","properties":{"bindings":{"type":"integer","minimum":0,"maximum":9007199254740991},"duplicate":{"type":"boolean"}},"required":["bindings","duplicate"],"additionalProperties":false},"GitBindingPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GitBinding"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"GitBinding":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"provider":{"$ref":"#/components/schemas/GitProvider"},"repository":{"type":"string"},"branch":{"type":"string"},"direction":{"$ref":"#/components/schemas/GitBindingDirection"},"pathPrefix":{"type":"string"},"state":{"$ref":"#/components/schemas/GitBindingState"},"stateReason":{"type":["string","null"]},"adapter":{"anyOf":[{"$ref":"#/components/schemas/GitAdapterKind"},{"type":"null"}]},"adapterLabel":{"type":["string","null"]},"connectionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"webhook":{"$ref":"#/components/schemas/GitBindingWebhook"},"baseCommit":{"type":["string","null"]},"trackedObjects":{"type":"integer","minimum":0,"maximum":9007199254740991},"openConflicts":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastSyncAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastRun":{"anyOf":[{"$ref":"#/components/schemas/GitSyncRunSummary"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","provider","repository","branch","direction","pathPrefix","state","stateReason","adapter","adapterLabel","connectionId","webhook","baseCommit","trackedObjects","openConflicts","lastSyncAt","lastRun","revision","createdAt","updatedAt"],"additionalProperties":false},"GitProvider":{"type":"string","enum":["github","gitlab","bitbucket"]},"GitBindingDirection":{"type":"string","enum":["export","import","both"],"description":"export = workspace → pull/merge request; import = repository → reviewed template drafts; both."},"GitBindingState":{"type":"string","enum":["awaiting_authorization","connected","needs_reauthorization","error","disconnected"]},"GitAdapterKind":{"type":"string","enum":["local_fixture","github","gitlab","bitbucket"]},"GitBindingWebhook":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/GitWebhookState"},"reason":{"type":["string","null"]},"lastDeliveryAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastOutcome":{"anyOf":[{"$ref":"#/components/schemas/GitWebhookOutcome"},{"type":"null"}]},"remoteHeadCommit":{"type":["string","null"]}},"required":["state","reason","lastDeliveryAt","lastOutcome","remoteHeadCommit"],"additionalProperties":false},"GitWebhookState":{"type":"string","enum":["none","app","registered","not_registered"]},"GitWebhookOutcome":{"type":"string","enum":["previewed","stale","duplicate","ignored","failed"],"description":"previewed = an import preview was computed for the pushed head; stale = the pushed commit is no longer the branch head (superseded or replayed); duplicate = this delivery id was already handled; ignored = nothing to do (another branch, an export-only binding); failed = the provider could not be read (retry by hand)."},"GitSyncRunSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"bindingId":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["preview","apply"]},"direction":{"$ref":"#/components/schemas/GitRunDirection"},"status":{"$ref":"#/components/schemas/GitSyncRunStatus"},"baseCommit":{"type":["string","null"]},"headCommit":{"type":["string","null"]},"diffHash":{"type":["string","null"]},"counts":{"type":"object","properties":{"unchanged":{"type":"integer","minimum":0,"maximum":9007199254740991},"toExport":{"type":"integer","minimum":0,"maximum":9007199254740991},"toImport":{"type":"integer","minimum":0,"maximum":9007199254740991},"merged":{"type":"integer","minimum":0,"maximum":9007199254740991},"conflicts":{"type":"integer","minimum":0,"maximum":9007199254740991},"deletions":{"type":"integer","minimum":0,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["unchanged","toExport","toImport","merged","conflicts","deletions","invalid"],"additionalProperties":false},"previewRunId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"branchName":{"type":["string","null"]},"pullRequestUrl":{"type":["string","null"]},"pullRequestNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","bindingId","kind","direction","status","baseCommit","headCommit","diffHash","counts","previewRunId","branchName","pullRequestUrl","pullRequestNumber","error","createdAt","completedAt"],"additionalProperties":false},"GitRunDirection":{"type":"string","enum":["export","import"]},"GitSyncRunStatus":{"type":"string","enum":["completed","conflicted","failed"]},"CreateGitBindingInput":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/GitConnectionProvider"},"connectionId":{"$ref":"#/components/schemas/Uuid"},"repository":{"type":"string","minLength":3,"maxLength":200,"pattern":"^[A-Za-z0-9_-][A-Za-z0-9_.-]*(\\/[A-Za-z0-9_-][A-Za-z0-9_.-]*){1,3}$"},"branch":{"default":"main","type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9][A-Za-z0-9._/-]*$"},"direction":{"default":"export","$ref":"#/components/schemas/GitBindingDirection"},"pathPrefix":{"default":"arenf","type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9][a-z0-9_-]{0,63}(\\/[a-z0-9][a-z0-9_-]{0,63}){0,3}$"}},"required":["provider","repository"],"additionalProperties":false},"DisconnectGitBindingInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false},"GitSyncRun":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"bindingId":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["preview","apply"]},"direction":{"$ref":"#/components/schemas/GitRunDirection"},"status":{"$ref":"#/components/schemas/GitSyncRunStatus"},"baseCommit":{"type":["string","null"]},"headCommit":{"type":["string","null"]},"diffHash":{"type":["string","null"]},"counts":{"type":"object","properties":{"unchanged":{"type":"integer","minimum":0,"maximum":9007199254740991},"toExport":{"type":"integer","minimum":0,"maximum":9007199254740991},"toImport":{"type":"integer","minimum":0,"maximum":9007199254740991},"merged":{"type":"integer","minimum":0,"maximum":9007199254740991},"conflicts":{"type":"integer","minimum":0,"maximum":9007199254740991},"deletions":{"type":"integer","minimum":0,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["unchanged","toExport","toImport","merged","conflicts","deletions","invalid"],"additionalProperties":false},"previewRunId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"branchName":{"type":["string","null"]},"pullRequestUrl":{"type":["string","null"]},"pullRequestNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"diff":{"type":"array","items":{"$ref":"#/components/schemas/GitDiffEntry"}}},"required":["id","bindingId","kind","direction","status","baseCommit","headCommit","diffHash","counts","previewRunId","branchName","pullRequestUrl","pullRequestNumber","error","createdAt","completedAt","diff"],"additionalProperties":false},"GitDiffEntry":{"type":"object","properties":{"path":{"type":"string"},"objectKind":{"$ref":"#/components/schemas/GitObjectKind"},"objectId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"name":{"type":["string","null"]},"change":{"$ref":"#/components/schemas/GitDiffChange"},"action":{"$ref":"#/components/schemas/GitDiffAction"},"baseHash":{"type":["string","null"]},"workspaceHash":{"type":["string","null"]},"repositoryHash":{"type":["string","null"]},"requiresTombstoneReview":{"type":"boolean"},"fieldPaths":{"type":"array","items":{"type":"string"}},"conflictId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"validation":{"anyOf":[{"$ref":"#/components/schemas/GitValidation"},{"type":"null"}]}},"required":["path","objectKind","objectId","name","change","action","baseHash","workspaceHash","repositoryHash","requiresTombstoneReview","fieldPaths","conflictId","validation"],"additionalProperties":false},"GitObjectKind":{"type":"string","enum":["template","journey","design_tokens"]},"GitDiffChange":{"type":"string","enum":["unchanged","workspace_added","workspace_changed","workspace_deleted","repository_added","repository_changed","repository_deleted","merged","conflict","invalid"],"description":"Three-way classification of one tracked path (base vs workspace vs repository)."},"GitDiffAction":{"type":"string","enum":["none","write","delete","import","archive","resolve_first","rejected"],"description":"What apply would do in the run's direction: write/delete a repository file (export), import/archive a template draft (import)."},"GitValidation":{"type":"object","properties":{"ok":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":["string","null"]}},"required":["code","message","path"],"additionalProperties":false}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":["string","null"]}},"required":["code","message","path"],"additionalProperties":false}}},"required":["ok","issues","warnings"],"additionalProperties":false},"PreviewGitSyncInput":{"type":"object","properties":{"direction":{"$ref":"#/components/schemas/GitRunDirection"},"expectedBaseCommit":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{40,64}$"},{"type":"null"}]}},"required":["direction"],"additionalProperties":false},"ApplyGitSyncInput":{"type":"object","properties":{"previewRunId":{"$ref":"#/components/schemas/Uuid"},"reviewedDiffHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"targetBranch":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9][A-Za-z0-9._/-]*$"},"acceptDeletions":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","maxLength":300}}},"required":["previewRunId","reviewedDiffHash"],"additionalProperties":false},"GitSyncRunPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/GitSyncRunSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"SyncConflict":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"bindingId":{"$ref":"#/components/schemas/Uuid"},"runId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"repository":{"type":"string"},"branch":{"type":"string"},"path":{"type":"string"},"status":{"$ref":"#/components/schemas/SyncConflictStatus"},"baseHash":{"type":["string","null"]},"localHash":{"type":["string","null"]},"remoteHash":{"type":["string","null"]},"baseContent":{"anyOf":[{},{"type":"null"}]},"localContent":{"anyOf":[{},{"type":"null"}]},"remoteContent":{"anyOf":[{},{"type":"null"}]},"conflictPaths":{"type":"array","items":{"type":"string"}},"suggestedContent":{"anyOf":[{},{"type":"null"}]},"mergedContent":{"anyOf":[{},{"type":"null"}]},"validation":{"anyOf":[{"$ref":"#/components/schemas/GitValidation"},{"type":"null"}]},"resolvedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"resolvedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","bindingId","runId","repository","branch","path","status","baseHash","localHash","remoteHash","baseContent","localContent","remoteContent","conflictPaths","suggestedContent","mergedContent","validation","resolvedAt","resolvedByUserId","createdAt"],"additionalProperties":false},"SyncConflictStatus":{"type":"string","enum":["open","resolved","discarded"]},"ResolveSyncConflictInput":{"type":"object","properties":{"choice":{"type":"string","enum":["workspace","repository","manual"]},"mergedContent":{},"dryRun":{"default":false,"type":"boolean"}},"required":["choice"],"additionalProperties":false},"ConnectorCatalog":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorCatalogItem"}}},"required":["items"],"additionalProperties":false},"ConnectorCatalogItem":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/ConnectorProvider"},"label":{"type":"string"},"category":{"type":"string","enum":["commerce","crm","payments","data"]},"available":{"type":"boolean"},"requirement":{"type":"string"}},"required":["provider","label","category","available","requirement"],"additionalProperties":false},"ConnectorProvider":{"type":"string","enum":["shopify","woocommerce","salesforce","hubspot","stripe","custom_events"]},"ConnectorPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Connector"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"Connector":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"provider":{"$ref":"#/components/schemas/ConnectorProvider"},"providerLabel":{"type":"string"},"name":{"type":"string"},"state":{"$ref":"#/components/schemas/ConnectorState"},"stateReason":{"type":["string","null"]},"cursor":{"type":["string","null"]},"settings":{"$ref":"#/components/schemas/ConnectorSettings"},"ingestPath":{"type":"string"},"lastSyncAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastError":{"type":["string","null"]},"recordsApplied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recordsSkipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recordsRejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastBatch":{"anyOf":[{"$ref":"#/components/schemas/ConnectorBatch"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","provider","providerLabel","name","state","stateReason","cursor","settings","ingestPath","lastSyncAt","lastError","recordsApplied","recordsSkipped","recordsRejected","lastBatch","revision","createdAt","updatedAt"],"additionalProperties":false},"ConnectorState":{"type":"string","enum":["awaiting_authorization","active","paused","needs_reauthorization","error"]},"ConnectorSettings":{"type":"object","properties":{"applyOptOuts":{"default":true,"type":"boolean"}},"required":["applyOptOuts"],"additionalProperties":false},"ConnectorBatch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"connectorId":{"$ref":"#/components/schemas/Uuid"},"cursorBefore":{"type":["string","null"]},"cursorAfter":{"type":["string","null"]},"received":{"type":"integer","minimum":0,"maximum":9007199254740991},"applied":{"type":"integer","minimum":0,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejections":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["contact","event"]},"externalId":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["kind","externalId","code","message"],"additionalProperties":false}},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","connectorId","cursorBefore","cursorAfter","received","applied","skipped","rejected","rejections","createdAt"],"additionalProperties":false},"CreateConnectorInput":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/ConnectorProvider"},"name":{"type":"string","minLength":1,"maxLength":120},"settings":{"default":{"applyOptOuts":true},"$ref":"#/components/schemas/ConnectorSettingsInput"}},"required":["provider","name"],"additionalProperties":false},"ConnectorSettingsInput":{"type":"object","properties":{"applyOptOuts":{"default":true,"type":"boolean"}},"additionalProperties":false},"UpdateConnectorInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"settings":{"$ref":"#/components/schemas/ConnectorSettingsInput"},"state":{"type":"string","enum":["active","paused"]}},"additionalProperties":false},"ConnectorBatchResult":{"type":"object","properties":{"batch":{"$ref":"#/components/schemas/ConnectorBatch"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorRecordResult"}}},"required":["batch","results"],"additionalProperties":false},"ConnectorRecordResult":{"type":"object","properties":{"kind":{"type":"string","enum":["contact","event"]},"externalId":{"type":"string"},"outcome":{"$ref":"#/components/schemas/ConnectorRecordOutcome"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"consentNote":{"anyOf":[{"$ref":"#/components/schemas/ConsentPrecedenceNote"},{"type":"null"}]},"code":{"type":["string","null"]},"commerceOutcome":{"default":null,"anyOf":[{"$ref":"#/components/schemas/CommerceBridgeOutcome"},{"type":"null"}]}},"required":["kind","externalId","outcome","contactId","consentNote","code","commerceOutcome"],"additionalProperties":false},"ConnectorRecordOutcome":{"type":"string","enum":["applied","unchanged","rejected"]},"ConsentPrecedenceNote":{"type":"string","enum":["crm_opt_out_applied","crm_opt_out_already_withdrawn","crm_opt_out_not_applied_setting","crm_subscribed_not_consent","crm_subscribed_ignored_withdrawn"]},"CommerceBridgeOutcome":{"type":"string","enum":["order_recorded","order_duplicate","order_conflict","refund_recorded","refund_duplicate","refund_conflict","refund_exceeds_order","refund_currency_mismatch","refund_awaiting_order"]},"SubmitConnectorBatchInput":{"type":"object","properties":{"cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"contacts":{"default":[],"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/ConnectorContactRecord"}},"events":{"default":[],"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/ConnectorEventInput"}}},"additionalProperties":false},"ConnectorContactRecord":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","minLength":3,"maxLength":320},"firstName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"crmMarketingStatus":{"default":"unknown","$ref":"#/components/schemas/CrmMarketingStatus"}},"required":["externalId","version","email"],"additionalProperties":false},"CrmMarketingStatus":{"type":"string","enum":["subscribed","unsubscribed","unknown"]},"ConnectorEventInput":{"type":"object","properties":{"type":{"type":"string","minLength":3,"maxLength":80},"schemaVersion":{"type":"integer","minimum":1,"maximum":1000},"externalId":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","minLength":3,"maxLength":320},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"data":{}},"required":["type","schemaVersion","externalId","occurredAt","data"],"additionalProperties":false},"ConnectorBatchPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorBatch"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ConnectorEventPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorEventItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ConnectorEventItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"connectorId":{"$ref":"#/components/schemas/Uuid"},"type":{"type":"string"},"schemaVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"externalId":{"type":"string"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"commerceOutcome":{"anyOf":[{"$ref":"#/components/schemas/CommerceBridgeOutcome"},{"type":"null"}]},"commerceOrderId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","connectorId","type","schemaVersion","externalId","contactId","occurredAt","data","commerceOutcome","commerceOrderId","createdAt"],"additionalProperties":false},"CommerceOverview":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"orders":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false}}},"required":["count","totals"],"additionalProperties":false},"refunds":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["currency","amountMinor"],"additionalProperties":false}}},"required":["count","totals"],"additionalProperties":false},"carts":{"type":"object","properties":{"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"abandoned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["updated","abandoned"],"additionalProperties":false},"productViews":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"customEvents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connectors":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"provider":{"$ref":"#/components/schemas/ConnectorProvider"},"state":{"$ref":"#/components/schemas/ConnectorState"},"lastSyncAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"recordsRejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","provider","state","lastSyncAt","recordsRejected"],"additionalProperties":false}},"unavailable":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string","enum":["catalog","coupons","loyalty"]},"requirement":{"type":"string"},"reason":{"type":"string"}},"required":["feature","requirement","reason"],"additionalProperties":false}}},"required":["asOf","windowDays","orders","refunds","carts","productViews","customEvents","connectors","unavailable"],"additionalProperties":false,"description":"Commerce facts from connector events (S102). Counts are of RECEIVED events, not attributed revenue."},"SavedReportPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SavedReport"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"SavedReport":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/ReportDefinition"},"schedule":{"$ref":"#/components/schemas/ReportSchedule"},"recipientUserIds":{"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"nextRunAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","definition","schedule","recipientUserIds","nextRunAt","revision","createdByUserId","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"ReportDefinition":{"type":"object","properties":{"dimensions":{"minItems":1,"maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/ReportDimension"}},"granularity":{"default":"week","description":"Bucket of the `period` dimension.","$ref":"#/components/schemas/ReportGranularity"},"metrics":{"minItems":1,"maxItems":12,"type":"array","items":{"$ref":"#/components/schemas/ReportMetricKey"}},"filters":{"default":{"campaignIds":[],"streams":[]},"$ref":"#/components/schemas/ReportFilters"},"range":{"$ref":"#/components/schemas/ReportDateRange"},"view":{"default":"filtered","$ref":"#/components/schemas/ReportView"},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["dimensions","granularity","metrics","filters","range","view","compareToPrevious"],"additionalProperties":false,"description":"A closed, compiled report definition (no query language, ADR 0027)."},"ReportDimension":{"type":"string","enum":["campaign","period","stream","contact_cohort","list","campaign_owner","campaign_approver","journey","journey_step"]},"ReportGranularity":{"type":"string","enum":["day","week","month"]},"ReportMetricKey":{"type":"string","enum":["attempted","provider_accepted","reported_delivered","bounced","complained","unsubscribed","clicks","acceptance_rate","reported_delivery_rate","bounce_rate","complaint_rate","unique_human_click_rate"]},"ReportFilters":{"type":"object","properties":{"campaignIds":{"default":[],"description":"Empty = every campaign of the workspace.","maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"streams":{"default":[],"description":"Empty = both streams.","maxItems":2,"type":"array","items":{"type":"string","enum":["marketing","transactional"]}}},"required":["campaignIds","streams"],"additionalProperties":false},"ReportDateRange":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"relative"},"relative":{"type":"string","enum":["last_7_days","last_30_days","last_90_days","previous_month","month_to_date"]}},"required":["kind","relative"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"absolute"},"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["kind","from","to"],"additionalProperties":false}]},"ReportSchedule":{"oneOf":[{"type":"object","properties":{"cadence":{"type":"string","const":"none"}},"required":["cadence"],"additionalProperties":false},{"type":"object","properties":{"cadence":{"type":"string","const":"daily"},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Wall-clock hour in `timeZone`."},"timeZone":{"default":"UTC","description":"IANA time zone of the cadence (default UTC).","type":"string","minLength":1,"maxLength":64}},"required":["cadence","hour","timeZone"],"additionalProperties":false},{"type":"object","properties":{"cadence":{"type":"string","const":"weekly"},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Wall-clock hour in `timeZone`."},"timeZone":{"default":"UTC","description":"IANA time zone of the cadence (default UTC).","type":"string","minLength":1,"maxLength":64},"dayOfWeek":{"type":"integer","minimum":1,"maximum":7,"description":"ISO day, 1 = Monday."}},"required":["cadence","hour","timeZone","dayOfWeek"],"additionalProperties":false},{"type":"object","properties":{"cadence":{"type":"string","const":"monthly"},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Wall-clock hour in `timeZone`."},"timeZone":{"default":"UTC","description":"IANA time zone of the cadence (default UTC).","type":"string","minLength":1,"maxLength":64},"dayOfMonth":{"type":"integer","minimum":1,"maximum":28}},"required":["cadence","hour","timeZone","dayOfMonth"],"additionalProperties":false}]},"CreateSavedReportInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"definition":{"$ref":"#/components/schemas/ReportDefinitionInput"},"schedule":{"default":{"cadence":"none"},"$ref":"#/components/schemas/ReportScheduleInput"},"recipientUserIds":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"required":["name","definition"],"additionalProperties":false},"ReportDefinitionInput":{"type":"object","properties":{"dimensions":{"minItems":1,"maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/ReportDimension"}},"granularity":{"default":"week","description":"Bucket of the `period` dimension.","$ref":"#/components/schemas/ReportGranularity"},"metrics":{"minItems":1,"maxItems":12,"type":"array","items":{"$ref":"#/components/schemas/ReportMetricKey"}},"filters":{"default":{"campaignIds":[],"streams":[]},"$ref":"#/components/schemas/ReportFiltersInput"},"range":{"$ref":"#/components/schemas/ReportDateRange"},"view":{"default":"filtered","$ref":"#/components/schemas/ReportView"},"compareToPrevious":{"default":false,"type":"boolean"}},"required":["dimensions","metrics","range"],"additionalProperties":false,"description":"A closed, compiled report definition (no query language, ADR 0027)."},"ReportFiltersInput":{"type":"object","properties":{"campaignIds":{"default":[],"description":"Empty = every campaign of the workspace.","maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"streams":{"default":[],"description":"Empty = both streams.","maxItems":2,"type":"array","items":{"type":"string","enum":["marketing","transactional"]}}},"additionalProperties":false},"ReportScheduleInput":{"oneOf":[{"type":"object","properties":{"cadence":{"type":"string","const":"none"}},"required":["cadence"],"additionalProperties":false},{"type":"object","properties":{"cadence":{"type":"string","const":"daily"},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Wall-clock hour in `timeZone`."},"timeZone":{"default":"UTC","description":"IANA time zone of the cadence (default UTC).","type":"string","minLength":1,"maxLength":64}},"required":["cadence","hour"],"additionalProperties":false},{"type":"object","properties":{"cadence":{"type":"string","const":"weekly"},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Wall-clock hour in `timeZone`."},"timeZone":{"default":"UTC","description":"IANA time zone of the cadence (default UTC).","type":"string","minLength":1,"maxLength":64},"dayOfWeek":{"type":"integer","minimum":1,"maximum":7,"description":"ISO day, 1 = Monday."}},"required":["cadence","hour","dayOfWeek"],"additionalProperties":false},{"type":"object","properties":{"cadence":{"type":"string","const":"monthly"},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"Wall-clock hour in `timeZone`."},"timeZone":{"default":"UTC","description":"IANA time zone of the cadence (default UTC).","type":"string","minLength":1,"maxLength":64},"dayOfMonth":{"type":"integer","minimum":1,"maximum":28}},"required":["cadence","hour","dayOfMonth"],"additionalProperties":false}]},"UpdateSavedReportInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"definition":{"$ref":"#/components/schemas/ReportDefinitionInput"},"schedule":{"$ref":"#/components/schemas/ReportScheduleInput"},"recipientUserIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"additionalProperties":false},"ReportResult":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"definition":{"$ref":"#/components/schemas/ReportDefinition"},"range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to"],"additionalProperties":false},"previousRange":{"anyOf":[{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to"],"additionalProperties":false},{"type":"null"}]},"freshness":{"type":"object","properties":{"asOf":{"description":"When the report was computed.","$ref":"#/components/schemas/IsoDateTime"},"lastEventReceivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Most recent ingested event of the scope (data freshness)."},"classifierVersion":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Bot/privacy-proxy rule set version of the filtered view."},"realtime":{"type":"boolean","description":"Computed from the event store at request time (no batch lag)."}},"required":["asOf","lastEventReceivedAt","classifierVersion","realtime"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"dimensions":{"type":"array","items":{"type":"object","properties":{"dimension":{"$ref":"#/components/schemas/ReportDimension"},"key":{"type":"string"},"label":{"type":"string"}},"required":["dimension","key","label"],"additionalProperties":false}},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}},"previous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Metric"}},{"type":"null"}]}},"required":["dimensions","metrics","previous"],"additionalProperties":false}},"totals":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}},"truncated":{"type":"boolean"},"readOnly":{"type":"boolean","const":true}},"required":["workspaceId","definition","range","previousRange","freshness","rows","totals","truncated","readOnly"],"additionalProperties":false},"PreviewReportInput":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/ReportDefinitionInput"}},"required":["definition"],"additionalProperties":false},"ReportRun":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"reportId":{"$ref":"#/components/schemas/Uuid"},"reportName":{"type":"string"},"trigger":{"type":"string","enum":["manual","schedule"]},"scheduledFor":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/ReportRunStatus"},"requestedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"rowCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sizeBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"checksum":{"type":["string","null"]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"delivery":{"type":"array","items":{"type":"object","properties":{"userId":{"$ref":"#/components/schemas/Uuid"},"outcome":{"type":"string","enum":["notified","skipped_not_member","skipped_no_permission","skipped_inactive"]}},"required":["userId","outcome"],"additionalProperties":false}},"errorCode":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","reportId","reportName","trigger","scheduledFor","status","requestedByUserId","rowCount","sizeBytes","checksum","expiresAt","delivery","errorCode","createdAt","completedAt"],"additionalProperties":false},"ReportRunStatus":{"type":"string","enum":["queued","running","succeeded","failed","expired"]},"ReportRunPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReportRun"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ReportDownloadLink":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["url","expiresAt"],"additionalProperties":false},"RecordOrderResult":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/CommerceOrder"},"duplicate":{"type":"boolean"}},"required":["order","duplicate"],"additionalProperties":false},"CommerceOrder":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"source":{"type":"string"},"externalOrderId":{"type":"string"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"receivedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","source","externalOrderId","contactId","currency","amountMinor","refundedMinor","netMinor","occurredAt","receivedAt"],"additionalProperties":false},"RecordOrderInput":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":60,"pattern":"^[a-z0-9][a-z0-9_.-]*$","description":"Store key, e.g. `shopify-eu` (`connector.*` is reserved)."},"externalOrderId":{"type":"string","minLength":1,"maxLength":120},"contactId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","maxLength":320,"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,}$"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"amountMinor":{"type":"integer","minimum":0,"maximum":1000000000000,"description":"Order total in minor units (integer, never floating point)."},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"items":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/OrderLineItemInput"}},"couponCodes":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/CouponCodeText"}}},"required":["source","externalOrderId","currency","amountMinor","occurredAt"],"additionalProperties":false},"OrderLineItemInput":{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"integer","minimum":1,"maximum":10000},"unitPriceMinor":{"type":"integer","minimum":0,"maximum":1000000000000}},"required":["sku","quantity"],"additionalProperties":false},"CouponCodeText":{"type":"string","minLength":4,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"RecordRefundResult":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/CommerceOrder"},"duplicate":{"type":"boolean"}},"required":["order","duplicate"],"additionalProperties":false},"RecordRefundInput":{"type":"object","properties":{"externalRefundId":{"type":"string","minLength":1,"maxLength":120},"amountMinor":{"type":"integer","minimum":1,"maximum":1000000000000},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["externalRefundId","amountMinor","occurredAt"],"additionalProperties":false},"CommerceOrderPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CommerceOrder"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"CommerceSyncHealth":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastOrderReceivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"unlinkedOrders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Orders whose customer matched no contact (never attributed)."}},"required":["source","orders","lastOrderReceivedAt","unlinkedOrders"],"additionalProperties":false}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["sources","asOf"],"additionalProperties":false},"AttributionReport":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"range":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to"],"additionalProperties":false},"model":{"$ref":"#/components/schemas/AttributionModel"},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"currencyPolicy":{"type":"string","const":"no_conversion"},"metrics":{"type":"object","properties":{"orders":{"$ref":"#/components/schemas/Metric"},"grossRevenue":{"$ref":"#/components/schemas/Metric"},"refunds":{"$ref":"#/components/schemas/Metric"},"netRevenue":{"$ref":"#/components/schemas/Metric"},"attributedOrders":{"$ref":"#/components/schemas/Metric"},"netAttributedRevenue":{"$ref":"#/components/schemas/Metric"},"attributionCoverage":{"$ref":"#/components/schemas/Metric"}},"required":["orders","grossRevenue","refunds","netRevenue","attributedOrders","netAttributedRevenue","attributionCoverage"],"additionalProperties":false},"excludedOtherCurrency":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unlinkedOrders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"campaigns":{"type":"array","items":{"type":"object","properties":{"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"attributedOrders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossAttributedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netAttributedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["campaignId","campaignName","attributedOrders","grossAttributedMinor","refundedMinor","netAttributedMinor"],"additionalProperties":false}},"incrementality":{"$ref":"#/components/schemas/HoldoutLift"},"freshness":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"lastOrderReceivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"classifierVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["asOf","lastOrderReceivedAt","classifierVersion"],"additionalProperties":false}},"required":["workspaceId","range","model","windowDays","currency","currencyPolicy","metrics","excludedOtherCurrency","unlinkedOrders","campaigns","incrementality","freshness"],"additionalProperties":false},"AttributionModel":{"type":"string","enum":["last_human_click","last_accepted_send"]},"HoldoutLift":{"type":"object","properties":{"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"status":{"type":"string","enum":["available","unavailable"]},"unavailableReason":{"anyOf":[{"type":"string","enum":["no_holdout","holdout_too_small","not_requested","no_order_feed"]},{"type":"null"}]},"treatment":{"anyOf":[{"type":"object","properties":{"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netRevenueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revenuePerMemberMinor":{"type":"number"}},"required":["members","netRevenueMinor","revenuePerMemberMinor"],"additionalProperties":false},{"type":"null"}]},"holdout":{"anyOf":[{"type":"object","properties":{"members":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netRevenueMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"revenuePerMemberMinor":{"type":"number"}},"required":["members","netRevenueMinor","revenuePerMemberMinor"],"additionalProperties":false},{"type":"null"}]},"incrementalNetRevenueMinor":{"type":["number","null"]},"relativeLift":{"type":["number","null"]},"confidence":{"anyOf":[{"type":"object","properties":{"level":{"type":"number"},"perMemberDifferenceMinor":{"type":"number"},"perMemberIntervalMinor":{"type":"object","properties":{"low":{"type":"number"},"high":{"type":"number"}},"required":["low","high"],"additionalProperties":false},"incrementalIntervalMinor":{"type":"object","properties":{"low":{"type":"number"},"high":{"type":"number"}},"required":["low","high"],"additionalProperties":false},"standardErrorMinor":{"type":"number"},"degreesOfFreedom":{"type":["number","null"]},"pValue":{"type":["number","null"]},"significant":{"type":"boolean"}},"required":["level","perMemberDifferenceMinor","perMemberIntervalMinor","incrementalIntervalMinor","standardErrorMinor","degreesOfFreedom","pValue","significant"],"additionalProperties":false},{"type":"null"}]},"method":{"type":"string","description":"How the lift and its interval were computed (difference in means; Welch's t interval at 95 %)."}},"required":["campaignId","status","unavailableReason","treatment","holdout","incrementalNetRevenueMinor","relativeLift","confidence","method"],"additionalProperties":false},"AiSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"model":{"$ref":"#/components/schemas/AiModel"},"monthlyBudgetMicroUsd":{"type":"integer","minimum":0,"maximum":1000000000000},"brandVoice":{"type":"string"},"spentThisMonthMicroUsd":{"type":"integer","minimum":0,"maximum":1000000000000},"reservedMicroUsd":{"type":"integer","minimum":0,"maximum":1000000000000},"periodStart":{"$ref":"#/components/schemas/IsoDateTime"},"providerConfigured":{"type":"boolean"},"enabledByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"enabledAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["enabled","model","monthlyBudgetMicroUsd","brandVoice","spentThisMonthMicroUsd","reservedMicroUsd","periodStart","providerConfigured","enabledByUserId","enabledAt","revision"],"additionalProperties":false},"AiModel":{"type":"string","enum":["claude-opus-5-5","claude-sonnet-5-5"]},"UpdateAiSettingsInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"model":{"$ref":"#/components/schemas/AiModel"},"monthlyBudgetMicroUsd":{"description":"At most $1 000 per month.","type":"integer","minimum":0,"maximum":1000000000},"brandVoice":{"type":"string","maxLength":4000}},"additionalProperties":false},"AiSourceList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AiSource"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"AiSource":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/AiSourceType"},"id":{"type":"string"},"label":{"type":"string"},"excerpt":{"type":"string"}},"required":["type","id","label","excerpt"],"additionalProperties":false},"AiSourceType":{"type":"string","enum":["brand_voice","template","campaign_version"]},"AiGeneration":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"type":"string","enum":["subject_lines","email_copy","audience_explanation"]},"status":{"$ref":"#/components/schemas/AiGenerationStatus"},"model":{"type":"string"},"provider":{"type":"string"},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"requestedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/AiSourceRef"}},"draft":{"anyOf":[{"$ref":"#/components/schemas/AiDraftOutput"},{"type":"null"}]},"explanation":{"anyOf":[{"$ref":"#/components/schemas/AudienceExplanationOutput"},{"type":"null"}]},"findings":{"type":"array","items":{"$ref":"#/components/schemas/AiFinding"}},"preview":{"anyOf":[{"type":"object","properties":{"current":{"type":"object","properties":{"subject":{"type":"string"},"preheader":{"type":["string","null"]}},"required":["subject","preheader"],"additionalProperties":false},"proposed":{"type":"object","properties":{"subject":{"type":["string","null"]},"preheader":{"type":["string","null"]}},"required":["subject","preheader"],"additionalProperties":false}},"required":["current","proposed"],"additionalProperties":false},{"type":"null"}]},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outputTokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"costMicroUsd":{"type":"integer","minimum":0,"maximum":1000000000000}},"required":["inputTokens","outputTokens","costMicroUsd"],"additionalProperties":false},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["accepted","rejected"]},"userId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"note":{"type":["string","null"]},"at":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["decision","userId","note","at"],"additionalProperties":false},{"type":"null"}]},"errorCode":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","kind","status","model","provider","campaignId","requestedByUserId","sources","draft","explanation","findings","preview","usage","review","errorCode","createdAt"],"additionalProperties":false},"AiGenerationStatus":{"type":"string","enum":["succeeded","blocked","failed"]},"AiSourceRef":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/AiSourceType"},"id":{"type":"string","minLength":1,"maxLength":64}},"required":["type","id"],"additionalProperties":false},"AiDraftOutput":{"type":"object","properties":{"subjectLines":{"type":"array","items":{"type":"string"}},"preheader":{"type":["string","null"]},"bodyText":{"type":["string","null"]},"rationale":{"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"sourceType":{"$ref":"#/components/schemas/AiSourceType"},"sourceId":{"type":"string"},"quote":{"type":"string"}},"required":["sourceType","sourceId","quote"],"additionalProperties":false}}},"required":["subjectLines","preheader","bodyText","rationale","citations"],"additionalProperties":false},"AudienceExplanationOutput":{"type":"object","properties":{"summary":{"type":"string"},"factors":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label","detail"],"additionalProperties":false}},"facts":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"key":{"type":"string","maxLength":64},"params":{"$ref":"#/components/schemas/MessageParams"}},"required":["label","value"],"additionalProperties":false}}},"required":["summary","factors","facts"],"additionalProperties":false},"AiFinding":{"type":"object","properties":{"kind":{"type":"string","enum":["unsupported_claim","uncited_source","pii_redacted","no_citation","provider_refusal"]},"blocking":{"type":"boolean"},"detail":{"type":"string"},"detailCode":{"type":"string","maxLength":64},"detailParams":{"$ref":"#/components/schemas/MessageParams"}},"required":["kind","blocking","detail"],"additionalProperties":false},"GenerateDraftInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/AiDraftKind"},"goal":{"type":"string","minLength":3,"maxLength":1000},"campaignId":{"$ref":"#/components/schemas/Uuid"},"sources":{"minItems":1,"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/AiSourceRef"}}},"required":["kind","goal","sources"],"additionalProperties":false},"AiDraftKind":{"type":"string","enum":["subject_lines","email_copy"]},"ExplainAudienceInput":{"type":"object","properties":{"segmentId":{"$ref":"#/components/schemas/Uuid"},"listId":{"$ref":"#/components/schemas/Uuid"}},"additionalProperties":false},"AiGenerationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AiGeneration"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ReviewAiGenerationInput":{"type":"object","properties":{"decision":{"type":"string","enum":["accepted","rejected"]},"note":{"type":"string","maxLength":500}},"required":["decision"],"additionalProperties":false},"UserPreferences":{"type":"object","properties":{"language":{"anyOf":[{"$ref":"#/components/schemas/UiLanguage"},{"type":"null"}],"description":"null: follow the browser, then the workspace default language."},"locale":{"description":"BCP 47 formatting locale; null: derived from the language.","type":["string","null"]},"timeZone":{"description":"IANA zone the console shows times in; null: the workspace default timezone.","type":["string","null"]},"recordSurfaces":{"description":"How records open from lists (side panel, dialog, full screen); null fields: the defaults.","$ref":"#/components/schemas/RecordSurfacePreferences"},"display":{"description":"Side navigation width, motion, text size, colour theme and the composer's advanced options; null fields: the defaults.","$ref":"#/components/schemas/DisplayPreferences"},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"null until the person saves preferences for the first time."}},"required":["language","locale","timeZone","revision","updatedAt"],"additionalProperties":false},"UpdateUserPreferencesInput":{"type":"object","properties":{"language":{"anyOf":[{"$ref":"#/components/schemas/UiLanguage"},{"type":"null"}]},"locale":{"anyOf":[{"$ref":"#/components/schemas/FormatLocale"},{"type":"null"}]},"timeZone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"recordSurfaces":{"type":"object","properties":{"view":{"anyOf":[{"$ref":"#/components/schemas/RecordSurfaceMode"},{"type":"null"}]},"edit":{"anyOf":[{"$ref":"#/components/schemas/RecordSurfaceMode"},{"type":"null"}]}},"additionalProperties":false},"display":{"type":"object","properties":{"sidebar":{"anyOf":[{"$ref":"#/components/schemas/SidebarMode"},{"type":"null"}]},"motion":{"anyOf":[{"$ref":"#/components/schemas/MotionPreference"},{"type":"null"}]},"textSize":{"anyOf":[{"$ref":"#/components/schemas/TextSize"},{"type":"null"}]},"theme":{"anyOf":[{"$ref":"#/components/schemas/ThemePreference"},{"type":"null"}]},"advancedOptions":{"anyOf":[{"$ref":"#/components/schemas/AdvancedOptionsPreference"},{"type":"null"}]}},"additionalProperties":false}},"additionalProperties":false},"FormatLocale":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"},"MyProfile":{"type":"object","properties":{"userId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string","description":"The login email (lower-cased). Read-only here."},"emailVerified":{"type":"boolean"},"displayName":{"description":"The name co-members see; null = they see the email.","type":["string","null"]},"signInMethods":{"type":"object","properties":{"totp":{"type":"boolean"},"passkeys":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["totp","passkeys"],"additionalProperties":false},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["userId","email","emailVerified","displayName","signInMethods","createdAt","revision"],"additionalProperties":false},"UpdateMyProfileInput":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["displayName"],"additionalProperties":false},"StartSsoResult":{"type":"object","properties":{"redirectUrl":{"type":"string"},"protocol":{"$ref":"#/components/schemas/SsoProtocol"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["redirectUrl","protocol","expiresAt"],"additionalProperties":false},"SsoProtocol":{"type":"string","enum":["oidc","saml"],"description":"OpenID Connect (authorization code + PKCE) or SAML 2.0 (SP-initiated, signed assertions)."},"StartSsoInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"returnTo":{"type":"string","maxLength":512,"pattern":"^\\/(?![/\\\\])[^\\s]*$"},"persistent":{"default":false,"type":"boolean"}},"additionalProperties":false},"StartSsoStepUpInput":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"returnTo":{"type":"string","maxLength":512,"pattern":"^\\/(?![/\\\\])[^\\s]*$"}},"required":["workspaceId"],"additionalProperties":false},"SsoSignInResult":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"authenticated"},"session":{"$ref":"#/components/schemas/AuthSession"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"returnTo":{"type":["string","null"]}},"required":["status","session","workspaceId","returnTo"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"stepped_up"},"stepUpUntil":{"$ref":"#/components/schemas/IsoDateTime"},"workspaceId":{"$ref":"#/components/schemas/Uuid"},"returnTo":{"type":["string","null"]}},"required":["status","stepUpUntil","workspaceId","returnTo"],"additionalProperties":false}]},"OidcCallbackInput":{"type":"object","properties":{"state":{"type":"string","minLength":16,"maxLength":512},"code":{"type":"string","minLength":1,"maxLength":4096},"iss":{"type":"string","maxLength":2048},"error":{"type":"string","maxLength":256},"error_description":{"type":"string","maxLength":1024}},"required":["state"],"additionalProperties":false},"SamlResponseAccepted":{"type":"object","properties":{"ticket":{"type":"string"}},"required":["ticket"],"additionalProperties":false},"SamlResponseInput":{"type":"object","properties":{"SAMLResponse":{"type":"string","minLength":1,"maxLength":524288},"RelayState":{"type":"string","minLength":16,"maxLength":512}},"required":["SAMLResponse","RelayState"],"additionalProperties":false},"CompleteSsoInput":{"type":"object","properties":{"ticket":{"type":"string","minLength":20,"maxLength":200}},"required":["ticket"],"additionalProperties":false},"SsoSettings":{"type":"object","properties":{"connection":{"anyOf":[{"$ref":"#/components/schemas/SsoConnection"},{"type":"null"}]},"serviceProvider":{"type":"object","properties":{"samlEntityId":{"type":["string","null"]},"samlAcsUrl":{"type":"string"},"samlMetadataXml":{"type":["string","null"]},"oidcRedirectUri":{"type":"string"}},"required":["samlEntityId","samlAcsUrl","samlMetadataXml","oidcRedirectUri"],"additionalProperties":false},"domains":{"type":"array","items":{"$ref":"#/components/schemas/SsoDomain"}},"groupMappings":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}}},"required":["group","roles"],"additionalProperties":false}},"recoveryOwners":{"type":"array","items":{"type":"object","properties":{"userId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"displayName":{"type":["string","null"]}},"required":["userId","email","displayName"],"additionalProperties":false}},"scim":{"type":"object","properties":{"baseUrl":{"type":"string"},"tokens":{"type":"array","items":{"$ref":"#/components/schemas/ScimTokenView"}},"users":{"type":"integer","minimum":0,"maximum":9007199254740991},"activeUsers":{"type":"integer","minimum":0,"maximum":9007199254740991},"groups":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["baseUrl","tokens","users","activeUsers","groups"],"additionalProperties":false},"callerSignedInWithSso":{"type":"boolean"}},"required":["connection","serviceProvider","domains","groupMappings","recoveryOwners","scim","callerSignedInWithSso"],"additionalProperties":false},"SsoConnection":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"protocol":{"$ref":"#/components/schemas/SsoProtocol"},"status":{"$ref":"#/components/schemas/SsoConnectionStatus"},"displayName":{"type":"string"},"oidc":{"anyOf":[{"type":"object","properties":{"issuer":{"type":"string"},"clientId":{"type":"string"},"clientSecretSet":{"type":"boolean"}},"required":["issuer","clientId","clientSecretSet"],"additionalProperties":false},{"type":"null"}]},"saml":{"anyOf":[{"type":"object","properties":{"idpEntityId":{"type":"string"},"idpSsoUrl":{"type":"string"},"idpCertificates":{"type":"array","items":{"type":"object","properties":{"subject":{"type":["string","null"]},"notAfter":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"fingerprintSha256":{"type":"string"}},"required":["subject","notAfter","fingerprintSha256"],"additionalProperties":false}}},"required":["idpEntityId","idpSsoUrl","idpCertificates"],"additionalProperties":false},{"type":"null"}]},"groupsClaim":{"type":"string"},"jitProvisioning":{"type":"boolean"},"defaultRole":{"type":"string"},"trustIdpMfa":{"type":"boolean"},"enforced":{"type":"boolean"},"allowCredentialsWhenEnforced":{"type":"boolean"},"lastLoginAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","protocol","status","displayName","oidc","saml","groupsClaim","jitProvisioning","defaultRole","trustIdpMfa","enforced","allowCredentialsWhenEnforced","lastLoginAt","revision","updatedAt"],"additionalProperties":false},"SsoConnectionStatus":{"type":"string","enum":["draft","active","disabled"],"description":"draft = being configured, never signs anyone in; active = sign-in works (enforcement possible); disabled = refuses every sign-in, kept for audit."},"SsoDomain":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"domain":{"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastCheckOutcome":{"anyOf":[{"type":"string","enum":["verified","missing","temporary_failure","claimed_elsewhere"]},{"type":"null"}]},"record":{"type":"object","properties":{"type":{"type":"string","const":"TXT"},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"],"additionalProperties":false}},"required":["id","domain","verified","verifiedAt","lastCheckedAt","lastCheckOutcome","record"],"additionalProperties":false},"ScimTokenView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastUsedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","name","prefix","createdAt","lastUsedAt","expiresAt","revokedAt"],"additionalProperties":false},"CreateSsoConnectionInput":{"oneOf":[{"type":"object","properties":{"protocol":{"type":"string","const":"oidc"},"oidc":{"type":"object","properties":{"issuer":{"type":"string","maxLength":2048,"format":"uri"},"clientId":{"type":"string","minLength":1,"maxLength":512},"clientSecret":{"type":"string","minLength":1,"maxLength":4096}},"required":["issuer","clientId","clientSecret"],"additionalProperties":false},"displayName":{"type":"string","minLength":1,"maxLength":120},"groupsClaim":{"type":"string","minLength":1,"maxLength":256},"jitProvisioning":{"type":"boolean"},"defaultRole":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"trustIdpMfa":{"type":"boolean"}},"required":["protocol","oidc","displayName"],"additionalProperties":false},{"type":"object","properties":{"protocol":{"type":"string","const":"saml"},"saml":{"type":"object","properties":{"idpEntityId":{"type":"string","minLength":1,"maxLength":1024},"idpSsoUrl":{"type":"string","maxLength":2048,"format":"uri"},"idpCertificates":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":100,"maxLength":16384}}},"required":["idpEntityId","idpSsoUrl","idpCertificates"],"additionalProperties":false},"displayName":{"type":"string","minLength":1,"maxLength":120},"groupsClaim":{"type":"string","minLength":1,"maxLength":256},"jitProvisioning":{"type":"boolean"},"defaultRole":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"trustIdpMfa":{"type":"boolean"}},"required":["protocol","saml","displayName"],"additionalProperties":false}]},"UpdateSsoConnectionInput":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":120},"oidc":{"type":"object","properties":{"issuer":{"type":"string","maxLength":2048,"format":"uri"},"clientId":{"type":"string","minLength":1,"maxLength":512},"clientSecret":{"type":"string","maxLength":4096}},"additionalProperties":false},"saml":{"type":"object","properties":{"idpEntityId":{"type":"string","minLength":1,"maxLength":1024},"idpSsoUrl":{"type":"string","maxLength":2048,"format":"uri"},"idpCertificates":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","minLength":100,"maxLength":16384}}},"additionalProperties":false},"groupsClaim":{"type":"string","minLength":1,"maxLength":256},"jitProvisioning":{"type":"boolean"},"defaultRole":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"},"trustIdpMfa":{"type":"boolean"},"status":{"$ref":"#/components/schemas/SsoConnectionStatus"},"enforced":{"type":"boolean"},"allowCredentialsWhenEnforced":{"type":"boolean"},"groupMappings":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SsoGroupMappingInput"}},"recoveryOwnerUserIds":{"maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}}},"additionalProperties":false},"SsoGroupMappingInput":{"type":"object","properties":{"group":{"type":"string","minLength":1,"maxLength":256},"roles":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,40}$"}}},"required":["group","roles"],"additionalProperties":false},"SsoConnectionTestResult":{"type":"object","properties":{"ok":{"type":"boolean"},"checks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"ok":{"type":"boolean"},"detail":{"type":"string"}},"required":["name","ok","detail"],"additionalProperties":false}}},"required":["ok","checks"],"additionalProperties":false},"AddSsoDomainInput":{"type":"object","properties":{"domain":{"type":"string","maxLength":253,"pattern":"^(?=.{4,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"}},"required":["domain"],"additionalProperties":false},"CreatedScimToken":{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ScimTokenView"},"secret":{"type":"string"}},"required":["token","secret"],"additionalProperties":false},"CreateScimTokenInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"expiresInDays":{"type":"integer","minimum":1,"maximum":730}},"required":["name"],"additionalProperties":false},"BreakGlassResult":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"ownersNotified":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","expiresAt","ownersNotified"],"additionalProperties":false},"BreakGlassInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"],"additionalProperties":false},"MigrationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MigrationSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"MigrationSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"source":{"$ref":"#/components/schemas/MigrationSource"},"status":{"$ref":"#/components/schemas/MigrationStatus"},"reconciled":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"appliedFiles":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","source","status","reconciled","createdAt","updatedAt","files","appliedFiles"],"additionalProperties":false},"Migration":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"source":{"$ref":"#/components/schemas/MigrationSource"},"listId":{"$ref":"#/components/schemas/Uuid"},"status":{"$ref":"#/components/schemas/MigrationStatus"},"files":{"type":"array","items":{"$ref":"#/components/schemas/MigrationFile"}},"templates":{"type":"array","items":{"type":"object","properties":{"templateId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"sourceSha256":{"type":"string"},"sanitized":{"type":"boolean"},"unconvertedMergeTags":{"type":"array","items":{"type":"string"}},"unconvertedReasons":{"default":[],"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"reason":{"type":"string"}},"required":["tag","reason"],"additionalProperties":false}},"convertedMergeTags":{"default":[],"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"count":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["from","to","count"],"additionalProperties":false}},"importedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["templateId","name","sourceSha256","sanitized","unconvertedMergeTags","unconvertedReasons","convertedMergeTags","importedAt"],"additionalProperties":false}},"lossReport":{"type":"array","items":{"$ref":"#/components/schemas/MigrationLossItem"}},"reconciliation":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"expected":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"actual":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ok":{"type":["boolean","null"]}},"required":["id","label","expected","actual","ok"],"additionalProperties":false}},"reconciled":{"type":"boolean"},"freeze":{"anyOf":[{"type":"object","properties":{"attestation":{"type":"string"},"frozenAt":{"$ref":"#/components/schemas/IsoDateTime"},"frozenByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["attestation","frozenAt","frozenByUserId"],"additionalProperties":false},{"type":"null"}]},"cutOverAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"rollback":{"anyOf":[{"$ref":"#/components/schemas/MigrationRollback"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","source","listId","status","files","templates","lossReport","reconciliation","reconciled","freeze","cutOverAt","rollback","revision","createdAt","updatedAt"],"additionalProperties":false},"MigrationFile":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"fileName":{"type":"string"},"declaredKind":{"anyOf":[{"$ref":"#/components/schemas/MigrationFileKind"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/MigrationFileStatus"},"checksum":{"type":"string"},"sizeBytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"delta":{"type":"boolean"},"analysis":{"anyOf":[{"$ref":"#/components/schemas/MigrationAnalysis"},{"type":"null"}]},"applied":{"anyOf":[{"$ref":"#/components/schemas/MigrationApplyResult"},{"type":"null"}]},"importId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"errorCode":{"type":["string","null"]},"errorDetail":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","fileName","declaredKind","status","checksum","sizeBytes","delta","analysis","applied","importId","errorCode","errorDetail","createdAt","updatedAt"],"additionalProperties":false},"MigrationFileKind":{"type":"string","enum":["contacts","campaign_history","automations"]},"MigrationFileStatus":{"type":"string","enum":["analyzing","analyzed","applying","applied","failed"]},"MigrationAnalysis":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MigrationFileKind"},"rowsScanned":{"type":"integer","minimum":0,"maximum":9007199254740991},"columns":{"type":"array","items":{"type":"object","properties":{"header":{"type":"string"},"target":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["header","target","note"],"additionalProperties":false}},"byStatus":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"suppressions":{"type":"integer","minimum":0,"maximum":9007199254740991},"contactsToImport":{"type":"integer","minimum":0,"maximum":9007199254740991},"campaigns":{"type":"integer","minimum":0,"maximum":9007199254740991},"automations":{"type":"integer","minimum":0,"maximum":9007199254740991},"lossItems":{"type":"array","items":{"$ref":"#/components/schemas/MigrationLossItem"}},"sourceChecksum":{"type":"string"},"analysisHash":{"type":"string"},"analyzedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["kind","rowsScanned","columns","byStatus","suppressions","contactsToImport","campaigns","automations","lossItems","sourceChecksum","analysisHash","analyzedAt"],"additionalProperties":false},"MigrationLossItem":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/MigrationLossCategory"},"subject":{"type":"string","maxLength":300},"detail":{"type":"string","maxLength":500},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["category","subject","detail","count"],"additionalProperties":false},"MigrationLossCategory":{"type":"string","enum":["unmapped_column","unsupported_construct","skipped_rows","merge_tag","statistic"]},"MigrationApplyResult":{"type":"object","properties":{"suppressionsCreated":{"type":"integer","minimum":0,"maximum":9007199254740991},"suppressionsAlreadyPresent":{"type":"integer","minimum":0,"maximum":9007199254740991},"contactsStaged":{"type":"integer","minimum":0,"maximum":9007199254740991},"canonicalChecksum":{"type":["string","null"]},"campaignsRecorded":{"type":"integer","minimum":0,"maximum":9007199254740991},"automationsListed":{"type":"integer","minimum":0,"maximum":9007199254740991},"resumedAfterRow":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"appliedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["suppressionsCreated","suppressionsAlreadyPresent","contactsStaged","canonicalChecksum","campaignsRecorded","automationsListed","resumedAfterRow","appliedAt"],"additionalProperties":false},"MigrationRollback":{"type":"object","properties":{"reason":{"type":"string"},"requestedAt":{"$ref":"#/components/schemas/IsoDateTime"},"requestedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"excludedRecipients":{"type":"integer","minimum":0,"maximum":9007199254740991},"excludedMessages":{"type":"integer","minimum":0,"maximum":9007199254740991},"approvedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"approvedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"required":["reason","requestedAt","requestedByUserId","excludedRecipients","excludedMessages","approvedAt","approvedByUserId"],"additionalProperties":false},"CreateMigrationInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"source":{"$ref":"#/components/schemas/MigrationSource"},"listId":{"$ref":"#/components/schemas/Uuid"}},"required":["name","source","listId"],"additionalProperties":false},"AddMigrationFileInput":{"type":"object","properties":{"objectKey":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[A-Za-z0-9/_.-]+$"},"checksum":{"type":"string","pattern":"^[0-9a-f]{64}$"},"fileName":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\.(csv|txt)$"},"kind":{"$ref":"#/components/schemas/MigrationFileKind"}},"required":["objectKey","checksum","fileName"],"additionalProperties":false},"ApplyMigrationFileInput":{"type":"object","properties":{"analysisHash":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["analysisHash"],"additionalProperties":false},"ImportMigrationTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"subject":{"type":"string","maxLength":998},"html":{"type":"string","minLength":1,"maxLength":256000}},"required":["name","html"],"additionalProperties":false},"MigrationCampaignHistoryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MigrationCampaignHistoryRecord"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"MigrationCampaignHistoryRecord":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"fileId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"subject":{"type":["string","null"]},"sentAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"sourceMetrics":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","fileId","name","subject","sentAt","sourceMetrics"],"additionalProperties":false},"FreezeMigrationInput":{"type":"object","properties":{"attestation":{"type":"string","const":"The old platform's scheduled sends are disabled"}},"required":["attestation"],"additionalProperties":false},"RequestMigrationRollbackInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"],"additionalProperties":false},"MigrationRollbackExclusionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MigrationRollbackExclusion"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"MigrationRollbackExclusion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"email":{"type":"string"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"campaignName":{"type":"string"},"acceptedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","email","campaignId","campaignName","acceptedAt"],"additionalProperties":false},"SolutionPackCatalog":{"type":"object","properties":{"packs":{"type":"array","items":{"$ref":"#/components/schemas/SolutionPackSummary"}},"planned":{"type":"array","items":{"type":"string"}}},"required":["packs","planned"],"additionalProperties":false},"SolutionPackSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/SolutionPackId"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"useCase":{"type":"string"},"description":{"type":"string"},"contents":{"type":"object","properties":{"fields":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lists":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"segments":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"templates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"journeys":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"forms":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"surveys":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"transactional":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reports":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"couponPools":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["fields","lists","segments","templates","journeys","forms","surveys","transactional","reports","couponPools"],"additionalProperties":false},"limits":{"type":"array","items":{"type":"string"}},"languages":{"default":["en"],"type":"array","items":{"$ref":"#/components/schemas/SolutionPackLanguage"}},"eventMappings":{"default":[],"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"target":{"type":"string"},"note":{"type":"string"}},"required":["event","target","note"],"additionalProperties":false}},"installation":{"anyOf":[{"$ref":"#/components/schemas/SolutionPackInstallation"},{"type":"null"}]}},"required":["id","version","name","useCase","description","contents","limits","languages","eventMappings","installation"],"additionalProperties":false},"SolutionPackId":{"type":"string","enum":["association_membership","university_department","ecommerce_lifecycle","saas_lifecycle","nonprofit_engagement","certification_lifecycle","publisher_editorial","agency_msp"]},"SolutionPackLanguage":{"type":"string","enum":["en","fr"]},"SolutionPackInstallation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"packId":{"$ref":"#/components/schemas/SolutionPackId"},"packVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"language":{"$ref":"#/components/schemas/SolutionPackLanguage"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/SolutionPackResource"}},"installedByUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"installedAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["id","packId","packVersion","language","resources","installedByUserId","installedAt","updatedAt","revision"],"additionalProperties":false},"SolutionPackResource":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/SolutionPackResourceKind"},"key":{"type":"string"},"name":{"type":"string"},"id":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"outcome":{"$ref":"#/components/schemas/SolutionPackResourceOutcome"},"detail":{"type":["string","null"]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fingerprint":{"type":["string","null"]}},"required":["kind","key","name","id","outcome","detail"],"additionalProperties":false},"SolutionPackResourceKind":{"type":"string","enum":["field","list","segment","template","campaign","journey","form","survey","transactional_template","saved_report","coupon_pool"]},"SolutionPackResourceOutcome":{"type":"string","enum":["created","reused","conflict","updated","kept","removed"]},"ListSolutionPacksQuery":{"type":"object","properties":{"language":{"$ref":"#/components/schemas/SolutionPackLanguage"}},"additionalProperties":false},"InstallSolutionPackInput":{"default":{},"type":"object","properties":{"language":{"$ref":"#/components/schemas/SolutionPackLanguage"}},"additionalProperties":false},"SolutionPackUninstallResult":{"type":"object","properties":{"packId":{"$ref":"#/components/schemas/SolutionPackId"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/SolutionPackResource"}}},"required":["packId","resources"],"additionalProperties":false},"RenderTestList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RenderTest"}},"provider":{"type":"object","properties":{"adapter":{"$ref":"#/components/schemas/RenderTestAdapter"},"simulated":{"type":"boolean"},"label":{"type":"string"},"clients":{"type":"array","items":{"$ref":"#/components/schemas/RenderTestClient"}}},"required":["adapter","simulated","label","clients"],"additionalProperties":false},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","provider","asOf"],"additionalProperties":false},"RenderTest":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"$ref":"#/components/schemas/Uuid"},"draftRevision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"variantKey":{"type":["string","null"]},"adapter":{"$ref":"#/components/schemas/RenderTestAdapter"},"simulated":{"type":"boolean"},"providerLabel":{"type":"string"},"state":{"$ref":"#/components/schemas/RenderTestState"},"error":{"type":["string","null"]},"requestedAt":{"$ref":"#/components/schemas/IsoDateTime"},"completedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"results":{"type":"array","items":{"$ref":"#/components/schemas/RenderClientResult"}},"stale":{"type":"boolean"}},"required":["id","campaignId","draftRevision","variantKey","adapter","simulated","providerLabel","state","error","requestedAt","completedAt","results","stale"],"additionalProperties":false,"description":"A client rendering test of a campaign's message (ADR 0069)."},"RenderTestAdapter":{"type":"string","enum":["local","vendor_api"]},"RenderTestState":{"type":"string","enum":["pending","complete","failed"]},"RenderClientResult":{"type":"object","properties":{"client":{"type":"string"},"clientName":{"type":"string"},"platform":{"type":"string"},"clientVersion":{"type":"string"},"renderedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"status":{"type":"string","enum":["pending","complete","failed"]},"screenshotUrl":{"type":["string","null"]},"inboxPreview":{"anyOf":[{"type":"object","properties":{"subject":{"type":"string"},"subjectCut":{"type":"boolean"},"preview":{"type":"string"},"previewCut":{"type":"boolean"}},"required":["subject","subjectCut","preview","previewCut"],"additionalProperties":false},{"type":"null"}]},"clipped":{"type":["boolean","null"]},"issues":{"type":"array","items":{"$ref":"#/components/schemas/RenderIssue"}}},"required":["client","clientName","platform","clientVersion","renderedAt","status","screenshotUrl","inboxPreview","clipped","issues"],"additionalProperties":false},"RenderIssue":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["blocking","warning","info"]},"message":{"type":"string"}},"required":["code","severity","message"],"additionalProperties":false},"RenderTestClient":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id","name","platform"],"additionalProperties":false},"CreateRenderTestInput":{"type":"object","properties":{"clients":{"maxItems":40,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"variantKey":{"anyOf":[{"type":"string","minLength":1,"maxLength":16},{"type":"null"}]}}},"SpamRiskReviewList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SpamRiskReview"}},"generatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","generatedAt"],"additionalProperties":false},"SpamRiskReview":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"campaign":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"state":{"type":"string"}},"required":["id","name","state"],"additionalProperties":false},"spamRisk":{"type":"integer","minimum":0,"maximum":100},"spamRiskEstimated":{"type":"boolean"},"compliance":{"type":"string","enum":["pass","fail"]},"modelVersion":{"type":"string"},"analyzedAt":{"$ref":"#/components/schemas/IsoDateTime"},"contentFingerprint":{"type":["string","null"]},"override":{"anyOf":[{"$ref":"#/components/schemas/SpamRiskOverride"},{"type":"null"}]},"overridable":{"type":"boolean"},"notOverridableReason":{"anyOf":[{"type":"string","enum":["compliance_fail","old_analysis","not_critical"]},{"type":"null"}]}},"required":["workspace","campaign","spamRisk","spamRiskEstimated","compliance","modelVersion","analyzedAt","contentFingerprint","override","overridable","notOverridableReason"],"additionalProperties":false,"description":"A campaign in preparation whose pre-send analysis scores a critical spam risk (ADR 0069)."},"GrantSpamRiskOverrideInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500},"expiresInHours":{"type":"integer","minimum":1,"maximum":168}},"required":["reason"]},"RevokeSpamRiskOverrideInput":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["reason"]},"InboxSettings":{"type":"object","properties":{"available":{"type":"boolean"},"routeReplies":{"type":"boolean"},"replyDomain":{"type":["string","null"]},"firstResponseMinutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":43200},{"type":"null"}]},"retentionDays":{"type":"integer","minimum":30,"maximum":3650},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["available","routeReplies","replyDomain","firstResponseMinutes","retentionDays","revision","updatedAt"],"additionalProperties":false},"UpdateInboxSettingsInput":{"type":"object","properties":{"routeReplies":{"type":"boolean"},"firstResponseMinutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":43200},{"type":"null"}]},"retentionDays":{"type":"integer","minimum":30,"maximum":3650}},"additionalProperties":false},"InboxConversationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InboxConversationSummary"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"InboxConversationSummary":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"subject":{"type":"string"},"status":{"$ref":"#/components/schemas/InboxStatus"},"intent":{"$ref":"#/components/schemas/InboxIntent"},"attribution":{"$ref":"#/components/schemas/InboxAttribution"},"messageId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignName":{"type":["string","null"]},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"sender":{"type":["string","null"]},"senderName":{"type":["string","null"]},"senderDomain":{"type":["string","null"]},"assigneeUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"assigneeName":{"type":["string","null"]},"messageCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastMessageAt":{"$ref":"#/components/schemas/IsoDateTime"},"awaitingSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"slaDueAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"slaState":{"$ref":"#/components/schemas/InboxSlaState"},"stopRequested":{"type":"boolean"},"unsubscribedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","subject","status","intent","attribution","messageId","campaignId","campaignName","contactId","sender","senderName","senderDomain","assigneeUserId","assigneeName","messageCount","lastMessageAt","awaitingSince","slaDueAt","slaState","stopRequested","unsubscribedAt","revision","createdAt","updatedAt"],"additionalProperties":false},"InboxStatus":{"type":"string","enum":["open","pending","closed"]},"InboxIntent":{"type":"string","enum":["question","positive","negative","out_of_office","stop","other"]},"InboxAttribution":{"type":"string","enum":["thread","sender","unverified"]},"InboxSlaState":{"type":"string","enum":["none","on_track","breached"]},"InboxConversation":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"subject":{"type":"string"},"status":{"$ref":"#/components/schemas/InboxStatus"},"intent":{"$ref":"#/components/schemas/InboxIntent"},"attribution":{"$ref":"#/components/schemas/InboxAttribution"},"messageId":{"$ref":"#/components/schemas/Uuid"},"campaignId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"campaignName":{"type":["string","null"]},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"sender":{"type":["string","null"]},"senderName":{"type":["string","null"]},"senderDomain":{"type":["string","null"]},"assigneeUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"assigneeName":{"type":["string","null"]},"messageCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastMessageAt":{"$ref":"#/components/schemas/IsoDateTime"},"awaitingSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"slaDueAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"slaState":{"$ref":"#/components/schemas/InboxSlaState"},"stopRequested":{"type":"boolean"},"unsubscribedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/InboxMessage"}},"replyTo":{"type":["string","null"]},"replyBlockedReason":{"type":["string","null"]}},"required":["id","subject","status","intent","attribution","messageId","campaignId","campaignName","contactId","sender","senderName","senderDomain","assigneeUserId","assigneeName","messageCount","lastMessageAt","awaitingSince","slaDueAt","slaState","stopRequested","unsubscribedAt","revision","createdAt","updatedAt","messages","replyTo","replyBlockedReason"],"additionalProperties":false},"InboxMessage":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/InboxMessageKind"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"from":{"type":["string","null"]},"fromName":{"type":["string","null"]},"subject":{"type":["string","null"]},"text":{"type":"string"},"intent":{"anyOf":[{"$ref":"#/components/schemas/InboxIntent"},{"type":"null"}]},"attribution":{"anyOf":[{"$ref":"#/components/schemas/InboxAttribution"},{"type":"null"}]},"authenticated":{"type":["boolean","null"]},"authorUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"authorName":{"type":["string","null"]},"replyState":{"anyOf":[{"$ref":"#/components/schemas/InboxReplyState"},{"type":"null"}]},"reviewerUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reviewerName":{"type":["string","null"]},"reviewedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"reviewNote":{"type":["string","null"]},"sentAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"failureCode":{"type":["string","null"]},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["id","kind","createdAt","from","fromName","subject","text","intent","attribution","authenticated","authorUserId","authorName","replyState","reviewerUserId","reviewerName","reviewedAt","reviewNote","sentAt","failureCode","revision"],"additionalProperties":false},"InboxMessageKind":{"type":"string","enum":["inbound","reply","note"]},"InboxReplyState":{"type":"string","enum":["pending_review","rejected","approved","sending","sent","failed","send_unknown"]},"UpdateInboxConversationInput":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/InboxStatus"},"assigneeUserId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]}},"additionalProperties":false},"AddInboxNoteInput":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["text"],"additionalProperties":false,"description":"An internal note: never sent, visible to the workspace's inbox readers."},"CreateInboxReplyInput":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000},"cannedReplyId":{"$ref":"#/components/schemas/Uuid"}},"required":["text"],"additionalProperties":false,"description":"A reply DRAFT: it waits for a reviewer with inbox.review before anything is sent."},"ReviewInboxReplyInput":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"note":{"type":"string","maxLength":1000}},"required":["decision"],"additionalProperties":false},"UnsubscribeInboxSenderInput":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["reason"],"additionalProperties":false,"description":"Unsubscribes the conversation's recipient from the workspace's marketing (RFC 8058 effects) after a person read their stop request."},"CannedReplyList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CannedReply"}}},"required":["items"],"additionalProperties":false},"CannedReply":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"body":{"type":"string"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","body","revision","createdAt","updatedAt"],"additionalProperties":false},"CannedReplyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":20000}},"required":["name","body"],"additionalProperties":false},"WarmupDetection":{"type":"object","properties":{"address":{"type":"string"},"domain":{"type":"string"},"providerKey":{"type":["string","null"]},"provider":{"$ref":"#/components/schemas/WarmupProvider"},"source":{"type":"string","enum":["hosted","known_domain","mx","autoconfig","none"]},"verifiedDomain":{"type":"boolean"},"sendRoute":{"$ref":"#/components/schemas/WarmupSendRoute"},"alreadyJoined":{"type":"boolean"},"options":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"hosted"},"hostedMailboxId":{"$ref":"#/components/schemas/Uuid"}},"required":["kind","hostedMailboxId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"oauth"},"provider":{"$ref":"#/components/schemas/OAuthMailProvider"},"configured":{"type":"boolean"}},"required":["kind","provider","configured"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"password"},"imap":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["host","port"],"additionalProperties":false},{"type":"null"}]},"smtp":{"anyOf":[{"$ref":"#/components/schemas/WarmupSmtpServer"},{"type":"null"}]},"appPassword":{"type":"boolean"}},"required":["kind","imap","smtp","appPassword"],"additionalProperties":false}]}}},"required":["address","domain","providerKey","provider","source","verifiedDomain","sendRoute","alreadyJoined","options"],"additionalProperties":false},"WarmupProvider":{"type":"string","enum":["google","microsoft","yahoo","other"]},"WarmupSendRoute":{"type":"string","enum":["platform","provider"]},"WarmupSmtpServer":{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tls":{"type":"string","enum":["implicit","starttls_required"]}},"required":["host","port","tls"],"additionalProperties":false},"WarmupOverview":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"credits":{"$ref":"#/components/schemas/WarmupCredits"},"level":{"$ref":"#/components/schemas/WarmupLevel"},"contributorSlots":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["used","max"],"additionalProperties":false},"entitlement":{"type":"object","properties":{"active":{"type":"boolean"},"mailboxes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inUse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dailyCapPerMailbox":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","mailboxes","inUse","dailyCapPerMailbox"],"additionalProperties":false},"consent":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"}},"required":["version","text"],"additionalProperties":false},"network":{"type":"object","properties":{"participants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byProvider":{"type":"object","propertyNames":{"$ref":"#/components/schemas/WarmupProvider"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["google","microsoft","yahoo","other"]},"seeds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"providers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["participants","byProvider","seeds","providers"],"additionalProperties":false},"deliverability":{"$ref":"#/components/schemas/WarmupDeliverability"},"progress":{"type":"array","items":{"$ref":"#/components/schemas/WarmupProgressDay"}}},"required":["asOf","credits","level","contributorSlots","entitlement","consent","network","deliverability","progress"],"additionalProperties":false},"WarmupCredits":{"type":"object","properties":{"balance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"welcomeGranted":{"type":"boolean"},"last30Days":{"type":"object","properties":{"earned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refunded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"penalties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bonuses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["earned","spent","refunded","penalties","bonuses"],"additionalProperties":false},"recent":{"type":"array","items":{"$ref":"#/components/schemas/WarmupCreditEntry"}}},"required":["balance","cap","reserved","welcomeGranted","last30Days","recent"],"additionalProperties":false},"WarmupCreditEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/WarmupCreditKind"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mailboxId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"at":{"$ref":"#/components/schemas/IsoDateTime"},"detail":{"type":["string","null"]}},"required":["id","kind","amount","mailboxId","at","detail"],"additionalProperties":false},"WarmupCreditKind":{"type":"string","enum":["welcome","earn","spend","refund","penalty","bonus"]},"WarmupLevel":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/WarmupLevelKey"},"engaged30d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next":{"anyOf":[{"type":"object","properties":{"key":{"$ref":"#/components/schemas/WarmupLevelKey"},"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","from","remaining"],"additionalProperties":false},{"type":"null"}]},"perks":{"type":"object","properties":{"dailyCap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"priorityPairing":{"type":"boolean"},"badge":{"type":"boolean"}},"required":["dailyCap","priorityPairing","badge"],"additionalProperties":false},"onHold":{"type":"boolean"}},"required":["key","engaged30d","next","perks","onHold"],"additionalProperties":false},"WarmupLevelKey":{"type":"string","enum":["newcomer","contributor","supporter","champion"]},"WarmupDeliverability":{"type":"object","properties":{"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"$ref":"#/components/schemas/WarmupPlacementCounts"},"byProvider":{"type":"array","items":{"type":"object","properties":{"inbox":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spam":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inboxRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"provider":{"$ref":"#/components/schemas/WarmupProvider"}},"required":["inbox","category","spam","missing","inboxRate","provider"],"additionalProperties":false}},"bounced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complained":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["days","total","byProvider","bounced","complained"],"additionalProperties":false},"WarmupPlacementCounts":{"type":"object","properties":{"inbox":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spam":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inboxRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["inbox","category","spam","missing","inboxRate"],"additionalProperties":false},"WarmupProgressDay":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"inbox":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spam":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","inbox","category","spam","queued","replies"],"additionalProperties":false},"WarmupMailboxPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WarmupMailbox"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"WarmupMailbox":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"address":{"type":"string"},"displayName":{"type":["string","null"]},"provider":{"$ref":"#/components/schemas/WarmupProvider"},"state":{"$ref":"#/components/schemas/WarmupMailboxState"},"pauseReason":{"anyOf":[{"$ref":"#/components/schemas/WarmupPauseReason"},{"type":"null"}]},"participation":{"$ref":"#/components/schemas/WarmupParticipation"},"reputation":{"anyOf":[{"$ref":"#/components/schemas/WarmupReputation"},{"type":"null"}]},"suspension":{"anyOf":[{"$ref":"#/components/schemas/WarmupSuspension"},{"type":"null"}]},"effectiveDailyCap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"covered":{"type":"boolean"},"connection":{"$ref":"#/components/schemas/WarmupConnectionView"},"ramp":{"$ref":"#/components/schemas/WarmupRamp"},"rampDay":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"todayTarget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"todayPlanned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inboxRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"activatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastReadAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastErrorCode":{"type":["string","null"]},"consent":{"type":"object","properties":{"version":{"type":"string"},"acceptedAt":{"$ref":"#/components/schemas/IsoDateTime"},"acceptedByUserId":{"$ref":"#/components/schemas/Uuid"}},"required":["version","acceptedAt","acceptedByUserId"],"additionalProperties":false},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","address","displayName","provider","state","pauseReason","participation","reputation","suspension","effectiveDailyCap","covered","connection","ramp","rampDay","todayTarget","todayPlanned","inboxRate","activatedAt","lastReadAt","lastErrorCode","consent","revision","createdAt","updatedAt"],"additionalProperties":false},"WarmupMailboxState":{"type":"string","enum":["draft","active","paused","needs_reauthorization","suspended","left"]},"WarmupPauseReason":{"type":"string","enum":["manual","bounces","complaints"]},"WarmupParticipation":{"type":"string","enum":["contributor","addon","seed"]},"WarmupReputation":{"type":"object","properties":{"score":{"type":"integer","minimum":0,"maximum":100},"tier":{"anyOf":[{"$ref":"#/components/schemas/WarmupTier"},{"type":"null"}]},"components":{"type":"object","properties":{"inboxRate":{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"measured":{"type":"boolean"}},"required":["value","measured"],"additionalProperties":false},"availability":{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"measured":{"type":"boolean"}},"required":["value","measured"],"additionalProperties":false},"engagement":{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"measured":{"type":"boolean"}},"required":["value","measured"],"additionalProperties":false},"signals":{"type":"object","properties":{"value":{"type":"number","minimum":0,"maximum":1},"measured":{"type":"boolean"}},"required":["value","measured"],"additionalProperties":false}},"required":["inboxRate","availability","engagement","signals"],"additionalProperties":false},"scoredAt":{"$ref":"#/components/schemas/IsoDateTime"},"since":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"probationUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["score","tier","components","scoredAt","since","probationUntil"],"additionalProperties":false},"WarmupTier":{"type":"string","enum":["good","limited"]},"WarmupSuspension":{"type":"object","properties":{"at":{"$ref":"#/components/schemas/IsoDateTime"},"reason":{"$ref":"#/components/schemas/WarmupSuspensionReason"},"resumableAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["at","reason","resumableAt"],"additionalProperties":false},"WarmupSuspensionReason":{"type":"string","enum":["inbox_rate","availability","engagement","signals"]},"WarmupConnectionView":{"type":"object","properties":{"kind":{"type":"string","enum":["password","oauth"]},"sendRoute":{"$ref":"#/components/schemas/WarmupSendRoute"},"smtp":{"anyOf":[{"$ref":"#/components/schemas/WarmupSmtpServer"},{"type":"null"}]},"host":{"type":"string"},"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"username":{"type":"string"},"tlsServerName":{"type":["string","null"]},"passwordSet":{"type":"boolean"},"oauthProvider":{"anyOf":[{"$ref":"#/components/schemas/OAuthMailProvider"},{"type":"null"}]},"oauthGrant":{"anyOf":[{"$ref":"#/components/schemas/OAuthGrantSummary"},{"type":"null"}]},"hosted":{"type":"boolean"}},"required":["kind","sendRoute","smtp","host","port","username","tlsServerName","passwordSet","oauthProvider","oauthGrant","hosted"],"additionalProperties":false},"WarmupRamp":{"type":"object","properties":{"dailyStart":{"type":"integer","minimum":1,"maximum":20},"dailyIncrement":{"type":"integer","minimum":1,"maximum":10},"dailyCap":{"type":"integer","minimum":1,"maximum":200},"replyRatePercent":{"type":"integer","minimum":0,"maximum":100}},"required":["dailyStart","dailyIncrement","dailyCap","replyRatePercent"],"additionalProperties":false},"CreatedWarmupMailbox":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"address":{"type":"string"},"displayName":{"type":["string","null"]},"provider":{"$ref":"#/components/schemas/WarmupProvider"},"state":{"$ref":"#/components/schemas/WarmupMailboxState"},"pauseReason":{"anyOf":[{"$ref":"#/components/schemas/WarmupPauseReason"},{"type":"null"}]},"participation":{"$ref":"#/components/schemas/WarmupParticipation"},"reputation":{"anyOf":[{"$ref":"#/components/schemas/WarmupReputation"},{"type":"null"}]},"suspension":{"anyOf":[{"$ref":"#/components/schemas/WarmupSuspension"},{"type":"null"}]},"effectiveDailyCap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"covered":{"type":"boolean"},"connection":{"$ref":"#/components/schemas/WarmupConnectionView"},"ramp":{"$ref":"#/components/schemas/WarmupRamp"},"rampDay":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"todayTarget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"todayPlanned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inboxRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"activatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastReadAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastErrorCode":{"type":["string","null"]},"consent":{"type":"object","properties":{"version":{"type":"string"},"acceptedAt":{"$ref":"#/components/schemas/IsoDateTime"},"acceptedByUserId":{"$ref":"#/components/schemas/Uuid"}},"required":["version","acceptedAt","acceptedByUserId"],"additionalProperties":false},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"deliverability":{"$ref":"#/components/schemas/WarmupDeliverability"},"capacity":{"anyOf":[{"$ref":"#/components/schemas/WarmupCapacity"},{"type":"null"}]},"progress":{"type":"array","items":{"$ref":"#/components/schemas/WarmupProgressDay"}},"received":{"type":"object","properties":{"found":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rescued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"repliesSent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["found","rescued","repliesSent"],"additionalProperties":false},"hostedPassword":{"type":"string"}},"required":["id","address","displayName","provider","state","pauseReason","participation","reputation","suspension","effectiveDailyCap","covered","connection","ramp","rampDay","todayTarget","todayPlanned","inboxRate","activatedAt","lastReadAt","lastErrorCode","consent","revision","createdAt","updatedAt","deliverability","capacity","progress","received"],"additionalProperties":false},"WarmupCapacity":{"type":"object","properties":{"coldOutreachPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newsletterPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"estimate":{"type":"boolean","const":true}},"required":["coldOutreachPerDay","newsletterPerDay","estimate"],"additionalProperties":false},"CreateWarmupMailboxInput":{"type":"object","properties":{"address":{"type":"string","maxLength":320,"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,}$"},"displayName":{"type":"string","maxLength":120},"connection":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"password"},"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[A-Za-z0-9.-]+$"},"port":{"default":993,"type":"integer","minimum":1,"maximum":65535},"username":{"type":"string","maxLength":320},"password":{"type":"string","maxLength":1024},"tlsServerName":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[A-Za-z0-9.-]+$"},"smtp":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[A-Za-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"tls":{"type":"string","enum":["implicit","starttls_required"]}},"required":["host","port","tls"],"additionalProperties":false}},"required":["kind","host","username","password"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"oauth"},"provider":{"$ref":"#/components/schemas/OAuthMailProvider"}},"required":["kind","provider"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"hosted"},"hostedMailboxId":{"$ref":"#/components/schemas/Uuid"},"rotatePassword":{"type":"boolean","const":true}},"required":["kind","hostedMailboxId","rotatePassword"],"additionalProperties":false}]},"ramp":{"type":"object","properties":{"dailyStart":{"type":"integer","minimum":1,"maximum":20},"dailyIncrement":{"type":"integer","minimum":1,"maximum":10},"dailyCap":{"type":"integer","minimum":1,"maximum":200},"replyRatePercent":{"type":"integer","minimum":0,"maximum":100}}},"participation":{"$ref":"#/components/schemas/WarmupParticipationChoice"},"consent":{"type":"object","properties":{"accepted":{"type":"boolean","const":true},"version":{"type":"string","const":"2026-10-29"}},"required":["accepted","version"],"additionalProperties":false}},"required":["address","connection","consent"],"additionalProperties":false},"WarmupParticipationChoice":{"type":"string","enum":["contributor","addon"]},"WarmupMailboxDetail":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"address":{"type":"string"},"displayName":{"type":["string","null"]},"provider":{"$ref":"#/components/schemas/WarmupProvider"},"state":{"$ref":"#/components/schemas/WarmupMailboxState"},"pauseReason":{"anyOf":[{"$ref":"#/components/schemas/WarmupPauseReason"},{"type":"null"}]},"participation":{"$ref":"#/components/schemas/WarmupParticipation"},"reputation":{"anyOf":[{"$ref":"#/components/schemas/WarmupReputation"},{"type":"null"}]},"suspension":{"anyOf":[{"$ref":"#/components/schemas/WarmupSuspension"},{"type":"null"}]},"effectiveDailyCap":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"covered":{"type":"boolean"},"connection":{"$ref":"#/components/schemas/WarmupConnectionView"},"ramp":{"$ref":"#/components/schemas/WarmupRamp"},"rampDay":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"todayTarget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"todayPlanned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inboxRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"activatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastReadAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lastErrorCode":{"type":["string","null"]},"consent":{"type":"object","properties":{"version":{"type":"string"},"acceptedAt":{"$ref":"#/components/schemas/IsoDateTime"},"acceptedByUserId":{"$ref":"#/components/schemas/Uuid"}},"required":["version","acceptedAt","acceptedByUserId"],"additionalProperties":false},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"},"deliverability":{"$ref":"#/components/schemas/WarmupDeliverability"},"capacity":{"anyOf":[{"$ref":"#/components/schemas/WarmupCapacity"},{"type":"null"}]},"progress":{"type":"array","items":{"$ref":"#/components/schemas/WarmupProgressDay"}},"received":{"type":"object","properties":{"found":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rescued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"repliesSent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["found","rescued","repliesSent"],"additionalProperties":false}},"required":["id","address","displayName","provider","state","pauseReason","participation","reputation","suspension","effectiveDailyCap","covered","connection","ramp","rampDay","todayTarget","todayPlanned","inboxRate","activatedAt","lastReadAt","lastErrorCode","consent","revision","createdAt","updatedAt","deliverability","capacity","progress","received"],"additionalProperties":false},"UpdateWarmupMailboxInput":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"ramp":{"type":"object","properties":{"dailyStart":{"type":"integer","minimum":1,"maximum":20},"dailyIncrement":{"type":"integer","minimum":1,"maximum":10},"dailyCap":{"type":"integer","minimum":1,"maximum":200},"replyRatePercent":{"type":"integer","minimum":0,"maximum":100}}},"state":{"type":"string","enum":["active","paused"]},"participation":{"$ref":"#/components/schemas/WarmupParticipationChoice"},"password":{"type":"string","maxLength":1024}},"additionalProperties":false},"WarmupTestResult":{"type":"object","properties":{"ok":{"type":"boolean"},"steps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","enum":["ok","failed","skipped"]},"detail":{"type":"string"}},"required":["name","status","detail"],"additionalProperties":false}},"errorCode":{"type":["string","null"]},"mailbox":{"$ref":"#/components/schemas/WarmupMailbox"}},"required":["ok","steps","errorCode","mailbox"],"additionalProperties":false},"WarmupLeaveInput":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}},"additionalProperties":false},"WarmupHealth":{"type":"object","properties":{"checkedAt":{"$ref":"#/components/schemas/IsoDateTime"},"domain":{"type":"string"},"domainCheckedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"items":{"type":"array","items":{"$ref":"#/components/schemas/WarmupHealthItem"}}},"required":["checkedAt","domain","domainCheckedAt","items"],"additionalProperties":false},"WarmupHealthItem":{"type":"object","properties":{"key":{"type":"string","enum":["spf","dkim","dmarc","alignment","mx","blocklists","domain_age"]},"status":{"type":"string","enum":["pass","warn","fail","unavailable"]},"summary":{"type":"string"},"summaryCode":{"type":"string"},"summaryParams":{"$ref":"#/components/schemas/MessageParams"}},"required":["key","status","summary","summaryCode"],"additionalProperties":false},"OrganizationView":{"type":"object","properties":{"organizationId":{"$ref":"#/components/schemas/Uuid"},"legalName":{"type":"string"},"governed":{"type":"boolean"},"role":{"$ref":"#/components/schemas/OrganizationRole"},"policy":{"anyOf":[{"$ref":"#/components/schemas/OrganizationPolicy"},{"type":"null"}]},"unit":{"anyOf":[{"$ref":"#/components/schemas/OrganizationUnit"},{"type":"null"}]},"units":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationUnit"}}},"required":["organizationId","legalName","governed","role","policy","unit","units"],"additionalProperties":false},"OrganizationRole":{"type":"string","enum":["central","unit","member"],"description":"central: sets the floors and creates units; unit: a department/chapter created by the central workspace; member: another workspace of the organization (floors apply too)."},"OrganizationPolicy":{"type":"object","properties":{"organizationId":{"$ref":"#/components/schemas/Uuid"},"centralWorkspaceId":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/OrganizationKind"},"floors":{"$ref":"#/components/schemas/OrganizationFloors"},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["organizationId","centralWorkspaceId","kind","floors","revision","updatedAt"],"additionalProperties":false},"OrganizationKind":{"type":"string","enum":["university","association","enterprise"]},"OrganizationFloors":{"type":"object","properties":{"mfaRequired":{"type":"boolean"},"ssoLocked":{"type":"boolean"},"fourEyesApproval":{"type":"boolean"},"maxTrackingMode":{"anyOf":[{"$ref":"#/components/schemas/TrackingMode"},{"type":"null"}]},"allowedRegions":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/Region"}},"doubleOptInRequired":{"type":"boolean"},"restrictedFieldKeys":{"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"}},"maxEventDetailDays":{"anyOf":[{"type":"integer","minimum":30,"maximum":730},{"type":"null"}]},"maxInactiveContactDays":{"anyOf":[{"type":"integer","minimum":180,"maximum":3650},{"type":"null"}]},"minAuditDays":{"anyOf":[{"type":"integer","minimum":365,"maximum":2555},{"type":"null"}]},"defaultMonthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]}},"required":["mfaRequired","ssoLocked","fourEyesApproval","maxTrackingMode","allowedRegions","doubleOptInRequired","restrictedFieldKeys","maxEventDetailDays","maxInactiveContactDays","minAuditDays","defaultMonthlySendCap"],"additionalProperties":false},"OrganizationUnit":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"code":{"type":"string"},"region":{"$ref":"#/components/schemas/Region"},"status":{"type":"string"},"monthlySendCap":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"effectiveMonthlySendCap":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sisOrgIds":{"type":"array","items":{"type":"string"}},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["workspaceId","name","code","region","status","monthlySendCap","effectiveMonthlySendCap","sisOrgIds","revision","createdAt"],"additionalProperties":false},"EnableOrganizationInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/OrganizationKind"}},"required":["kind"],"additionalProperties":false,"description":"Makes THIS workspace the central workspace of its organization (no floor is set yet)."},"OrganizationPolicyChange":{"type":"object","properties":{"policy":{"$ref":"#/components/schemas/OrganizationPolicy"},"raised":{"type":"array","items":{"type":"string"}},"propagation":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationFloorPropagation"}}},"required":["policy","raised","propagation"],"additionalProperties":false},"OrganizationFloorPropagation":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"workspaceName":{"type":"string"},"tightened":{"type":"array","items":{"type":"string"}},"stillMissing":{"type":"array","items":{"type":"string"}}},"required":["workspaceId","workspaceName","tightened","stillMissing"],"additionalProperties":false},"UpdateOrganizationPolicyInput":{"type":"object","properties":{"mfaRequired":{"type":"boolean"},"ssoLocked":{"type":"boolean"},"fourEyesApproval":{"type":"boolean"},"maxTrackingMode":{"anyOf":[{"$ref":"#/components/schemas/TrackingMode"},{"type":"null"}]},"allowedRegions":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/Region"}},"doubleOptInRequired":{"type":"boolean"},"restrictedFieldKeys":{"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"}},"maxEventDetailDays":{"anyOf":[{"type":"integer","minimum":30,"maximum":730},{"type":"null"}]},"maxInactiveContactDays":{"anyOf":[{"type":"integer","minimum":180,"maximum":3650},{"type":"null"}]},"minAuditDays":{"anyOf":[{"type":"integer","minimum":365,"maximum":2555},{"type":"null"}]},"defaultMonthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"reason":{"type":"string","minLength":10,"maxLength":500,"description":"Why the floors change (kept in every affected workspace's audit trail)."}},"required":["reason"],"additionalProperties":false},"CreateOrganizationUnitInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"code":{"$ref":"#/components/schemas/OrganizationUnitCode"},"region":{"$ref":"#/components/schemas/Region"},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"locale":{"default":"en","type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"},"monthlySendCap":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"sisOrgIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}}},"required":["name","code","region"],"additionalProperties":false,"description":"Creates a department / chapter workspace IN this organization, with every floor applied; the caller becomes its first owner."},"OrganizationUnitCode":{"type":"string","pattern":"^[A-Z0-9][A-Z0-9_-]{0,31}$"},"UpdateOrganizationUnitInput":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/OrganizationUnitCode"},"monthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"sisOrgIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}}},"additionalProperties":false},"OrganizationRollup":{"type":"object","properties":{"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"organizationId":{"$ref":"#/components/schemas/Uuid"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationRollupItem"}},"totals":{"type":"object","properties":{"workspaces":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acceptedThisMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workspacesWithGaps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["workspaces","contacts","acceptedThisMonth","workspacesWithGaps"],"additionalProperties":false}},"required":["asOf","organizationId","items","totals"],"additionalProperties":false,"description":"Counts per workspace of the organization; never recipient data."},"OrganizationRollupItem":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"role":{"$ref":"#/components/schemas/OrganizationRole"},"code":{"type":["string","null"]},"region":{"$ref":"#/components/schemas/Region"},"status":{"type":"string"},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acceptedThisMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"committedThisMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthlySendCap":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bounced30d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"complaints30d":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeMembers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"gaps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"gap":{"type":"string"}},"required":["key","label","gap"],"additionalProperties":false}}},"required":["workspaceId","name","role","code","region","status","contacts","acceptedThisMonth","committedThisMonth","monthlySendCap","bounced30d","complaints30d","activeMembers","gaps"],"additionalProperties":false},"EffectiveOrganizationPolicy":{"type":"object","properties":{"governed":{"type":"boolean"},"organizationName":{"type":["string","null"]},"kind":{"anyOf":[{"$ref":"#/components/schemas/OrganizationKind"},{"type":"null"}]},"items":{"type":"array","items":{"$ref":"#/components/schemas/EffectivePolicyItem"}}},"required":["governed","organizationName","kind","items"],"additionalProperties":false,"description":"Each floor of the organization next to this workspace's own setting, with which one decides (provenance)."},"EffectivePolicyItem":{"type":"object","properties":{"key":{"type":"string","enum":["mfaRequired","ssoLocked","fourEyesApproval","maxTrackingMode","allowedRegions","doubleOptInRequired","restrictedFieldKeys","maxEventDetailDays","maxInactiveContactDays","minAuditDays","defaultMonthlySendCap"]},"label":{"type":"string"},"description":{"type":"string"},"floor":{"$ref":"#/components/schemas/OrganizationPolicyValue"},"workspace":{"$ref":"#/components/schemas/OrganizationPolicyValue"},"source":{"type":"string","enum":["organization","workspace"]},"compliant":{"type":"boolean"},"gap":{"type":["string","null"]}},"required":["key","label","description","floor","workspace","source","compliant","gap"],"additionalProperties":false},"OrganizationPolicyValue":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"SharedOrganizationTemplate":{"type":"object","properties":{"sourceTemplateId":{"$ref":"#/components/schemas/Uuid"},"sourceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"copies":{"type":"array","items":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/Uuid"},"templateId":{"$ref":"#/components/schemas/Uuid"},"versionId":{"$ref":"#/components/schemas/Uuid"}},"required":["workspaceId","templateId","versionId"],"additionalProperties":false}}},"required":["sourceTemplateId","sourceVersion","copies"],"additionalProperties":false},"ShareOrganizationTemplateInput":{"type":"object","properties":{"unitWorkspaceIds":{"default":[],"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Uuid"}},"name":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false},"OneRosterSyncResult":{"type":"object","properties":{"connectorId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"dryRun":{"type":"boolean"},"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"routed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"otherUnits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inactive":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fieldsUpdated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingFields":{"type":"array","items":{"type":"string"}},"rejections":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/OneRosterRejection"}}},"required":["connectorId","dryRun","received","routed","otherUnits","inactive","applied","unchanged","rejected","fieldsUpdated","missingFields","rejections"],"additionalProperties":false},"OneRosterRejection":{"type":"object","properties":{"sourcedId":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["sourcedId","code","message"],"additionalProperties":false},"OneRosterSyncInput":{"type":"object","properties":{"usersCsv":{"type":"string","minLength":1,"maxLength":900000},"rolesCsv":{"type":"string","minLength":1,"maxLength":900000},"dryRun":{"default":false,"type":"boolean"}},"required":["usersCsv"],"additionalProperties":false},"ConnectSellerView":{"type":"object","properties":{"configured":{"type":"boolean"},"supportedCountries":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"applicationFeeBps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"refundApplicationFee":{"type":"boolean"},"seller":{"anyOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"stripeAccountId":{"type":"string"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"state":{"$ref":"#/components/schemas/ConnectSellerState"},"chargesEnabled":{"type":"boolean"},"payoutsEnabled":{"type":"boolean"},"detailsSubmitted":{"type":"boolean"},"requirementsDue":{"type":"array","items":{"type":"string"}},"disabledReason":{"type":["string","null"]},"lastSyncedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"}},"required":["id","stripeAccountId","country","state","chargesEnabled","payoutsEnabled","detailsSubmitted","requirementsDue","disabledReason","lastSyncedAt","revision"],"additionalProperties":false},{"type":"null"}]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["configured","supportedCountries","applicationFeeBps","refundApplicationFee","seller","asOf"],"additionalProperties":false},"ConnectSellerState":{"type":"string","enum":["onboarding","enabled","restricted","disabled"]},"ConnectOnboardingLink":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["url","expiresAt"],"additionalProperties":false},"StartConnectOnboardingInput":{"type":"object","properties":{"country":{"type":"string","pattern":"^[A-Z]{2}$"},"returnPath":{"type":"string","maxLength":300,"pattern":"^\\/[A-Za-z0-9/_\\-.~%?=&]*$"}},"required":["country","returnPath"],"additionalProperties":false},"ResellerPlanList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ResellerPlanView"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","asOf"],"additionalProperties":false},"ResellerPlanView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/ResellerPlanKind"},"name":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"unitAmountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"interval":{"type":"string","enum":["month","year"]},"trialDays":{"type":"integer","minimum":0,"maximum":90},"applicationFeeBps":{"type":"integer","minimum":0,"maximum":10000},"entitlements":{"$ref":"#/components/schemas/ResellerEntitlements"},"publicationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/ResellerPlanState"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","kind","name","currency","unitAmountMinor","interval","trialDays","applicationFeeBps","entitlements","publicationId","state","createdAt"],"additionalProperties":false},"ResellerPlanKind":{"type":"string","enum":["client_plan","newsletter_premium"]},"ResellerEntitlements":{"type":"object","properties":{"monthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"restrictListCreation":{"type":"boolean"},"sendingModel":{"$ref":"#/components/schemas/AgencySendingModel"}},"additionalProperties":false},"ResellerPlanState":{"type":"string","enum":["published","archived"]},"CreateResellerPlanInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/ResellerPlanKind"},"name":{"type":"string","minLength":1,"maxLength":120},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"unitAmountMinor":{"type":"integer","minimum":50,"maximum":100000000},"interval":{"default":"month","type":"string","enum":["month","year"]},"trialDays":{"default":0,"type":"integer","minimum":0,"maximum":90},"entitlements":{"default":{},"$ref":"#/components/schemas/ResellerEntitlementsInput"},"publicationId":{"$ref":"#/components/schemas/Uuid"}},"required":["kind","name","currency","unitAmountMinor"],"additionalProperties":false},"ResellerEntitlementsInput":{"type":"object","properties":{"monthlySendCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000000},{"type":"null"}]},"restrictListCreation":{"type":"boolean"},"sendingModel":{"$ref":"#/components/schemas/AgencySendingModel"}}},"ResellerCheckoutView":{"type":"object","properties":{"subscriptionId":{"$ref":"#/components/schemas/Uuid"},"url":{"type":"string","format":"uri"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["subscriptionId","url","expiresAt"],"additionalProperties":false},"CreateResellerCheckoutInput":{"type":"object","properties":{"planId":{"$ref":"#/components/schemas/Uuid"},"clientName":{"type":"string","minLength":1,"maxLength":120},"legalName":{"type":"string","minLength":1,"maxLength":200},"region":{"$ref":"#/components/schemas/Region"},"timezone":{"default":"UTC","type":"string","minLength":1,"maxLength":64},"locale":{"default":"en","type":"string","minLength":2,"maxLength":35},"ownerEmail":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"returnPath":{"type":"string","maxLength":300,"pattern":"^\\/[A-Za-z0-9/_\\-.~%?=&]*$"}},"required":["planId","clientName","region","ownerEmail","returnPath"],"additionalProperties":false},"ResellerSubscriptionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ResellerSubscriptionView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ResellerSubscriptionView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/ResellerPlanKind"},"planId":{"$ref":"#/components/schemas/Uuid"},"planName":{"type":"string"},"lifecycle":{"$ref":"#/components/schemas/ResellerLifecycle"},"stripeStatus":{"type":["string","null"]},"clientWorkspaceId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"agencyClientId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"clientName":{"type":["string","null"]},"publicationId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"currentPeriodEnd":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"suspendedByBilling":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"lastSyncedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","kind","planId","planName","lifecycle","stripeStatus","clientWorkspaceId","agencyClientId","clientName","publicationId","currentPeriodEnd","suspendedByBilling","createdAt","lastSyncedAt"],"additionalProperties":false},"ResellerLifecycle":{"type":"string","enum":["checkout_open","checkout_expired","trial","paid","past_due","suspended","cancelled"]},"ResellerBillingView":{"type":"object","properties":{"sellerName":{"type":["string","null"]},"subscription":{"anyOf":[{"$ref":"#/components/schemas/ResellerSubscriptionView"},{"type":"null"}]},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/ResellerInvoiceView"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["sellerName","subscription","invoices","asOf"],"additionalProperties":false},"ResellerInvoiceView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"number":{"type":["string","null"]},"status":{"type":"string","enum":["draft","open","paid","void","uncollectible"]},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},"amountPaidMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},"applicationFeeMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},{"type":"null"}]},"hostedUrl":{"type":["string","null"]},"pdfUrl":{"type":["string","null"]},"periodStart":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"periodEnd":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","number","status","currency","totalMinor","amountPaidMinor","applicationFeeMinor","hostedUrl","pdfUrl","periodStart","periodEnd","createdAt"],"additionalProperties":false},"ConnectLedgerSummary":{"type":"object","properties":{"currencies":{"type":"array","items":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/CurrencyCode"},"balances":{"type":"object","propertyNames":{"$ref":"#/components/schemas/ConnectLedgerAccountKind"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},"required":["customer_payments","seller_payable","platform_fee_revenue","refunds","disputes"]},"sellerDeficitMinor":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["currency","balances","sellerDeficitMinor"],"additionalProperties":false}},"openDisputes":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"stripeDisputeId":{"type":"string"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"reason":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/ConnectDisputeState"},"evidenceDueBy":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","stripeDisputeId","amountMinor","currency","reason","state","evidenceDueBy"],"additionalProperties":false}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["currencies","openDisputes","asOf"],"additionalProperties":false},"ConnectLedgerAccountKind":{"type":"string","enum":["customer_payments","seller_payable","platform_fee_revenue","refunds","disputes"]},"ConnectDisputeState":{"type":"string","enum":["open","won","lost","closed"]},"ConnectLedgerTransactionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectLedgerTransactionView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ConnectLedgerTransactionView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"type":{"$ref":"#/components/schemas/ConnectLedgerTransactionType"},"stripeObjectId":{"type":"string"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"entries":{"type":"array","items":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ConnectLedgerAccountKind"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."}},"required":["account","currency","amountMinor"],"additionalProperties":false}}},"required":["id","type","stripeObjectId","occurredAt","entries"],"additionalProperties":false},"ConnectLedgerTransactionType":{"type":"string","enum":["payment","refund","dispute"]},"ConnectChargePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectChargeView"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"ConnectChargeView":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"stripeChargeId":{"type":"string"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"amountMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},"applicationFeeMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},"amountRefundedMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Integer minor units (cents), signed where stated."},"disputed":{"type":"boolean"},"subscriptionId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","stripeChargeId","currency","amountMinor","applicationFeeMinor","amountRefundedMinor","disputed","subscriptionId","createdAt"],"additionalProperties":false},"ConnectRefundRequested":{"type":"object","properties":{"stripeRefundId":{"type":"string"},"status":{"type":"string"}},"required":["stripeRefundId","status"],"additionalProperties":false},"RefundConnectChargeInput":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":1,"maximum":9007199254740991},"reason":{"default":"requested_by_customer","type":"string","enum":["duplicate","fraudulent","requested_by_customer"]}},"additionalProperties":false},"PublicPremiumOffer":{"type":"object","properties":{"available":{"type":"boolean"},"name":{"type":["string","null"]},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"null"}]},"unitAmountMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"interval":{"anyOf":[{"type":"string","enum":["month","year"]},{"type":"null"}]},"trialDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellerName":{"type":["string","null"]}},"required":["available","name","currency","unitAmountMinor","interval","trialDays","sellerName"],"additionalProperties":false},"PremiumCheckoutView":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false},"PremiumCheckoutInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}},"required":["email"],"additionalProperties":false},"ConnectIngestAccepted":{"type":"object","properties":{"received":{"type":"boolean","const":true},"duplicate":{"type":"boolean"}},"required":["received","duplicate"],"additionalProperties":false},"PredictionOverview":{"type":"object","properties":{"trainingEnabled":{"type":"boolean"},"kinds":{"type":"array","items":{"$ref":"#/components/schemas/PredictionKindOverview"}},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["trainingEnabled","kinds","asOf"],"additionalProperties":false},"PredictionKindOverview":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/PredictionKind"},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]},"retrainRequestedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"updatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"active":{"anyOf":[{"$ref":"#/components/schemas/PredictionModel"},{"type":"null"}]},"latest":{"anyOf":[{"$ref":"#/components/schemas/PredictionModel"},{"type":"null"}]},"history":{"type":"array","items":{"$ref":"#/components/schemas/PredictionModel"}},"usable":{"type":"boolean"},"unusableReason":{"anyOf":[{"$ref":"#/components/schemas/PredictionUnusableReason"},{"type":"null"}]},"fallback":{"type":"string"}},"required":["kind","enabled","disabledReason","retrainRequestedAt","revision","updatedAt","active","latest","history","usable","unusableReason","fallback"],"additionalProperties":false},"PredictionKind":{"type":"string","enum":["send_time","churn_risk","purchase_propensity"]},"PredictionModel":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"kind":{"$ref":"#/components/schemas/PredictionKind"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"$ref":"#/components/schemas/PredictionModelStatus"},"reasons":{"type":"array","items":{"type":"string"}},"algorithm":{"type":"string"},"dataWindow":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoDateTime"},"to":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["from","to"],"additionalProperties":false},"requirements":{"type":"array","items":{"$ref":"#/components/schemas/PredictionRequirement"}},"sample":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"validation":{"anyOf":[{"$ref":"#/components/schemas/PredictionValidation"},{"type":"null"}]},"drift":{"anyOf":[{"$ref":"#/components/schemas/PredictionDrift"},{"type":"null"}]},"explanation":{"anyOf":[{"$ref":"#/components/schemas/PredictionExplanation"},{"type":"null"}]},"bands":{"anyOf":[{"type":"object","properties":{"low":{"type":"number"},"high":{"type":"number"}},"required":["low","high"],"additionalProperties":false},{"type":"null"}]},"features":{"type":"array","items":{"type":"string"}},"predictedContacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trainedAt":{"$ref":"#/components/schemas/IsoDateTime"},"activatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"supersededAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","kind","version","status","reasons","algorithm","dataWindow","requirements","sample","validation","drift","explanation","bands","features","predictedContacts","trainedAt","activatedAt","supersededAt"],"additionalProperties":false},"PredictionModelStatus":{"type":"string","enum":["training","active","insufficient_data","rejected","superseded"],"description":"training = validated, its predictions being written; active = validated and used; insufficient_data = the minimum data is not met, nothing was fitted; rejected = fitted but not trusted (no better than chance, significant drift, or no better than a random hour); superseded = an older active version."},"PredictionRequirement":{"type":"object","properties":{"key":{"type":"string"},"required":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"actual":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"met":{"type":"boolean"}},"required":["key","required","actual","met"],"additionalProperties":false},"PredictionValidation":{"oneOf":[{"type":"object","properties":{"metric":{"type":"string","const":"auc"},"value":{"type":"number"},"interval":{"$ref":"#/components/schemas/PredictionInterval"},"brier":{"type":"number"},"calibrationError":{"type":"number"},"calibration":{"type":"array","items":{"type":"object","properties":{"from":{"type":"number"},"to":{"type":"number"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"meanPredicted":{"type":["number","null"]},"observedRate":{"type":["number","null"]}},"required":["from","to","count","meanPredicted","observedRate"],"additionalProperties":false}},"baseRate":{"type":"number"},"positives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"negatives":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["metric","value","interval","brier","calibrationError","calibration","baseRate","positives","negatives"],"additionalProperties":false},{"type":"object","properties":{"metric":{"type":"string","const":"hit_rate"},"value":{"type":"number"},"interval":{"$ref":"#/components/schemas/PredictionInterval"},"workspaceRate":{"type":"number"},"workspaceInterval":{"$ref":"#/components/schemas/PredictionInterval"},"uniformRate":{"type":"number"},"events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"personalized":{"type":"boolean"}},"required":["metric","value","interval","workspaceRate","workspaceInterval","uniformRate","events","personalized"],"additionalProperties":false}]},"PredictionInterval":{"type":"object","properties":{"level":{"type":"number","minimum":0,"maximum":1},"low":{"type":"number"},"high":{"type":"number"}},"required":["level","low","high"],"additionalProperties":false},"PredictionDrift":{"type":"object","properties":{"status":{"type":"string","enum":["stable","moderate","significant"]},"maxPsi":{"type":"number"},"features":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string"},"psi":{"type":"number"},"status":{"type":"string","enum":["stable","moderate","significant"]},"ignored":{"type":"boolean"}},"required":["feature","psi","status"],"additionalProperties":false}}},"required":["status","maxPsi","features"],"additionalProperties":false},"PredictionExplanation":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"coefficients"},"items":{"type":"array","items":{"type":"object","properties":{"feature":{"type":"string"},"coefficient":{"type":"number"},"oddsRatio":{"type":"number"},"direction":{"type":"string","enum":["raises","lowers"]}},"required":["feature","coefficient","oddsRatio","direction"],"additionalProperties":false}}},"required":["kind","items"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"hour_profile"},"topHours":{"type":"array","items":{"type":"object","properties":{"hourOfWeek":{"type":"integer","minimum":0,"maximum":167},"share":{"type":"number"}},"required":["hourOfWeek","share"],"additionalProperties":false}},"priorStrength":{"type":"number"},"minContactEvents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","topHours","priorStrength","minContactEvents"],"additionalProperties":false}]},"PredictionUnusableReason":{"type":"string","enum":["training_off","not_trained","insufficient_data","rejected","turned_off"]},"UpdatePredictionSettingInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":"string","maxLength":500}},"required":["enabled"],"additionalProperties":false},"RetrainPredictionsAccepted":{"type":"object","properties":{"kinds":{"type":"array","items":{"$ref":"#/components/schemas/PredictionKind"}},"requestedAt":{"$ref":"#/components/schemas/IsoDateTime"},"trainingEnabled":{"type":"boolean"}},"required":["kinds","requestedAt","trainingEnabled"],"additionalProperties":false},"RetrainPredictionsInput":{"type":"object","properties":{"kinds":{"minItems":1,"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/PredictionKind"}}},"additionalProperties":false},"ContactPredictions":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ContactPredictionItem"}},"unavailable":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/PredictionKind"},"reason":{"$ref":"#/components/schemas/PredictionUnusableReason"}},"required":["kind","reason"],"additionalProperties":false}}},"required":["contactId","items","unavailable"],"additionalProperties":false},"ContactPredictionItem":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/PredictionKind"},"modelId":{"$ref":"#/components/schemas/Uuid"},"modelVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"score":{"type":["number","null"]},"interval":{"anyOf":[{"$ref":"#/components/schemas/PredictionInterval"},{"type":"null"}]},"band":{"anyOf":[{"$ref":"#/components/schemas/PredictionBand"},{"type":"null"}]},"evidence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sendTime":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","enum":["contact","workspace"]},"topHours":{"type":"array","items":{"type":"object","properties":{"hourOfWeek":{"type":"integer","minimum":0,"maximum":167},"share":{"type":"number"}},"required":["hourOfWeek","share"],"additionalProperties":false}}},"required":["source","topHours"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","modelId","modelVersion","score","interval","band","evidence","sendTime"],"additionalProperties":false},"ChannelOverview":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ChannelOverviewItem"}},"pricesConfigured":{"type":"boolean"},"fakeProviders":{"type":"boolean"}},"required":["items","pricesConfigured","fakeProviders"],"additionalProperties":false},"ChannelOverviewItem":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/ChannelKind"},"status":{"type":"string","enum":["connected","setup_required","available"]},"senders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"readySenders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"templates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approvedTemplates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"consentedEndpoints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"credits":{"anyOf":[{"$ref":"#/components/schemas/ChannelCredits"},{"type":"null"}]},"coverage":{"type":"array","items":{"$ref":"#/components/schemas/ChannelCoverageCountry"}},"flatPrice":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["channel","status","senders","readySenders","templates","approvedTemplates","consentedEndpoints","credits","coverage","flatPrice"],"additionalProperties":false},"ChannelKind":{"type":"string","enum":["sms","whatsapp","web_push","mobile_push","wallet"]},"ChannelCredits":{"type":"object","properties":{"unit":{"type":"string","enum":["email_unit","sms_unit","whatsapp_unit","web_push_unit","mobile_push_unit","wallet_unit"]},"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"settled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["unit","available","reserved","settled"],"additionalProperties":false},"ChannelCoverageCountry":{"type":"object","properties":{"country":{"type":"string","pattern":"^[A-Z]{2}$"},"price":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}]},"quietHours":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"noSundays":{"type":"boolean"},"basis":{"type":"string"},"covered":{"type":"boolean"}},"required":["country","price","quietHours","noSundays","basis","covered"],"additionalProperties":false},"ChannelSenderPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ChannelSender"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ChannelSender":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"channel":{"$ref":"#/components/schemas/ChannelKind"},"provider":{"$ref":"#/components/schemas/ChannelProvider"},"displayName":{"type":"string"},"kind":{"$ref":"#/components/schemas/ChannelSenderKind"},"address":{"type":"string"},"countries":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"state":{"$ref":"#/components/schemas/ChannelSenderState"},"registrationState":{"$ref":"#/components/schemas/ChannelRegistrationState"},"registrationDetail":{"type":["string","null"]},"registration":{"$ref":"#/components/schemas/ChannelRegistration"},"registrationCheckedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"credentialsSet":{"type":"boolean"},"callbacks":{"type":"object","properties":{"status":{"type":["string","null"]},"inbound":{"type":["string","null"]},"verifyToken":{"type":["string","null"]}},"required":["status","inbound","verifyToken"],"additionalProperties":false},"site":{"anyOf":[{"type":"object","properties":{"publicKey":{"type":"string"},"snippetUrl":{"type":["string","null"]},"serviceWorkerUrl":{"type":["string","null"]}},"required":["publicKey","snippetUrl","serviceWorkerUrl"],"additionalProperties":false},{"type":"null"}]},"readiness":{"$ref":"#/components/schemas/ChannelSenderReadiness"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","channel","provider","displayName","kind","address","countries","state","registrationState","registrationDetail","registration","registrationCheckedAt","credentialsSet","callbacks","site","readiness","revision","createdAt","updatedAt"],"additionalProperties":false},"ChannelProvider":{"type":"string","enum":["twilio","whatsapp_cloud","vapid","fcm","apns","apple_wallet","google_wallet"]},"ChannelSenderKind":{"type":"string","enum":["long_code","toll_free","short_code","alphanumeric","ten_dlc","waba_number","web_site","fcm_app","apns_app","apple_pass_type","google_wallet_issuer"]},"ChannelSenderState":{"type":"string","enum":["active","disabled"]},"ChannelRegistrationState":{"type":"string","enum":["draft","pending","approved","rejected","suspended"]},"ChannelRegistration":{"type":"object","properties":{"messagingServiceSid":{"type":"string","pattern":"^MG[0-9a-f]{32}$"},"brandRegistrationSid":{"type":"string","pattern":"^BN[0-9a-f]{32}$"},"campaignSid":{"type":"string","pattern":"^(QE|CM)[0-9A-Za-z]{2,40}$"},"wabaId":{"type":"string","pattern":"^\\d{5,20}$"},"phoneNumberId":{"type":"string","pattern":"^\\d{5,20}$"},"appId":{"type":"string","pattern":"^\\d{5,20}$"},"projectId":{"type":"string","pattern":"^[a-z][a-z0-9-]{4,61}[a-z0-9]$"},"teamId":{"type":"string","pattern":"^[A-Z0-9]{10}$"},"keyId":{"type":"string","pattern":"^[A-Z0-9]{10}$"},"apnsEnvironment":{"type":"string","enum":["production","sandbox"]},"serviceAccountEmail":{"type":"string","maxLength":320,"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,}$"}},"additionalProperties":false},"ChannelSenderReadiness":{"type":"object","properties":{"ready":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["ready","reasons"],"additionalProperties":false},"CreateChannelSenderInput":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/ChannelKind"},"displayName":{"type":"string","minLength":1,"maxLength":120},"kind":{"$ref":"#/components/schemas/ChannelSenderKind"},"address":{"type":"string","minLength":3,"maxLength":255},"countries":{"default":[],"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"registration":{"default":{},"$ref":"#/components/schemas/ChannelRegistration"},"credentials":{"$ref":"#/components/schemas/ChannelCredentials"}},"required":["channel","displayName","kind","address"],"additionalProperties":false},"ChannelCredentials":{"anyOf":[{"$ref":"#/components/schemas/TwilioCredentials"},{"$ref":"#/components/schemas/WhatsAppCredentials"},{"$ref":"#/components/schemas/FcmCredentials"},{"$ref":"#/components/schemas/ApnsCredentials"},{"$ref":"#/components/schemas/AppleWalletCredentials"},{"$ref":"#/components/schemas/GoogleWalletCredentials"}]},"TwilioCredentials":{"type":"object","properties":{"accountSid":{"type":"string","pattern":"^AC[0-9a-f]{32}$"},"authToken":{"type":"string","pattern":"^[0-9a-f]{32}$"}},"required":["accountSid","authToken"],"additionalProperties":false},"WhatsAppCredentials":{"type":"object","properties":{"accessToken":{"type":"string","minLength":20,"maxLength":1024},"appSecret":{"type":"string","pattern":"^[0-9a-f]{32}$"}},"required":["accessToken","appSecret"],"additionalProperties":false},"FcmCredentials":{"type":"object","properties":{"projectId":{"type":"string","pattern":"^[a-z][a-z0-9-]{4,61}[a-z0-9]$"},"clientEmail":{"type":"string","maxLength":320,"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,}$"},"privateKey":{"type":"string","minLength":64,"maxLength":16384,"pattern":"-----BEGIN PRIVATE KEY-----"}},"required":["projectId","clientEmail","privateKey"],"additionalProperties":false},"ApnsCredentials":{"type":"object","properties":{"teamId":{"type":"string","pattern":"^[A-Z0-9]{10}$"},"keyId":{"type":"string","pattern":"^[A-Z0-9]{10}$"},"privateKey":{"type":"string","minLength":64,"maxLength":16384,"pattern":"-----BEGIN PRIVATE KEY-----"},"environment":{"default":"production","type":"string","enum":["production","sandbox"]}},"required":["teamId","keyId","privateKey"],"additionalProperties":false},"AppleWalletCredentials":{"type":"object","properties":{"teamIdentifier":{"type":"string","pattern":"^[A-Z0-9]{10}$"},"certificatePem":{"type":"string","minLength":64,"maxLength":16384,"pattern":"-----BEGIN CERTIFICATE-----"},"privateKeyPem":{"type":"string","minLength":64,"maxLength":16384,"pattern":"-----BEGIN PRIVATE KEY-----"},"wwdrCertificatePem":{"type":"string","minLength":64,"maxLength":16384,"pattern":"-----BEGIN CERTIFICATE-----"}},"required":["teamIdentifier","certificatePem","privateKeyPem","wwdrCertificatePem"],"additionalProperties":false},"GoogleWalletCredentials":{"type":"object","properties":{"serviceAccountEmail":{"type":"string","maxLength":320,"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,}$"},"privateKey":{"type":"string","minLength":64,"maxLength":16384,"pattern":"-----BEGIN PRIVATE KEY-----"}},"required":["serviceAccountEmail","privateKey"],"additionalProperties":false},"UpdateChannelSenderInput":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":120},"countries":{"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"registration":{"$ref":"#/components/schemas/ChannelRegistration"},"credentials":{"$ref":"#/components/schemas/ChannelCredentials"},"state":{"$ref":"#/components/schemas/ChannelSenderState"}},"additionalProperties":false},"ChannelTemplatePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ChannelTemplate"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ChannelTemplate":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"channel":{"$ref":"#/components/schemas/ChannelKind"},"name":{"type":"string"},"body":{"type":"string"},"language":{"type":"string"},"category":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppTemplateCategory"},{"type":"null"}]},"senderId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"providerTemplateName":{"type":["string","null"]},"approvalState":{"$ref":"#/components/schemas/ChannelTemplateApprovalState"},"approvalDetail":{"type":["string","null"]},"variables":{"type":"array","items":{"type":"string"}},"push":{"anyOf":[{"$ref":"#/components/schemas/PushContent"},{"type":"null"}]},"wallet":{"anyOf":[{"$ref":"#/components/schemas/WalletPassContent"},{"type":"null"}]},"segments":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"encoding":{"anyOf":[{"type":"string","enum":["gsm7","ucs2"]},{"type":"null"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ChannelTemplateVersion"}},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","channel","name","body","language","category","senderId","providerTemplateName","approvalState","approvalDetail","variables","push","wallet","segments","encoding","versions","revision","createdAt","updatedAt"],"additionalProperties":false},"WhatsAppTemplateCategory":{"type":"string","enum":["marketing","utility","authentication"]},"ChannelTemplateApprovalState":{"type":"string","enum":["not_required","draft","pending","approved","rejected","paused"]},"PushContent":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"url":{"default":null,"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"icon":{"default":null,"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]}},"required":["title","url","icon"],"additionalProperties":false},"WalletPassContent":{"type":"object","properties":{"style":{"default":"storeCard","type":"string","enum":["storeCard","generic"]},"organizationName":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":120},"logoText":{"default":null,"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"backgroundColor":{"default":"#1F2937","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"foregroundColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"labelColor":{"default":"#D1D5DB","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"headerFields":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","label","value"],"additionalProperties":false}},"primaryFields":{"default":[],"maxItems":1,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","label","value"],"additionalProperties":false}},"secondaryFields":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","label","value"],"additionalProperties":false}},"auxiliaryFields":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","label","value"],"additionalProperties":false}},"backFields":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","label","value"],"additionalProperties":false}},"barcode":{"default":null,"anyOf":[{"type":"object","properties":{"format":{"type":"string","enum":["qr","pdf417","aztec","code128"]},"message":{"type":"string","minLength":1,"maxLength":200}},"required":["format","message"],"additionalProperties":false},{"type":"null"}]}},"required":["style","organizationName","description","logoText","backgroundColor","foregroundColor","labelColor","headerFields","primaryFields","secondaryFields","auxiliaryFields","backFields","barcode"],"additionalProperties":false},"ChannelTemplateVersion":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"contentHash":{"type":"string"},"frozenAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","version","contentHash","frozenAt"],"additionalProperties":false},"CreateChannelTemplateInput":{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/ChannelKind"},"name":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":1600},"language":{"default":"en","type":"string","pattern":"^[a-z]{2,3}(_[A-Z]{2})?$"},"category":{"$ref":"#/components/schemas/WhatsAppTemplateCategory"},"senderId":{"$ref":"#/components/schemas/Uuid"},"push":{"$ref":"#/components/schemas/PushContentInput"},"wallet":{"$ref":"#/components/schemas/WalletPassContentInput"}},"required":["channel","name","body"],"additionalProperties":false},"PushContentInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"url":{"default":null,"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"icon":{"default":null,"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]}},"required":["title"],"additionalProperties":false},"WalletPassContentInput":{"type":"object","properties":{"style":{"default":"storeCard","type":"string","enum":["storeCard","generic"]},"organizationName":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":120},"logoText":{"default":null,"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"backgroundColor":{"default":"#1F2937","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"foregroundColor":{"default":"#FFFFFF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"labelColor":{"default":"#D1D5DB","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"headerFields":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","value"],"additionalProperties":false}},"primaryFields":{"default":[],"maxItems":1,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","value"],"additionalProperties":false}},"secondaryFields":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","value"],"additionalProperties":false}},"auxiliaryFields":{"default":[],"maxItems":4,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","value"],"additionalProperties":false}},"backFields":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,30}$"},"label":{"default":"","type":"string","maxLength":40},"value":{"type":"string","minLength":1,"maxLength":120}},"required":["key","value"],"additionalProperties":false}},"barcode":{"default":null,"anyOf":[{"type":"object","properties":{"format":{"type":"string","enum":["qr","pdf417","aztec","code128"]},"message":{"type":"string","minLength":1,"maxLength":200}},"required":["format","message"],"additionalProperties":false},{"type":"null"}]}},"required":["organizationName","description"],"additionalProperties":false},"UpdateChannelTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":1600},"language":{"type":"string","pattern":"^[a-z]{2,3}(_[A-Z]{2})?$"},"category":{"$ref":"#/components/schemas/WhatsAppTemplateCategory"},"push":{"$ref":"#/components/schemas/PushContentInput"},"wallet":{"$ref":"#/components/schemas/WalletPassContentInput"}},"additionalProperties":false},"ChannelEndpointPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ChannelEndpoint"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"ChannelEndpoint":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"contactId":{"$ref":"#/components/schemas/Uuid"},"channel":{"$ref":"#/components/schemas/ChannelKind"},"address":{"type":"string"},"country":{"type":"string"},"senderId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"platform":{"anyOf":[{"type":"string","enum":["android","ios","web"]},{"type":"null"}]},"devices":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"state":{"$ref":"#/components/schemas/ChannelEndpointState"},"consent":{"type":"object","properties":{"marketing":{"$ref":"#/components/schemas/ChannelConsentState"},"transactional":{"$ref":"#/components/schemas/ChannelConsentState"}},"required":["marketing","transactional"],"additionalProperties":false},"suppressed":{"type":"boolean"},"lastInboundAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","contactId","channel","address","country","senderId","platform","devices","state","consent","suppressed","lastInboundAt","revision","createdAt"],"additionalProperties":false},"ChannelEndpointState":{"type":"string","enum":["active","invalid","disabled"]},"ChannelConsentState":{"type":"string","enum":["granted","withdrawn","expired","unknown"]},"CreateChannelEndpointInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"channel":{"$ref":"#/components/schemas/ChannelKind"},"phone":{"type":"string","minLength":3,"maxLength":40},"defaultCountry":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["contactId","channel","phone"],"additionalProperties":false},"RecordChannelConsentInput":{"type":"object","properties":{"purpose":{"type":"string","enum":["marketing","transactional"]},"choice":{"$ref":"#/components/schemas/ConsentChoice"},"legalBasis":{"$ref":"#/components/schemas/LegalBasis"},"evidence":{"$ref":"#/components/schemas/ConsentEvidence"},"noticeVersion":{"type":"string","minLength":1,"maxLength":100},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}(-[A-Z0-9]{1,3})?$"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"source":{"default":"api","type":"string","minLength":1,"maxLength":100}},"required":["purpose","choice"],"additionalProperties":false},"ChannelIngestAccepted":{"type":"object","properties":{"receipts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inbound":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicate":{"type":"boolean"}},"required":["receipts","inbound","duplicate"],"additionalProperties":false},"RegisterPushEndpointInput":{"oneOf":[{"type":"object","properties":{"channel":{"type":"string","const":"web_push"},"contactId":{"$ref":"#/components/schemas/Uuid"},"senderId":{"$ref":"#/components/schemas/Uuid"},"subscription":{"$ref":"#/components/schemas/WebPushSubscription"}},"required":["channel","contactId","senderId","subscription"],"additionalProperties":false},{"type":"object","properties":{"channel":{"type":"string","const":"mobile_push"},"contactId":{"$ref":"#/components/schemas/Uuid"},"senderId":{"$ref":"#/components/schemas/Uuid"},"device":{"$ref":"#/components/schemas/MobileDevice"}},"required":["channel","contactId","senderId","device"],"additionalProperties":false}]},"WebPushSubscription":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":2048,"format":"uri"},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":80,"maxLength":100,"pattern":"^[A-Za-z0-9_-]+={0,2}$"},"auth":{"type":"string","minLength":16,"maxLength":32,"pattern":"^[A-Za-z0-9_-]+={0,2}$"}},"required":["p256dh","auth"],"additionalProperties":false},"expirationTime":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["endpoint","keys"],"additionalProperties":false},"MobileDevice":{"type":"object","properties":{"platform":{"type":"string","enum":["android","ios"]},"token":{"type":"string","pattern":"^[A-Za-z0-9:_\\-.]{20,4096}$"}},"required":["platform","token"],"additionalProperties":false},"WalletPassLinks":{"type":"object","properties":{"endpointId":{"$ref":"#/components/schemas/Uuid"},"provider":{"type":"string","enum":["apple_wallet","google_wallet"]},"url":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["endpointId","provider","url","expiresAt"],"additionalProperties":false},"IssueWalletPassInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"senderId":{"$ref":"#/components/schemas/Uuid"},"templateId":{"$ref":"#/components/schemas/Uuid"}},"required":["contactId","senderId","templateId"],"additionalProperties":false},"WebPushSubscriberToken":{"type":"object","properties":{"token":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["token","expiresAt"],"additionalProperties":false},"CreateWebPushSubscriberTokenInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"}},"required":["contactId"],"additionalProperties":false},"WebPushSiteConfig":{"type":"object","properties":{"senderId":{"$ref":"#/components/schemas/Uuid"},"origin":{"type":"string"},"publicKey":{"type":"string"}},"required":["senderId","origin","publicKey"],"additionalProperties":false},"PublicWebPushSubscribed":{"type":"object","properties":{"endpointId":{"$ref":"#/components/schemas/Uuid"}},"required":["endpointId"],"additionalProperties":false},"PublicWebPushSubscribeInput":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":512},"subscription":{"$ref":"#/components/schemas/WebPushSubscription"}},"required":["token","subscription"],"additionalProperties":false},"PublicWebPushReceiptInput":{"type":"object","properties":{"r":{"type":"string","pattern":"^[0-9a-f-]{36}\\.[0-9a-f-]{36}\\.[A-Za-z0-9_-]{20,64}$"},"event":{"type":"string","enum":["shown","clicked"]}},"required":["r","event"],"additionalProperties":false},"RegisterWalletDeviceInput":{"type":"object","properties":{"pushToken":{"type":"string","pattern":"^[0-9A-Fa-f]{32,200}$"}},"required":["pushToken"]},"WalletSerialsUpdated":{"type":"object","properties":{"serialNumbers":{"type":"array","items":{"type":"string"}},"lastUpdated":{"type":"string"}},"required":["serialNumbers","lastUpdated"],"additionalProperties":false},"WalletDeviceLogInput":{"type":"object","properties":{"logs":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":2000}}},"required":["logs"]},"CatalogBatchResult":{"type":"object","properties":{"batch":{"$ref":"#/components/schemas/CatalogBatch"},"results":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"outcome":{"$ref":"#/components/schemas/CatalogItemOutcome"},"productId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"code":{"type":["string","null"]}},"required":["externalId","outcome","productId","version","code"],"additionalProperties":false}}},"required":["batch","results"],"additionalProperties":false},"CatalogBatch":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"source":{"type":"string"},"connectorId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"received":{"type":"integer","minimum":0,"maximum":9007199254740991},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"updated":{"type":"integer","minimum":0,"maximum":9007199254740991},"unchanged":{"type":"integer","minimum":0,"maximum":9007199254740991},"removed":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":0,"maximum":9007199254740991},"rejections":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["externalId","code","message"],"additionalProperties":false}},"actorType":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","source","connectorId","received","created","updated","unchanged","removed","rejected","rejections","actorType","createdAt"],"additionalProperties":false,"description":"One catalog synchronization: a receipt with counts, audited (AT-090)."},"CatalogItemOutcome":{"type":"string","enum":["created","updated","unchanged","removed","rejected"]},"SubmitCatalogBatchInput":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/CommerceSource"},"products":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/CatalogProductInput"}}},"required":["source","products"],"additionalProperties":false},"CommerceSource":{"type":"string","minLength":1,"maxLength":60,"pattern":"^[a-z0-9][a-z0-9_.-]*$","description":"Store key, e.g. `shopify-eu` (`connector.*` is reserved)."},"CatalogProductInput":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":300},"url":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"null"}]},"priceMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000000},{"type":"null"}]},"available":{"default":true,"type":"boolean"},"removed":{"default":false,"type":"boolean"},"variants":{"default":[],"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/CatalogVariantInput"}}},"required":["externalId","title"],"additionalProperties":false},"CatalogVariantInput":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200},"sku":{"type":"string","minLength":1,"maxLength":120},"title":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"priceMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000000},{"type":"null"}]},"available":{"default":true,"type":"boolean"}},"required":["externalId","sku"],"additionalProperties":false},"CatalogBatchPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CatalogBatch"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"CatalogProductPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CatalogProduct"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"CatalogProduct":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"source":{"type":"string"},"externalId":{"type":"string"},"title":{"type":"string"},"url":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"currency":{"type":["string","null"]},"priceMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"available":{"type":"boolean"},"status":{"$ref":"#/components/schemas/CatalogProductStatus"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"replenishDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/CatalogVariant"}},"lastBatchId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","source","externalId","title","url","imageUrl","currency","priceMinor","available","status","version","replenishDays","variants","lastBatchId","revision","createdAt","updatedAt"],"additionalProperties":false},"CatalogProductStatus":{"type":"string","enum":["active","removed"]},"CatalogVariant":{"type":"object","properties":{"externalId":{"type":"string"},"sku":{"type":"string"},"title":{"type":["string","null"]},"priceMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"available":{"type":"boolean"}},"required":["externalId","sku","title","priceMinor","available"],"additionalProperties":false},"UpdateCatalogProductInput":{"type":"object","properties":{"replenishDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]}},"required":["replenishDays"],"additionalProperties":false},"CatalogProductVersionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CatalogProductVersion"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false},"CatalogProductVersion":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"batchId":{"$ref":"#/components/schemas/Uuid"},"contentHash":{"type":"string"},"status":{"$ref":"#/components/schemas/CatalogProductStatus"},"title":{"type":"string"},"priceMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":["string","null"]},"variantCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["version","batchId","contentHash","status","title","priceMinor","currency","variantCount","createdAt"],"additionalProperties":false},"CouponPoolPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CouponPool"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"CouponPool":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"key":{"$ref":"#/components/schemas/CouponPoolKey"},"mergeTag":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"issuance":{"$ref":"#/components/schemas/CouponIssuanceMode"},"status":{"$ref":"#/components/schemas/CouponPoolStatus"},"state":{"$ref":"#/components/schemas/CouponPoolState"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lowStockThreshold":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"counts":{"type":"object","properties":{"available":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"issued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"redeemed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"void":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["available","issued","redeemed","void"],"additionalProperties":false},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","key","mergeTag","name","description","issuance","status","state","expiresAt","lowStockThreshold","counts","revision","createdAt","updatedAt"],"additionalProperties":false},"CouponPoolKey":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,62}$"},"CouponIssuanceMode":{"type":"string","enum":["once_per_contact","per_send"]},"CouponPoolStatus":{"type":"string","enum":["active","archived"]},"CouponPoolState":{"type":"string","enum":["ready","low","exhausted","expired","archived"]},"CreateCouponPoolInput":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/CouponPoolKey"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"issuance":{"default":"once_per_contact","$ref":"#/components/schemas/CouponIssuanceMode"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lowStockThreshold":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000},{"type":"null"}]}},"required":["key","name"],"additionalProperties":false},"UpdateCouponPoolInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"lowStockThreshold":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000},{"type":"null"}]},"status":{"$ref":"#/components/schemas/CouponPoolStatus"}},"additionalProperties":false},"AddCouponCodesResult":{"type":"object","properties":{"pool":{"$ref":"#/components/schemas/CouponPool"},"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["pool","added","duplicates"],"additionalProperties":false},"AddCouponCodesInput":{"type":"object","properties":{"codes":{"minItems":1,"maxItems":10000,"type":"array","items":{"$ref":"#/components/schemas/CouponCodeText"}}},"required":["codes"],"additionalProperties":false,"description":"Codes created in the store (uploaded): each must be new to the WORKSPACE (case-insensitive)."},"GenerateCouponCodesInput":{"type":"object","properties":{"count":{"type":"integer","minimum":1,"maximum":10000},"prefix":{"default":"","type":"string","pattern":"^[A-Z0-9_-]{0,12}$"},"length":{"default":10,"type":"integer","minimum":6,"maximum":20}},"required":["count"],"additionalProperties":false,"description":"Generated codes exist only here: the store must be told about them (export or its own import) before they can be redeemed."},"CouponCodePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CouponCodeItem"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"CouponCodeItem":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"code":{"type":"string"},"state":{"$ref":"#/components/schemas/CouponCodeState"},"contactId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"issueSource":{"type":["string","null"]},"issuedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"redeemedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"redeemedOrderId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","code","state","contactId","issueSource","issuedAt","redeemedAt","redeemedOrderId","createdAt"],"additionalProperties":false},"CouponCodeState":{"type":"string","enum":["available","issued","redeemed","void"]},"IssuedCoupon":{"type":"object","properties":{"poolId":{"$ref":"#/components/schemas/Uuid"},"codeId":{"$ref":"#/components/schemas/Uuid"},"code":{"type":"string"},"contactId":{"$ref":"#/components/schemas/Uuid"},"issuedAt":{"$ref":"#/components/schemas/IsoDateTime"},"existing":{"type":"boolean"}},"required":["poolId","codeId","code","contactId","issuedAt","existing"],"additionalProperties":false},"IssueCouponInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"sourceKey":{"type":"string","minLength":1,"maxLength":200}},"required":["contactId","sourceKey"],"additionalProperties":false},"LoyaltyProgramState":{"type":"object","properties":{"program":{"anyOf":[{"$ref":"#/components/schemas/LoyaltyProgram"},{"type":"null"}]}},"required":["program"],"additionalProperties":false},"LoyaltyProgram":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"name":{"type":"string"},"status":{"$ref":"#/components/schemas/LoyaltyProgramStatus"},"earnRules":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyEarnRule"}},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyTier"}},"members":{"type":"object","properties":{"enrolled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byTier":{"type":"array","items":{"type":"object","properties":{"tierKey":{"type":["string","null"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tierKey","count"],"additionalProperties":false}}},"required":["enrolled","byTier"],"additionalProperties":false},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","status","earnRules","tiers","members","revision","createdAt","updatedAt"],"additionalProperties":false},"LoyaltyProgramStatus":{"type":"string","enum":["draft","active","paused"]},"LoyaltyEarnRule":{"type":"object","properties":{"currency":{"$ref":"#/components/schemas/CurrencyCode"},"minorUnitsPerPoint":{"type":"integer","minimum":1,"maximum":1000000}},"required":["currency","minorUnitsPerPoint"],"additionalProperties":false},"LoyaltyTier":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/LoyaltyTierKey"},"name":{"type":"string","minLength":1,"maxLength":60},"threshold":{"type":"integer","minimum":0,"maximum":100000000}},"required":["key","name","threshold"],"additionalProperties":false},"CreateLoyaltyProgramInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"status":{"default":"draft","$ref":"#/components/schemas/LoyaltyProgramStatus"},"earnRules":{"default":[],"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/LoyaltyEarnRule"}},"tiers":{"default":[],"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/LoyaltyTier"}}},"required":["name"],"additionalProperties":false},"UpdateLoyaltyProgramInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"status":{"$ref":"#/components/schemas/LoyaltyProgramStatus"},"earnRules":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/LoyaltyEarnRule"}},"tiers":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/LoyaltyTier"}}},"additionalProperties":false},"LoyaltyMemberPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyMember"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"},"total":{"$ref":"#/components/schemas/CollectionTotal"},"groups":{"description":"Present when the query is grouped, in group order.","type":"array","items":{"$ref":"#/components/schemas/CollectionGroupFacet"}}},"required":["items","nextCursor","asOf","total"],"additionalProperties":false},"LoyaltyMember":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"contactId":{"$ref":"#/components/schemas/Uuid"},"email":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/LoyaltyMemberStatus"},"balance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tierKey":{"type":["string","null"]},"tierName":{"type":["string","null"]},"enrolledAt":{"$ref":"#/components/schemas/IsoDateTime"},"leftAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"provenance":{"$ref":"#/components/schemas/LoyaltyProvenance"},"revision":{"$ref":"#/components/schemas/Revision"},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","contactId","email","status","balance","tierKey","tierName","enrolledAt","leftAt","provenance","revision","createdAt","updatedAt"],"additionalProperties":false},"LoyaltyMemberStatus":{"type":"string","enum":["enrolled","left"]},"LoyaltyProvenance":{"type":"object","properties":{"method":{"$ref":"#/components/schemas/LoyaltyEnrollmentMethod"},"reference":{"type":"string","minLength":1,"maxLength":200},"statement":{"type":"string","minLength":1,"maxLength":500},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"},"recordedByType":{"type":"string"},"recordedAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["method","reference","statement","occurredAt","recordedByType","recordedAt"],"additionalProperties":false},"LoyaltyEnrollmentMethod":{"type":"string","enum":["checkout_opt_in","signup_form","in_store","support_request","account_settings"]},"EnrollLoyaltyMemberInput":{"type":"object","properties":{"contactId":{"$ref":"#/components/schemas/Uuid"},"provenance":{"$ref":"#/components/schemas/LoyaltyProvenanceInput"}},"required":["contactId","provenance"],"additionalProperties":false},"LoyaltyProvenanceInput":{"type":"object","properties":{"method":{"$ref":"#/components/schemas/LoyaltyEnrollmentMethod"},"reference":{"type":"string","minLength":1,"maxLength":200},"statement":{"type":"string","minLength":1,"maxLength":500},"occurredAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["method","reference","statement","occurredAt"],"additionalProperties":false},"LeaveLoyaltyInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false},"LoyaltyPosting":{"type":"object","properties":{"member":{"$ref":"#/components/schemas/LoyaltyMember"},"entry":{"$ref":"#/components/schemas/LoyaltyLedgerEntry"},"existing":{"type":"boolean"}},"required":["member","entry","existing"],"additionalProperties":false},"LoyaltyLedgerEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/Uuid"},"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"$ref":"#/components/schemas/LoyaltyEntryReason"},"orderId":{"anyOf":[{"$ref":"#/components/schemas/Uuid"},{"type":"null"}]},"reference":{"type":"string"},"note":{"type":["string","null"]},"actorType":{"type":"string"},"tierBefore":{"type":["string","null"]},"tierAfter":{"type":["string","null"]},"createdAt":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["id","delta","balanceAfter","reason","orderId","reference","note","actorType","tierBefore","tierAfter","createdAt"],"additionalProperties":false},"LoyaltyEntryReason":{"type":"string","enum":["order","refund","adjustment"]},"AdjustLoyaltyPointsInput":{"type":"object","properties":{"delta":{"type":"integer","minimum":-1000000,"maximum":1000000},"reference":{"type":"string","minLength":1,"maxLength":120},"note":{"type":"string","minLength":1,"maxLength":500}},"required":["delta","reference","note"],"additionalProperties":false},"LoyaltyLedgerPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyLedgerEntry"}},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"asOf":{"$ref":"#/components/schemas/IsoDateTime"}},"required":["items","nextCursor","asOf"],"additionalProperties":false}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Session or scoped service key (identity module)."}}},"tags":[{"name":"account"},{"name":"agency"},{"name":"ai"},{"name":"assets"},{"name":"audit"},{"name":"auth"},{"name":"automation"},{"name":"billing"},{"name":"bounces"},{"name":"branding"},{"name":"campaign-lifecycle"},{"name":"campaigns"},{"name":"channels"},{"name":"commerce"},{"name":"connectors"},{"name":"consent"},{"name":"contacts"},{"name":"content"},{"name":"deliverability"},{"name":"developers"},{"name":"experiments"},{"name":"exports"},{"name":"fields"},{"name":"git-sync"},{"name":"growth"},{"name":"imports"},{"name":"inbox"},{"name":"infrastructure"},{"name":"ingest"},{"name":"internal"},{"name":"lists"},{"name":"mailboxes"},{"name":"mcp"},{"name":"messages"},{"name":"migrations"},{"name":"notifications"},{"name":"oauth"},{"name":"oauth-applications"},{"name":"operations"},{"name":"organization"},{"name":"people"},{"name":"personalization"},{"name":"platform"},{"name":"predictions"},{"name":"privacy"},{"name":"public"},{"name":"publishing"},{"name":"realtime"},{"name":"recipient"},{"name":"reports"},{"name":"routing"},{"name":"scim"},{"name":"segments"},{"name":"smtp"},{"name":"solution-packs"},{"name":"sso"},{"name":"suppressions"},{"name":"templates"},{"name":"tracking"},{"name":"transactional"},{"name":"trust"},{"name":"warmup"},{"name":"webhooks"}]}