From 0ba99c09df4f2a85087f0cd1baf6315870e20377 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Tue, 13 Oct 2026 21:48:59 -0400 Subject: [PATCH 1/6] feat(billing): sync ingest types and decode the new capability denial reasons --- .../fixtures/data/billingCapabilities.ts | 6 + .../src/core/billing/capabilities.test.ts | 31 + .../src/core/billing/capabilityDenials.ts | 42 +- .../billingCapabilities.contract.test.ts | 18 +- .../src/core/billing/scopedReader.test.ts | 6 + .../src/core/billing/topup.test.ts | 6 + .../billing/__fixtures__/billingHarness.ts | 6 + packages/ingest-types/src/types.gen.ts | 989 +++++++++++++++--- packages/ingest-types/src/zod.gen.ts | 143 ++- src/platform/auth/webSessionFlagOn.test.ts | 6 + .../workspace/api/__mocks__/workspaceApi.ts | 6 + .../workspace/api/workspaceApi.test.ts | 21 + .../sdk/billingCapabilitiesView.test.ts | 6 + .../sdk/subscriptionOperationView.test.ts | 14 + .../useBillingCapabilities.test.ts | 6 + 15 files changed, 1148 insertions(+), 158 deletions(-) diff --git a/browser_tests/fixtures/data/billingCapabilities.ts b/browser_tests/fixtures/data/billingCapabilities.ts index 6847efe3075..0f850fabe3e 100644 --- a/browser_tests/fixtures/data/billingCapabilities.ts +++ b/browser_tests/fixtures/data/billingCapabilities.ts @@ -24,6 +24,12 @@ export function createBillingCapabilities( can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: true, diff --git a/packages/account-core/src/core/billing/capabilities.test.ts b/packages/account-core/src/core/billing/capabilities.test.ts index 7baf4d80c78..2e137eaa9fd 100644 --- a/packages/account-core/src/core/billing/capabilities.test.ts +++ b/packages/account-core/src/core/billing/capabilities.test.ts @@ -44,6 +44,12 @@ const CAPABILITIES = { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: false, @@ -395,6 +401,31 @@ describe('createCapabilitiesReader', () => { ) }) + it.for([ + ['can_subscribe_self_serve', 'not_original_owner'], + ['can_subscribe_self_serve', 'creator_only_provisioning'], + ['can_top_up', 'payment_past_due'], + ['can_cancel', 'billing_operation_parked'], + ['can_reactivate', 'cancellation_not_scheduled'], + ['can_delete_workspace', 'plan_not_ended'], + ['can_leave_workspace', 'workspace_creator'], + ['can_leave_workspace', 'only_owner'] + ])('decodes %s denied for %s', async ([capability, reason]) => { + const { scopeSource } = fakeSession() + const { transport } = fakeTransport([ + httpOk(capabilitiesBody({ denied_reasons: { [capability]: reason } })) + ]) + + const result = await createCapabilitiesReader({ + transport, + scopeSource + }).read() + + expect(result.status).toBe('ok') + if (result.status !== 'ok') return + expect(result.value.denials[capability]).toBe(reason) + }) + it('falls back to the generic reason for a value it does not recognize', async () => { const { scopeSource } = fakeSession() const { transport } = fakeTransport([ diff --git a/packages/account-core/src/core/billing/capabilityDenials.ts b/packages/account-core/src/core/billing/capabilityDenials.ts index 386d054245b..fdb17227112 100644 --- a/packages/account-core/src/core/billing/capabilityDenials.ts +++ b/packages/account-core/src/core/billing/capabilityDenials.ts @@ -27,6 +27,23 @@ export type CapabilityDenialReason = | 'subscription_change_in_progress' /** The server has no guidance for the row — distinct from a deliberate refusal. */ | 'subscription_status_unrecognized' + | 'not_original_owner' + | 'creator_only_provisioning' + | 'payment_past_due' + | 'free_plan' + | 'no_subscription' + | 'subscription_ended' + | 'billing_operation_in_progress' + | 'billing_operation_parked' + | 'cancellation_scheduled' + | 'cancellation_not_scheduled' + | 'workspace_sso_attached' + | 'personal_workspace' + | 'plan_not_ended' + | 'membership_managed_by_directory' + | 'personal_workspace_creator' + | 'workspace_creator' + | 'only_owner' /** * A reason outside the set above. Kept as a reason rather than dropped so a * refusal the server explained still reads as explained; the copy it maps to @@ -40,13 +57,30 @@ const KNOWN_REASONS: ReadonlySet = new Set([ 'tier_not_self_serve', 'subscription_not_started', 'subscription_change_in_progress', - 'subscription_status_unrecognized' + 'subscription_status_unrecognized', + 'not_original_owner', + 'creator_only_provisioning', + 'payment_past_due', + 'free_plan', + 'no_subscription', + 'subscription_ended', + 'billing_operation_in_progress', + 'billing_operation_parked', + 'cancellation_scheduled', + 'cancellation_not_scheduled', + 'workspace_sso_attached', + 'personal_workspace', + 'plan_not_ended', + 'membership_managed_by_directory', + 'personal_workspace_creator', + 'workspace_creator', + 'only_owner' ]) /** - * Only `can_subscribe_self_serve` carries a reason today. The record is open - * because the server adds keys as policy grows, and a client that rejected an - * unknown key would fail the whole read over a field it does not use. + * The record is open because the server adds keys as policy grows, and a + * client that rejected an unknown key would fail the whole read over a field + * it does not use. */ export type CapabilityDenials = Readonly< Partial> diff --git a/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts b/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts index cebf19809e1..cccca93eb9a 100644 --- a/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts +++ b/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts @@ -20,6 +20,12 @@ function capabilities(): Capabilities { can_downgrade_to_personal: false, can_invite_members: true, can_manage_members: true, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: true, @@ -44,13 +50,12 @@ function capabilitiesBody( } } -// Compile-time pins: a regen that moves these fails the package typecheck. - -// The five fields the reader composes its own schema from, plus two it leaves out. expectTypeOf().toEqualTypeOf< | 'capabilities' | 'denied_reasons' | 'expires_at' + | 'plan_kind' + | 'recovery_route' | 'resolved_for' | 'revision' | 'rollout_defaults_applied' @@ -59,13 +64,19 @@ expectTypeOf().toEqualTypeOf< expectTypeOf().toEqualTypeOf<{ can_cancel: boolean can_change_seats: boolean + can_delete_workspace: boolean can_downgrade_to_personal: boolean can_invite_members: boolean + can_leave_workspace: boolean + can_manage_billing: boolean can_manage_members: boolean + can_manage_partner_node_access: boolean can_reactivate: boolean can_revert_scheduled_change: boolean can_subscribe_self_serve: boolean can_top_up: boolean + can_view_pending_invites: boolean + can_view_team_usage: boolean }>() expectTypeOf().toEqualTypeOf<{ user_id: string @@ -76,7 +87,6 @@ expectTypeOf().toEqualTypeOf<{ can_subscribe_self_serve: boolean can_top_up: boolean }>() -// The expiry the reader paces freshness from; the revision it reads as a number. expectTypeOf().toEqualTypeOf() expectTypeOf().toEqualTypeOf() diff --git a/packages/account-core/src/core/billing/scopedReader.test.ts b/packages/account-core/src/core/billing/scopedReader.test.ts index 785493abc5b..83d3642f200 100644 --- a/packages/account-core/src/core/billing/scopedReader.test.ts +++ b/packages/account-core/src/core/billing/scopedReader.test.ts @@ -141,6 +141,12 @@ function capabilitiesBody(overrides: Record = {}) { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: false, diff --git a/packages/account-core/src/core/billing/topup.test.ts b/packages/account-core/src/core/billing/topup.test.ts index a2c70b270a9..a9638c2dc90 100644 --- a/packages/account-core/src/core/billing/topup.test.ts +++ b/packages/account-core/src/core/billing/topup.test.ts @@ -93,6 +93,12 @@ const CAPABILITIES = { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: false, diff --git a/packages/account-ui/src/billing/__fixtures__/billingHarness.ts b/packages/account-ui/src/billing/__fixtures__/billingHarness.ts index c61b6982a34..f7492a8f021 100644 --- a/packages/account-ui/src/billing/__fixtures__/billingHarness.ts +++ b/packages/account-ui/src/billing/__fixtures__/billingHarness.ts @@ -115,6 +115,12 @@ export const CAPABILITIES = { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: true, diff --git a/packages/ingest-types/src/types.gen.ts b/packages/ingest-types/src/types.gen.ts index 38df864a305..b39feece029 100644 --- a/packages/ingest-types/src/types.gen.ts +++ b/packages/ingest-types/src/types.gen.ts @@ -61,7 +61,7 @@ export type WorkspaceDeploymentList = { */ gone_default_deployment_id?: string /** - * The deployment this browser had picked, present only when it is no longer one of the workspace's live deployments (deleted, or no longer the workspace's). Every catalog read and submit already ran this browser on Comfy Cloud for it, and this response clears the pick: the pick cookie is rewritten as the explicit Comfy Cloud pick (pick_source `browser`), whether or not the workspace has a live default, so a default an owner sets later does not move this browser. The browser is on Comfy Cloud and picked_deployment_id is absent. The next listing no longer carries it, so the editor tells the person on this response. + * The deployment this browser had picked, present only when it is no longer one of the workspace's live deployments (deleted, or no longer the workspace's). Every catalog read and submit already ran this browser on Comfy Cloud for it. The response leaves the cookie untouched, so an older listing cannot overwrite a newer pick. The stale cookie remains an explicit browser pick (pick_source `browser`), so a workspace default set later does not move this browser. The browser is on Comfy Cloud and picked_deployment_id is absent. Subsequent listings report the same gone id until the cookie changes or expires. */ gone_picked_deployment_id?: string items: Array @@ -480,6 +480,10 @@ export type UsageTimeSeries = { group_labels?: Array groups: Array not_available?: UsageNotAvailable + /** + * `ledger` when `groups` are the usage ledger's keys, which the `filter_*` parameters accept; absent for an invoice-served answer. + */ + served_from?: 'ledger' starting_on: string summary: UsageSummary } @@ -536,14 +540,22 @@ export type UsageSummary = { * Present, with empty groups, buckets and breakdown, when the requested grouping is not served for this workspace. Render as unavailable, not as zero spend. */ export type UsageNotAvailable = { - reason: 'no_attribution_source' + reason: 'no_attribution_source' | 'filter_needs_ledger' } export type UsageGroupLabel = { /** - * Human-readable name for the key: a person's name, a product line's label, or the key's owner and prefix. + * Human-readable name for the key: a person's name, a product line's label, a model's name (`Not specified` for `unspecified`), or the key's owner and prefix. */ display_name?: string + /** + * Only for `person` when the member is known; tells two members with one name apart. + */ + email?: string + /** + * Only for `person`: true when the person is no longer a member of this workspace. Their spend stays under their name. + */ + former_member?: boolean /** * The value as it appears in `groups`, `buckets` and `breakdown`. */ @@ -564,6 +576,10 @@ export type UsageGroupLabel = { * Only for `source` when the key's owner is known. */ owner_display_name?: string + /** + * Only for `source` when the key's owner is known; tells two owners with one name apart. + */ + owner_email?: string /** * Only for `source` when the key is known to this workspace. */ @@ -2121,21 +2137,33 @@ export type PreviewSubscribeRequest = { } /** - * Reason why a plan is unavailable + * Why a plan is unavailable. Present exactly when available is false and + * absent when it is true. Only the first reason that applies is reported, + * in the order below. Render the value as received; do not recompute it. + * same_plan: (a) Why can this plan not be picked? (b) It is the plan the workspace is already on. (c) Absent means the plan is not the current one. (d) Not a refusal of a different plan; see incompatible_transition. (e) The plan slug equals the slug of the workspace's active subscription. + * incompatible_transition: (a) Why is this plan closed for the workspace's current plan? (b) The transition rules never allow it: the Free plan, which is provisioned only through free-tier eligibility, or a switch into the Founders plan. (c) Absent means no such rule applies. (d) Not a temporary state, and not billing_operation_in_progress, billing_operation_parked or annual_to_monthly_unsupported. (e) The target is the Free plan, or the transition matrix refuses the pair for a reason other than annual_to_monthly_unsupported. + * billing_operation_in_progress: (a) Why can no other plan be picked for now? (b) A subscription-changing billing operation is running for the workspace's active subscription. It settles on its own, so a client may say that plans will be available again shortly. (c) Absent means no such operation is running. (d) Not billing_operation_parked, which does not clear on its own, not a successor already scheduled for a future billing boundary, and not a seat problem. (e) The workspace has a non-scheduled active subscription and a subscription-changing billing operation is running and none is parked. + * billing_operation_parked: (a) Why can no other plan be picked until support steps in? (b) A subscription-changing billing operation is parked for reconciliation for the workspace's active subscription: it is either paid but credits not granted, or a replacement subscription that could not finish superseding the old one. It does not clear on its own, so a client must route the user to support and never imply a wait. (c) Absent means no operation is parked. (d) Not billing_operation_in_progress, which settles on its own, not a successor already scheduled for a future billing boundary, and not a seat problem. (e) The workspace has a non-scheduled active subscription and a subscription-changing billing operation is parked; reported instead of billing_operation_in_progress when both exist. + * annual_to_monthly_unsupported: (a) Why can a monthly plan not be chosen from an annual plan? (b) The annual commitment binds, so a move to a higher-tier monthly plan is not supported before the term ends. (c) Absent means the transition is not an annual to higher-tier monthly move. (d) Not a downgrade, which is allowed and scheduled, and not incompatible_transition. (e) The transition matrix refuses the pair with its annual-to-monthly tier upgrade rule. + * exceeds_max_seats: (a) Why is this plan closed to a workspace with many people? (b) The occupied seats exceed the plan's seat limit, counted as the subscribe request counts them: a team plan counts members plus unexpired pending invitations, any other plan counts members alone. (c) Absent means the occupied seats fit the plan. (d) Not a pending-invitation count for non-team plans, where an invitation does not occupy a seat. (e) For a team plan, members + pending invitations is greater than the seat limit; for any other plan, members is greater than the seat limit; a positive workspace override replaces the plan default in both cases. + * requires_team and requires_personal are part of this enum but are not reported today. */ export type PlanAvailabilityReason = | 'same_plan' | 'incompatible_transition' + | 'billing_operation_in_progress' + | 'billing_operation_parked' + | 'annual_to_monthly_unsupported' + | 'exceeds_max_seats' | 'requires_team' | 'requires_personal' - | 'exceeds_max_seats' /** * Availability and eligibility information for a billing plan. */ export type PlanAvailability = { /** - * Whether the workspace can subscribe to this plan + * Whether the workspace can switch to this plan right now. False exactly when reason is present. */ available: boolean reason?: PlanAvailabilityReason @@ -2399,7 +2427,7 @@ export type ErrorResponse = { } message: string /** - * On `sso_required`: the SSO organization the caller must sign in with (its WorkOS id, `org_...`), the value `GET /api/auth/sso/start?organization=` takes: the organization that owns the account's email domain, else the workspace's. Absent when no sign-in would admit the caller (an account another organization holds, in an SSO organization's workspace), when unknown, and on every other code. + * On `sso_required`: the SSO organization the caller must sign in with (its WorkOS id, `org_...`), the value `GET /api/auth/sso/start?organization=` takes: the organization that owns the account's email domain, else the workspace's. Absent when no sign-in would admit the caller (an account another organization holds, in an SSO organization's workspace), when unknown, and on every other code but `account_outside_organization`, where it is the workspace's organization, which no sign-in of the account joins. */ organization_id?: string } @@ -3259,8 +3287,7 @@ export type InputUploadUrlRequest = { * MIME type of the file to upload. Must be one of the image types * image/jpeg, image/png, image/webp, image/gif, the audio types * audio/mpeg, audio/mp3, audio/wav, audio/wave, audio/x-wav, - * audio/flac, audio/x-flac, audio/ogg, or — where the deployment has - * enabled video input uploads — the video types video/mp4, + * audio/flac, audio/x-flac, audio/ogg, or the video types video/mp4, * video/webm, video/quicktime. * Advisory: the stored asset's format always follows the uploaded * bytes as identified server-side (decoded for images, sniffed for @@ -3967,6 +3994,18 @@ export type ExchangeTokenResponse = { * */ export type ExchangeTokenRequest = { + /** + * What the token is for. Omitted mints today's workspace token. + * `partner-node` mints a partner-node token: audience + * `comfy-partner-node` only, a `sid` claim naming a new renewable + * session, and the partner-node lifetime. Only a sign-in mints one + * (a Firebase JWT or the web session); an API key gets 403 + * `partner_node_requires_sign_in`. While the mint is switched off + * it is 503 `partner_node_token_disabled`. Any other value is 400 + * `resource_invalid`. + * + */ + resource?: 'partner-node' /** * Workspace ID to get token for. Defaults to personal workspace if omitted. */ @@ -4889,6 +4928,14 @@ export type BillingEventsResponse = { * A single history event. The cloud history-events store is the single source of truth for both billing events (charges, credits, adjustments) and user-facing usage events. */ export type BillingEvent = { + /** + * That key's name, when the key is known to this workspace (revoked keys included). + */ + api_key_name?: string + /** + * The API key the charge came through, from the event's `spend_source`; absent for a signed-in session or a deployment. + */ + api_key_prefix?: string /** * When the event occurred */ @@ -4901,6 +4948,22 @@ export type BillingEvent = { * Type of history event. Billing types (e.g. invoice_paid, checkout_completed, topup_completed) and the migrated user-facing usage types (account_created, credit_added, api_usage_completed, cloud_subscription_created, cloud_subscription_paid, cloud_subscription_credit_added, cloud_workflow_executed, free_tier_credit_granted). Kept as a free-form string for back-compat with existing billing-event consumers. */ event_type: string + /** + * That member's name, or their email when they have no name set. + */ + member_display_name?: string + /** + * That member's email, so two members with one name can be told apart. + */ + member_email?: string + /** + * True when that person is no longer a member of this workspace. + */ + member_former?: boolean + /** + * The member the charge counts toward, from the event's `user_id`; absent when the event names none. + */ + member_user_id?: string /** * Event-specific parameters */ @@ -4976,12 +5039,24 @@ export type BillingCapabilityRolloutDefaults = { * names the policy branch that decided, not customer-facing wording: the * client owns the message. * + * How to read this: render each capability from `capabilities` as received, and + * use a reason only to explain a capability that is false. Never recombine + * capabilities or reasons into a new decision, and never derive a reason from + * tier, role, status or plan slug. A missing reason is not a grant. A refused + * capability usually has a key here naming the branch that refused it. A false + * capability with no matching key is an unexplained refusal: no recognised + * explanation, still false. A true capability never has a key. + * Within a key the values are listed in the order the resolver reaches them, + * and the first one reached is the one reported. Capabilities are UI guidance, + * not authorization: the write endpoints decide. + * * The invariant runs one way only. **Presence implies refusal**: a key is * present only alongside `capabilities. == false`, reconciled before * the response is built, so a reason never accompanies a granted - * capability. **Absence implies nothing** -- it means no recognised - * explanation, not that the capability was granted. Consult - * `capabilities`, which stays authoritative for what the client may offer. + * capability. **Absence implies nothing**: on a false capability it + * means no recognised explanation, and on a true capability it is the + * expected state. Consult `capabilities`, which stays authoritative for what + * the client may offer. * * A key is absent for a refused capability whenever this service is * talking to a billing-api that predates the field, and whenever it drops @@ -4996,22 +5071,295 @@ export type BillingCapabilityRolloutDefaults = { */ export type BillingCapabilityDenials = { /** - * not_a_member is unreachable through this endpoint -- a non-member is - * answered 403 before capabilities resolve. subscription_not_started - * is a subscription row reserved before payment that never began. - * subscription_change_in_progress means the current subscription - * already has a successor scheduled for a future billing boundary. - * subscription_status_unrecognized is the server having no guidance - * for the row, as distinct from a deliberate refusal. + * Present only when can_cancel is false. The value names the resolver branch + * that decided, not customer wording. Values are listed in the order the + * resolver reaches them; the first one reached wins. cancellation_scheduled, + * subscription_ended, subscription_not_started and + * subscription_status_unrecognized belong to different subscription statuses and + * are alternatives that never compete. Absent while the capability is false + * means no recognised explanation, not a grant. + * - not_a_member: the caller is not a member of the workspace. Unreachable + * over HTTP: a non-member is answered 403 before capabilities resolve. + * - not_workspace_owner: the caller is a member whose role is not owner. Not + * the same as not_a_member. + * - not_original_owner: the caller is an owner but not the workspace's creator; + * only the creator may start, change, cancel or reactivate the plan. Reached + * after not_workspace_owner. Reported only when the rollout mode is not + * `owner`. Not not_workspace_owner (role) and not creator_only_provisioning + * (provisioning a personal workspace's billing identity). + * - free_plan: the current tier is FREE. Checked on the tier alone, whatever + * the status, and before the no-subscription check. A FREE plan is not a paid + * subscription, so there is nothing to cancel. + * - no_subscription: there is no subscription row and the server treats that + * absence as authoritative. Where the absence is only unknown (a legacy + * Stripe workspace) can_cancel stays true and no reason is sent. A leftover + * reserved row with no live operation behind it, on a self-serve tier, is + * reported as no subscription. + * - tier_not_self_serve: the subscription's tier is sales-managed or + * unrecognised, so its lifecycle is not customer-driven. + * - billing_operation_in_progress: an initial subscription, plan change, + * cancel, resubscribe, seat change, revert or retention offer is running, + * either a pending workflow or the retention-offer gate between the Stripe + * write and its confirmation. It settles on its own, so a client may tell the + * user to wait, and cancel is refused until it does. Not + * subscription_change_in_progress, where a successor plan is scheduled. Not + * evaluated for a reserved subscription, which reports + * subscription_not_started. Reached before cancellation_scheduled. + * - billing_operation_parked: such an operation is parked for reconciliation, + * either paid but credits not granted or a replacement subscription that + * could not finish superseding the old one. It does not clear on its own, so + * a client must route the user to support and never imply a wait. Reported + * instead of billing_operation_in_progress when both kinds exist, and reached + * at the same point, before cancellation_scheduled. + * - cancellation_scheduled: a cancellation is already scheduled, so cancelling + * again is refused. The opposite of cancellation_not_scheduled on + * can_reactivate. + * - subscription_ended: the subscription has stopped for good: ended, or + * canceled with no cancellation date. Never competes with + * billing_operation_in_progress or billing_operation_parked, which a stopped + * subscription does not evaluate. + * - subscription_not_started: a subscription row is reserved but not running. + * Not no_subscription (no row at all) and not subscription_ended. + * - subscription_status_unrecognized: the subscription status is one the + * resolver has no guidance for. The server is undetermined, which is not a + * deliberate refusal. * */ - can_subscribe_self_serve?: + can_cancel?: | 'not_a_member' | 'not_workspace_owner' + | 'not_original_owner' + | 'free_plan' + | 'no_subscription' | 'tier_not_self_serve' + | 'billing_operation_in_progress' + | 'billing_operation_parked' + | 'cancellation_scheduled' + | 'subscription_ended' | 'subscription_not_started' + | 'subscription_status_unrecognized' + /** + * Present only when can_delete_workspace is false. The value names the + * resolver branch that decided, not customer wording. The list follows the + * order the resolver reaches the branches, and the first one reached wins. + * Absent while the capability is false means no recognised explanation, not + * a grant: a fact could not be read, or the team-workspaces feature is off. + * - not_a_member: the caller is not a member of the workspace. Unreachable + * through this endpoint: a non-member is answered 403 before capabilities + * resolve. + * - not_workspace_owner: the caller is a member whose role is not owner. A + * non-owner is told nothing below this branch, so it never learns whether + * an SSO organization holds the workspace. + * - workspace_sso_attached: the workspace belongs to an SSO organization and + * only an operator detach can delete it. + * - personal_workspace: a personal workspace, which is never deleted. + * - billing_operation_in_progress: an initial subscription, plan change, + * cancel, resubscribe, seat change, revert or retention offer is running, + * either a pending workflow or the retention-offer gate between the + * Stripe write and its confirmation. It settles on its own, so a client + * may tell the user to wait. The same fact as the reason of that name on + * can_cancel and can_reactivate. Not plan_not_ended, which is about a + * subscription row. + * - billing_operation_parked: such an operation is parked for + * reconciliation, either paid but credits not granted or a replacement + * subscription that could not finish superseding the old one. It does + * not clear on its own, so a client must route the user to support and + * never imply a wait. Reported instead of billing_operation_in_progress + * when both kinds exist. The same fact as the reason of that name on + * can_cancel and can_reactivate. + * - plan_not_ended: a subscription row is still live, so deleting the + * workspace would leave the plan charging. Live means active, or canceled + * with no cancellation date or one still in the future; ended and reserved + * rows do not count. Reached after billing_operation_in_progress and + * billing_operation_parked. + * + */ + can_delete_workspace?: + | 'not_a_member' + | 'not_workspace_owner' + | 'workspace_sso_attached' + | 'personal_workspace' + | 'billing_operation_in_progress' + | 'billing_operation_parked' + | 'plan_not_ended' + /** + * Present only when can_leave_workspace is false. The value names the + * resolver branch that decided, not customer wording. The list follows the + * order the resolver reaches the branches, and the first one reached wins. + * Absent while the capability is false means no recognised explanation, not + * a grant: a fact could not be read, or the team-workspaces feature is off. + * - not_a_member: the caller is not a member of the workspace. Unreachable + * through this endpoint: a non-member is answered 403 before capabilities + * resolve. + * - membership_managed_by_directory: the workspace's SSO organization is + * attached and holds this account, so the membership is the organization's + * to manage and leaving would strand an SSO account with no workspace. + * - personal_workspace_creator: the caller created this personal workspace + * and can never leave it. Not personal_workspace on can_delete_workspace, + * which is about deleting the workspace. + * - workspace_creator: the caller created this team workspace and can never + * leave it, even while other owners remain. Reached after + * personal_workspace_creator and before only_owner, which a creator who + * is the sole owner therefore never sees. + * - only_owner: the caller is the sole owner, so leaving would leave the + * workspace with no owner. Another owner must exist first. + * + */ + can_leave_workspace?: + | 'not_a_member' + | 'membership_managed_by_directory' + | 'personal_workspace_creator' + | 'workspace_creator' + | 'only_owner' + /** + * Present only when can_reactivate is false. The value names the resolver + * branch that decided, not customer wording. Values are listed in the order the + * resolver reaches them; the first one reached wins. cancellation_not_scheduled, + * subscription_ended, subscription_not_started and + * subscription_status_unrecognized belong to different subscription statuses and + * are alternatives that never compete. Absent while the capability is false + * means no recognised explanation, not a grant. + * - not_a_member: the caller is not a member of the workspace. Unreachable + * over HTTP: a non-member is answered 403 before capabilities resolve. + * - not_workspace_owner: the caller is a member whose role is not owner. Not + * the same as not_a_member. + * - not_original_owner: the caller is an owner but not the workspace's creator; + * only the creator may start, change, cancel or reactivate the plan. Reached + * after not_workspace_owner. Reported only when the rollout mode is not + * `owner`. Not not_workspace_owner (role) and not creator_only_provisioning + * (provisioning a personal workspace's billing identity). + * - no_subscription: there is no subscription row, so there is nothing to + * reactivate. Unlike can_cancel, reported even where the absence is only + * unknown, because reactivation needs a subscription id that does not exist + * without a row. + * - tier_not_self_serve: the subscription's tier is sales-managed or + * unrecognised, so its lifecycle is not customer-driven. + * - billing_operation_in_progress: an initial subscription, plan change, + * cancel, resubscribe, seat change, revert or retention offer is running, + * either a pending workflow or the retention-offer gate between the Stripe + * write and its confirmation. It settles on its own, so a client may tell the + * user to wait, and reactivate is refused until it does. Not + * subscription_change_in_progress, where a successor plan is scheduled. Not + * evaluated for a reserved subscription, which reports + * subscription_not_started. Reached before cancellation_not_scheduled. + * - billing_operation_parked: such an operation is parked for reconciliation, + * either paid but credits not granted or a replacement subscription that + * could not finish superseding the old one. It does not clear on its own, so + * a client must route the user to support and never imply a wait. Reported + * instead of billing_operation_in_progress when both kinds exist, and reached + * at the same point, before cancellation_not_scheduled. + * - cancellation_not_scheduled: the subscription is running with no + * cancellation scheduled, so there is nothing to undo. The opposite of + * cancellation_scheduled on can_cancel. A FREE plan reports this too, since + * free_plan is a reason for can_cancel only. + * - subscription_ended: the subscription has stopped for good: ended, or + * canceled with no cancellation date. A plan that has ended is not recovered + * by reactivating; can_subscribe_self_serve is the way back. + * - subscription_not_started: a subscription row is reserved but not running. + * Not no_subscription (no row at all) and not subscription_ended. + * - subscription_status_unrecognized: the subscription status is one the + * resolver has no guidance for. The server is undetermined, which is not a + * deliberate refusal. + * + */ + can_reactivate?: + | 'not_a_member' + | 'not_workspace_owner' + | 'not_original_owner' + | 'no_subscription' + | 'tier_not_self_serve' + | 'billing_operation_in_progress' + | 'billing_operation_parked' + | 'cancellation_not_scheduled' + | 'subscription_ended' + | 'subscription_not_started' + | 'subscription_status_unrecognized' + /** + * Present only when can_subscribe_self_serve is false. The value names the + * resolver branch that decided, not customer wording. Values are listed in the + * order the resolver reaches them; the first one reached wins. + * subscription_not_started and subscription_status_unrecognized are + * alternatives for different subscription statuses and never compete. Absent + * while the capability is false means no recognised explanation, not a grant. + * - not_a_member: the caller is not a member of the workspace. Unreachable + * over HTTP: a non-member is answered 403 before capabilities resolve. + * - not_workspace_owner: the caller is a member whose role is not owner. Not + * the same as not_a_member. + * - not_original_owner: the caller is an owner but not the workspace's creator; + * only the creator may start, change, cancel or reactivate the plan. Reached + * after not_workspace_owner. Reported only when the rollout mode is not + * `owner`. Not not_workspace_owner (role) and not creator_only_provisioning + * (provisioning a personal workspace's billing identity). + * - creator_only_provisioning: the caller is an owner but not the creator of a + * personal workspace whose billing identity (Stripe customer, Metronome + * customer or Metronome contract) is not provisioned yet. Subscribing + * provisions it first, and only the creator may. The same reason appears on + * can_top_up. When the rollout mode is not `owner`, such an owner is told + * not_original_owner first, so this reason is reached only in mode `owner`. + * - tier_not_self_serve: the subscription's tier is sales-managed or + * unrecognised, so its lifecycle is not customer-driven. + * - subscription_change_in_progress: the current subscription already has a + * successor plan scheduled for a future billing boundary. Reached before + * subscription_not_started and subscription_status_unrecognized. Not + * billing_operation_in_progress, which names an operation that is running or + * parked and is a reason for can_cancel and can_reactivate only. + * - subscription_not_started: a subscription row is reserved but not running + * and no live checkout can safely be resumed for it. Not no_subscription (no + * row at all) and not subscription_ended (a plan that ran and stopped). + * - subscription_status_unrecognized: the subscription status is one the + * resolver has no guidance for. The server is undetermined, which is not a + * deliberate refusal. + * + */ + can_subscribe_self_serve?: + | 'not_a_member' + | 'not_workspace_owner' + | 'not_original_owner' + | 'creator_only_provisioning' + | 'tier_not_self_serve' | 'subscription_change_in_progress' + | 'subscription_not_started' | 'subscription_status_unrecognized' + /** + * Present only when can_top_up is false. The value names the resolver branch that + * decided, not customer wording. Values are listed in the order the resolver + * reaches them; the first one reached wins. Absent while the capability is + * false means no recognised explanation, not a grant. A running sales-managed + * plan keeps top-up open and carries no reason. + * - not_a_member: the caller is not a member of the workspace. Unreachable + * over HTTP: a non-member is answered 403 before capabilities resolve. + * - not_workspace_owner: the caller is a member whose role is not owner. Not + * the same as not_a_member. + * - creator_only_provisioning: the caller is an owner but not the creator of a + * personal workspace whose billing identity (Stripe customer, Metronome + * customer or Metronome contract) is not provisioned yet. A top-up provisions + * it first, and only the creator may. The same reason appears on + * can_subscribe_self_serve; can_manage_billing is false there too, without a + * reason. Reached before payment_past_due. + * - payment_past_due: the workspace billing status is payment_failed or paused. + * Credits bought now could not be spent until the failed subscription payment + * is resolved, so the customer resolves it first. Reported before free_plan and + * no_subscription, so a past-due workspace is told about the payment first. + * - free_plan: the current tier is FREE, checked on the tier alone. A FREE plan + * is not a paid subscription; subscribe first. The same state as + * no_subscription for top-up purposes. + * - no_subscription: there is no subscription row and the server treats that + * absence as authoritative. Where the absence is only unknown (a legacy + * Stripe workspace) can_top_up stays true and no reason is sent. + * - subscription_ended: the subscription has stopped for good: ended, or + * canceled with no cancellation date. Applies to a self-serve plan and to a + * sales-managed plan whose term has ended; a running sales-managed plan is not + * refused. + * + */ + can_top_up?: + | 'not_a_member' + | 'not_workspace_owner' + | 'creator_only_provisioning' + | 'payment_past_due' + | 'free_plan' + | 'no_subscription' + | 'subscription_ended' } /** @@ -5024,6 +5372,40 @@ export type BillingCapabilitiesResponse = { * Time after which the client must refetch this snapshot. */ expires_at: string + /** + * Who runs the plan lifecycle. Rendered as received; never derive it from + * tier names or slugs. + * - none: the workspace has no subscription in the capability facts. An + * orphaned reserved row on a self-serve tier is reported as none. + * - self_serve: a subscription on a tier with a customer-driven lifecycle, + * including a FREE plan. + * - sales_managed: a subscription on a sales-managed tier. It also covers a + * tier the resolver does not recognise. + * It classifies the plan by tier only. It says nothing about whether the plan + * is running (a reserved or ended subscription still has a kind) and nothing + * about what the user may do; that is capabilities. Absent in the same cases as + * recovery_route. + * + */ + plan_kind?: 'none' | 'self_serve' | 'sales_managed' + /** + * Where the customer goes when the plan has ended. Rendered as received; + * never derive it from tier names or slugs. + * - none: there is no subscription, or it has not stopped for good (a + * canceled plan that still has a cancellation date has not). + * - resubscribe: the subscription has stopped for good (ended, or canceled + * with no cancellation date) on a self-serve tier. The route is subscribing + * again. + * - contact_sales: the subscription has stopped for good on a sales-managed + * or unrecognised tier. The route is through sales. + * It names the route only and deliberately ignores the user's role. Whether + * the control is enabled stays with capabilities.can_subscribe_self_serve + * and its denied reason. It is not a capability and not authorization. + * Absent when billing is disabled, when talking to a billing-api version + * that predates it, and when the upstream value is not recognised. + * + */ + recovery_route?: 'none' | 'resubscribe' | 'contact_sales' resolved_for: BillingCapabilityScope /** * JavaScript-safe, time-sortable revision for this snapshot. It @@ -5048,23 +5430,318 @@ export type BillingCapabilitiesResponse = { * Conservative UI guidance. These values do not authorize billing writes; * each write endpoint independently enforces its permission policy. * + * Each field answers one UI question for the authenticated user in the + * authenticated workspace. Render each as received and never combine fields + * into a new decision. False without a matching key in denied_reasons means no + * recognised explanation, not necessarily a refusal. A field is never + * per-surface: one value serves every screen. The plan-lifecycle fields + * (can_subscribe_self_serve, can_cancel, can_reactivate, + * can_revert_scheduled_change) require the workspace's creator only when the + * rollout mode is not `owner`; every other owner-level field stays open to + * every owner. + * + * When the deployment has billing disabled, this endpoint answers without + * consulting billing-api: can_top_up is true, can_manage_members and + * can_invite_members follow the owner role, and every other field is false. + * */ export type BillingCapabilities = { + /** + * - Answers: should the client offer cancelling the subscription? + * - True: the user is a workspace owner (the workspace's creator when the + * rollout mode is not `owner`) of a paid self-serve subscription that is + * running with no cancellation scheduled and no billing operation in flight. + * It is also true where there is no local subscription row but that absence + * is not authoritative (the state is unknown, not none). + * - False: denied_reasons.can_cancel names the branch that decided. False + * without that key means no recognised explanation, not necessarily a + * refusal, for example when billing-api predates the field. + * - Not: authorization (the cancel route enforces its own rules). Not + * can_reactivate, which undoes a scheduled cancellation, and not + * can_subscribe_self_serve. Not can_top_up or can_manage_billing, which stay + * open to every owner. A FREE plan is not a paid subscription, so it has + * nothing to cancel. + * - False when: the user is not an owner; the user is an owner who is not the + * workspace's creator (rollout mode not `owner`); the tier is FREE; there is no + * subscription row and the absence is authoritative; the tier is + * sales-managed or unrecognised; the subscription is reserved but not + * running; its status is not recognised; it has ended or been canceled for + * good; a billing operation is running or parked; a cancellation is already + * scheduled. + * + */ can_cancel: boolean + /** + * - Answers: should the client offer changing the seat quantity of the + * subscription? + * - True: the user is a workspace owner with a subscription row on a + * self-serve tier whose status is active, or canceled with a cancellation + * date still set. + * - False: never explained. There is no denied_reasons key for this field, so + * false without a reason is the normal case, not a gap. + * - Not: authorization (the seat-change route enforces its own rules). Not room + * to invite (can_invite_members) and not member management + * (can_manage_members). The resolver tests the tier only against the + * self-serve list and does not check that the plan is seat-based, so true + * does not mean the plan has seats to change: an owner on a FREE plan gets + * true. A scheduled cancellation, a scheduled successor plan, a running + * billing operation and a past-due payment do not change it. + * - False when: the user is not an owner; there is no subscription row, even + * where that absence is only unknown; the tier is sales-managed or + * unrecognised; the subscription is reserved but not running; its status is + * not recognised; it has ended or been canceled for good. + * + */ can_change_seats: boolean + /** + * - Answers: should the client offer deleting this workspace? + * - True: the user is an owner of a team workspace and, when the answer was + * read, the workspace is not attached to an SSO organization, has no + * subscription-changing billing operation running or parked, and has no + * live subscription. + * - False: denied_reasons.can_delete_workspace names the branch that + * decided. False without that key means no recognised explanation, not a + * refusal: a fact it depends on could not be read, or the team-workspaces + * feature is off. + * - Not: authorization. It reports what the DELETE /api/workspaces/{id} + * handler would decide; the handler stays authoritative and re-checks under + * the workspace lock, so this answer can be stale. Not a billing + * capability: use can_cancel to ask about cancelling a subscription. + * - False when: the user is not an owner; the workspace is personal; the + * workspace is attached to an SSO organization; a billing operation is + * running or parked; a subscription is still live; a dependent fact could + * not be read; the team-workspaces feature is off. + * + */ + can_delete_workspace: boolean + /** + * - Answers: may the user downgrade the workspace's subscription to a personal + * plan? + * - True: not in practice today. billing-api forces this field to false in + * every response, a retired rollout's closed default, so a client must not + * wait for it to become true. + * - False: always on this server version. There is no denied_reasons key for + * this field. + * - Not: authorization. Not the same as + * rollout_defaults_applied.can_downgrade_to_personal, which is true by design + * and says nothing about this value. + * - Before that override the resolver would grant it only to the workspace's + * original owner (its creator) who also has the owner role, on a running + * self-serve subscription with no successor plan scheduled. + * + */ can_downgrade_to_personal: boolean + /** + * - Answers: should the client offer sending a new workspace invitation right + * now? + * - True: the user is a workspace owner and the workspace has room: members + * plus unexpired pending invitations are below the seat limit, or the limit + * is not positive (unlimited). + * - False: never explained. There is no denied_reasons key for this field. + * - Not: authorization (invitation creation enforces the same limit itself). + * Not member management (can_manage_members) and not buying seats + * (can_change_seats). Pending invitations count toward capacity. The + * resolver ignores tier, subscription status, cancellation and past-due + * payment; only the seat limit, which can come from the active plan, reflects + * the plan. + * - False when: the user is not an owner; the seat limit is 1 (the limit is the + * workspace override if set, else the active plan's default max seats, and + * defaults to one seat with no active subscription); members plus unexpired + * pending invitations have reached the limit; the capacity could not be + * read, which fails closed. + * + */ can_invite_members: boolean /** - * Workspace owner may manage members independently of seat quantity and subscription lifecycle. Individual target restrictions still apply. + * - Answers: should the client offer leaving this workspace? + * - True: the user is a member and no branch below applies. A plain member + * of a team workspace who did not create it can leave; an owner who did + * not create it can leave only when another owner remains. + * - False: denied_reasons.can_leave_workspace names the branch that decided. + * False without that key means no recognised explanation, not a refusal: a + * fact it depends on could not be read, or the team-workspaces feature is + * off. + * - Not: authorization. It reports what POST /api/workspace/leave would + * decide for the authenticated workspace; the route stays authoritative. + * Not can_delete_workspace: leaving ends one membership, deleting removes + * the workspace. + * - False when: the user is not a member; the membership is managed by the + * workspace's SSO organization; the user created this personal workspace; + * the user created this team workspace; the user is the only owner. + * + */ + can_leave_workspace: boolean + /** + * - Answers: should the client offer payment-method, invoice, payment-update + * and company-details management? + * - True: the user is a member of the workspace whose role is owner, except in + * the false case below. + * - False: never explained. There is no denied_reasons key for this field. + * - Not: authorization. Not member management (can_manage_members) and not + * buying or subscribing (can_top_up, can_subscribe_self_serve). Independent + * of tier, subscription status, cancellation, past-due payment, a running + * billing operation and invite capacity. + * - False when: the user is not an owner, or is a non-creator owner of a + * personal workspace that is missing a billing provider id (not yet + * provisioned). + * + */ + can_manage_billing: boolean + /** + * - Answers: should the client offer member-management controls? + * - True: the user is a member of the workspace whose role is owner. + * - False: never explained. There is no denied_reasons key for this field. + * - Not: authorization; individual target restrictions still apply. Not invite + * capacity (can_invite_members), seat quantity (can_change_seats) or billing + * management (can_manage_billing). Independent of tier, subscription status, + * cancellation, past-due payment and billing provisioning. + * - False when: the user is not a member, or is a member whose role is not + * owner. Nothing else closes it. + * */ can_manage_members: boolean + /** + * - Answers: should the client offer changing the workspace's partner node + * (partner provider) access policy? + * - True: the user is an owner and the workspace holds the partner + * governance entitlement. + * - False: never explained. There is no denied_reasons key for this field. + * False covers a missing entitlement, an entitlement that could not be + * read, a non-owner and the team-workspaces feature being off. + * - Not: authorization. It mirrors the owner-only PUT + * /api/workspace/provider-policy, which replaces the whole policy document + * and stays authoritative. Not whether the policy may be read: GET + * /api/workspace/provider-policy is available to members and answers 403 + * FEATURE_NOT_ENABLED without the entitlement. Not can_manage_members. + * - False when: the user is not an owner; the workspace lacks the partner + * governance entitlement; the entitlement could not be read; the + * team-workspaces feature is off. + * + */ + can_manage_partner_node_access: boolean + /** + * - Answers: may the user undo a SCHEDULED cancellation on a subscription that + * is still running? + * - True: the user is a workspace owner (the workspace's creator when the + * rollout mode is not `owner`), the subscription is active or canceled with a + * cancellation date still set (running until that date), and no billing + * operation is in flight. + * - False: denied_reasons.can_reactivate names the branch that decided. False + * without that key means no recognised explanation, not necessarily a + * refusal, for example when billing-api predates the field. + * - Not: authorization (the resubscribe route enforces its own rules). Not a + * way back from a plan that has ended: that is can_subscribe_self_serve, + * which stays open there. Not an undo of a scheduled plan change, which is + * can_revert_scheduled_change. Not can_top_up or can_manage_billing, which stay + * open to every owner. + * - False when: the user is not an owner; the user is an owner who is not the + * workspace's creator (rollout mode not `owner`); there is no subscription row at all, + * even where that absence is only unknown; the tier is sales-managed or + * unrecognised; the subscription is reserved but not running; its status is + * not recognised; it has ended or been canceled for good; a billing + * operation is running or parked; no cancellation is scheduled. + * + */ can_reactivate: boolean /** - * Stripe-billed only; false within 1 hour of the change. + * - Answers: may the user undo a plan change that is already scheduled for a + * future billing boundary? + * - True: the user is a workspace owner (the workspace's creator when the + * rollout mode is not `owner`), the subscription is Stripe-billed and has a + * pending scheduled change from it, and the revert window is open: more than + * one hour before the change takes effect and, when reverting would restore a + * cancellation, more than one hour before that cancellation date. + * - False: never explained. There is no denied_reasons key for this field, so + * it does not say which of the conditions failed, including that the user is + * an owner who is not the creator. + * - Not: authorization. Not can_reactivate (undo a scheduled cancellation) and + * not can_subscribe_self_serve. Not can_top_up or can_manage_billing, which + * stay open to every owner. When subscribe is refused with + * subscription_change_in_progress, a successor plan is scheduled; this field + * says whether that change can still be reverted. + * - False when: the user is not an owner; the user is an owner who is not the + * workspace's creator (rollout mode not `owner`); there is no pending + * scheduled change from this subscription; the cutoff has passed; the tier is + * sales-managed or unrecognised; the subscription has ended or been canceled + * for good. + * */ can_revert_scheduled_change: boolean + /** + * - Answers: may this user start, recover or change a self-serve plan? + * - True: the user is a workspace owner and no resolver branch closed it. When + * the rollout mode is not `owner`, the user must also be the workspace's + * creator; in mode `owner` any owner qualifies. That includes a workspace + * with no plan, a running self-serve plan, and a plan that has ended or been + * canceled for good, where it stays open because it is the only path back. + * - False: the user is not an owner, the user is an owner who is not the + * workspace's creator (rollout mode not `owner`), the user is a non-creator + * owner of a personal workspace whose billing is not yet provisioned, the + * tier is sales-managed or unrecognised, a successor plan is already + * scheduled, the subscription is reserved but not running and has no + * recoverable checkout, or its status is not recognised. + * denied_reasons.can_subscribe_self_serve names the branch that decided. + * False without that key means no recognised explanation, not necessarily a + * refusal, for example when billing-api predates the field. + * - Not: authorization (the subscribe route enforces its own rules). Not + * can_top_up (buy credits) or can_manage_billing, which stay open to every + * owner. Not can_reactivate (undo a scheduled cancellation) or can_cancel. + * One value serves every surface; there is no per-surface variant. + * + */ can_subscribe_self_serve: boolean + /** + * - Answers: should the client offer buying credits? + * - True: the user is a workspace owner and none of the false conditions below + * applies. A sales-managed tier stays true while its subscription is not + * terminal, because the contract, not the subscription row, entitles the + * customer to buy credits. + * - False: denied_reasons.can_top_up names the branch that decided. False + * without that key means no recognised explanation, not necessarily a + * refusal, for example when billing-api predates the field. + * - Not: authorization (the top-up route enforces its own rules). Not + * can_subscribe_self_serve, which starts or recovers a plan. Cloud policy is + * that credits are not for sale with no plan, a FREE plan, an ended plan or a + * past-due payment. + * - False when: the user is not an owner; the user is a non-creator owner of a + * personal workspace whose billing is not yet provisioned; the tier is FREE, + * or there is no subscription and the absence is authoritative (where the + * absence is only unknown the field stays true); the workspace billing status + * is payment_failed or paused (past due); the subscription has ended or been + * canceled for good, on a self-serve or a sales-managed tier. + * + */ can_top_up: boolean + /** + * - Answers: should the client show the workspace's invitation list? + * - True: the user is a member of the workspace whose role is owner. + * - False: never explained. There is no denied_reasons key for this field. + * False means the user is not an owner, the team-workspaces feature is off, + * or the membership could not be read. + * - Not: authorization. It mirrors the owner-only GET /api/workspace/invites + * route, which stays authoritative and lists every invitation including + * expired ones, despite the word pending. Not room to send a new invitation + * (can_invite_members) and not member management (can_manage_members). + * - False when: the user is not an owner; the team-workspaces feature is + * off; the membership could not be read. + * + */ + can_view_pending_invites: boolean + /** + * - Answers: may the user see the whole-workspace usage attribution + * breakdown rather than only their own rows? + * - True: the user is an owner and the usage-attribution feature is enabled. + * - False: never explained. There is no denied_reasons key for this field. + * - Not: whether the usage route is reachable. GET + * /api/billing/usage/timeseries answers any authenticated workspace member, + * and with attribution enabled a non-owner's attribution groupings are + * limited to their own rows. Not authorization, and not a billing + * capability. + * - False when: the user is not an owner; usage attribution is not enabled; + * the team-workspaces feature is off; the membership could not be read. + * + */ + can_view_team_usage: boolean } /** @@ -5688,7 +6365,7 @@ export type AgentPendingAsk = */ export type AgentMessage = { /** - * Message payload. User turns carry {text, attachments?, attachment_refs?, workflow_references?}. Attachments are the input-image filenames from the request. attachment_refs is the server's own resolution of those same filenames to library assets, as {name, id?, kind?, display_name?} objects. display_name preserves the original user-facing filename when name is an opaque storage key. To bound denormalized data, repeated entries with the same name carry display_name only on the first occurrence; clients should apply it to every entry sharing that name. The sibling exists so a later turn in the thread can reach an earlier turn's file — clients should keep reading attachments. workflow_references is an optional array of explicit non-target references, each with workflow_id and name (an empty string when no name was supplied). An optional unavailable: true records that the reference could not be authorized at turn start, without distinguishing unknown IDs, inaccessible workflows, or lookup failures. These entries preserve the user's reference intent without exposing workflow content; the frontend restores reference chips from this metadata. The field is omitted when there are no references. Assistant turns carry {text} — the final answer text (or error copy on a failed turn). Omitted when empty (e.g. an assistant message still streaming). Per-turn token accounting is NOT included here; it is surfaced on the agent_message_done WebSocket broadcast. tool_calls is an optional array of ToolCallSummary, attached to an assistant message that has persisted terminal (ok/error) tool-call rows — it lets a chat reload render the tool history a turn produced instead of showing nothing until the next live turn. Omitted when the message has no such rows. + * Message payload. User turns carry {text, attachments?, attachment_refs?, workflow_references?}. Attachments are the input-image filenames from the request. attachment_refs is the server's own resolution of those same filenames to library assets, as {name, id?, kind?, display_name?} objects. display_name carries the validated user-facing filename when name is an opaque storage key; the server may remove a registered emoji selector that does not change the displayed glyph. To bound denormalized data, repeated entries with the same name carry display_name only on the first occurrence; clients should apply it to every entry sharing that name. The sibling exists so a later turn in the thread can reach an earlier turn's file — clients should keep reading attachments. workflow_references is an optional array of explicit non-target references, each with workflow_id and name (an empty string when no name was supplied). An optional unavailable: true records that the reference could not be authorized at turn start, without distinguishing unknown IDs, inaccessible workflows, or lookup failures. These entries preserve the user's reference intent without exposing workflow content; the frontend restores reference chips from this metadata. The field is omitted when there are no references. Assistant turns carry {text} — the final answer text (or error copy on a failed turn). Omitted when empty (e.g. an assistant message still streaming). Per-turn token accounting is NOT included here; it is surfaced on the agent_message_done WebSocket broadcast. tool_calls is an optional array of ToolCallSummary, attached to an assistant message that has persisted terminal (ok/error) tool-call rows — it lets a chat reload render the tool history a turn produced instead of showing nothing until the next live turn. Omitted when the message has no such rows. */ content?: { attachment_refs?: Array<{ @@ -6328,7 +7005,7 @@ export type AgentGetIdentityErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -6388,7 +7065,7 @@ export type AgentLlmAdmitErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -6461,7 +7138,7 @@ export type AgentLlmMessagesErrors = { */ 402: AgentAdmissionError /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -6511,7 +7188,7 @@ export type AgentLlmTracesErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -6570,7 +7247,7 @@ export type AgentGetRunModeErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -6621,7 +7298,7 @@ export type AgentPutRunModeErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -6676,7 +7353,7 @@ export type AgentListSkillsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -6727,7 +7404,7 @@ export type AgentPublishSkillErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -6795,7 +7472,7 @@ export type AgentDeleteSkillErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -6857,7 +7534,7 @@ export type AgentListThreadsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -6900,7 +7577,7 @@ export type AgentCreateThreadErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7019,7 +7696,7 @@ export type AgentGetMessagesErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -7290,7 +7967,7 @@ export type ListAssetsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -7360,7 +8037,7 @@ export type CreateAssetErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7421,7 +8098,7 @@ export type DeleteAssetErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7429,7 +8106,7 @@ export type DeleteAssetErrors = { */ 404: ErrorResponse /** - * Asset cannot be deleted because it is referenced by another resource, e.g. a workflow version (error code: ASSET_IN_USE) + * Asset cannot be deleted because it is referenced by another resource, e.g. a workflow version, or because content moderation still holds it (error code: ASSET_IN_USE for both; a moderation hold is deliberately not distinguishable) */ 409: ErrorResponse /** @@ -7472,7 +8149,7 @@ export type GetAssetByIdErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -7540,7 +8217,7 @@ export type UpdateAssetErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7602,7 +8279,7 @@ export type GetAssetContentErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -7655,7 +8332,7 @@ export type RemoveAssetTagsErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7712,7 +8389,7 @@ export type AddAssetTagsErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7777,7 +8454,7 @@ export type CreateAssetDownloadErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7859,7 +8536,7 @@ export type CreateAssetExportErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -7903,7 +8580,7 @@ export type DownloadExportErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -7969,7 +8646,7 @@ export type CreateAssetFromHashErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -8022,7 +8699,7 @@ export type PostAssetsFromWorkflowErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -8110,7 +8787,7 @@ export type ImportPublishedAssetsErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -8177,7 +8854,7 @@ export type GetRemoteAssetMetadataErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -8340,7 +9017,7 @@ export type GetAssetTagHistogramErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -8638,7 +9315,7 @@ export type RevokeAllSessionsErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -8777,7 +9454,7 @@ export type ExchangeTokenErrors = { */ 401: ErrorResponse /** - * A refused web session request. `code` is `origin_not_allowed`, `cross_site_request` or `csrf_invalid` (see the `WebSessionAuth` scheme). While `web_session_enabled` is off for the user, and for a credential this route does not take, the body is instead `{"error": {"message", "type": "auth_type_not_allowed"}, "accepted": [...]}`. An API key whose user is not allowed to use it, whose workspace was deleted, or whose registry account is on the free tier gets `code` `FORBIDDEN`. `sso_required`: an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not that organization's, or the target workspace is an SSO organization's and the account is not on its domains or the credential is not its SSO sign-in; `organization_id`, when present, names the organization to sign in with. + * A refused web session request. `code` is `origin_not_allowed`, `cross_site_request` or `csrf_invalid` (see the `WebSessionAuth` scheme). While `web_session_enabled` is off for the user, and for a credential this route does not take, the body is instead `{"error": {"message", "type": "auth_type_not_allowed"}, "accepted": [...]}`. An API key whose user is not allowed to use it, whose workspace was deleted, or whose registry account is on the free tier gets `code` `FORBIDDEN`. `sso_required`: an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not that organization's, or the target workspace is an SSO organization's and the account is not on its domains or the credential is not its SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization`: the target workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. */ 403: ErrorResponse /** @@ -8793,7 +9470,7 @@ export type ExchangeTokenErrors = { */ 500: ErrorResponse /** - * The comfy-api registry could not verify an API key. `code` is `SERVICE_UNAVAILABLE`; retry, since the key may be good. + * The comfy-api registry could not verify an API key. `code` is `SERVICE_UNAVAILABLE`; retry, since the key may be good. `partner_node_token_disabled`: a partner-node mint while ops have switched those off (`PartnerNodeTokenMintDisabled`); mint without `resource` instead. */ 503: ErrorResponse } @@ -8827,7 +9504,7 @@ export type GetBillingBalanceErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -8913,7 +9590,7 @@ export type GetChurnkeyAuthErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -8999,7 +9676,7 @@ export type UpdateBillingCompanyDetailsErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9111,7 +9788,7 @@ export type GetBillingOpStatusErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -9159,7 +9836,7 @@ export type CancelBillingOpErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9249,7 +9926,7 @@ export type GetPaymentPortalErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9288,7 +9965,7 @@ export type GetBillingPlansErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -9327,7 +10004,7 @@ export type PreviewSubscribeErrors = { */ 401: ErrorResponse /** - * Workspace owner role required + * `FORBIDDEN`: workspace owner role required. `NOT_ORIGINAL_OWNER`: the caller is an owner but not the workspace's creator, and only the creator may change the plan; returned only when the rollout mode is `creator`. */ 403: ErrorResponse /** @@ -9366,7 +10043,7 @@ export type AcceptRetentionOfferErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9413,7 +10090,7 @@ export type RecordRetentionFlowEventErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9460,11 +10137,11 @@ export type PrepareRetentionFlowErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** - * Subscription does not support this flow + * Subscription does not support this flow, or cancellation offers are switched off */ 422: ErrorResponse /** @@ -9507,7 +10184,7 @@ export type GetBillingStatusErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -9550,7 +10227,7 @@ export type SubscribeErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9587,7 +10264,7 @@ export type CancelSubscriptionErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9630,7 +10307,7 @@ export type ResubscribeErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9671,7 +10348,7 @@ export type RevertScheduledChangeErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9710,7 +10387,7 @@ export type CreateTopupErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9799,7 +10476,7 @@ export type CreateTopupQuoteErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -9836,7 +10513,11 @@ export type GetBillingUsageTimeSeriesData = { * key, a member's `person` and `source` views hold only their own * rows, and an `unattributed` group carries spend with no usable * identity so the groups still sum to the total. Elsewhere the response is an empty series with - * `not_available` set. Group keys for those three carry a matching + * `not_available` set. For an enabled workspace `product_line` and + * `model` are also read from the ledger when the range starts on or + * after the environment's ledger start, and from the invoice otherwise; a model the + * ledger has no name for is `unspecified`. Group keys for + * `product_line`, `model`, `person` and `source` carry a matching * entry in `group_labels`. * */ @@ -9847,6 +10528,32 @@ export type GetBillingUsageTimeSeriesData = { | 'product_line' | 'person' | 'source' + /** + * Keep only spend on this product line (a key the `product_line` + * grouping returns). The four `filter_*` parameters combine with each + * other and with the ledger groupings `product_line`, `model`, + * `person` and `source`, so a page can drill from a line to its + * models to the people behind one model. They apply only to + * ledger-served reads of an enabled workspace: on any other read, + * including the invoice groupings `product` and `endpoint`, the + * response is an empty series with `not_available` reason + * `filter_needs_ledger`. A member's view is still only their own + * rows: filtering on a colleague returns nothing. + * + */ + filter_product_line?: string + /** + * Keep only spend on this model (a key the `model` grouping returns, `unspecified` for none). See `filter_product_line`. + */ + filter_model?: string + /** + * Keep only spend by this member (a key the `person` grouping returns, or `unattributed`). See `filter_product_line`. + */ + filter_person?: string + /** + * Keep only spend from this source (a key the `source` grouping returns, or `unattributed`). See `filter_product_line`. + */ + filter_source?: string granularity?: 'hour' | 'day' | 'month' starting_on?: string ending_before?: string @@ -9857,7 +10564,7 @@ export type GetBillingUsageTimeSeriesData = { export type GetBillingUsageTimeSeriesErrors = { /** - * Invalid time range + * Invalid time range or filter value */ 400: ErrorResponse /** @@ -9865,7 +10572,7 @@ export type GetBillingUsageTimeSeriesErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -10046,7 +10753,7 @@ export type GetNodeInfoSchemaErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError } @@ -10083,7 +10790,7 @@ export type GetNodeByIdErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -10261,7 +10968,7 @@ export type SubmitFeedbackErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -10305,7 +11012,7 @@ export type GetMaskLayersErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -10609,7 +11316,7 @@ export type ManageHistoryErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -10669,7 +11376,7 @@ export type GetHistoryErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -10711,7 +11418,7 @@ export type GetHistoryForPromptErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -10754,7 +11461,7 @@ export type CreateHubAssetUploadUrlErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -10802,7 +11509,7 @@ export type ListHubLabelsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -10840,7 +11547,7 @@ export type CreateHubProfileErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -10928,7 +11635,7 @@ export type UpdateHubProfileErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -10973,7 +11680,7 @@ export type CheckHubUsernameErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -11016,7 +11723,7 @@ export type GetMyHubProfileErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -11121,7 +11828,7 @@ export type PublishHubWorkflowErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -11169,7 +11876,7 @@ export type DeleteHubWorkflowErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -11318,7 +12025,7 @@ export type CreateInputUploadUrlErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -11365,7 +12072,7 @@ export type InterruptJobErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -11578,7 +12285,7 @@ export type ListJobsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -11620,7 +12327,7 @@ export type DeleteJobErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -11732,7 +12439,7 @@ export type GetJobAssetsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -11779,7 +12486,7 @@ export type CancelJobErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -11820,7 +12527,7 @@ export type CancelJobsErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -11932,7 +12639,7 @@ export type GetNodeInfoErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError } @@ -11984,7 +12691,7 @@ export type GetPromptInfoErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12130,7 +12837,7 @@ export type GetQueueInfoErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12168,7 +12875,7 @@ export type ManageQueueErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -12206,7 +12913,7 @@ export type ListSecretsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12458,7 +13165,7 @@ export type ListSecretProvidersErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12497,7 +13204,7 @@ export type GetAllSettingsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError } @@ -12539,7 +13246,7 @@ export type UpdateMultipleSettingsErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError } @@ -12581,7 +13288,7 @@ export type GetSettingByIdErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12633,7 +13340,7 @@ export type UpdateSettingByIdErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError } @@ -12725,7 +13432,7 @@ export type ListTagsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12795,7 +13502,7 @@ export type ListTasksErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12838,7 +13545,7 @@ export type CancelTaskErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -12892,7 +13599,7 @@ export type GetTaskErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -12950,7 +13657,7 @@ export type UploadImageErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -13010,7 +13717,7 @@ export type UploadMaskErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -13110,7 +13817,7 @@ export type GetUserErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError } @@ -13160,7 +13867,7 @@ export type GetUserdataErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -13207,7 +13914,7 @@ export type DeleteUserdataFileErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -13255,7 +13962,7 @@ export type GetUserdataFileErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -13369,7 +14076,7 @@ export type MoveUserdataFileErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -13421,7 +14128,7 @@ export type GetUserdataFilePublishErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -13469,7 +14176,7 @@ export type PostUserdataFilePublishErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -13512,7 +14219,7 @@ export type GetUsersInfoErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError } @@ -13585,7 +14292,7 @@ export type GetVhsQueryVideoErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -13683,7 +14390,7 @@ export type GetVhsViewAudioErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -13763,7 +14470,7 @@ export type GetVhsViewVideoErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -13858,7 +14565,7 @@ export type ViewFileErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -13944,7 +14651,7 @@ export type GetApiViewVideoAliasErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -14025,7 +14732,7 @@ export type ListWorkflowsErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -14063,7 +14770,7 @@ export type CreateWorkflowErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -14111,7 +14818,7 @@ export type DeleteWorkflowErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -14206,7 +14913,7 @@ export type UpdateWorkflowErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -14413,7 +15120,7 @@ export type GetPublishedWorkflowErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -14460,7 +15167,7 @@ export type CreateWorkflowUploadUrlErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -14840,7 +15547,7 @@ export type LeaveWorkspaceErrors = { */ 401: ErrorResponse /** - * Cannot leave as the only owner (`ONLY_OWNER`), cannot leave a personal workspace (`PERSONAL_WORKSPACE`), or `code` is `membership_managed_by_directory` with `message` "Your organization's admin manages membership" for an account the workspace's attached SSO organization holds. + * Cannot leave as the only owner (`ONLY_OWNER`), cannot leave a personal workspace (`PERSONAL_WORKSPACE`), cannot leave a team workspace the caller created (`CANNOT_LEAVE_AS_CREATOR`), or `code` is `membership_managed_by_directory` with `message` "Your organization's admin manages membership" for an account the workspace's attached SSO organization holds. */ 403: ErrorResponse /** @@ -14992,7 +15699,7 @@ export type RemoveWorkspaceMemberErrors = { */ 401: ErrorResponse /** - * Owner role required or cannot remove yourself + * Owner role required, cannot remove yourself, the original owner of a personal workspace cannot be removed (`CANNOT_REMOVE_ORIGINAL_OWNER`), or the creator of a team workspace cannot be removed (`CANNOT_REMOVE_CREATOR`) */ 403: ErrorResponse /** @@ -15040,7 +15747,7 @@ export type UpdateWorkspaceMemberRoleErrors = { */ 401: ErrorResponse /** - * Owner role required, the original owner cannot be demoted, or `DIRECTORY_MANAGED`: the member's role comes from their organization's directory (SSO) and is changed there + * Owner role required, the original owner of a personal workspace cannot be demoted (`CANNOT_DEMOTE_ORIGINAL_OWNER`), the creator of a team workspace cannot be demoted (`CANNOT_DEMOTE_CREATOR`), or `DIRECTORY_MANAGED`: the member's role comes from their organization's directory (SSO) and is changed there */ 403: ErrorResponse /** @@ -15177,7 +15884,7 @@ export type ListWorkspacesErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -15220,7 +15927,7 @@ export type CreateWorkspaceErrors = { */ 401: ErrorResponse /** - * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. + * A refused request that changes data. For a web session, `code` is `csrf_invalid` (no `X-CSRF-Token`, or not the session's), `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email, or, on `POST /api/workspaces`, an account an SSO organization holds (its organization manages its workspaces; signing in again does not change it). On the plan-lifecycle writes (`POST /api/billing/subscribe`, `POST /api/billing/subscription/cancel`, `POST /api/billing/subscription/resubscribe`, `POST /api/billing/subscription/revert-scheduled-change`, `POST /api/billing/ops/{id}/cancel` and the `/api/billing/retention*` routes), `NOT_ORIGINAL_OWNER` means the caller is an owner but not the workspace's creator, and only the creator may change the plan; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever the flag. */ 403: ForbiddenError /** @@ -15320,7 +16027,7 @@ export type GetWorkspaceErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** @@ -16172,7 +16879,7 @@ export type GetViewCompatAliasErrors = { */ 401: ErrorResponse /** - * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. + * A refused request. For a web session, `code` is `workspace_access_denied` (the selected workspace is unknown, deleted, or the user is not a member; the three look the same), `no_workspace_access` (the account has no personal workspace and is a member of no live workspace), `origin_not_allowed` or `cross_site_request`; see the `WebSessionAuth` scheme. For any credential, `sso_required` means an SSO organization holds the account (its email is on the organization's verified domains) and the credential is not an SSO sign-in, or the workspace is an SSO organization's and the account is not on its domains or the credential is not an SSO sign-in; `organization_id`, when present, names the organization to sign in with. `account_outside_organization` means the workspace is an SSO organization's and the account is on none of its domains, so no sign-in admits it; `organization_id` names the workspace's organization. `FORBIDDEN` is the route's own authorization check failing, such as an unverified email. On `GET /api/billing/churnkey/auth`, `NOT_ORIGINAL_OWNER` means the caller is not the workspace's creator; it is returned only when the rollout mode is `creator`. A credential this route does not take gets AuthTypeNotAllowedError instead, and so does the session while `web_session_enabled` is off for the user, unless the operation says it takes the session whatever `web_session_enabled` says. */ 403: ForbiddenError /** diff --git a/packages/ingest-types/src/zod.gen.ts b/packages/ingest-types/src/zod.gen.ts index cb4c299e55b..693d85a7015 100644 --- a/packages/ingest-types/src/zod.gen.ts +++ b/packages/ingest-types/src/zod.gen.ts @@ -302,16 +302,19 @@ export const zUsageSummary = z.object({ * Present, with empty groups, buckets and breakdown, when the requested grouping is not served for this workspace. Render as unavailable, not as zero spend. */ export const zUsageNotAvailable = z.object({ - reason: z.enum(['no_attribution_source']) + reason: z.enum(['no_attribution_source', 'filter_needs_ledger']) }) export const zUsageGroupLabel = z.object({ display_name: z.string().optional(), + email: z.string().optional(), + former_member: z.boolean().optional(), key: z.string(), key_name: z.string().optional(), key_prefix: z.string().optional(), kind: z.enum(['api_key', 'session', 'deployment']).optional(), owner_display_name: z.string().optional(), + owner_email: z.string().optional(), owner_user_id: z.string().optional() }) @@ -344,6 +347,7 @@ export const zUsageTimeSeries = z.object({ group_labels: z.array(zUsageGroupLabel).optional(), groups: z.array(z.string()), not_available: zUsageNotAvailable.optional(), + served_from: z.enum(['ledger']).optional(), starting_on: z.iso.datetime(), summary: zUsageSummary }) @@ -1325,14 +1329,26 @@ export const zPreviewSubscribeRequest = z.object({ }) /** - * Reason why a plan is unavailable + * Why a plan is unavailable. Present exactly when available is false and + * absent when it is true. Only the first reason that applies is reported, + * in the order below. Render the value as received; do not recompute it. + * same_plan: (a) Why can this plan not be picked? (b) It is the plan the workspace is already on. (c) Absent means the plan is not the current one. (d) Not a refusal of a different plan; see incompatible_transition. (e) The plan slug equals the slug of the workspace's active subscription. + * incompatible_transition: (a) Why is this plan closed for the workspace's current plan? (b) The transition rules never allow it: the Free plan, which is provisioned only through free-tier eligibility, or a switch into the Founders plan. (c) Absent means no such rule applies. (d) Not a temporary state, and not billing_operation_in_progress, billing_operation_parked or annual_to_monthly_unsupported. (e) The target is the Free plan, or the transition matrix refuses the pair for a reason other than annual_to_monthly_unsupported. + * billing_operation_in_progress: (a) Why can no other plan be picked for now? (b) A subscription-changing billing operation is running for the workspace's active subscription. It settles on its own, so a client may say that plans will be available again shortly. (c) Absent means no such operation is running. (d) Not billing_operation_parked, which does not clear on its own, not a successor already scheduled for a future billing boundary, and not a seat problem. (e) The workspace has a non-scheduled active subscription and a subscription-changing billing operation is running and none is parked. + * billing_operation_parked: (a) Why can no other plan be picked until support steps in? (b) A subscription-changing billing operation is parked for reconciliation for the workspace's active subscription: it is either paid but credits not granted, or a replacement subscription that could not finish superseding the old one. It does not clear on its own, so a client must route the user to support and never imply a wait. (c) Absent means no operation is parked. (d) Not billing_operation_in_progress, which settles on its own, not a successor already scheduled for a future billing boundary, and not a seat problem. (e) The workspace has a non-scheduled active subscription and a subscription-changing billing operation is parked; reported instead of billing_operation_in_progress when both exist. + * annual_to_monthly_unsupported: (a) Why can a monthly plan not be chosen from an annual plan? (b) The annual commitment binds, so a move to a higher-tier monthly plan is not supported before the term ends. (c) Absent means the transition is not an annual to higher-tier monthly move. (d) Not a downgrade, which is allowed and scheduled, and not incompatible_transition. (e) The transition matrix refuses the pair with its annual-to-monthly tier upgrade rule. + * exceeds_max_seats: (a) Why is this plan closed to a workspace with many people? (b) The occupied seats exceed the plan's seat limit, counted as the subscribe request counts them: a team plan counts members plus unexpired pending invitations, any other plan counts members alone. (c) Absent means the occupied seats fit the plan. (d) Not a pending-invitation count for non-team plans, where an invitation does not occupy a seat. (e) For a team plan, members + pending invitations is greater than the seat limit; for any other plan, members is greater than the seat limit; a positive workspace override replaces the plan default in both cases. + * requires_team and requires_personal are part of this enum but are not reported today. */ export const zPlanAvailabilityReason = z.enum([ 'same_plan', 'incompatible_transition', + 'billing_operation_in_progress', + 'billing_operation_parked', + 'annual_to_monthly_unsupported', + 'exceeds_max_seats', 'requires_team', - 'requires_personal', - 'exceeds_max_seats' + 'requires_personal' ]) /** @@ -2407,6 +2423,7 @@ export const zExchangeTokenResponse = z.object({ * */ export const zExchangeTokenRequest = z.object({ + resource: z.enum(['partner-node']).optional(), workspace_id: z.string().optional() }) @@ -2902,9 +2919,15 @@ export const zBillingOpCancelResponse = z.object({ * A single history event. The cloud history-events store is the single source of truth for both billing events (charges, credits, adjustments) and user-facing usage events. */ export const zBillingEvent = z.object({ + api_key_name: z.string().optional(), + api_key_prefix: z.string().optional(), createdAt: z.iso.datetime(), event_id: z.string(), event_type: z.string(), + member_display_name: z.string().optional(), + member_email: z.string().optional(), + member_former: z.boolean().optional(), + member_user_id: z.string().optional(), params: z.record(z.string(), z.unknown()).optional() }) @@ -2980,12 +3003,24 @@ export const zBillingCapabilityRolloutDefaults = z.object({ * names the policy branch that decided, not customer-facing wording: the * client owns the message. * + * How to read this: render each capability from `capabilities` as received, and + * use a reason only to explain a capability that is false. Never recombine + * capabilities or reasons into a new decision, and never derive a reason from + * tier, role, status or plan slug. A missing reason is not a grant. A refused + * capability usually has a key here naming the branch that refused it. A false + * capability with no matching key is an unexplained refusal: no recognised + * explanation, still false. A true capability never has a key. + * Within a key the values are listed in the order the resolver reaches them, + * and the first one reached is the one reported. Capabilities are UI guidance, + * not authorization: the write endpoints decide. + * * The invariant runs one way only. **Presence implies refusal**: a key is * present only alongside `capabilities. == false`, reconciled before * the response is built, so a reason never accompanies a granted - * capability. **Absence implies nothing** -- it means no recognised - * explanation, not that the capability was granted. Consult - * `capabilities`, which stays authoritative for what the client may offer. + * capability. **Absence implies nothing**: on a false capability it + * means no recognised explanation, and on a true capability it is the + * expected state. Consult `capabilities`, which stays authoritative for what + * the client may offer. * * A key is absent for a refused capability whenever this service is * talking to a billing-api that predates the field, and whenever it drops @@ -2999,15 +3034,79 @@ export const zBillingCapabilityRolloutDefaults = z.object({ * */ export const zBillingCapabilityDenials = z.object({ - can_subscribe_self_serve: z + can_cancel: z + .enum([ + 'not_a_member', + 'not_workspace_owner', + 'not_original_owner', + 'free_plan', + 'no_subscription', + 'tier_not_self_serve', + 'billing_operation_in_progress', + 'billing_operation_parked', + 'cancellation_scheduled', + 'subscription_ended', + 'subscription_not_started', + 'subscription_status_unrecognized' + ]) + .optional(), + can_delete_workspace: z + .enum([ + 'not_a_member', + 'not_workspace_owner', + 'workspace_sso_attached', + 'personal_workspace', + 'billing_operation_in_progress', + 'billing_operation_parked', + 'plan_not_ended' + ]) + .optional(), + can_leave_workspace: z + .enum([ + 'not_a_member', + 'membership_managed_by_directory', + 'personal_workspace_creator', + 'workspace_creator', + 'only_owner' + ]) + .optional(), + can_reactivate: z .enum([ 'not_a_member', 'not_workspace_owner', + 'not_original_owner', + 'no_subscription', 'tier_not_self_serve', + 'billing_operation_in_progress', + 'billing_operation_parked', + 'cancellation_not_scheduled', + 'subscription_ended', 'subscription_not_started', + 'subscription_status_unrecognized' + ]) + .optional(), + can_subscribe_self_serve: z + .enum([ + 'not_a_member', + 'not_workspace_owner', + 'not_original_owner', + 'creator_only_provisioning', + 'tier_not_self_serve', 'subscription_change_in_progress', + 'subscription_not_started', 'subscription_status_unrecognized' ]) + .optional(), + can_top_up: z + .enum([ + 'not_a_member', + 'not_workspace_owner', + 'creator_only_provisioning', + 'payment_past_due', + 'free_plan', + 'no_subscription', + 'subscription_ended' + ]) .optional() }) @@ -3015,17 +3114,37 @@ export const zBillingCapabilityDenials = z.object({ * Conservative UI guidance. These values do not authorize billing writes; * each write endpoint independently enforces its permission policy. * + * Each field answers one UI question for the authenticated user in the + * authenticated workspace. Render each as received and never combine fields + * into a new decision. False without a matching key in denied_reasons means no + * recognised explanation, not necessarily a refusal. A field is never + * per-surface: one value serves every screen. The plan-lifecycle fields + * (can_subscribe_self_serve, can_cancel, can_reactivate, + * can_revert_scheduled_change) require the workspace's creator only when the + * rollout mode is not `owner`; every other owner-level field stays open to + * every owner. + * + * When the deployment has billing disabled, this endpoint answers without + * consulting billing-api: can_top_up is true, can_manage_members and + * can_invite_members follow the owner role, and every other field is false. + * */ export const zBillingCapabilities = z.object({ can_cancel: z.boolean(), can_change_seats: z.boolean(), + can_delete_workspace: z.boolean(), can_downgrade_to_personal: z.boolean(), can_invite_members: z.boolean(), + can_leave_workspace: z.boolean(), + can_manage_billing: z.boolean(), can_manage_members: z.boolean(), + can_manage_partner_node_access: z.boolean(), can_reactivate: z.boolean(), can_revert_scheduled_change: z.boolean(), can_subscribe_self_serve: z.boolean(), - can_top_up: z.boolean() + can_top_up: z.boolean(), + can_view_pending_invites: z.boolean(), + can_view_team_usage: z.boolean() }) /** @@ -3035,6 +3154,8 @@ export const zBillingCapabilitiesResponse = z.object({ capabilities: zBillingCapabilities, denied_reasons: zBillingCapabilityDenials.optional(), expires_at: z.iso.datetime(), + plan_kind: z.enum(['none', 'self_serve', 'sales_managed']).optional(), + recovery_route: z.enum(['none', 'resubscribe', 'contact_sales']).optional(), resolved_for: zBillingCapabilityScope, revision: z.coerce .bigint() @@ -4305,6 +4426,10 @@ export const zGetBillingUsageTimeSeriesQuery = z.object({ .enum(['model', 'endpoint', 'product', 'product_line', 'person', 'source']) .optional() .default('model'), + filter_product_line: z.string().max(200).optional(), + filter_model: z.string().max(200).optional(), + filter_person: z.string().max(200).optional(), + filter_source: z.string().max(200).optional(), granularity: z.enum(['hour', 'day', 'month']).optional().default('month'), starting_on: z.iso.datetime().optional(), ending_before: z.iso.datetime().optional(), diff --git a/src/platform/auth/webSessionFlagOn.test.ts b/src/platform/auth/webSessionFlagOn.test.ts index 3906aa711b2..3f79e498aa3 100644 --- a/src/platform/auth/webSessionFlagOn.test.ts +++ b/src/platform/auth/webSessionFlagOn.test.ts @@ -663,6 +663,12 @@ function capabilitiesResponse({ can_change_seats: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_downgrade_to_personal: false }, rollout_defaults_applied: { diff --git a/src/platform/workspace/api/__mocks__/workspaceApi.ts b/src/platform/workspace/api/__mocks__/workspaceApi.ts index 956e326e5f9..aec045b079c 100644 --- a/src/platform/workspace/api/__mocks__/workspaceApi.ts +++ b/src/platform/workspace/api/__mocks__/workspaceApi.ts @@ -94,6 +94,12 @@ export const workspaceApi = vi.mockObject( can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: false, diff --git a/src/platform/workspace/api/workspaceApi.test.ts b/src/platform/workspace/api/workspaceApi.test.ts index 67440ca8544..c8f96259cbe 100644 --- a/src/platform/workspace/api/workspaceApi.test.ts +++ b/src/platform/workspace/api/workspaceApi.test.ts @@ -180,6 +180,27 @@ describe('workspaceApi', () => { }) }) + it('keeps the server message and code of a creator-only refusal', async () => { + mockAxiosInstance.post.mockRejectedValue({ + isAxiosError: true, + response: { + status: 403, + data: { + code: 'NOT_ORIGINAL_OWNER', + message: 'Only the workspace creator can change the plan.' + } + }, + message: 'Request failed' + }) + + await expect(workspaceApi.acceptInvite('token')).rejects.toMatchObject({ + name: 'WorkspaceApiError', + status: 403, + code: 'NOT_ORIGINAL_OWNER', + message: 'Only the workspace creator can change the plan.' + }) + }) + it.for([ { operation: 'getBillingOpStatus', diff --git a/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts b/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts index 039463d1958..6cd7a439f4b 100644 --- a/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts +++ b/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts @@ -11,6 +11,12 @@ const SNAPSHOT: CapabilitiesSnapshot = { can_downgrade_to_personal: false, can_invite_members: true, can_manage_members: true, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: true, diff --git a/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts b/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts index bebdec0750a..97e6d697c9b 100644 --- a/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts +++ b/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts @@ -182,6 +182,20 @@ describe('projectSubscriptionResult', () => { message: 'a subscription change is already in progress' } ], + [ + { + status: 'error', + code: 'ACCESS_DENIED', + httpStatus: 403, + serverCode: serverCode('NOT_ORIGINAL_OWNER'), + serverMessage: 'Only the workspace creator can change the plan.' + }, + { + status: 403, + code: 'NOT_ORIGINAL_OWNER', + message: 'Only the workspace creator can change the plan.' + } + ], [ { status: 'error', code: 'SUPERSEDED' }, { diff --git a/src/platform/workspace/composables/useBillingCapabilities.test.ts b/src/platform/workspace/composables/useBillingCapabilities.test.ts index 734e54e2ae5..9a22f75f01b 100644 --- a/src/platform/workspace/composables/useBillingCapabilities.test.ts +++ b/src/platform/workspace/composables/useBillingCapabilities.test.ts @@ -71,6 +71,12 @@ function capabilitiesResponse( can_change_seats: true, can_invite_members: true, can_manage_members: true, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_downgrade_to_personal: true, ...overrides }, From 9562e4b5076e506774bf96649cac14ef5927f890 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Tue, 13 Oct 2026 21:58:08 -0400 Subject: [PATCH 2/6] fix(billing): cover every consumer of the new denial reasons and capability fields --- apps/billing-web/e2e/fixtures/scenario.ts | 6 +++ apps/billing-web/src/checkout/endingScreen.ts | 17 ++++++ .../billing-web/src/test/fakeBillingClient.ts | 6 +++ apps/website/e2e/fixtures/buyCredits.ts | 6 +++ .../src/config/workshop-billing-sdk.test.ts | 6 +++ .../src/core/billing/capabilities.test.ts | 25 --------- .../src/core/billing/capabilityDenials.ts | 54 ++++++++++--------- .../billingCapabilities.contract.test.ts | 7 +++ .../workspace/api/workspaceApi.test.ts | 27 +++------- .../sdk/billingSdkTelemetryOwnership.test.ts | 6 +++ .../billing/sdk/createBillingSdk.test.ts | 6 +++ .../sdk/subscriptionOperationView.test.ts | 14 ----- 12 files changed, 94 insertions(+), 86 deletions(-) diff --git a/apps/billing-web/e2e/fixtures/scenario.ts b/apps/billing-web/e2e/fixtures/scenario.ts index f4cfde07a5a..eed90c6144f 100644 --- a/apps/billing-web/e2e/fixtures/scenario.ts +++ b/apps/billing-web/e2e/fixtures/scenario.ts @@ -41,6 +41,12 @@ export function capabilitiesWith( can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: true, diff --git a/apps/billing-web/src/checkout/endingScreen.ts b/apps/billing-web/src/checkout/endingScreen.ts index dcb43c80a02..0804164104e 100644 --- a/apps/billing-web/src/checkout/endingScreen.ts +++ b/apps/billing-web/src/checkout/endingScreen.ts @@ -40,6 +40,23 @@ const REFUSAL_COPY: Readonly> = { subscription_status_unrecognized: 'unknown', subscription_change_in_progress: 'change_unnamed', not_a_member: 'unknown', + not_original_owner: 'unknown', + creator_only_provisioning: 'unknown', + payment_past_due: 'unknown', + free_plan: 'unknown', + no_subscription: 'unknown', + subscription_ended: 'unknown', + billing_operation_in_progress: 'unknown', + billing_operation_parked: 'unknown', + cancellation_scheduled: 'unknown', + cancellation_not_scheduled: 'unknown', + workspace_sso_attached: 'unknown', + personal_workspace: 'unknown', + plan_not_ended: 'unknown', + membership_managed_by_directory: 'unknown', + personal_workspace_creator: 'unknown', + workspace_creator: 'unknown', + only_owner: 'unknown', unspecified: 'unknown' } diff --git a/apps/billing-web/src/test/fakeBillingClient.ts b/apps/billing-web/src/test/fakeBillingClient.ts index 90bf5f5fe8a..74b9f158af3 100644 --- a/apps/billing-web/src/test/fakeBillingClient.ts +++ b/apps/billing-web/src/test/fakeBillingClient.ts @@ -225,6 +225,12 @@ export function createFakeBillingClient( can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: false, diff --git a/apps/website/e2e/fixtures/buyCredits.ts b/apps/website/e2e/fixtures/buyCredits.ts index f1bd1e4261a..eecfbf3a9d0 100644 --- a/apps/website/e2e/fixtures/buyCredits.ts +++ b/apps/website/e2e/fixtures/buyCredits.ts @@ -52,6 +52,12 @@ const CAPABILITIES: BillingCapabilitiesResponse = { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: true, diff --git a/apps/website/src/config/workshop-billing-sdk.test.ts b/apps/website/src/config/workshop-billing-sdk.test.ts index 80625ced65f..9cab7263645 100644 --- a/apps/website/src/config/workshop-billing-sdk.test.ts +++ b/apps/website/src/config/workshop-billing-sdk.test.ts @@ -36,6 +36,12 @@ const CLOUD_BODIES: Readonly> = { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: false, diff --git a/packages/account-core/src/core/billing/capabilities.test.ts b/packages/account-core/src/core/billing/capabilities.test.ts index 2e137eaa9fd..df30ea7887a 100644 --- a/packages/account-core/src/core/billing/capabilities.test.ts +++ b/packages/account-core/src/core/billing/capabilities.test.ts @@ -401,31 +401,6 @@ describe('createCapabilitiesReader', () => { ) }) - it.for([ - ['can_subscribe_self_serve', 'not_original_owner'], - ['can_subscribe_self_serve', 'creator_only_provisioning'], - ['can_top_up', 'payment_past_due'], - ['can_cancel', 'billing_operation_parked'], - ['can_reactivate', 'cancellation_not_scheduled'], - ['can_delete_workspace', 'plan_not_ended'], - ['can_leave_workspace', 'workspace_creator'], - ['can_leave_workspace', 'only_owner'] - ])('decodes %s denied for %s', async ([capability, reason]) => { - const { scopeSource } = fakeSession() - const { transport } = fakeTransport([ - httpOk(capabilitiesBody({ denied_reasons: { [capability]: reason } })) - ]) - - const result = await createCapabilitiesReader({ - transport, - scopeSource - }).read() - - expect(result.status).toBe('ok') - if (result.status !== 'ok') return - expect(result.value.denials[capability]).toBe(reason) - }) - it('falls back to the generic reason for a value it does not recognize', async () => { const { scopeSource } = fakeSession() const { transport } = fakeTransport([ diff --git a/packages/account-core/src/core/billing/capabilityDenials.ts b/packages/account-core/src/core/billing/capabilityDenials.ts index fdb17227112..16cf39c8424 100644 --- a/packages/account-core/src/core/billing/capabilityDenials.ts +++ b/packages/account-core/src/core/billing/capabilityDenials.ts @@ -51,31 +51,33 @@ export type CapabilityDenialReason = */ | 'unspecified' -const KNOWN_REASONS: ReadonlySet = new Set([ - 'not_a_member', - 'not_workspace_owner', - 'tier_not_self_serve', - 'subscription_not_started', - 'subscription_change_in_progress', - 'subscription_status_unrecognized', - 'not_original_owner', - 'creator_only_provisioning', - 'payment_past_due', - 'free_plan', - 'no_subscription', - 'subscription_ended', - 'billing_operation_in_progress', - 'billing_operation_parked', - 'cancellation_scheduled', - 'cancellation_not_scheduled', - 'workspace_sso_attached', - 'personal_workspace', - 'plan_not_ended', - 'membership_managed_by_directory', - 'personal_workspace_creator', - 'workspace_creator', - 'only_owner' -]) +const KNOWN_REASONS: Readonly< + Record, true> +> = { + not_a_member: true, + not_workspace_owner: true, + tier_not_self_serve: true, + subscription_not_started: true, + subscription_change_in_progress: true, + subscription_status_unrecognized: true, + not_original_owner: true, + creator_only_provisioning: true, + payment_past_due: true, + free_plan: true, + no_subscription: true, + subscription_ended: true, + billing_operation_in_progress: true, + billing_operation_parked: true, + cancellation_scheduled: true, + cancellation_not_scheduled: true, + workspace_sso_attached: true, + personal_workspace: true, + plan_not_ended: true, + membership_managed_by_directory: true, + personal_workspace_creator: true, + workspace_creator: true, + only_owner: true +} /** * The record is open because the server adds keys as policy grows, and a @@ -104,7 +106,7 @@ export function decodeCapabilityDenials(raw: unknown): CapabilityDenials { const denials: Record = {} for (const [capability, reason] of Object.entries(parsed.data)) { - denials[capability] = KNOWN_REASONS.has(reason) + denials[capability] = Object.hasOwn(KNOWN_REASONS, reason) ? (reason as CapabilityDenialReason) : 'unspecified' } diff --git a/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts b/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts index cccca93eb9a..7a6f82052e4 100644 --- a/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts +++ b/packages/account-core/src/core/billing/contracts/billingCapabilities.contract.test.ts @@ -7,11 +7,15 @@ import type { import { describe, expect, expectTypeOf, it } from 'vitest' import type { z } from 'zod' +import type { CapabilityDenialReason } from '../capabilityDenials.js' + type CapabilitiesResponseBody = z.input type CapabilitiesResponse = z.infer type Capabilities = z.infer type CapabilityScope = z.infer type RolloutDefaults = z.infer +type DeniedReasons = NonNullable +type ServerDenialReason = NonNullable function capabilities(): Capabilities { return { @@ -78,6 +82,9 @@ expectTypeOf().toEqualTypeOf<{ can_view_pending_invites: boolean can_view_team_usage: boolean }>() +expectTypeOf().toEqualTypeOf< + Exclude +>() expectTypeOf().toEqualTypeOf<{ user_id: string workspace_id: string diff --git a/src/platform/workspace/api/workspaceApi.test.ts b/src/platform/workspace/api/workspaceApi.test.ts index c8f96259cbe..f5f08b83871 100644 --- a/src/platform/workspace/api/workspaceApi.test.ts +++ b/src/platform/workspace/api/workspaceApi.test.ts @@ -180,27 +180,6 @@ describe('workspaceApi', () => { }) }) - it('keeps the server message and code of a creator-only refusal', async () => { - mockAxiosInstance.post.mockRejectedValue({ - isAxiosError: true, - response: { - status: 403, - data: { - code: 'NOT_ORIGINAL_OWNER', - message: 'Only the workspace creator can change the plan.' - } - }, - message: 'Request failed' - }) - - await expect(workspaceApi.acceptInvite('token')).rejects.toMatchObject({ - name: 'WorkspaceApiError', - status: 403, - code: 'NOT_ORIGINAL_OWNER', - message: 'Only the workspace creator can change the plan.' - }) - }) - it.for([ { operation: 'getBillingOpStatus', @@ -550,6 +529,12 @@ describe('workspaceApi', () => { can_change_seats: true, can_invite_members: true, can_manage_members: true, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_downgrade_to_personal: false } } diff --git a/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts b/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts index c0b0c06bc4b..97411d08f5a 100644 --- a/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts +++ b/src/platform/workspace/billing/sdk/billingSdkTelemetryOwnership.test.ts @@ -154,6 +154,12 @@ const CAPABILITIES = { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: true, can_revert_scheduled_change: false, can_subscribe_self_serve: true, diff --git a/src/platform/workspace/billing/sdk/createBillingSdk.test.ts b/src/platform/workspace/billing/sdk/createBillingSdk.test.ts index e4899c362e3..5657d33f06b 100644 --- a/src/platform/workspace/billing/sdk/createBillingSdk.test.ts +++ b/src/platform/workspace/billing/sdk/createBillingSdk.test.ts @@ -61,6 +61,12 @@ const CAPABILITIES = { can_downgrade_to_personal: false, can_invite_members: false, can_manage_members: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false, can_reactivate: false, can_revert_scheduled_change: false, can_subscribe_self_serve: false, diff --git a/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts b/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts index 97e6d697c9b..bebdec0750a 100644 --- a/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts +++ b/src/platform/workspace/billing/sdk/subscriptionOperationView.test.ts @@ -182,20 +182,6 @@ describe('projectSubscriptionResult', () => { message: 'a subscription change is already in progress' } ], - [ - { - status: 'error', - code: 'ACCESS_DENIED', - httpStatus: 403, - serverCode: serverCode('NOT_ORIGINAL_OWNER'), - serverMessage: 'Only the workspace creator can change the plan.' - }, - { - status: 403, - code: 'NOT_ORIGINAL_OWNER', - message: 'Only the workspace creator can change the plan.' - } - ], [ { status: 'error', code: 'SUPERSEDED' }, { From 68d729ca72368a27d2930270b53730422fd55d2a Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Thu, 15 Oct 2026 16:32:29 -0400 Subject: [PATCH 3/6] test(billing): give the new capability fixtures from main the synced fields (FE-3432) --- .../composables/useBillingCapabilities.crossUser.test.ts | 8 +++++++- .../workspace/telemetry/workspaceTelemetryContext.test.ts | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts b/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts index 9f15fd01f65..78a2fbd3d2a 100644 --- a/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts +++ b/src/platform/workspace/composables/useBillingCapabilities.crossUser.test.ts @@ -47,7 +47,13 @@ function capabilitiesFor( can_change_seats: isOwner, can_invite_members: isOwner, can_manage_members: isOwner, - can_downgrade_to_personal: isOwner + can_downgrade_to_personal: isOwner, + can_delete_workspace: isOwner, + can_leave_workspace: isOwner, + can_manage_billing: isOwner, + can_manage_partner_node_access: isOwner, + can_view_pending_invites: isOwner, + can_view_team_usage: isOwner }, rollout_defaults_applied: { can_downgrade_to_personal: false, diff --git a/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts b/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts index df8682377bb..658cf2a63df 100644 --- a/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts +++ b/src/platform/workspace/telemetry/workspaceTelemetryContext.test.ts @@ -165,7 +165,13 @@ describe('useBillingCapabilities workspace scope mismatch', () => { can_change_seats: false, can_invite_members: false, can_manage_members: false, - can_downgrade_to_personal: false + can_downgrade_to_personal: false, + can_delete_workspace: false, + can_leave_workspace: false, + can_manage_billing: false, + can_manage_partner_node_access: false, + can_view_pending_invites: false, + can_view_team_usage: false }, rollout_defaults_applied: { can_downgrade_to_personal: false, From 43f272c49b55ab6330df76720412f25dd6fb66f2 Mon Sep 17 00:00:00 2001 From: Dante Date: Thu, 15 Oct 2026 17:45:33 -0400 Subject: [PATCH 4/6] FE-3433 fix(workspace): gate Delete workspace on can_delete_workspace (#21117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Render the Delete workspace item from the server's `can_delete_workspace` and its denied reason, in both menus, instead of deriving it from role, personal workspace and tier. Stacked on #20973 (FE-3432), which syncs the ingest types that carry `can_delete_workspace` and its `denied_reasons`. Base is that branch; retarget to `main` once it merges. - Linear: https://linear.app/comfyorg/issue/FE-3433 - Notion: https://app.notion.com/p/3fa6d73d3650815f8934dc73b2fe65c6 ## Why A wrongly hidden or disabled Delete emits nothing, and the server already resolves the answer with a reason (`workspace_sso_attached`, `personal_workspace`, `billing_operation_in_progress`, `billing_operation_parked`, `plan_not_ended`). ADR-API-SERVER-FACTS-0042: a gate renders one server fact as received. ## Root cause `useWorkspaceMenuItems` gated Delete on `canManageSubscription && !isInPersonalWorkspace && tier !== 'ENTERPRISE'`, and `WorkspaceMenuButton.vue` on `workspaceMenuAction === 'delete' && canManageSubscription`. The disabled state came from `canAccessSubscriptionFeatures` / the workspace's `isWorkspaceSubscribed`, two different local proxies for "the plan has not ended", so the two menus could disagree with each other and with the server. ## How - `useBillingCapabilities` exposes `canDeleteWorkspace` (a `ServerFact<'can_delete_workspace'>`, `false` while unresolved) and `deleteWorkspaceDenial` (the raw `denied_reasons.can_delete_workspace` string). - New `useDeleteWorkspaceGate` is the single source for both menus: `hidden` / `enabled` / `disabled` plus the tooltip. - granted: enabled. - `personal_workspace`, `workspace_sso_attached`: hidden (as before). `not_workspace_owner` / `not_a_member`: hidden too, so members keep not seeing Delete. - `plan_not_ended`, `billing_operation_parked`, `billing_operation_in_progress`: disabled with the ticket copy. `plan_not_ended` names the plan end date only when the subscription is cancelled and the server served an end date; no date is computed. - unknown reason or no reason: disabled with a generic reason, never a grant. Capabilities not resolved: hidden, never a grant. - The SDK rail's capabilities projection (`projectBillingCapabilities`) dropped the snapshot's `denials`, so on the rail `denied_reasons` was absent and an owner Personal Workspace read as "refused, no reason" (disabled, generic tooltip). It now carries `denied_reasons`; the read type is `BillingCapabilitiesRead`. Observed on testcloud for that workspace: `can_delete_workspace: false` with `denied_reasons: { can_delete_workspace: "personal_workspace", can_leave_workspace: "personal_workspace_creator", can_cancel: "no_subscription", can_reactivate: "no_subscription" }`. - Dropped from the gate: `canManageSubscription`, `isInPersonalWorkspace`, `isDeleteDisabled`, `isWorkspaceSubscribed`. `isDeleteDisabled` / `deleteDisabledTooltipKey` are removed from `useWorkspaceUI`. - Enterprise (DES-782): the API does not express it, so the existing hide is kept behind `pendingServerFact('BE-20592', tier === 'ENTERPRISE')` and expires with that ticket. - `not_original_owner` copy is not added (FE-3432 decodes it, BE-20592 not shipped); it falls into the generic disabled state. Follow-up, not in this PR: `uiConfig.workspaceMenuAction` / `workspaceMenuDisabledTooltip` and the `deleteWorkspaceDisabledTooltip` string are now unused by these menus; removing them touches several unrelated fixtures. ## AS IS / TO BE | AS IS | TO BE | | --- | --- | | | | | main: Plan & Credits menu on an owner workspace with no plan, no Delete workspace item (local main -> testcloud) | FE-3433 branch: Delete workspace shown disabled with tooltip "This workspace can't be deleted right now." (local branch -> testcloud) | ## Plan position | Ticket | Scope | State | | --- | --- | --- | | FE-3432 | Sync ingest types, decode the new denial reasons (#20973) | In merge queue | | **FE-3433** | **Gate Delete workspace on `can_delete_workspace` (this PR)** | **This PR** | | FE-3455 | Workspace menu (⋯) | Pending | | BE-20592 | `not_original_owner` and Enterprise expressed by the server | Not shipped | ```mermaid flowchart LR A["FE-3432: sync types, decode denial reasons"] --> B["FE-3433: gate Delete on can_delete_workspace (this PR)"] B --> C["FE-3455: workspace menu"] D["BE-20592: not_original_owner, Enterprise"] --> B style B fill:#f4b400,stroke:#333,stroke-width:3px,color:#000 ``` ## Verification - `pnpm vitest run src/platform/workspace`: 95 files, 2833 tests pass. New: `useDeleteWorkspaceGate.test.ts` (reason table incl. unknown/no reason, unresolved capabilities, Enterprise hide, tooltip copy, date only when served), capability exposure in `useBillingCapabilities.test.ts`, both menus' tests. - oxlint `--type-aware`, oxfmt, eslint on touched files clean; pre-commit `typecheck:app` and `lint:server-facts` pass. --- src/locales/en/main.json | 6 +- src/platform/workspace/api/workspaceApi.ts | 4 + .../sdk/billingCapabilitiesView.test.ts | 6 +- .../billing/sdk/billingCapabilitiesView.ts | 5 +- .../workspace/billing/sdk/billingSdkStore.ts | 4 +- .../SubscriptionPanelContentWorkspace.test.ts | 31 +-- .../settings/WorkspaceMenuButton.test.ts | 130 ++++++------- .../dialogs/settings/WorkspaceMenuButton.vue | 37 +--- .../__mocks__/useBillingCapabilities.ts | 4 + .../composables/__mocks__/useWorkspaceUI.ts | 4 +- .../useBillingCapabilities.test.ts | 92 +++++++++ .../composables/useBillingCapabilities.ts | 26 ++- .../composables/useBillingReadRail.ts | 4 +- .../useDeleteWorkspaceGate.test.ts | 178 ++++++++++++++++++ .../composables/useDeleteWorkspaceGate.ts | 91 +++++++++ .../composables/useWorkspaceMenuItems.test.ts | 91 ++++----- .../composables/useWorkspaceMenuItems.ts | 55 ++---- .../composables/useWorkspaceUI.test.ts | 24 --- .../workspace/composables/useWorkspaceUI.ts | 14 +- 19 files changed, 551 insertions(+), 255 deletions(-) create mode 100644 src/platform/workspace/composables/useDeleteWorkspaceGate.test.ts create mode 100644 src/platform/workspace/composables/useDeleteWorkspaceGate.ts diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 43a77b20be3..78a8688588c 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -3732,7 +3732,11 @@ "leaveWorkspace": "Leave Workspace", "deleteWorkspace": "Delete Workspace", "deleteWorkspaceDisabledTooltip": "Cancel your workspace's active subscription first", - "deleteWorkspaceAfterPlanEndsTooltip": "You can delete this workspace after your plan ends on {date}", + "deleteWorkspaceAfterPlanEndsTooltip": "You can delete this workspace after your plan ends on {date}.", + "deleteWorkspacePlanNotEndedTooltip": "You can delete this workspace after its plan ends. Cancel it from Manage plan.", + "deleteWorkspaceBillingParkedTooltip": "A recent payment needs a fix from our team. Contact support.", + "deleteWorkspaceBillingInProgressTooltip": "A billing change is in progress. Try again in a moment.", + "deleteWorkspaceUnavailableTooltip": "This workspace can't be deleted right now.", "creatorCannotLeave": "The workspace creator can't leave the workspace they created" }, "editWorkspaceDialog": { diff --git a/src/platform/workspace/api/workspaceApi.ts b/src/platform/workspace/api/workspaceApi.ts index 70f9995b60c..9b9f0bc65f7 100644 --- a/src/platform/workspace/api/workspaceApi.ts +++ b/src/platform/workspace/api/workspaceApi.ts @@ -144,6 +144,10 @@ export type { ScheduledPlanChange } export type { BillingBalanceResponse } export type { BillingEventsResponse } export type { BillingCapabilitiesResponse } +export type BillingCapabilitiesRead = Omit< + BillingCapabilitiesResponse, + 'denied_reasons' +> & { denied_reasons?: Readonly>> } export type { CreateTopupResponse } export type { BillingOpStatusResponse } export type { SavedPaymentMethod } diff --git a/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts b/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts index 6cd7a439f4b..c167c4178de 100644 --- a/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts +++ b/src/platform/workspace/billing/sdk/billingCapabilitiesView.test.ts @@ -22,7 +22,10 @@ const SNAPSHOT: CapabilitiesSnapshot = { can_subscribe_self_serve: true, can_top_up: true }, - denials: {}, + denials: { + can_delete_workspace: 'personal_workspace', + can_leave_workspace: 'personal_workspace_creator' + }, rolloutDefaultsApplied: { can_downgrade_to_personal: false, can_subscribe_self_serve: true, @@ -41,6 +44,7 @@ describe('projectBillingCapabilities', () => { it('reads the snapshot back as the response the composable holds', () => { expect(projectBillingCapabilities(SNAPSHOT)).toStrictEqual({ capabilities: SNAPSHOT.capabilities, + denied_reasons: SNAPSHOT.denials, expires_at: '2026-10-01T00:00:00.000Z', resolved_for: { user_id: 'canonical-user-1', diff --git a/src/platform/workspace/billing/sdk/billingCapabilitiesView.ts b/src/platform/workspace/billing/sdk/billingCapabilitiesView.ts index 1f2b7c9ec42..3f85bf6999d 100644 --- a/src/platform/workspace/billing/sdk/billingCapabilitiesView.ts +++ b/src/platform/workspace/billing/sdk/billingCapabilitiesView.ts @@ -1,6 +1,6 @@ import type { CapabilitiesSnapshot } from '@comfyorg/account-core/billing' -import type { BillingCapabilitiesResponse } from '@/platform/workspace/api/workspaceApi' +import type { BillingCapabilitiesRead } from '@/platform/workspace/api/workspaceApi' /** * The SDK's cached capabilities snapshot in the shape the capabilities @@ -9,9 +9,10 @@ import type { BillingCapabilitiesResponse } from '@/platform/workspace/api/works */ export function projectBillingCapabilities( snapshot: CapabilitiesSnapshot -): BillingCapabilitiesResponse { +): BillingCapabilitiesRead { return { capabilities: snapshot.capabilities, + denied_reasons: snapshot.denials, expires_at: new Date(snapshot.freshUntil).toISOString(), resolved_for: { user_id: snapshot.scope.userId, diff --git a/src/platform/workspace/billing/sdk/billingSdkStore.ts b/src/platform/workspace/billing/sdk/billingSdkStore.ts index caa6f521f3f..ee8c57218ac 100644 --- a/src/platform/workspace/billing/sdk/billingSdkStore.ts +++ b/src/platform/workspace/billing/sdk/billingSdkStore.ts @@ -37,7 +37,7 @@ import { useSettingsDialog } from '@/platform/settings/composables/useSettingsDi import { useTelemetry } from '@/platform/telemetry' import type { BillingBalanceResponse, - BillingCapabilitiesResponse, + BillingCapabilitiesRead, BillingEventsResponse, BillingPlansResponse, BillingStatusResponse, @@ -597,7 +597,7 @@ export const useBillingSdkStore = defineStore('billingSdk', () => { async function readCapabilities( options: CapabilitiesReadOptions - ): Promise> { + ): Promise> { const result = await sdk.capabilities.read(options) return result.status === 'ok' ? { status: 'ok', value: projectBillingCapabilities(result.value) } diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts index 95c524ed9d1..0db8453472a 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts @@ -5,6 +5,7 @@ import { useWorkspaceDialogs } from '@/platform/workspace/composables/useWorkspa import { useBillingContext } from '@/composables/billing/useBillingContext' import { useBillingRouting } from '@/composables/billing/useBillingRouting' import { getActivePinia } from 'pinia' +import { receiveServerFact } from '@/platform/serverFacts/serverFact' import { computed, nextTick, ref, toRef } from 'vue' import { useBillingOperationStore } from '@/platform/workspace/stores/billingOperationStore' import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore' @@ -198,12 +199,6 @@ const mockIsSubscriptionCancelled = computed( () => mockSubscription.value?.isCancelled ?? false ) -const mockIsDeleteDisabled = computed( - () => - mockIsActiveSubscription.value && - !(mockSubscription.value?.isCancelled ?? false) -) - vi.mock(import('@/platform/workspace/composables/useWorkspaceUI')) vi.mock(import('@/platform/workspace/composables/useBillingCapabilities')) @@ -313,12 +308,6 @@ describe('SubscriptionPanelContentWorkspace', () => { workspaceUI.isTeamPlanCancelled = computed( () => mockIsTeamPlanCancelled.value ) - workspaceUI.isDeleteDisabled = computed(() => mockIsDeleteDisabled.value) - workspaceUI.deleteDisabledTooltipKey = computed(() => - mockIsDeleteDisabled.value - ? mockUiConfig.value.workspaceMenuDisabledTooltip - : null - ) mockDistributionState.isCloud = true mockBillingBanner.kind = null mockSubscriptionStatus.value = 'active' @@ -1361,6 +1350,9 @@ describe('SubscriptionPanelContentWorkspace', () => { Object.assign(useTeamWorkspaceStore(), { isWorkspaceSubscribed: false }) mockUiConfig.value = personalUiConfig mockCanLeaveWorkspace.value = false + useBillingCapabilities().deleteWorkspaceDenial = computed( + () => 'personal_workspace' + ) renderComponent() await user.click(screen.getByRole('button', { name: 'More Options' })) @@ -1385,6 +1377,9 @@ describe('SubscriptionPanelContentWorkspace', () => { Object.assign(useTeamWorkspaceStore(), { isWorkspaceSubscribed: false }) mockUiConfig.value = personalUiConfig mockCanLeaveWorkspace.value = false + useBillingCapabilities().deleteWorkspaceDenial = computed( + () => 'personal_workspace' + ) renderComponent() await user.click(screen.getByRole('button', { name: 'More Options' })) @@ -1468,6 +1463,9 @@ describe('SubscriptionPanelContentWorkspace', () => { useBillingCapabilities().canReactivate = computed(() => false) useBillingCapabilities().canChangeSeats = computed(() => false) useBillingCapabilities().canSubscribeSelfServe = computed(() => false) + useBillingCapabilities().deleteWorkspaceDenial = computed( + () => 'not_workspace_owner' + ) mockUiConfig.value = memberUiConfig renderComponent() @@ -1506,6 +1504,9 @@ describe('SubscriptionPanelContentWorkspace', () => { it('offers an additional workspace owner Edit, Cancel, Leave, and locked Delete', async () => { const user = userEvent.setup() + useBillingCapabilities().deleteWorkspaceDenial = computed( + () => 'plan_not_ended' + ) renderComponent() await user.click(screen.getByRole('button', { name: 'More Options' })) @@ -1525,9 +1526,11 @@ describe('SubscriptionPanelContentWorkspace', () => { ) }) - it('enables Delete for any additional workspace owner once the plan is cancelled', async () => { + it('enables Delete once the server grants it', async () => { const user = userEvent.setup() - mockSubscriptionStatus.value = 'canceled' + useBillingCapabilities().canDeleteWorkspace = computed(() => + receiveServerFact('can_delete_workspace', true) + ) renderComponent() await user.click(screen.getByRole('button', { name: 'More Options' })) diff --git a/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.test.ts b/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.test.ts index 64bfa4531fb..04656df255b 100644 --- a/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.test.ts +++ b/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.test.ts @@ -1,5 +1,6 @@ import { useWorkspaceDialogs } from '@/platform/workspace/composables/useWorkspaceDialogs' -import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore' +import { receiveServerFact } from '@/platform/serverFacts/serverFact' +import { useBillingCapabilities } from '@/platform/workspace/composables/useBillingCapabilities' import { render, screen } from '@testing-library/vue' import userEvent from '@testing-library/user-event' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -11,26 +12,19 @@ import { useWorkspaceUI } from '@/platform/workspace/composables/useWorkspaceUI' import WorkspaceMenuButton from './WorkspaceMenuButton.vue' -const ownerConfig = { - showEditWorkspaceMenuItem: true, - workspaceMenuAction: 'delete' as const, - workspaceMenuDisabledTooltip: - 'workspacePanel.menu.deleteWorkspaceDisabledTooltip' -} -const memberConfig = { - showEditWorkspaceMenuItem: false, - workspaceMenuAction: null, - workspaceMenuDisabledTooltip: null -} -const personalConfig = { - showEditWorkspaceMenuItem: true, - workspaceMenuAction: null, - workspaceMenuDisabledTooltip: null -} - -const mockUiConfig = ref>(ownerConfig) const mockCanLeaveWorkspace = ref(false) -const mockCanManageSubscription = ref(true) + +vi.mock(import('@/composables/billing/useBillingContext'), () => ({ + useBillingContext: () => ({ + subscription: computed(() => ({ + endDate: '2026-08-01T00:00:00Z', + isCancelled: false, + tier: 'PRO' + })) + }) +})) + +vi.mock(import('@/platform/workspace/composables/useBillingCapabilities')) vi.mock(import('@/platform/workspace/composables/useWorkspaceUI')) @@ -42,6 +36,19 @@ const i18n = createI18n({ messages: { en: enMessages } }) +function grantDelete() { + useBillingCapabilities().canDeleteWorkspace = computed(() => + receiveServerFact('can_delete_workspace', true) + ) +} + +function denyDelete(denial: string | undefined) { + useBillingCapabilities().canDeleteWorkspace = computed(() => + receiveServerFact('can_delete_workspace', false) + ) + useBillingCapabilities().deleteWorkspaceDenial = computed(() => denial) +} + async function renderComponent() { render(WorkspaceMenuButton, { global: { @@ -57,36 +64,26 @@ describe('WorkspaceMenuButton', () => { const defaultPermissions = workspaceUI.permissions.value workspaceUI.permissions = computed(() => ({ ...defaultPermissions, - canLeaveWorkspace: mockCanLeaveWorkspace.value, - canManageSubscription: mockCanManageSubscription.value - })) - const defaultUiConfig = workspaceUI.uiConfig.value - workspaceUI.uiConfig = computed(() => ({ - ...defaultUiConfig, - ...mockUiConfig.value, - workspaceMenuAction: - mockUiConfig.value.workspaceMenuAction === 'delete' ? 'delete' : null + canLeaveWorkspace: mockCanLeaveWorkspace.value })) - mockUiConfig.value = ownerConfig mockCanLeaveWorkspace.value = false - mockCanManageSubscription.value = true - Object.assign(useTeamWorkspaceStore(), { isWorkspaceSubscribed: false }) + grantDelete() }) it('lets a member leave and offers no destructive workspace actions', async () => { - mockUiConfig.value = memberConfig mockCanLeaveWorkspace.value = true - mockCanManageSubscription.value = false + denyDelete('not_workspace_owner') await renderComponent() - const leave = screen.getByRole('menuitem', { name: 'Leave Workspace' }) - expect(leave).toBeEnabled() + expect( + screen.getByRole('menuitem', { name: 'Leave Workspace' }) + ).toBeEnabled() expect( screen.queryByRole('menuitem', { name: 'Delete Workspace' }) ).not.toBeInTheDocument() }) - it('lets an additional workspace owner leave and delete', async () => { + it('lets a workspace owner leave and delete when the server grants Delete', async () => { const user = userEvent.setup() mockCanLeaveWorkspace.value = true await renderComponent() @@ -104,22 +101,37 @@ describe('WorkspaceMenuButton', () => { ).toHaveBeenCalledOnce() }) - it('does not expose Delete in a personal workspace', async () => { - mockUiConfig.value = personalConfig - await renderComponent() + it.for(['personal_workspace', 'workspace_sso_attached'])( + 'does not expose Delete when the server names %s', + async (denial) => { + denyDelete(denial) + await renderComponent() - expect( - screen.queryByRole('menuitem', { name: 'Delete Workspace' }) - ).not.toBeInTheDocument() - }) + expect( + screen.queryByRole('menuitem', { name: 'Delete Workspace' }) + ).not.toBeInTheDocument() + } + ) + + it.for(['plan_not_ended', 'billing_operation_parked', undefined])( + 'disables Delete when the server refuses it with %s', + async (denial) => { + denyDelete(denial) + await renderComponent() + + expect( + screen.getByRole('menuitem', { name: 'Delete Workspace' }) + ).toHaveAttribute('aria-disabled', 'true') + } + ) - it('disables Delete while the additional workspace is subscribed', async () => { - Object.assign(useTeamWorkspaceStore(), { isWorkspaceSubscribed: true }) + it('hides Delete until capabilities resolve', async () => { + useBillingCapabilities().hasResolvedCapabilities = computed(() => false) await renderComponent() expect( - screen.getByRole('menuitem', { name: 'Delete Workspace' }) - ).toHaveAttribute('aria-disabled', 'true') + screen.queryByRole('menuitem', { name: 'Delete Workspace' }) + ).not.toBeInTheDocument() }) it('hides Leave when workspace permission is withheld', async () => { @@ -154,27 +166,17 @@ describe('WorkspaceMenuButton', () => { ).not.toHaveBeenCalled() }) - it('rechecks owner permission before opening the delete dialog', async () => { - await renderComponent() - - const deleteWorkspace = screen.getByRole('menuitem', { - name: 'Delete Workspace' - }) - mockCanManageSubscription.value = false - deleteWorkspace.click() - - expect( - useWorkspaceDialogs().showDeleteWorkspaceDialog - ).not.toHaveBeenCalled() - }) - - it('rechecks the subscription lock before opening the delete dialog', async () => { + it('rechecks the capability before opening the delete dialog', async () => { + const granted = ref(true) + useBillingCapabilities().canDeleteWorkspace = computed(() => + receiveServerFact('can_delete_workspace', granted.value) + ) await renderComponent() const deleteWorkspace = screen.getByRole('menuitem', { name: 'Delete Workspace' }) - Object.assign(useTeamWorkspaceStore(), { isWorkspaceSubscribed: true }) + granted.value = false deleteWorkspace.click() expect( diff --git a/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.vue b/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.vue index 8bebda1c039..68d268258ed 100644 --- a/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.vue +++ b/src/platform/workspace/components/dialogs/settings/WorkspaceMenuButton.vue @@ -14,14 +14,13 @@