@canopy-io/node 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -514,7 +514,7 @@ interface paths {
514
514
  head?: never;
515
515
  /**
516
516
  * Update an identity
517
- * @description Updates an identity's mutable profile fields (`first_name`, `last_name`, `is_active`, `metadata`) in the current Environment. `email` and `external_id` are immutable here — `external_id` is owned by the SSO/SCIM provisioning path and cannot be re-pointed through this endpoint. Returns the updated identity and writes an `identity.updated` audit row; returns `404` when the identity has no membership in this Environment.
517
+ * @description Updates an identity's mutable profile fields (`first_name`, `last_name`, `is_active`, `metadata`) in the current Environment. `email` and `external_id` are immutable here — `external_id` is owned by the SSO/SCIM provisioning path and cannot be re-pointed through this endpoint. Returns the updated identity and writes an `identity.updated` audit row for the profile fields; a change to `is_active` writes `identity.status_set` instead, the account-wide activation switch. Returns `404` when the identity has no membership in this Environment.
518
518
  */
519
519
  patch: operations["ApiIdentitiesController_updateIdentity"];
520
520
  trace?: never;
@@ -550,7 +550,7 @@ interface paths {
550
550
  put?: never;
551
551
  /**
552
552
  * Activate an identity
553
- * @description Reactivates an identity by setting `is_active = true` in the current Environment, allowing it to authenticate again. Returns a `200` message envelope. Returns `404` when the identity has no membership in this Environment.
553
+ * @description Reactivates an identity by setting `is_active = true`, the account-wide switch, allowing it to authenticate again in every Environment it belongs to. Writes an `identity.status_set` audit row (the same event the Console's account route emits), delivered to the account's subscriptions and to those of every Environment the identity is a member of. Returns a `200` message envelope. Returns `404` when the identity has no membership in this Environment.
554
554
  */
555
555
  post: operations["ApiIdentitiesController_activateIdentity"];
556
556
  delete?: never;
@@ -570,7 +570,7 @@ interface paths {
570
570
  put?: never;
571
571
  /**
572
572
  * Deactivate an identity
573
- * @description Deactivates an identity by setting `is_active = false` in the current Environment, blocking future sign-in. Returns a `200` message envelope. Returns `404` when the identity has no membership in this Environment.
573
+ * @description Deactivates an identity by setting `is_active = false`, the account-wide switch, blocking future sign-in in every Environment it belongs to. Writes an `identity.status_set` audit row (the same event the Console's account route emits), delivered to the account's subscriptions and to those of every Environment the identity is a member of. Returns a `200` message envelope. Returns `404` when the identity has no membership in this Environment.
574
574
  */
575
575
  post: operations["ApiIdentitiesController_deactivateIdentity"];
576
576
  delete?: never;
@@ -630,7 +630,7 @@ interface paths {
630
630
  put?: never;
631
631
  /**
632
632
  * Revoke all of an identity's sessions (admin)
633
- * @description Revokes all of an identity's sessions (server-to-server admin) by marking every active refresh token revoked, so the next refresh on any device returns `401` and the user must sign in again. In-flight access tokens remain valid until their short TTL lapses. Idempotent — revoking when no tokens are active is a no-op. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment.
633
+ * @description Revokes all of an identity's sessions (server-to-server admin) by marking every active refresh token revoked, so the next refresh on any device returns `401` and the user must sign in again. In-flight access tokens remain valid until their short TTL lapses. Idempotent — revoking when no tokens are active is a no-op. Audits twice: `identity.sessions.admin_revoked` for the identity's own security log, and `session.all_revoked`, the subscribable webhook event, so a revoke made here reaches subscribers exactly as one made from the Console does. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment.
634
634
  */
635
635
  post: operations["ApiIdentitiesController_revokeIdentitySessions"];
636
636
  delete?: never;
@@ -898,7 +898,7 @@ interface paths {
898
898
  put?: never;
899
899
  /**
900
900
  * Create a hierarchy node
901
- * @description Creates a hierarchy node in the active Application's current Environment. Authorization is evaluated against `hierarchy.manage` on the parent node when `parent_node_id` is supplied, or Application-wide when creating the root. The node type and the parent/child relationship are validated against the Environment's hierarchy schema, only one root node is permitted per Environment (a second returns `409`), and the configured `max_depth` is enforced; a missing `slug` is derived from the name. Returns `201` with the created node and writes a `node.created` audit row.
901
+ * @description Creates a hierarchy node in the active Application's current Environment. Prerequisite: the Environment must have a hierarchy schema — define it first via `PATCH /api/v1/hierarchy-schema` (or the Console's enable-hierarchy wizard), or this endpoint returns `400` ("Hierarchy schema is not configured"). Authorization is evaluated against `hierarchy.manage` on the parent node when `parent_node_id` is supplied, or Application-wide when creating the root. The node type and the parent/child relationship are validated against the schema, only one root node is permitted per Environment (a second returns `409`), and the configured `max_depth` is enforced; a missing `slug` is derived from the name. Returns `201` with the created node and writes a `node.created` audit row.
902
902
  */
903
903
  post: operations["ApiNodesController_createNode"];
904
904
  delete?: never;
@@ -1075,6 +1075,222 @@ interface paths {
1075
1075
  patch?: never;
1076
1076
  trace?: never;
1077
1077
  };
1078
+ "/api/v1/organizations": {
1079
+ parameters: {
1080
+ query?: never;
1081
+ header?: never;
1082
+ path?: never;
1083
+ cookie?: never;
1084
+ };
1085
+ /**
1086
+ * List organizations
1087
+ * @description Lists the Environment's organizations with `member_count` and `pending_invite_count` per row, paginated and searchable by name or slug (`q`), or looked up exactly by your own id (`external_id`). Empty while the Environment has organizations disabled. Requires the `hierarchy.view` permission.
1088
+ */
1089
+ get: operations["ApiOrganizationsController_listOrganizations"];
1090
+ put?: never;
1091
+ /**
1092
+ * Create an organization
1093
+ * @description Creates an organization from a `name` (slug auto-derived, display-only) with optional `description`, `metadata`, and `external_id` (your own id for it, unique per Environment; a repeat answers `409 organization.external_id_conflict`, so create-then-store is idempotent). The Environment must have organizations enabled (`409 organization.not_enabled` otherwise); the container is independent of the access model, so flat and hierarchy Environments both hold organizations. Requires the `hierarchy.manage` permission and emits `organization.created`.
1094
+ */
1095
+ post: operations["ApiOrganizationsController_createOrganization"];
1096
+ /**
1097
+ * Delete every organization
1098
+ * @description Deletes every live organization in the Environment the way the single delete does: memberships and every assignment beneath each organization are removed, pending invitations bound to the organization or its tree are revoked, and each organization is soft-deleted with its subtree. Member identities are untouched. This is the step before switching the container off. Responds `204 No Content`, requires the `hierarchy.manage` permission, and emits `organization.deleted_all` with the counts.
1099
+ */
1100
+ delete: operations["ApiOrganizationsController_deleteAllOrganizations"];
1101
+ options?: never;
1102
+ head?: never;
1103
+ patch?: never;
1104
+ trace?: never;
1105
+ };
1106
+ "/api/v1/organizations/{id}": {
1107
+ parameters: {
1108
+ query?: never;
1109
+ header?: never;
1110
+ path?: never;
1111
+ cookie?: never;
1112
+ };
1113
+ /**
1114
+ * Get an organization
1115
+ * @description Returns a single organization by `id` with `member_count` and `pending_invite_count`. Returns `404` when the id does not name a live organization in the current Environment. Requires the `hierarchy.view` permission at the organization.
1116
+ */
1117
+ get: operations["ApiOrganizationsController_getOrganization"];
1118
+ put?: never;
1119
+ post?: never;
1120
+ /**
1121
+ * Delete an organization
1122
+ * @description Deletes an organization by `id`: removes every membership and every assignment beneath the organization, revokes every pending invitation bound to it or its tree, and soft-deletes the organization with its subtree. Member identities themselves are untouched and keep their memberships in other organizations. Supports optimistic concurrency via the `If-Match` header (`409` on a version mismatch). Responds `204 No Content`, requires the `hierarchy.manage` permission at the organization, and emits `organization.deleted`.
1123
+ */
1124
+ delete: operations["ApiOrganizationsController_deleteOrganization"];
1125
+ options?: never;
1126
+ head?: never;
1127
+ /**
1128
+ * Update an organization
1129
+ * @description Updates an organization's `name`, `description`, `metadata`, and/or `external_id` (`null` clears it; a value already used by another organization in the Environment answers `409 organization.external_id_conflict`) by `id`. The slug is frozen at create and never changes. Supports optimistic concurrency via the `If-Match` header carrying the organization's current version (`409` on a version mismatch). Requires the `hierarchy.manage` permission at the organization and emits `organization.updated`.
1130
+ */
1131
+ patch: operations["ApiOrganizationsController_updateOrganization"];
1132
+ trace?: never;
1133
+ };
1134
+ "/api/v1/organizations/{id}/policy": {
1135
+ parameters: {
1136
+ query?: never;
1137
+ header?: never;
1138
+ path?: never;
1139
+ cookie?: never;
1140
+ };
1141
+ /**
1142
+ * Get an organization's authentication policy
1143
+ * @description Returns the organization's own authentication policy (null fields inherit the Environment) alongside the effective policy its members sign in under. Requires the `hierarchy.view` permission at the organization.
1144
+ */
1145
+ get: operations["ApiOrganizationsController_getPolicy"];
1146
+ put?: never;
1147
+ post?: never;
1148
+ delete?: never;
1149
+ options?: never;
1150
+ head?: never;
1151
+ /**
1152
+ * Update an organization's authentication policy
1153
+ * @description Sets the organization's own authentication policy. A field set to `null` inherits the Environment again. The policy can only tighten the Environment's settings: `mfa_required` can be true where the Environment leaves MFA optional, `mfa_factor_allowlist` must be a subset of the Environment's, `mfa_after_sso` can be `require` where the Environment exempts, and `require_sso` refuses password and code logins for members. Returns `400` (`organization.policy_loosens`) when a value would loosen the Environment, `409` when `If-Match` does not match the policy version. Requires the `hierarchy.manage` permission at the organization and emits `organization.policy.updated`.
1154
+ */
1155
+ patch: operations["ApiOrganizationsController_updatePolicy"];
1156
+ trace?: never;
1157
+ };
1158
+ "/api/v1/organizations/{id}/sso-connections": {
1159
+ parameters: {
1160
+ query?: never;
1161
+ header?: never;
1162
+ path?: never;
1163
+ cookie?: never;
1164
+ };
1165
+ /**
1166
+ * List an organization's SSO connections
1167
+ * @description Lists the end-user SSO connections bound to this organization, oldest first, each with the membership role a just-in-time provisioned login receives. Requires the `hierarchy.view` permission at the organization. The response is an unpaginated `{ items }` array.
1168
+ */
1169
+ get: operations["ApiOrganizationsController_listSsoConnections"];
1170
+ put?: never;
1171
+ /**
1172
+ * Bind an SSO connection to an organization
1173
+ * @description Binds an `end_user` SSO connection to the organization: a login through the connection lands in this organization, joining as a member with `default_role_id` when the identity is provisioned or is not yet a member, and the session starts here. The connection must already be bound to the organization's Environment (that binding routes the email domain), and the role must be an active, non-system role of the Environment (`400` otherwise: `rbac.role_inactive` or `rbac.role_system_not_assignable`). A connection binds to one organization per Environment (`409`). Requires the `hierarchy.manage` permission at the organization and emits `organization.sso_connection.bound`.
1174
+ */
1175
+ post: operations["ApiOrganizationsController_bindSsoConnection"];
1176
+ delete?: never;
1177
+ options?: never;
1178
+ head?: never;
1179
+ patch?: never;
1180
+ trace?: never;
1181
+ };
1182
+ "/api/v1/organizations/{id}/sso-connections/{connectionId}": {
1183
+ parameters: {
1184
+ query?: never;
1185
+ header?: never;
1186
+ path?: never;
1187
+ cookie?: never;
1188
+ };
1189
+ get?: never;
1190
+ put?: never;
1191
+ post?: never;
1192
+ /**
1193
+ * Unbind an SSO connection from an organization
1194
+ * @description Removes the binding; logins through the connection fall back to the Environment's placement. Existing memberships are untouched. Returns `404` when the connection is not bound to this organization. Requires the `hierarchy.manage` permission at the organization and emits `organization.sso_connection.unbound`.
1195
+ */
1196
+ delete: operations["ApiOrganizationsController_unbindSsoConnection"];
1197
+ options?: never;
1198
+ head?: never;
1199
+ patch?: never;
1200
+ trace?: never;
1201
+ };
1202
+ "/api/v1/organizations/{id}/members": {
1203
+ parameters: {
1204
+ query?: never;
1205
+ header?: never;
1206
+ path?: never;
1207
+ cookie?: never;
1208
+ };
1209
+ /**
1210
+ * List an organization's members
1211
+ * @description Lists the organization's members: each row is the member's identity, their single role in this organization, effective dates, when they joined, and `node_assignments`, the grants the member also holds at nodes beneath the organization (empty in a flat Environment). Paginated; `q` searches name and email. Requires the `rbac.view_assignments` permission at the organization.
1212
+ */
1213
+ get: operations["ApiOrganizationsController_listMembers"];
1214
+ put?: never;
1215
+ /**
1216
+ * Add a member to an organization
1217
+ * @description Adds a member: assigns `role_id` to `identity_id` at the organization. The identity must already hold an active membership in this Environment (invite by email instead for someone who does not). A member holds exactly one role per organization, so an identity that is already a member returns `409` — use the change-role operation. Requires the `rbac.manage_assignments` permission at the organization and emits `organization.member.added`.
1218
+ */
1219
+ post: operations["ApiOrganizationsController_addMember"];
1220
+ delete?: never;
1221
+ options?: never;
1222
+ head?: never;
1223
+ patch?: never;
1224
+ trace?: never;
1225
+ };
1226
+ "/api/v1/organizations/{id}/members/{identityId}": {
1227
+ parameters: {
1228
+ query?: never;
1229
+ header?: never;
1230
+ path?: never;
1231
+ cookie?: never;
1232
+ };
1233
+ get?: never;
1234
+ put?: never;
1235
+ post?: never;
1236
+ /**
1237
+ * Remove a member from an organization
1238
+ * @description Removes the member from this organization, revoking their role here and nothing else — the identity and its memberships in other organizations are untouched. Returns `404` when the identity is not a member. Responds `204 No Content`, requires the `rbac.manage_assignments` permission at the organization, and emits `organization.member.removed`.
1239
+ */
1240
+ delete: operations["ApiOrganizationsController_removeMember"];
1241
+ options?: never;
1242
+ head?: never;
1243
+ /**
1244
+ * Change a member's role
1245
+ * @description Replaces the member's role in this organization with `role_id`. A member holds exactly one role per organization, so this updates the existing membership in place; changing to the role already held is a no-op. Returns `404` when the identity is not a member. Requires the `rbac.manage_assignments` permission at the organization and emits `organization.member.role_changed`.
1246
+ */
1247
+ patch: operations["ApiOrganizationsController_changeMemberRole"];
1248
+ trace?: never;
1249
+ };
1250
+ "/api/v1/organizations/{id}/invites": {
1251
+ parameters: {
1252
+ query?: never;
1253
+ header?: never;
1254
+ path?: never;
1255
+ cookie?: never;
1256
+ };
1257
+ /**
1258
+ * List an organization's invitations
1259
+ * @description Lists the organization's invitations (pending, accepted, revoked, and expired — filter with `status`), paginated. Requires the `identity.view` permission.
1260
+ */
1261
+ get: operations["ApiOrganizationsController_listInvites"];
1262
+ put?: never;
1263
+ /**
1264
+ * Invite a member into an organization
1265
+ * @description Invites an email into the organization with the role bound to the invitation; acceptance creates the Environment membership and the organization membership in one step. Works for emails with no identity in the Environment — one is created on acceptance. Requires the `identity.manage` permission and emits `invite.created`.
1266
+ */
1267
+ post: operations["ApiOrganizationsController_createInvite"];
1268
+ delete?: never;
1269
+ options?: never;
1270
+ head?: never;
1271
+ patch?: never;
1272
+ trace?: never;
1273
+ };
1274
+ "/api/v1/organizations/{id}/invites/{inviteId}": {
1275
+ parameters: {
1276
+ query?: never;
1277
+ header?: never;
1278
+ path?: never;
1279
+ cookie?: never;
1280
+ };
1281
+ get?: never;
1282
+ put?: never;
1283
+ post?: never;
1284
+ /**
1285
+ * Revoke an organization invitation
1286
+ * @description Revokes an invitation on this organization; the emailed link stops working immediately. Returns `404` when the invitation does not belong to this organization. Requires the `identity.manage` permission and emits `invite.revoked`.
1287
+ */
1288
+ delete: operations["ApiOrganizationsController_revokeInvite"];
1289
+ options?: never;
1290
+ head?: never;
1291
+ patch?: never;
1292
+ trace?: never;
1293
+ };
1078
1294
  "/api/v1/roles": {
1079
1295
  parameters: {
1080
1296
  query?: never;
@@ -2149,6 +2365,169 @@ interface components {
2149
2365
  distinct_role_count: number;
2150
2366
  recent_identities: components["schemas"]["RecentIdentityDto"][];
2151
2367
  };
2368
+ OrganizationResponseDto: {
2369
+ id: string;
2370
+ name: string;
2371
+ description?: string | null;
2372
+ /** @description Display label derived from the name at create; frozen afterwards. Organizations are addressed by `id`. */
2373
+ slug: string;
2374
+ metadata: Record<string, unknown>;
2375
+ /** @description Your own id for this organization, unique per Environment. */
2376
+ external_id?: string | null;
2377
+ /** @description Members (one role each) in this organization. */
2378
+ member_count: number;
2379
+ /** @description Unexpired, unaccepted, unrevoked invitations. */
2380
+ pending_invite_count: number;
2381
+ /** Format: date-time */
2382
+ created_at: string;
2383
+ /** Format: date-time */
2384
+ updated_at: string;
2385
+ /** @description Optimistic-lock version. Send back as the `If-Match` header when updating or deleting to detect concurrent edits. */
2386
+ version: number;
2387
+ };
2388
+ CreateOrganizationDto: {
2389
+ /** @description Organization name. The slug is auto-derived from it at create and never changes afterwards. */
2390
+ name: string;
2391
+ /** @description Organization description */
2392
+ description?: string;
2393
+ /** @description Free-form metadata stored on the organization, returned as sent. */
2394
+ metadata?: Record<string, unknown>;
2395
+ /** @description Your own id for this organization (the account id in your database), unique per Environment. Look the organization up with `GET /api/v1/organizations?external_id=...`; a second create with the same value answers 409, so create-then-store is idempotent. */
2396
+ external_id?: string;
2397
+ };
2398
+ UpdateOrganizationDto: {
2399
+ /** @description New organization name. The slug does not change. */
2400
+ name?: string;
2401
+ /** @description Organization description */
2402
+ description?: string;
2403
+ /** @description Free-form metadata stored on the organization, returned as sent. */
2404
+ metadata?: Record<string, unknown>;
2405
+ /** @description Your own id for this organization, unique per Environment. `null` clears it. */
2406
+ external_id?: string | null;
2407
+ };
2408
+ EffectiveOrganizationPolicyDto: {
2409
+ mfa_required: boolean;
2410
+ mfa_factor_allowlist: ("totp" | "webauthn" | "email_otp")[];
2411
+ /** @enum {string} */
2412
+ mfa_after_sso: "exempt" | "require";
2413
+ require_sso: boolean;
2414
+ };
2415
+ OrganizationPolicyResponseDto: {
2416
+ /** @description The organization this policy belongs to. */
2417
+ organization_id: string;
2418
+ mfa_required?: boolean | null;
2419
+ mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[] | null;
2420
+ /** @enum {string|null} */
2421
+ mfa_after_sso?: "exempt" | "require" | null;
2422
+ require_sso: boolean;
2423
+ /** @description The Environment's own settings, the floor this organization's policy tightens from. */
2424
+ environment: components["schemas"]["EffectiveOrganizationPolicyDto"];
2425
+ /** @description The policy the organization's members sign in under. */
2426
+ effective: components["schemas"]["EffectiveOrganizationPolicyDto"];
2427
+ /** @description Optimistic-concurrency version. 0 until the organization sets a policy of its own. */
2428
+ version: number;
2429
+ };
2430
+ UpdateOrganizationPolicyDto: {
2431
+ /** @description Require MFA for this organization's members. `true` tightens an Environment that leaves MFA optional; `false` is only accepted where the Environment does not require MFA; `null` inherits. */
2432
+ mfa_required?: boolean | null;
2433
+ /** @description Factors this organization's members may enroll and use. Must be a non-empty subset of the Environment's allowlist; `null` inherits. */
2434
+ mfa_factor_allowlist?: ("totp" | "webauthn" | "email_otp")[] | null;
2435
+ /**
2436
+ * @description Whether an SSO login still owes an MFA challenge. `require` tightens an Environment that exempts SSO; `exempt` is only accepted where the Environment exempts; `null` inherits.
2437
+ * @enum {string|null}
2438
+ */
2439
+ mfa_after_sso?: "exempt" | "require" | null;
2440
+ /** @description Members must sign in through SSO. Password and email-code logins are refused for the organization's members and for any email whose domain routes to a connection bound to this organization. */
2441
+ require_sso?: boolean;
2442
+ };
2443
+ OrganizationSsoConnectionSummaryDto: {
2444
+ id: string;
2445
+ name: string;
2446
+ /** @enum {string} */
2447
+ type: "saml" | "oidc";
2448
+ status: string;
2449
+ };
2450
+ OrganizationSsoRoleSummaryDto: {
2451
+ id: string;
2452
+ name: string;
2453
+ };
2454
+ OrganizationSsoConnectionResponseDto: {
2455
+ organization_node_id: string;
2456
+ sso_connection_id: string;
2457
+ sso_connection: components["schemas"]["OrganizationSsoConnectionSummaryDto"];
2458
+ /** @description The membership role a login through this connection receives when it joins the organization. */
2459
+ default_role_id: string;
2460
+ default_role: components["schemas"]["OrganizationSsoRoleSummaryDto"];
2461
+ /** Format: date-time */
2462
+ created_at: string;
2463
+ };
2464
+ BindOrganizationSsoConnectionDto: {
2465
+ /** @description An end-user SSO connection already bound to the organization's Environment. */
2466
+ sso_connection_id: string;
2467
+ /** @description The membership role a login through this connection receives when it joins the organization. Must belong to the organization's Environment. */
2468
+ default_role_id: string;
2469
+ };
2470
+ OrganizationMemberIdentityDto: {
2471
+ id: string;
2472
+ email: string;
2473
+ first_name?: string | null;
2474
+ last_name?: string | null;
2475
+ };
2476
+ OrganizationMemberRoleDto: {
2477
+ id: string;
2478
+ name: string;
2479
+ };
2480
+ OrganizationMemberNodeDto: {
2481
+ id: string;
2482
+ name: string;
2483
+ node_type: string;
2484
+ };
2485
+ OrganizationMemberNodeAssignmentDto: {
2486
+ /** @description The assignment id. */
2487
+ id: string;
2488
+ application_node: components["schemas"]["OrganizationMemberNodeDto"];
2489
+ role: components["schemas"]["OrganizationMemberRoleDto"];
2490
+ };
2491
+ OrganizationMemberResponseDto: {
2492
+ /** @description The membership (role assignment) id. */
2493
+ id: string;
2494
+ identity: components["schemas"]["OrganizationMemberIdentityDto"];
2495
+ role: components["schemas"]["OrganizationMemberRoleDto"];
2496
+ /** Format: date-time */
2497
+ effective_from?: string | null;
2498
+ /** Format: date-time */
2499
+ effective_to?: string | null;
2500
+ /**
2501
+ * Format: date-time
2502
+ * @description When the membership was created.
2503
+ */
2504
+ created_at: string;
2505
+ /** @description Assignments the member also holds at nodes beneath the organization. Empty in a flat Environment. */
2506
+ node_assignments: components["schemas"]["OrganizationMemberNodeAssignmentDto"][];
2507
+ };
2508
+ AddOrganizationMemberDto: {
2509
+ /** @description Identity to add. Must already hold an active membership in this Environment; invite by email instead for someone who does not. */
2510
+ identity_id: string;
2511
+ /** @description The single role the member holds in this organization, from the Environment's roles. */
2512
+ role_id: string;
2513
+ };
2514
+ ChangeOrganizationMemberRoleDto: {
2515
+ /** @description The replacement role. A member holds exactly one role per organization, so this updates the existing membership in place. */
2516
+ role_id: string;
2517
+ };
2518
+ CreateOrganizationInviteDto: {
2519
+ /** @description Email to invite. Works for people with no identity in this Environment — one is created when they accept. */
2520
+ email: string;
2521
+ /** @description The role the member will hold in this organization on acceptance. */
2522
+ role_id: string;
2523
+ first_name?: string;
2524
+ last_name?: string;
2525
+ /**
2526
+ * @description Set false to skip the email and deliver the returned accept URL yourself.
2527
+ * @default true
2528
+ */
2529
+ send_email: boolean;
2530
+ };
2152
2531
  RoleResponseDto: {
2153
2532
  id: string;
2154
2533
  application_id: string;
@@ -2252,7 +2631,7 @@ interface components {
2252
2631
  * @description Broad classification from the action catalog (e.g. `auth`, `rbac`). NULL on legacy rows whose action key was unknown at backfill time — those carry the `unknown` value in storage.
2253
2632
  * @enum {string|null}
2254
2633
  */
2255
- category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown" | null;
2634
+ category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "organization" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown" | null;
2256
2635
  /**
2257
2636
  * @description `info` for normal-flow events, `notice` for important state changes, `warning` for failures, `critical` for security events.
2258
2637
  * @enum {string}
@@ -2315,7 +2694,7 @@ interface components {
2315
2694
  /** @description Filter by one or more action keys. Repeat the query param (`?action=a&action=b`) or pass a comma-separated string. */
2316
2695
  action?: string[];
2317
2696
  /** @enum {string} */
2318
- category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown";
2697
+ category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "organization" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown";
2319
2698
  /** @enum {string} */
2320
2699
  severity?: "info" | "notice" | "warning" | "critical";
2321
2700
  /** @enum {string} */
@@ -2380,7 +2759,7 @@ interface components {
2380
2759
  * @description Broad classification from the action catalog (e.g. `auth`, `rbac`). NULL on legacy rows whose action key was unknown at backfill time — those carry the `unknown` value in storage.
2381
2760
  * @enum {string|null}
2382
2761
  */
2383
- category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown" | null;
2762
+ category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "organization" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown" | null;
2384
2763
  /**
2385
2764
  * @description `info` for normal-flow events, `notice` for important state changes, `warning` for failures, `critical` for security events.
2386
2765
  * @enum {string}
@@ -2472,6 +2851,11 @@ interface components {
2472
2851
  };
2473
2852
  WebhookEventTypeDto: {
2474
2853
  event_type: string;
2854
+ /**
2855
+ * @description The subscription scope that takes this event. The public API lists both: everything an environment subscription accepts, then the account-only events, which need an account-scoped subscription from the Console or the portal API.
2856
+ * @enum {string}
2857
+ */
2858
+ scope: "environment" | "account";
2475
2859
  category: string;
2476
2860
  description: string;
2477
2861
  };
@@ -2605,7 +2989,8 @@ interface operations {
2605
2989
  ApiPermissionsController_listPermissions: {
2606
2990
  parameters: {
2607
2991
  query?: {
2608
- source?: string;
2992
+ /** @description Filter by permission origin. */
2993
+ source?: "system" | "custom";
2609
2994
  };
2610
2995
  header?: never;
2611
2996
  path?: never;
@@ -6784,11 +7169,21 @@ interface operations {
6784
7169
  };
6785
7170
  };
6786
7171
  };
6787
- ApiRolesController_listRoles: {
7172
+ ApiOrganizationsController_listOrganizations: {
6788
7173
  parameters: {
6789
7174
  query?: {
6790
- include_inactive?: string;
6791
- type?: string;
7175
+ /** @description Page number (1-based) */
7176
+ page?: number;
7177
+ /** @description Items per page (1-100, default 20) */
7178
+ take?: number;
7179
+ /** @description Search term */
7180
+ q?: string;
7181
+ /** @description Column to sort by. Allowed values depend on the endpoint. */
7182
+ sort_by?: string;
7183
+ /** @description Sort direction */
7184
+ order?: "asc" | "desc";
7185
+ /** @description Exact match on the organization's `external_id` (your own id for it). Answers one organization or none. */
7186
+ external_id?: string;
6792
7187
  };
6793
7188
  header?: never;
6794
7189
  path?: never;
@@ -6796,14 +7191,15 @@ interface operations {
6796
7191
  };
6797
7192
  requestBody?: never;
6798
7193
  responses: {
6799
- /** @description Roles returned */
7194
+ /** @description Paginated list */
6800
7195
  200: {
6801
7196
  headers: {
6802
7197
  [name: string]: unknown;
6803
7198
  };
6804
7199
  content: {
6805
7200
  "application/json": {
6806
- items: components["schemas"]["RoleResponseDto"][];
7201
+ items: components["schemas"]["OrganizationResponseDto"][];
7202
+ pagination: components["schemas"]["PageMetaDto"];
6807
7203
  };
6808
7204
  };
6809
7205
  };
@@ -6820,7 +7216,7 @@ interface operations {
6820
7216
  * "code": null,
6821
7217
  * "message": "Invalid or expired token",
6822
7218
  * "timestamp": "2026-04-20T12:00:00.000Z",
6823
- * "path": "/api/v1/roles",
7219
+ * "path": "/api/v1/organizations",
6824
7220
  * "method": "GET"
6825
7221
  * }
6826
7222
  * }
@@ -6841,7 +7237,7 @@ interface operations {
6841
7237
  * "code": null,
6842
7238
  * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
6843
7239
  * "timestamp": "2026-04-20T12:00:00.000Z",
6844
- * "path": "/api/v1/roles",
7240
+ * "path": "/api/v1/organizations",
6845
7241
  * "method": "GET"
6846
7242
  * }
6847
7243
  * }
@@ -6851,7 +7247,7 @@ interface operations {
6851
7247
  };
6852
7248
  };
6853
7249
  };
6854
- ApiRolesController_createRole: {
7250
+ ApiOrganizationsController_createOrganization: {
6855
7251
  parameters: {
6856
7252
  query?: never;
6857
7253
  header?: never;
@@ -6860,18 +7256,1742 @@ interface operations {
6860
7256
  };
6861
7257
  requestBody: {
6862
7258
  content: {
6863
- "application/json": components["schemas"]["CreateRoleDto"];
7259
+ "application/json": components["schemas"]["CreateOrganizationDto"];
6864
7260
  };
6865
7261
  };
6866
7262
  responses: {
6867
- /** @description Role created */
7263
+ /** @description Organization created */
6868
7264
  201: {
6869
7265
  headers: {
6870
7266
  [name: string]: unknown;
6871
7267
  };
6872
7268
  content: {
6873
7269
  "application/json": {
6874
- data: components["schemas"]["RoleResponseDto"];
7270
+ data: components["schemas"]["OrganizationResponseDto"];
7271
+ };
7272
+ };
7273
+ };
7274
+ /** @description Invalid or expired token */
7275
+ 401: {
7276
+ headers: {
7277
+ [name: string]: unknown;
7278
+ };
7279
+ content: {
7280
+ /**
7281
+ * @example {
7282
+ * "error": {
7283
+ * "statusCode": 401,
7284
+ * "code": null,
7285
+ * "message": "Invalid or expired token",
7286
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7287
+ * "path": "/api/v1/organizations",
7288
+ * "method": "GET"
7289
+ * }
7290
+ * }
7291
+ */
7292
+ "application/json": components["schemas"]["ErrorResponseDto"];
7293
+ };
7294
+ };
7295
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7296
+ 403: {
7297
+ headers: {
7298
+ [name: string]: unknown;
7299
+ };
7300
+ content: {
7301
+ /**
7302
+ * @example {
7303
+ * "error": {
7304
+ * "statusCode": 403,
7305
+ * "code": null,
7306
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7307
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7308
+ * "path": "/api/v1/organizations",
7309
+ * "method": "GET"
7310
+ * }
7311
+ * }
7312
+ */
7313
+ "application/json": components["schemas"]["ErrorResponseDto"];
7314
+ };
7315
+ };
7316
+ /** @description Organizations are not enabled on this Environment; switch the container on first */
7317
+ 409: {
7318
+ headers: {
7319
+ [name: string]: unknown;
7320
+ };
7321
+ content: {
7322
+ /**
7323
+ * @example {
7324
+ * "error": {
7325
+ * "statusCode": 409,
7326
+ * "code": null,
7327
+ * "message": "Organizations are not enabled on this Environment; switch the container on first",
7328
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7329
+ * "path": "/api/v1/organizations",
7330
+ * "method": "POST"
7331
+ * }
7332
+ * }
7333
+ */
7334
+ "application/json": components["schemas"]["ErrorResponseDto"];
7335
+ };
7336
+ };
7337
+ };
7338
+ };
7339
+ ApiOrganizationsController_deleteAllOrganizations: {
7340
+ parameters: {
7341
+ query?: never;
7342
+ header?: never;
7343
+ path?: never;
7344
+ cookie?: never;
7345
+ };
7346
+ requestBody?: never;
7347
+ responses: {
7348
+ /** @description Every organization deleted with its memberships, pending invitations, and subtree */
7349
+ 204: {
7350
+ headers: {
7351
+ [name: string]: unknown;
7352
+ };
7353
+ content?: never;
7354
+ };
7355
+ /** @description Invalid or expired token */
7356
+ 401: {
7357
+ headers: {
7358
+ [name: string]: unknown;
7359
+ };
7360
+ content: {
7361
+ /**
7362
+ * @example {
7363
+ * "error": {
7364
+ * "statusCode": 401,
7365
+ * "code": null,
7366
+ * "message": "Invalid or expired token",
7367
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7368
+ * "path": "/api/v1/organizations",
7369
+ * "method": "GET"
7370
+ * }
7371
+ * }
7372
+ */
7373
+ "application/json": components["schemas"]["ErrorResponseDto"];
7374
+ };
7375
+ };
7376
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7377
+ 403: {
7378
+ headers: {
7379
+ [name: string]: unknown;
7380
+ };
7381
+ content: {
7382
+ /**
7383
+ * @example {
7384
+ * "error": {
7385
+ * "statusCode": 403,
7386
+ * "code": null,
7387
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7388
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7389
+ * "path": "/api/v1/organizations",
7390
+ * "method": "GET"
7391
+ * }
7392
+ * }
7393
+ */
7394
+ "application/json": components["schemas"]["ErrorResponseDto"];
7395
+ };
7396
+ };
7397
+ };
7398
+ };
7399
+ ApiOrganizationsController_getOrganization: {
7400
+ parameters: {
7401
+ query?: never;
7402
+ header?: never;
7403
+ path: {
7404
+ id: string;
7405
+ };
7406
+ cookie?: never;
7407
+ };
7408
+ requestBody?: never;
7409
+ responses: {
7410
+ /** @description Organization returned */
7411
+ 200: {
7412
+ headers: {
7413
+ [name: string]: unknown;
7414
+ };
7415
+ content: {
7416
+ "application/json": {
7417
+ data: components["schemas"]["OrganizationResponseDto"];
7418
+ };
7419
+ };
7420
+ };
7421
+ /** @description Invalid or expired token */
7422
+ 401: {
7423
+ headers: {
7424
+ [name: string]: unknown;
7425
+ };
7426
+ content: {
7427
+ /**
7428
+ * @example {
7429
+ * "error": {
7430
+ * "statusCode": 401,
7431
+ * "code": null,
7432
+ * "message": "Invalid or expired token",
7433
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7434
+ * "path": "/api/v1/organizations",
7435
+ * "method": "GET"
7436
+ * }
7437
+ * }
7438
+ */
7439
+ "application/json": components["schemas"]["ErrorResponseDto"];
7440
+ };
7441
+ };
7442
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7443
+ 403: {
7444
+ headers: {
7445
+ [name: string]: unknown;
7446
+ };
7447
+ content: {
7448
+ /**
7449
+ * @example {
7450
+ * "error": {
7451
+ * "statusCode": 403,
7452
+ * "code": null,
7453
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7454
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7455
+ * "path": "/api/v1/organizations",
7456
+ * "method": "GET"
7457
+ * }
7458
+ * }
7459
+ */
7460
+ "application/json": components["schemas"]["ErrorResponseDto"];
7461
+ };
7462
+ };
7463
+ /** @description Organization not found */
7464
+ 404: {
7465
+ headers: {
7466
+ [name: string]: unknown;
7467
+ };
7468
+ content: {
7469
+ /**
7470
+ * @example {
7471
+ * "error": {
7472
+ * "statusCode": 404,
7473
+ * "code": null,
7474
+ * "message": "Organization not found",
7475
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7476
+ * "path": "/api/v1/organizations/{id}",
7477
+ * "method": "GET"
7478
+ * }
7479
+ * }
7480
+ */
7481
+ "application/json": components["schemas"]["ErrorResponseDto"];
7482
+ };
7483
+ };
7484
+ };
7485
+ };
7486
+ ApiOrganizationsController_deleteOrganization: {
7487
+ parameters: {
7488
+ query?: never;
7489
+ header: {
7490
+ "if-match": string;
7491
+ /** @description Optimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since. */
7492
+ "If-Match"?: string;
7493
+ };
7494
+ path: {
7495
+ id: string;
7496
+ };
7497
+ cookie?: never;
7498
+ };
7499
+ requestBody?: never;
7500
+ responses: {
7501
+ /** @description Organization deleted */
7502
+ 204: {
7503
+ headers: {
7504
+ [name: string]: unknown;
7505
+ };
7506
+ content?: never;
7507
+ };
7508
+ /** @description Invalid or expired token */
7509
+ 401: {
7510
+ headers: {
7511
+ [name: string]: unknown;
7512
+ };
7513
+ content: {
7514
+ /**
7515
+ * @example {
7516
+ * "error": {
7517
+ * "statusCode": 401,
7518
+ * "code": null,
7519
+ * "message": "Invalid or expired token",
7520
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7521
+ * "path": "/api/v1/organizations",
7522
+ * "method": "GET"
7523
+ * }
7524
+ * }
7525
+ */
7526
+ "application/json": components["schemas"]["ErrorResponseDto"];
7527
+ };
7528
+ };
7529
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7530
+ 403: {
7531
+ headers: {
7532
+ [name: string]: unknown;
7533
+ };
7534
+ content: {
7535
+ /**
7536
+ * @example {
7537
+ * "error": {
7538
+ * "statusCode": 403,
7539
+ * "code": null,
7540
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7541
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7542
+ * "path": "/api/v1/organizations",
7543
+ * "method": "GET"
7544
+ * }
7545
+ * }
7546
+ */
7547
+ "application/json": components["schemas"]["ErrorResponseDto"];
7548
+ };
7549
+ };
7550
+ /** @description Organization not found */
7551
+ 404: {
7552
+ headers: {
7553
+ [name: string]: unknown;
7554
+ };
7555
+ content: {
7556
+ /**
7557
+ * @example {
7558
+ * "error": {
7559
+ * "statusCode": 404,
7560
+ * "code": null,
7561
+ * "message": "Organization not found",
7562
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7563
+ * "path": "/api/v1/organizations/{id}",
7564
+ * "method": "DELETE"
7565
+ * }
7566
+ * }
7567
+ */
7568
+ "application/json": components["schemas"]["ErrorResponseDto"];
7569
+ };
7570
+ };
7571
+ /** @description Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry. */
7572
+ 409: {
7573
+ headers: {
7574
+ [name: string]: unknown;
7575
+ };
7576
+ content: {
7577
+ /**
7578
+ * @example {
7579
+ * "error": {
7580
+ * "statusCode": 409,
7581
+ * "code": null,
7582
+ * "message": "Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry.",
7583
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7584
+ * "path": "/api/v1/organizations/{id}",
7585
+ * "method": "DELETE"
7586
+ * }
7587
+ * }
7588
+ */
7589
+ "application/json": components["schemas"]["ErrorResponseDto"];
7590
+ };
7591
+ };
7592
+ };
7593
+ };
7594
+ ApiOrganizationsController_updateOrganization: {
7595
+ parameters: {
7596
+ query?: never;
7597
+ header: {
7598
+ "if-match": string;
7599
+ /** @description Optimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since. */
7600
+ "If-Match"?: string;
7601
+ };
7602
+ path: {
7603
+ id: string;
7604
+ };
7605
+ cookie?: never;
7606
+ };
7607
+ requestBody: {
7608
+ content: {
7609
+ "application/json": components["schemas"]["UpdateOrganizationDto"];
7610
+ };
7611
+ };
7612
+ responses: {
7613
+ /** @description Organization updated */
7614
+ 200: {
7615
+ headers: {
7616
+ [name: string]: unknown;
7617
+ };
7618
+ content: {
7619
+ "application/json": {
7620
+ data: components["schemas"]["OrganizationResponseDto"];
7621
+ };
7622
+ };
7623
+ };
7624
+ /** @description Invalid or expired token */
7625
+ 401: {
7626
+ headers: {
7627
+ [name: string]: unknown;
7628
+ };
7629
+ content: {
7630
+ /**
7631
+ * @example {
7632
+ * "error": {
7633
+ * "statusCode": 401,
7634
+ * "code": null,
7635
+ * "message": "Invalid or expired token",
7636
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7637
+ * "path": "/api/v1/organizations",
7638
+ * "method": "GET"
7639
+ * }
7640
+ * }
7641
+ */
7642
+ "application/json": components["schemas"]["ErrorResponseDto"];
7643
+ };
7644
+ };
7645
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7646
+ 403: {
7647
+ headers: {
7648
+ [name: string]: unknown;
7649
+ };
7650
+ content: {
7651
+ /**
7652
+ * @example {
7653
+ * "error": {
7654
+ * "statusCode": 403,
7655
+ * "code": null,
7656
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7657
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7658
+ * "path": "/api/v1/organizations",
7659
+ * "method": "GET"
7660
+ * }
7661
+ * }
7662
+ */
7663
+ "application/json": components["schemas"]["ErrorResponseDto"];
7664
+ };
7665
+ };
7666
+ /** @description Organization not found */
7667
+ 404: {
7668
+ headers: {
7669
+ [name: string]: unknown;
7670
+ };
7671
+ content: {
7672
+ /**
7673
+ * @example {
7674
+ * "error": {
7675
+ * "statusCode": 404,
7676
+ * "code": null,
7677
+ * "message": "Organization not found",
7678
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7679
+ * "path": "/api/v1/organizations/{id}",
7680
+ * "method": "PATCH"
7681
+ * }
7682
+ * }
7683
+ */
7684
+ "application/json": components["schemas"]["ErrorResponseDto"];
7685
+ };
7686
+ };
7687
+ /** @description Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry. */
7688
+ 409: {
7689
+ headers: {
7690
+ [name: string]: unknown;
7691
+ };
7692
+ content: {
7693
+ /**
7694
+ * @example {
7695
+ * "error": {
7696
+ * "statusCode": 409,
7697
+ * "code": null,
7698
+ * "message": "Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry.",
7699
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7700
+ * "path": "/api/v1/organizations/{id}",
7701
+ * "method": "PATCH"
7702
+ * }
7703
+ * }
7704
+ */
7705
+ "application/json": components["schemas"]["ErrorResponseDto"];
7706
+ };
7707
+ };
7708
+ };
7709
+ };
7710
+ ApiOrganizationsController_getPolicy: {
7711
+ parameters: {
7712
+ query?: never;
7713
+ header?: never;
7714
+ path: {
7715
+ id: string;
7716
+ };
7717
+ cookie?: never;
7718
+ };
7719
+ requestBody?: never;
7720
+ responses: {
7721
+ /** @description Policy returned */
7722
+ 200: {
7723
+ headers: {
7724
+ [name: string]: unknown;
7725
+ };
7726
+ content: {
7727
+ "application/json": {
7728
+ data: components["schemas"]["OrganizationPolicyResponseDto"];
7729
+ };
7730
+ };
7731
+ };
7732
+ /** @description Invalid or expired token */
7733
+ 401: {
7734
+ headers: {
7735
+ [name: string]: unknown;
7736
+ };
7737
+ content: {
7738
+ /**
7739
+ * @example {
7740
+ * "error": {
7741
+ * "statusCode": 401,
7742
+ * "code": null,
7743
+ * "message": "Invalid or expired token",
7744
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7745
+ * "path": "/api/v1/organizations",
7746
+ * "method": "GET"
7747
+ * }
7748
+ * }
7749
+ */
7750
+ "application/json": components["schemas"]["ErrorResponseDto"];
7751
+ };
7752
+ };
7753
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7754
+ 403: {
7755
+ headers: {
7756
+ [name: string]: unknown;
7757
+ };
7758
+ content: {
7759
+ /**
7760
+ * @example {
7761
+ * "error": {
7762
+ * "statusCode": 403,
7763
+ * "code": null,
7764
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7765
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7766
+ * "path": "/api/v1/organizations",
7767
+ * "method": "GET"
7768
+ * }
7769
+ * }
7770
+ */
7771
+ "application/json": components["schemas"]["ErrorResponseDto"];
7772
+ };
7773
+ };
7774
+ /** @description Organization not found */
7775
+ 404: {
7776
+ headers: {
7777
+ [name: string]: unknown;
7778
+ };
7779
+ content: {
7780
+ /**
7781
+ * @example {
7782
+ * "error": {
7783
+ * "statusCode": 404,
7784
+ * "code": null,
7785
+ * "message": "Organization not found",
7786
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7787
+ * "path": "/api/v1/organizations/{id}/policy",
7788
+ * "method": "GET"
7789
+ * }
7790
+ * }
7791
+ */
7792
+ "application/json": components["schemas"]["ErrorResponseDto"];
7793
+ };
7794
+ };
7795
+ };
7796
+ };
7797
+ ApiOrganizationsController_updatePolicy: {
7798
+ parameters: {
7799
+ query?: never;
7800
+ header: {
7801
+ "if-match": string;
7802
+ /** @description Optimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since. */
7803
+ "If-Match"?: string;
7804
+ };
7805
+ path: {
7806
+ id: string;
7807
+ };
7808
+ cookie?: never;
7809
+ };
7810
+ requestBody: {
7811
+ content: {
7812
+ "application/json": components["schemas"]["UpdateOrganizationPolicyDto"];
7813
+ };
7814
+ };
7815
+ responses: {
7816
+ /** @description Policy updated */
7817
+ 200: {
7818
+ headers: {
7819
+ [name: string]: unknown;
7820
+ };
7821
+ content: {
7822
+ "application/json": {
7823
+ data: components["schemas"]["OrganizationPolicyResponseDto"];
7824
+ };
7825
+ };
7826
+ };
7827
+ /** @description The policy would loosen the Environment's authentication settings */
7828
+ 400: {
7829
+ headers: {
7830
+ [name: string]: unknown;
7831
+ };
7832
+ content: {
7833
+ /**
7834
+ * @example {
7835
+ * "error": {
7836
+ * "statusCode": 400,
7837
+ * "code": null,
7838
+ * "message": "The policy would loosen the Environment's authentication settings",
7839
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7840
+ * "path": "/api/v1/organizations/{id}/policy",
7841
+ * "method": "PATCH"
7842
+ * }
7843
+ * }
7844
+ */
7845
+ "application/json": components["schemas"]["ErrorResponseDto"];
7846
+ };
7847
+ };
7848
+ /** @description Invalid or expired token */
7849
+ 401: {
7850
+ headers: {
7851
+ [name: string]: unknown;
7852
+ };
7853
+ content: {
7854
+ /**
7855
+ * @example {
7856
+ * "error": {
7857
+ * "statusCode": 401,
7858
+ * "code": null,
7859
+ * "message": "Invalid or expired token",
7860
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7861
+ * "path": "/api/v1/organizations",
7862
+ * "method": "GET"
7863
+ * }
7864
+ * }
7865
+ */
7866
+ "application/json": components["schemas"]["ErrorResponseDto"];
7867
+ };
7868
+ };
7869
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7870
+ 403: {
7871
+ headers: {
7872
+ [name: string]: unknown;
7873
+ };
7874
+ content: {
7875
+ /**
7876
+ * @example {
7877
+ * "error": {
7878
+ * "statusCode": 403,
7879
+ * "code": null,
7880
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7881
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7882
+ * "path": "/api/v1/organizations",
7883
+ * "method": "GET"
7884
+ * }
7885
+ * }
7886
+ */
7887
+ "application/json": components["schemas"]["ErrorResponseDto"];
7888
+ };
7889
+ };
7890
+ /** @description Organization not found */
7891
+ 404: {
7892
+ headers: {
7893
+ [name: string]: unknown;
7894
+ };
7895
+ content: {
7896
+ /**
7897
+ * @example {
7898
+ * "error": {
7899
+ * "statusCode": 404,
7900
+ * "code": null,
7901
+ * "message": "Organization not found",
7902
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7903
+ * "path": "/api/v1/organizations/{id}/policy",
7904
+ * "method": "PATCH"
7905
+ * }
7906
+ * }
7907
+ */
7908
+ "application/json": components["schemas"]["ErrorResponseDto"];
7909
+ };
7910
+ };
7911
+ /** @description Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry. */
7912
+ 409: {
7913
+ headers: {
7914
+ [name: string]: unknown;
7915
+ };
7916
+ content: {
7917
+ /**
7918
+ * @example {
7919
+ * "error": {
7920
+ * "statusCode": 409,
7921
+ * "code": null,
7922
+ * "message": "Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry.",
7923
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7924
+ * "path": "/api/v1/organizations/{id}/policy",
7925
+ * "method": "PATCH"
7926
+ * }
7927
+ * }
7928
+ */
7929
+ "application/json": components["schemas"]["ErrorResponseDto"];
7930
+ };
7931
+ };
7932
+ };
7933
+ };
7934
+ ApiOrganizationsController_listSsoConnections: {
7935
+ parameters: {
7936
+ query?: never;
7937
+ header?: never;
7938
+ path: {
7939
+ id: string;
7940
+ };
7941
+ cookie?: never;
7942
+ };
7943
+ requestBody?: never;
7944
+ responses: {
7945
+ /** @description Bindings returned */
7946
+ 200: {
7947
+ headers: {
7948
+ [name: string]: unknown;
7949
+ };
7950
+ content: {
7951
+ "application/json": {
7952
+ items: components["schemas"]["OrganizationSsoConnectionResponseDto"][];
7953
+ };
7954
+ };
7955
+ };
7956
+ /** @description Invalid or expired token */
7957
+ 401: {
7958
+ headers: {
7959
+ [name: string]: unknown;
7960
+ };
7961
+ content: {
7962
+ /**
7963
+ * @example {
7964
+ * "error": {
7965
+ * "statusCode": 401,
7966
+ * "code": null,
7967
+ * "message": "Invalid or expired token",
7968
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7969
+ * "path": "/api/v1/organizations",
7970
+ * "method": "GET"
7971
+ * }
7972
+ * }
7973
+ */
7974
+ "application/json": components["schemas"]["ErrorResponseDto"];
7975
+ };
7976
+ };
7977
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
7978
+ 403: {
7979
+ headers: {
7980
+ [name: string]: unknown;
7981
+ };
7982
+ content: {
7983
+ /**
7984
+ * @example {
7985
+ * "error": {
7986
+ * "statusCode": 403,
7987
+ * "code": null,
7988
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
7989
+ * "timestamp": "2026-04-20T12:00:00.000Z",
7990
+ * "path": "/api/v1/organizations",
7991
+ * "method": "GET"
7992
+ * }
7993
+ * }
7994
+ */
7995
+ "application/json": components["schemas"]["ErrorResponseDto"];
7996
+ };
7997
+ };
7998
+ /** @description Organization not found */
7999
+ 404: {
8000
+ headers: {
8001
+ [name: string]: unknown;
8002
+ };
8003
+ content: {
8004
+ /**
8005
+ * @example {
8006
+ * "error": {
8007
+ * "statusCode": 404,
8008
+ * "code": null,
8009
+ * "message": "Organization not found",
8010
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8011
+ * "path": "/api/v1/organizations/{id}/sso-connections",
8012
+ * "method": "GET"
8013
+ * }
8014
+ * }
8015
+ */
8016
+ "application/json": components["schemas"]["ErrorResponseDto"];
8017
+ };
8018
+ };
8019
+ };
8020
+ };
8021
+ ApiOrganizationsController_bindSsoConnection: {
8022
+ parameters: {
8023
+ query?: never;
8024
+ header?: never;
8025
+ path: {
8026
+ id: string;
8027
+ };
8028
+ cookie?: never;
8029
+ };
8030
+ requestBody: {
8031
+ content: {
8032
+ "application/json": components["schemas"]["BindOrganizationSsoConnectionDto"];
8033
+ };
8034
+ };
8035
+ responses: {
8036
+ /** @description Connection bound */
8037
+ 201: {
8038
+ headers: {
8039
+ [name: string]: unknown;
8040
+ };
8041
+ content: {
8042
+ "application/json": {
8043
+ data: components["schemas"]["OrganizationSsoConnectionResponseDto"];
8044
+ };
8045
+ };
8046
+ };
8047
+ /** @description The connection is not an end-user connection bound to the organization's Environment, or the role is not an active, assignable role in that Environment */
8048
+ 400: {
8049
+ headers: {
8050
+ [name: string]: unknown;
8051
+ };
8052
+ content: {
8053
+ /**
8054
+ * @example {
8055
+ * "error": {
8056
+ * "statusCode": 400,
8057
+ * "code": null,
8058
+ * "message": "The connection is not an end-user connection bound to the organization's Environment, or the role is not an active, assignable role in that Environment",
8059
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8060
+ * "path": "/api/v1/organizations/{id}/sso-connections",
8061
+ * "method": "POST"
8062
+ * }
8063
+ * }
8064
+ */
8065
+ "application/json": components["schemas"]["ErrorResponseDto"];
8066
+ };
8067
+ };
8068
+ /** @description Invalid or expired token */
8069
+ 401: {
8070
+ headers: {
8071
+ [name: string]: unknown;
8072
+ };
8073
+ content: {
8074
+ /**
8075
+ * @example {
8076
+ * "error": {
8077
+ * "statusCode": 401,
8078
+ * "code": null,
8079
+ * "message": "Invalid or expired token",
8080
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8081
+ * "path": "/api/v1/organizations",
8082
+ * "method": "GET"
8083
+ * }
8084
+ * }
8085
+ */
8086
+ "application/json": components["schemas"]["ErrorResponseDto"];
8087
+ };
8088
+ };
8089
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8090
+ 403: {
8091
+ headers: {
8092
+ [name: string]: unknown;
8093
+ };
8094
+ content: {
8095
+ /**
8096
+ * @example {
8097
+ * "error": {
8098
+ * "statusCode": 403,
8099
+ * "code": null,
8100
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8101
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8102
+ * "path": "/api/v1/organizations",
8103
+ * "method": "GET"
8104
+ * }
8105
+ * }
8106
+ */
8107
+ "application/json": components["schemas"]["ErrorResponseDto"];
8108
+ };
8109
+ };
8110
+ /** @description Organization not found */
8111
+ 404: {
8112
+ headers: {
8113
+ [name: string]: unknown;
8114
+ };
8115
+ content: {
8116
+ /**
8117
+ * @example {
8118
+ * "error": {
8119
+ * "statusCode": 404,
8120
+ * "code": null,
8121
+ * "message": "Organization not found",
8122
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8123
+ * "path": "/api/v1/organizations/{id}/sso-connections",
8124
+ * "method": "POST"
8125
+ * }
8126
+ * }
8127
+ */
8128
+ "application/json": components["schemas"]["ErrorResponseDto"];
8129
+ };
8130
+ };
8131
+ /** @description The connection is already bound to an organization in this Environment */
8132
+ 409: {
8133
+ headers: {
8134
+ [name: string]: unknown;
8135
+ };
8136
+ content: {
8137
+ /**
8138
+ * @example {
8139
+ * "error": {
8140
+ * "statusCode": 409,
8141
+ * "code": null,
8142
+ * "message": "The connection is already bound to an organization in this Environment",
8143
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8144
+ * "path": "/api/v1/organizations/{id}/sso-connections",
8145
+ * "method": "POST"
8146
+ * }
8147
+ * }
8148
+ */
8149
+ "application/json": components["schemas"]["ErrorResponseDto"];
8150
+ };
8151
+ };
8152
+ };
8153
+ };
8154
+ ApiOrganizationsController_unbindSsoConnection: {
8155
+ parameters: {
8156
+ query?: never;
8157
+ header?: never;
8158
+ path: {
8159
+ id: string;
8160
+ connectionId: string;
8161
+ };
8162
+ cookie?: never;
8163
+ };
8164
+ requestBody?: never;
8165
+ responses: {
8166
+ /** @description Connection unbound */
8167
+ 204: {
8168
+ headers: {
8169
+ [name: string]: unknown;
8170
+ };
8171
+ content?: never;
8172
+ };
8173
+ /** @description Invalid or expired token */
8174
+ 401: {
8175
+ headers: {
8176
+ [name: string]: unknown;
8177
+ };
8178
+ content: {
8179
+ /**
8180
+ * @example {
8181
+ * "error": {
8182
+ * "statusCode": 401,
8183
+ * "code": null,
8184
+ * "message": "Invalid or expired token",
8185
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8186
+ * "path": "/api/v1/organizations",
8187
+ * "method": "GET"
8188
+ * }
8189
+ * }
8190
+ */
8191
+ "application/json": components["schemas"]["ErrorResponseDto"];
8192
+ };
8193
+ };
8194
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8195
+ 403: {
8196
+ headers: {
8197
+ [name: string]: unknown;
8198
+ };
8199
+ content: {
8200
+ /**
8201
+ * @example {
8202
+ * "error": {
8203
+ * "statusCode": 403,
8204
+ * "code": null,
8205
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8206
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8207
+ * "path": "/api/v1/organizations",
8208
+ * "method": "GET"
8209
+ * }
8210
+ * }
8211
+ */
8212
+ "application/json": components["schemas"]["ErrorResponseDto"];
8213
+ };
8214
+ };
8215
+ /** @description This SSO connection is not bound to the organization */
8216
+ 404: {
8217
+ headers: {
8218
+ [name: string]: unknown;
8219
+ };
8220
+ content: {
8221
+ /**
8222
+ * @example {
8223
+ * "error": {
8224
+ * "statusCode": 404,
8225
+ * "code": null,
8226
+ * "message": "This SSO connection is not bound to the organization",
8227
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8228
+ * "path": "/api/v1/organizations/{id}/sso-connections/{connectionId}",
8229
+ * "method": "DELETE"
8230
+ * }
8231
+ * }
8232
+ */
8233
+ "application/json": components["schemas"]["ErrorResponseDto"];
8234
+ };
8235
+ };
8236
+ };
8237
+ };
8238
+ ApiOrganizationsController_listMembers: {
8239
+ parameters: {
8240
+ query?: {
8241
+ /** @description Page number (1-based) */
8242
+ page?: number;
8243
+ /** @description Items per page (1-100, default 20) */
8244
+ take?: number;
8245
+ /** @description Search term */
8246
+ q?: string;
8247
+ /** @description Column to sort by. Allowed values depend on the endpoint. */
8248
+ sort_by?: string;
8249
+ /** @description Sort direction */
8250
+ order?: "asc" | "desc";
8251
+ /** @description Only members holding this role */
8252
+ role_id?: string;
8253
+ /** @description Filter by the membership's effective window: active now, scheduled to start, or already expired */
8254
+ status?: "active" | "scheduled" | "expired";
8255
+ };
8256
+ header?: never;
8257
+ path: {
8258
+ id: string;
8259
+ };
8260
+ cookie?: never;
8261
+ };
8262
+ requestBody?: never;
8263
+ responses: {
8264
+ /** @description Paginated list */
8265
+ 200: {
8266
+ headers: {
8267
+ [name: string]: unknown;
8268
+ };
8269
+ content: {
8270
+ "application/json": {
8271
+ items: components["schemas"]["OrganizationMemberResponseDto"][];
8272
+ pagination: components["schemas"]["PageMetaDto"];
8273
+ };
8274
+ };
8275
+ };
8276
+ /** @description Invalid or expired token */
8277
+ 401: {
8278
+ headers: {
8279
+ [name: string]: unknown;
8280
+ };
8281
+ content: {
8282
+ /**
8283
+ * @example {
8284
+ * "error": {
8285
+ * "statusCode": 401,
8286
+ * "code": null,
8287
+ * "message": "Invalid or expired token",
8288
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8289
+ * "path": "/api/v1/organizations",
8290
+ * "method": "GET"
8291
+ * }
8292
+ * }
8293
+ */
8294
+ "application/json": components["schemas"]["ErrorResponseDto"];
8295
+ };
8296
+ };
8297
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8298
+ 403: {
8299
+ headers: {
8300
+ [name: string]: unknown;
8301
+ };
8302
+ content: {
8303
+ /**
8304
+ * @example {
8305
+ * "error": {
8306
+ * "statusCode": 403,
8307
+ * "code": null,
8308
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8309
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8310
+ * "path": "/api/v1/organizations",
8311
+ * "method": "GET"
8312
+ * }
8313
+ * }
8314
+ */
8315
+ "application/json": components["schemas"]["ErrorResponseDto"];
8316
+ };
8317
+ };
8318
+ /** @description Organization not found */
8319
+ 404: {
8320
+ headers: {
8321
+ [name: string]: unknown;
8322
+ };
8323
+ content: {
8324
+ /**
8325
+ * @example {
8326
+ * "error": {
8327
+ * "statusCode": 404,
8328
+ * "code": null,
8329
+ * "message": "Organization not found",
8330
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8331
+ * "path": "/api/v1/organizations/{id}/members",
8332
+ * "method": "GET"
8333
+ * }
8334
+ * }
8335
+ */
8336
+ "application/json": components["schemas"]["ErrorResponseDto"];
8337
+ };
8338
+ };
8339
+ };
8340
+ };
8341
+ ApiOrganizationsController_addMember: {
8342
+ parameters: {
8343
+ query?: never;
8344
+ header?: never;
8345
+ path: {
8346
+ id: string;
8347
+ };
8348
+ cookie?: never;
8349
+ };
8350
+ requestBody: {
8351
+ content: {
8352
+ "application/json": components["schemas"]["AddOrganizationMemberDto"];
8353
+ };
8354
+ };
8355
+ responses: {
8356
+ /** @description Member added */
8357
+ 201: {
8358
+ headers: {
8359
+ [name: string]: unknown;
8360
+ };
8361
+ content: {
8362
+ "application/json": {
8363
+ data: components["schemas"]["OrganizationMemberResponseDto"];
8364
+ };
8365
+ };
8366
+ };
8367
+ /** @description Invalid or expired token */
8368
+ 401: {
8369
+ headers: {
8370
+ [name: string]: unknown;
8371
+ };
8372
+ content: {
8373
+ /**
8374
+ * @example {
8375
+ * "error": {
8376
+ * "statusCode": 401,
8377
+ * "code": null,
8378
+ * "message": "Invalid or expired token",
8379
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8380
+ * "path": "/api/v1/organizations",
8381
+ * "method": "GET"
8382
+ * }
8383
+ * }
8384
+ */
8385
+ "application/json": components["schemas"]["ErrorResponseDto"];
8386
+ };
8387
+ };
8388
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8389
+ 403: {
8390
+ headers: {
8391
+ [name: string]: unknown;
8392
+ };
8393
+ content: {
8394
+ /**
8395
+ * @example {
8396
+ * "error": {
8397
+ * "statusCode": 403,
8398
+ * "code": null,
8399
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8400
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8401
+ * "path": "/api/v1/organizations",
8402
+ * "method": "GET"
8403
+ * }
8404
+ * }
8405
+ */
8406
+ "application/json": components["schemas"]["ErrorResponseDto"];
8407
+ };
8408
+ };
8409
+ /** @description Organization not found */
8410
+ 404: {
8411
+ headers: {
8412
+ [name: string]: unknown;
8413
+ };
8414
+ content: {
8415
+ /**
8416
+ * @example {
8417
+ * "error": {
8418
+ * "statusCode": 404,
8419
+ * "code": null,
8420
+ * "message": "Organization not found",
8421
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8422
+ * "path": "/api/v1/organizations/{id}/members",
8423
+ * "method": "POST"
8424
+ * }
8425
+ * }
8426
+ */
8427
+ "application/json": components["schemas"]["ErrorResponseDto"];
8428
+ };
8429
+ };
8430
+ /** @description The identity is already a member of this organization */
8431
+ 409: {
8432
+ headers: {
8433
+ [name: string]: unknown;
8434
+ };
8435
+ content: {
8436
+ /**
8437
+ * @example {
8438
+ * "error": {
8439
+ * "statusCode": 409,
8440
+ * "code": null,
8441
+ * "message": "The identity is already a member of this organization",
8442
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8443
+ * "path": "/api/v1/organizations/{id}/members",
8444
+ * "method": "POST"
8445
+ * }
8446
+ * }
8447
+ */
8448
+ "application/json": components["schemas"]["ErrorResponseDto"];
8449
+ };
8450
+ };
8451
+ };
8452
+ };
8453
+ ApiOrganizationsController_removeMember: {
8454
+ parameters: {
8455
+ query?: never;
8456
+ header?: never;
8457
+ path: {
8458
+ id: string;
8459
+ identityId: string;
8460
+ };
8461
+ cookie?: never;
8462
+ };
8463
+ requestBody?: never;
8464
+ responses: {
8465
+ /** @description Member removed */
8466
+ 204: {
8467
+ headers: {
8468
+ [name: string]: unknown;
8469
+ };
8470
+ content?: never;
8471
+ };
8472
+ /** @description Invalid or expired token */
8473
+ 401: {
8474
+ headers: {
8475
+ [name: string]: unknown;
8476
+ };
8477
+ content: {
8478
+ /**
8479
+ * @example {
8480
+ * "error": {
8481
+ * "statusCode": 401,
8482
+ * "code": null,
8483
+ * "message": "Invalid or expired token",
8484
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8485
+ * "path": "/api/v1/organizations",
8486
+ * "method": "GET"
8487
+ * }
8488
+ * }
8489
+ */
8490
+ "application/json": components["schemas"]["ErrorResponseDto"];
8491
+ };
8492
+ };
8493
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8494
+ 403: {
8495
+ headers: {
8496
+ [name: string]: unknown;
8497
+ };
8498
+ content: {
8499
+ /**
8500
+ * @example {
8501
+ * "error": {
8502
+ * "statusCode": 403,
8503
+ * "code": null,
8504
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8505
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8506
+ * "path": "/api/v1/organizations",
8507
+ * "method": "GET"
8508
+ * }
8509
+ * }
8510
+ */
8511
+ "application/json": components["schemas"]["ErrorResponseDto"];
8512
+ };
8513
+ };
8514
+ /** @description The identity is not a member of this organization */
8515
+ 404: {
8516
+ headers: {
8517
+ [name: string]: unknown;
8518
+ };
8519
+ content: {
8520
+ /**
8521
+ * @example {
8522
+ * "error": {
8523
+ * "statusCode": 404,
8524
+ * "code": null,
8525
+ * "message": "The identity is not a member of this organization",
8526
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8527
+ * "path": "/api/v1/organizations/{id}/members/{identityId}",
8528
+ * "method": "DELETE"
8529
+ * }
8530
+ * }
8531
+ */
8532
+ "application/json": components["schemas"]["ErrorResponseDto"];
8533
+ };
8534
+ };
8535
+ };
8536
+ };
8537
+ ApiOrganizationsController_changeMemberRole: {
8538
+ parameters: {
8539
+ query?: never;
8540
+ header?: never;
8541
+ path: {
8542
+ id: string;
8543
+ identityId: string;
8544
+ };
8545
+ cookie?: never;
8546
+ };
8547
+ requestBody: {
8548
+ content: {
8549
+ "application/json": components["schemas"]["ChangeOrganizationMemberRoleDto"];
8550
+ };
8551
+ };
8552
+ responses: {
8553
+ /** @description Member role changed */
8554
+ 200: {
8555
+ headers: {
8556
+ [name: string]: unknown;
8557
+ };
8558
+ content: {
8559
+ "application/json": {
8560
+ data: components["schemas"]["OrganizationMemberResponseDto"];
8561
+ };
8562
+ };
8563
+ };
8564
+ /** @description Invalid or expired token */
8565
+ 401: {
8566
+ headers: {
8567
+ [name: string]: unknown;
8568
+ };
8569
+ content: {
8570
+ /**
8571
+ * @example {
8572
+ * "error": {
8573
+ * "statusCode": 401,
8574
+ * "code": null,
8575
+ * "message": "Invalid or expired token",
8576
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8577
+ * "path": "/api/v1/organizations",
8578
+ * "method": "GET"
8579
+ * }
8580
+ * }
8581
+ */
8582
+ "application/json": components["schemas"]["ErrorResponseDto"];
8583
+ };
8584
+ };
8585
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8586
+ 403: {
8587
+ headers: {
8588
+ [name: string]: unknown;
8589
+ };
8590
+ content: {
8591
+ /**
8592
+ * @example {
8593
+ * "error": {
8594
+ * "statusCode": 403,
8595
+ * "code": null,
8596
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8597
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8598
+ * "path": "/api/v1/organizations",
8599
+ * "method": "GET"
8600
+ * }
8601
+ * }
8602
+ */
8603
+ "application/json": components["schemas"]["ErrorResponseDto"];
8604
+ };
8605
+ };
8606
+ /** @description The identity is not a member of this organization */
8607
+ 404: {
8608
+ headers: {
8609
+ [name: string]: unknown;
8610
+ };
8611
+ content: {
8612
+ /**
8613
+ * @example {
8614
+ * "error": {
8615
+ * "statusCode": 404,
8616
+ * "code": null,
8617
+ * "message": "The identity is not a member of this organization",
8618
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8619
+ * "path": "/api/v1/organizations/{id}/members/{identityId}",
8620
+ * "method": "PATCH"
8621
+ * }
8622
+ * }
8623
+ */
8624
+ "application/json": components["schemas"]["ErrorResponseDto"];
8625
+ };
8626
+ };
8627
+ };
8628
+ };
8629
+ ApiOrganizationsController_listInvites: {
8630
+ parameters: {
8631
+ query?: {
8632
+ /** @description Page number (1-based) */
8633
+ page?: number;
8634
+ /** @description Items per page (1-100, default 20) */
8635
+ take?: number;
8636
+ /** @description Search term */
8637
+ q?: string;
8638
+ /** @description Column to sort by. Allowed values depend on the endpoint. */
8639
+ sort_by?: string;
8640
+ /** @description Sort direction */
8641
+ order?: "asc" | "desc";
8642
+ /** @description Filter by invitation status */
8643
+ status?: "pending" | "accepted" | "revoked" | "expired";
8644
+ };
8645
+ header?: never;
8646
+ path: {
8647
+ id: string;
8648
+ };
8649
+ cookie?: never;
8650
+ };
8651
+ requestBody?: never;
8652
+ responses: {
8653
+ /** @description Paginated list */
8654
+ 200: {
8655
+ headers: {
8656
+ [name: string]: unknown;
8657
+ };
8658
+ content: {
8659
+ "application/json": {
8660
+ items: components["schemas"]["IdentityInviteResponseDto"][];
8661
+ pagination: components["schemas"]["PageMetaDto"];
8662
+ };
8663
+ };
8664
+ };
8665
+ /** @description Invalid or expired token */
8666
+ 401: {
8667
+ headers: {
8668
+ [name: string]: unknown;
8669
+ };
8670
+ content: {
8671
+ /**
8672
+ * @example {
8673
+ * "error": {
8674
+ * "statusCode": 401,
8675
+ * "code": null,
8676
+ * "message": "Invalid or expired token",
8677
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8678
+ * "path": "/api/v1/organizations",
8679
+ * "method": "GET"
8680
+ * }
8681
+ * }
8682
+ */
8683
+ "application/json": components["schemas"]["ErrorResponseDto"];
8684
+ };
8685
+ };
8686
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8687
+ 403: {
8688
+ headers: {
8689
+ [name: string]: unknown;
8690
+ };
8691
+ content: {
8692
+ /**
8693
+ * @example {
8694
+ * "error": {
8695
+ * "statusCode": 403,
8696
+ * "code": null,
8697
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8698
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8699
+ * "path": "/api/v1/organizations",
8700
+ * "method": "GET"
8701
+ * }
8702
+ * }
8703
+ */
8704
+ "application/json": components["schemas"]["ErrorResponseDto"];
8705
+ };
8706
+ };
8707
+ /** @description Organization not found */
8708
+ 404: {
8709
+ headers: {
8710
+ [name: string]: unknown;
8711
+ };
8712
+ content: {
8713
+ /**
8714
+ * @example {
8715
+ * "error": {
8716
+ * "statusCode": 404,
8717
+ * "code": null,
8718
+ * "message": "Organization not found",
8719
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8720
+ * "path": "/api/v1/organizations/{id}/invites",
8721
+ * "method": "GET"
8722
+ * }
8723
+ * }
8724
+ */
8725
+ "application/json": components["schemas"]["ErrorResponseDto"];
8726
+ };
8727
+ };
8728
+ };
8729
+ };
8730
+ ApiOrganizationsController_createInvite: {
8731
+ parameters: {
8732
+ query?: never;
8733
+ header?: never;
8734
+ path: {
8735
+ id: string;
8736
+ };
8737
+ cookie?: never;
8738
+ };
8739
+ requestBody: {
8740
+ content: {
8741
+ "application/json": components["schemas"]["CreateOrganizationInviteDto"];
8742
+ };
8743
+ };
8744
+ responses: {
8745
+ /** @description Invitation created */
8746
+ 201: {
8747
+ headers: {
8748
+ [name: string]: unknown;
8749
+ };
8750
+ content: {
8751
+ "application/json": {
8752
+ data: components["schemas"]["ApiIdentityInviteResponseDto"];
8753
+ };
8754
+ };
8755
+ };
8756
+ /** @description Invalid or expired token */
8757
+ 401: {
8758
+ headers: {
8759
+ [name: string]: unknown;
8760
+ };
8761
+ content: {
8762
+ /**
8763
+ * @example {
8764
+ * "error": {
8765
+ * "statusCode": 401,
8766
+ * "code": null,
8767
+ * "message": "Invalid or expired token",
8768
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8769
+ * "path": "/api/v1/organizations",
8770
+ * "method": "GET"
8771
+ * }
8772
+ * }
8773
+ */
8774
+ "application/json": components["schemas"]["ErrorResponseDto"];
8775
+ };
8776
+ };
8777
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8778
+ 403: {
8779
+ headers: {
8780
+ [name: string]: unknown;
8781
+ };
8782
+ content: {
8783
+ /**
8784
+ * @example {
8785
+ * "error": {
8786
+ * "statusCode": 403,
8787
+ * "code": null,
8788
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8789
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8790
+ * "path": "/api/v1/organizations",
8791
+ * "method": "GET"
8792
+ * }
8793
+ * }
8794
+ */
8795
+ "application/json": components["schemas"]["ErrorResponseDto"];
8796
+ };
8797
+ };
8798
+ /** @description Organization not found */
8799
+ 404: {
8800
+ headers: {
8801
+ [name: string]: unknown;
8802
+ };
8803
+ content: {
8804
+ /**
8805
+ * @example {
8806
+ * "error": {
8807
+ * "statusCode": 404,
8808
+ * "code": null,
8809
+ * "message": "Organization not found",
8810
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8811
+ * "path": "/api/v1/organizations/{id}/invites",
8812
+ * "method": "POST"
8813
+ * }
8814
+ * }
8815
+ */
8816
+ "application/json": components["schemas"]["ErrorResponseDto"];
8817
+ };
8818
+ };
8819
+ };
8820
+ };
8821
+ ApiOrganizationsController_revokeInvite: {
8822
+ parameters: {
8823
+ query?: never;
8824
+ header?: never;
8825
+ path: {
8826
+ id: string;
8827
+ inviteId: string;
8828
+ };
8829
+ cookie?: never;
8830
+ };
8831
+ requestBody?: never;
8832
+ responses: {
8833
+ /** @description Invitation revoked */
8834
+ 204: {
8835
+ headers: {
8836
+ [name: string]: unknown;
8837
+ };
8838
+ content?: never;
8839
+ };
8840
+ /** @description Invalid or expired token */
8841
+ 401: {
8842
+ headers: {
8843
+ [name: string]: unknown;
8844
+ };
8845
+ content: {
8846
+ /**
8847
+ * @example {
8848
+ * "error": {
8849
+ * "statusCode": 401,
8850
+ * "code": null,
8851
+ * "message": "Invalid or expired token",
8852
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8853
+ * "path": "/api/v1/organizations",
8854
+ * "method": "GET"
8855
+ * }
8856
+ * }
8857
+ */
8858
+ "application/json": components["schemas"]["ErrorResponseDto"];
8859
+ };
8860
+ };
8861
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8862
+ 403: {
8863
+ headers: {
8864
+ [name: string]: unknown;
8865
+ };
8866
+ content: {
8867
+ /**
8868
+ * @example {
8869
+ * "error": {
8870
+ * "statusCode": 403,
8871
+ * "code": null,
8872
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8873
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8874
+ * "path": "/api/v1/organizations",
8875
+ * "method": "GET"
8876
+ * }
8877
+ * }
8878
+ */
8879
+ "application/json": components["schemas"]["ErrorResponseDto"];
8880
+ };
8881
+ };
8882
+ /** @description No such invitation on this organization */
8883
+ 404: {
8884
+ headers: {
8885
+ [name: string]: unknown;
8886
+ };
8887
+ content: {
8888
+ /**
8889
+ * @example {
8890
+ * "error": {
8891
+ * "statusCode": 404,
8892
+ * "code": null,
8893
+ * "message": "No such invitation on this organization",
8894
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8895
+ * "path": "/api/v1/organizations/{id}/invites/{inviteId}",
8896
+ * "method": "DELETE"
8897
+ * }
8898
+ * }
8899
+ */
8900
+ "application/json": components["schemas"]["ErrorResponseDto"];
8901
+ };
8902
+ };
8903
+ };
8904
+ };
8905
+ ApiRolesController_listRoles: {
8906
+ parameters: {
8907
+ query?: {
8908
+ /** @description Include deactivated roles in the list. */
8909
+ include_inactive?: "true" | "false";
8910
+ /** @description Filter by role origin. */
8911
+ type?: "system" | "custom";
8912
+ };
8913
+ header?: never;
8914
+ path?: never;
8915
+ cookie?: never;
8916
+ };
8917
+ requestBody?: never;
8918
+ responses: {
8919
+ /** @description Roles returned */
8920
+ 200: {
8921
+ headers: {
8922
+ [name: string]: unknown;
8923
+ };
8924
+ content: {
8925
+ "application/json": {
8926
+ items: components["schemas"]["RoleResponseDto"][];
8927
+ };
8928
+ };
8929
+ };
8930
+ /** @description Invalid or expired token */
8931
+ 401: {
8932
+ headers: {
8933
+ [name: string]: unknown;
8934
+ };
8935
+ content: {
8936
+ /**
8937
+ * @example {
8938
+ * "error": {
8939
+ * "statusCode": 401,
8940
+ * "code": null,
8941
+ * "message": "Invalid or expired token",
8942
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8943
+ * "path": "/api/v1/roles",
8944
+ * "method": "GET"
8945
+ * }
8946
+ * }
8947
+ */
8948
+ "application/json": components["schemas"]["ErrorResponseDto"];
8949
+ };
8950
+ };
8951
+ /** @description This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa) */
8952
+ 403: {
8953
+ headers: {
8954
+ [name: string]: unknown;
8955
+ };
8956
+ content: {
8957
+ /**
8958
+ * @example {
8959
+ * "error": {
8960
+ * "statusCode": 403,
8961
+ * "code": null,
8962
+ * "message": "This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)",
8963
+ * "timestamp": "2026-04-20T12:00:00.000Z",
8964
+ * "path": "/api/v1/roles",
8965
+ * "method": "GET"
8966
+ * }
8967
+ * }
8968
+ */
8969
+ "application/json": components["schemas"]["ErrorResponseDto"];
8970
+ };
8971
+ };
8972
+ };
8973
+ };
8974
+ ApiRolesController_createRole: {
8975
+ parameters: {
8976
+ query?: never;
8977
+ header?: never;
8978
+ path?: never;
8979
+ cookie?: never;
8980
+ };
8981
+ requestBody: {
8982
+ content: {
8983
+ "application/json": components["schemas"]["CreateRoleDto"];
8984
+ };
8985
+ };
8986
+ responses: {
8987
+ /** @description Role created */
8988
+ 201: {
8989
+ headers: {
8990
+ [name: string]: unknown;
8991
+ };
8992
+ content: {
8993
+ "application/json": {
8994
+ data: components["schemas"]["RoleResponseDto"];
6875
8995
  };
6876
8996
  };
6877
8997
  };
@@ -8163,7 +10283,7 @@ interface operations {
8163
10283
  to?: string;
8164
10284
  /** @description Filter by one or more action keys. Repeat the query param (`?action=a&action=b`) or pass a comma-separated string. */
8165
10285
  action?: string[];
8166
- category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown";
10286
+ category?: "auth" | "identity" | "admin_user" | "tenancy" | "hierarchy" | "organization" | "rbac" | "authorization" | "api_keys" | "oauth" | "webhooks" | "invites" | "mfa" | "audit" | "billing" | "sso" | "unknown";
8167
10287
  severity?: "info" | "notice" | "warning" | "critical";
8168
10288
  outcome?: "success" | "failure" | "denied";
8169
10289
  actor_id?: string;
@@ -10044,8 +12164,8 @@ declare class Assignments {
10044
12164
  /** Same partial-success contract as `bulkCreate`. */
10045
12165
  bulkChangeRole(input: RequestBody<"ApiAssignmentsController_bulkChangeRole">): Promise<ResponseBody<"ApiAssignmentsController_bulkChangeRole">>;
10046
12166
  }
10047
- type AssignmentItem = ItemOf$3<ResponseBody<"ApiAssignmentsController_listAppWideAssignments">>;
10048
- type ItemOf$3<T> = T extends {
12167
+ type AssignmentItem = ItemOf$4<ResponseBody<"ApiAssignmentsController_listAppWideAssignments">>;
12168
+ type ItemOf$4<T> = T extends {
10049
12169
  items: (infer Item)[];
10050
12170
  } ? Item : never;
10051
12171
 
@@ -10086,9 +12206,71 @@ declare class Identities {
10086
12206
  */
10087
12207
  permissions(id: string): Promise<ResponseBody<"ApiIdentitiesController_getIdentityPermissions">>;
10088
12208
  }
10089
- type IdentityItem = ItemOf$2<ResponseBody<"ApiIdentitiesController_listIdentities">>;
12209
+ type IdentityItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_listIdentities">>;
10090
12210
  /** One role grant from an identity's assignments collection. */
10091
- type IdentityAssignmentItem = ItemOf$2<ResponseBody<"ApiIdentitiesController_getIdentityAssignments">>;
12211
+ type IdentityAssignmentItem = ItemOf$3<ResponseBody<"ApiIdentitiesController_getIdentityAssignments">>;
12212
+ type ItemOf$3<T> = T extends {
12213
+ items: (infer Item)[];
12214
+ } ? Item : never;
12215
+
12216
+ /**
12217
+ * Tenant organizations: one per business customer, a role per membership,
12218
+ * each with its own authentication policy and identity provider. Every
12219
+ * call here needs the Environment's organizations container switched on.
12220
+ */
12221
+ declare class Organizations {
12222
+ private readonly client;
12223
+ constructor(client: CanopyClient);
12224
+ list(query?: QueryParams<"ApiOrganizationsController_listOrganizations">): Paginator<OrganizationItem>;
12225
+ get(id: string): Promise<ResponseBody<"ApiOrganizationsController_getOrganization">>;
12226
+ create(input: RequestBody<"ApiOrganizationsController_createOrganization">): Promise<ResponseBody<"ApiOrganizationsController_createOrganization">>;
12227
+ /**
12228
+ * Pass `ifMatch` with the organization's current `version` to make a
12229
+ * read-modify-write safe — a concurrent edit answers 409 instead of being
12230
+ * silently overwritten.
12231
+ */
12232
+ update(id: string, input: RequestBody<"ApiOrganizationsController_updateOrganization">, options?: ConcurrencyOptions): Promise<ResponseBody<"ApiOrganizationsController_updateOrganization">>;
12233
+ /**
12234
+ * Removes the organization with its memberships, pending invitations,
12235
+ * policy, connection bindings, and the tree beneath it. Member identities
12236
+ * survive.
12237
+ */
12238
+ delete(id: string, options?: ConcurrencyOptions): Promise<void>;
12239
+ /** Empties the container: every organization goes, the step before switching it off. */
12240
+ deleteAll(): Promise<void>;
12241
+ listMembers(id: string, query?: QueryParams<"ApiOrganizationsController_listMembers">): Paginator<OrganizationMemberItem>;
12242
+ addMember(id: string, input: RequestBody<"ApiOrganizationsController_addMember">): Promise<ResponseBody<"ApiOrganizationsController_addMember">>;
12243
+ changeMemberRole(id: string, identityId: string, input: RequestBody<"ApiOrganizationsController_changeMemberRole">): Promise<ResponseBody<"ApiOrganizationsController_changeMemberRole">>;
12244
+ /** Revokes that organization's one role; the identity and its other memberships are untouched. */
12245
+ removeMember(id: string, identityId: string): Promise<void>;
12246
+ listInvites(id: string, query?: QueryParams<"ApiOrganizationsController_listInvites">): Paginator<OrganizationInviteItem>;
12247
+ createInvite(id: string, input: RequestBody<"ApiOrganizationsController_createInvite">): Promise<ResponseBody<"ApiOrganizationsController_createInvite">>;
12248
+ revokeInvite(id: string, inviteId: string): Promise<void>;
12249
+ /**
12250
+ * The organization's own values (null inherits), the Environment baseline
12251
+ * they tighten from, and the effective policy its members sign in under.
12252
+ */
12253
+ getPolicy(id: string): Promise<ResponseBody<"ApiOrganizationsController_getPolicy">>;
12254
+ /**
12255
+ * Can only tighten the Environment: a value that would loosen it answers
12256
+ * 400 `organization.policy_loosens`. Pass `ifMatch` with the policy's
12257
+ * `version` (0 until the organization sets one) for a safe
12258
+ * read-modify-write.
12259
+ */
12260
+ updatePolicy(id: string, input: RequestBody<"ApiOrganizationsController_updatePolicy">, options?: ConcurrencyOptions): Promise<ResponseBody<"ApiOrganizationsController_updatePolicy">>;
12261
+ listSsoConnections(id: string): Promise<ResponseBody<"ApiOrganizationsController_listSsoConnections">>;
12262
+ /**
12263
+ * Sign-ins through the connection then land in this organization, joining
12264
+ * as a member with `default_role_id`. The connection must already be bound
12265
+ * to the organization's Environment, and a connection binds to one
12266
+ * organization per Environment.
12267
+ */
12268
+ bindSsoConnection(id: string, input: RequestBody<"ApiOrganizationsController_bindSsoConnection">): Promise<ResponseBody<"ApiOrganizationsController_bindSsoConnection">>;
12269
+ unbindSsoConnection(id: string, connectionId: string): Promise<void>;
12270
+ }
12271
+ type OrganizationItem = ItemOf$2<ResponseBody<"ApiOrganizationsController_listOrganizations">>;
12272
+ type OrganizationMemberItem = ItemOf$2<ResponseBody<"ApiOrganizationsController_listMembers">>;
12273
+ type OrganizationInviteItem = ItemOf$2<ResponseBody<"ApiOrganizationsController_listInvites">>;
10092
12274
  type ItemOf$2<T> = T extends {
10093
12275
  items: (infer Item)[];
10094
12276
  } ? Item : never;
@@ -10195,7 +12377,7 @@ type ItemOf<T> = T extends {
10195
12377
  * ```
10196
12378
  *
10197
12379
  * `client` is public because the wrapped resources cover the paths integrators
10198
- * hit most, not all 81 operations. Anything not wrapped is still reachable —
12380
+ * hit most, not all 102 operations. Anything not wrapped is still reachable —
10199
12381
  * `canopy.client.request("GET", "/api/v1/audit-events")` — with the same
10200
12382
  * envelope handling, typed errors and retry policy, so no endpoint is a dead
10201
12383
  * end while the ergonomic surface catches up.
@@ -10206,6 +12388,7 @@ declare class Canopy {
10206
12388
  readonly identities: Identities;
10207
12389
  readonly roles: Roles;
10208
12390
  readonly assignments: Assignments;
12391
+ readonly organizations: Organizations;
10209
12392
  constructor(options: CanopyClientOptions);
10210
12393
  }
10211
12394
 
@@ -10546,8 +12729,54 @@ interface CanopyTokenClaims {
10546
12729
  permissions?: string[];
10547
12730
  /** True when `permissions` was truncated; query the API for the full set. */
10548
12731
  permissions_overflow?: boolean;
12732
+ /**
12733
+ * How the session was proven: `pwd`, `otp`, or `sso`, plus `mfa` once a
12734
+ * second factor was verified. Identity tokens carry it; check for `mfa`
12735
+ * before allowing a sensitive action.
12736
+ */
12737
+ amr?: string[];
12738
+ /**
12739
+ * The organization this session is acting in — present only on identity
12740
+ * tokens from an Environment with the organizations container on, for an
12741
+ * identity that belongs to at least one organization. Always minted
12742
+ * together with `org_role`; read the pair through {@link orgContext}
12743
+ * rather than separately.
12744
+ */
12745
+ org_id?: string;
12746
+ /** The name of the single role the identity holds in `org_id`. */
12747
+ org_role?: string;
10549
12748
  [claim: string]: unknown;
10550
12749
  }
12750
+ /**
12751
+ * The organization context a verified token carries: which organization the
12752
+ * session is acting in, and the one role it holds there.
12753
+ */
12754
+ interface CanopyOrgContext {
12755
+ /** The organization's id — also a hierarchy node id, usable as `node_id`. */
12756
+ orgId: string;
12757
+ /** The role's name (not its id): what `org_role` carries. */
12758
+ orgRole: string;
12759
+ }
12760
+ /**
12761
+ * The organization context of a verified token, or `null` when it has none.
12762
+ *
12763
+ * `null` is an ordinary answer, not a failure: it is every token from an
12764
+ * Environment without the organizations container on, and every identity
12765
+ * that belongs to no organization yet. Branch on it rather than on the raw claims —
12766
+ * Canopy mints `org_id` and `org_role` together, and this helper refuses a
12767
+ * half-present pair instead of letting one claim be read as though the other
12768
+ * were there.
12769
+ *
12770
+ * ```ts
12771
+ * const claims = await verifier.verify(token);
12772
+ * const org = orgContext(claims);
12773
+ *
12774
+ * if (org) {
12775
+ * // acting inside org.orgId as org.orgRole
12776
+ * }
12777
+ * ```
12778
+ */
12779
+ declare function orgContext(claims: CanopyTokenClaims): CanopyOrgContext | null;
10551
12780
  declare class TokenVerifier {
10552
12781
  private readonly issuer;
10553
12782
  private readonly audience;
@@ -10607,4 +12836,4 @@ declare class TokenVerifier {
10607
12836
  private fetchKeys;
10608
12837
  }
10609
12838
 
10610
- export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, type operations, paginate, type paths, withConcurrency };
12839
+ export { type AssignmentItem, Assignments, type CallOptions, Canopy, CanopyAuthorizerError, CanopyClient, type CanopyClientOptions, CanopyConnectionError, CanopyError, type CanopyErrorBody, type CanopyOrgContext, type CanopyTokenClaims, CanopyTokenError, type Collection, type ConcurrencyOptions, type ConditionalResult, type CursorPagination, Identities, type IdentityAssignmentItem, type IdentityItem, type LocalAuthorizationQuery, LocalAuthorizer, type LocalAuthorizerOptions, type LocalAuthorizerStats, type OffsetPagination, type OperationId, type OrganizationInviteItem, type OrganizationItem, type OrganizationMemberItem, Organizations, type PageFetcher, type PageParams, type PaginateOptions, type Pagination, Paginator, type PartialSuccess, type PermissionItem, Permissions, type QueryParams, type RequestBody, type RequestOptions, type ResponseBody, type RoleItem, Roles, type Schema, TokenVerifier, type TokenVerifierOptions, type components, isCanopyAuthorizerError, isCanopyConnectionError, isCanopyError, isCanopyTokenError, isCursorPagination, type operations, orgContext, paginate, type paths, withConcurrency };