@canopy-io/node 0.23.3 → 0.23.4

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.cts CHANGED
@@ -611,7 +611,7 @@ interface paths {
611
611
  };
612
612
  /**
613
613
  * List an identity's active sessions (admin)
614
- * @description Lists one page of an identity's active sessions in the caller's Environment (server-to-server admin), newest first, taking `page` and `take` only: the rows a customer reads to confirm from its own side that a sign-out took, or to show a person where they are signed in. Each row is a session's current refresh token, so `id` changes on every refresh. Sessions the identity holds in its other Environments are not listed. Returns `404` when the identity has no membership in this Environment.
614
+ * @description Lists one page of an identity's active sessions in the caller's Environment (server-to-server admin), newest first, taking `page` and `take` only: the rows a customer reads to confirm from its own side that a sign-out took, or to show a person where they are signed in. A hosted sign-in no application has exchanged a code for yet holds no refresh token and is listed first, by its session id; every other row is a session's current refresh token, so its `id` changes on every refresh. Sessions the identity holds in its other Environments are not listed. Returns `404` when the identity has no membership in this Environment.
615
615
  */
616
616
  get: operations["ApiIdentitiesController_listIdentitySessions"];
617
617
  put?: never;
@@ -634,7 +634,7 @@ interface paths {
634
634
  post?: never;
635
635
  /**
636
636
  * Revoke one of an identity's sessions (admin)
637
- * @description Revokes one of an identity's sessions in the caller's Environment (server-to-server admin) by marking its refresh token revoked, so the next refresh from that device returns `401` while every other session carries on. Audited as `identity.session.revoked`, the same row the person's own per-session sign-out writes. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment, or when the session is not the identity's, belongs to another Environment, or is already revoked.
637
+ * @description Revokes one of an identity's sessions in the caller's Environment (server-to-server admin) by the id the list gave it: a refresh token's is marked revoked, so the next refresh from that device returns `401`, and a hosted sign-in no application has exchanged a code for yet is ended, so its code issues nothing, while every other session carries on. Audited as `identity.session.revoked`, the same row the person's own per-session sign-out writes. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment, or when the session is not the identity's, belongs to another Environment, or is already revoked or ended.
638
638
  */
639
639
  delete: operations["ApiIdentitiesController_revokeIdentitySession"];
640
640
  options?: never;
@@ -1605,7 +1605,7 @@ interface paths {
1605
1605
  head?: never;
1606
1606
  /**
1607
1607
  * Update an organization's authentication policy
1608
- * @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. `staff_entry` is the organization's own decision: `refused` turns away the Environment's staff (a role at the Environment root), records each attempt, and ends the sessions staff have inside at their next refresh. 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`.
1608
+ * @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. Turning `require_sso` on needs an active SSO connection bound to the organization and a verified domain, since members are sent to single sign-on and found by their email's domain; without both it returns `409` (`organization.sso_requirement_not_ready`). `staff_entry` is the organization's own decision: `refused` turns away the Environment's staff (a role at the Environment root), records each attempt, and ends the sessions staff have inside at their next refresh. 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`.
1609
1609
  */
1610
1610
  patch: operations["ApiOrganizationsController_updatePolicy"];
1611
1611
  trace?: never;
@@ -1746,7 +1746,7 @@ interface paths {
1746
1746
  post?: never;
1747
1747
  /**
1748
1748
  * Remove one of the organization's domain claims
1749
- * @description Removes a domain claim from the organization; the bound connection stops routing and admitting that domain on the next login. Emits an `sso.domain.removed` audit row and returns `204`; responds `404` when the organization holds no claim for that domain.
1749
+ * @description Removes a domain claim from the organization; the bound connection stops routing and admitting that domain on the next login. Emits an `sso.domain.removed` audit row and returns `204`; responds `404` when the organization holds no claim for that domain, and `409` (`organization.sso_requirement_needs_domain`) while the organization requires single sign-on and this is its only verified domain: turn `require_sso` off first.
1750
1750
  */
1751
1751
  delete: operations["ApiOrganizationsController_removeDomain"];
1752
1752
  options?: never;
@@ -1790,7 +1790,7 @@ interface paths {
1790
1790
  post?: never;
1791
1791
  /**
1792
1792
  * Unbind an SSO connection from an organization
1793
- * @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, and `409` (`organization.sso_connection_owned_cannot_unbind`) when the organization set the connection up itself: an owned connection stays with its organization, so disable or delete it instead. Requires the `hierarchy.manage` permission at the organization and emits `organization.sso_connection.unbound`.
1793
+ * @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, `409` (`organization.sso_connection_owned_cannot_unbind`) when the organization set the connection up itself: an owned connection stays with its organization, so disable or delete it instead; and `409` (`organization.sso_requirement_needs_connection`) while the organization requires single sign-on and this is its only active connection: turn `require_sso` off first. Requires the `hierarchy.manage` permission at the organization and emits `organization.sso_connection.unbound`.
1794
1794
  */
1795
1795
  delete: operations["ApiOrganizationsController_unbindSsoConnection"];
1796
1796
  options?: never;
@@ -1950,7 +1950,7 @@ interface paths {
1950
1950
  post: operations["ApiOrganizationSsoConnectionController_create"];
1951
1951
  /**
1952
1952
  * Remove an organization's SSO connection
1953
- * @description Unbinds the connection from the organization, unlinks it from the Environment, and deletes it. Existing memberships stay. Refused on a developer-managed connection. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1953
+ * @description Unbinds the connection from the organization, unlinks it from the Environment, and deletes it. Existing memberships stay. Refused on a developer-managed connection, and with `409` (`organization.sso_requirement_needs_connection`) while the organization requires single sign-on and this is its only active connection: turn `require_sso` off first. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1954
1954
  */
1955
1955
  delete: operations["ApiOrganizationSsoConnectionController_remove"];
1956
1956
  options?: never;
@@ -1993,7 +1993,7 @@ interface paths {
1993
1993
  put?: never;
1994
1994
  /**
1995
1995
  * Disable an organization's SSO connection
1996
- * @description Sets the connection `disabled`; sign-ins through it stop and the row stays. Refused on a developer-managed connection. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1996
+ * @description Sets the connection `disabled`; sign-ins through it stop and the row stays. Refused on a developer-managed connection, and with `409` (`organization.sso_requirement_needs_connection`) while the organization requires single sign-on and this is its only active connection: turn `require_sso` off first. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1997
1997
  */
1998
1998
  post: operations["ApiOrganizationSsoConnectionController_disable"];
1999
1999
  delete?: never;
@@ -3462,7 +3462,7 @@ interface paths {
3462
3462
  post?: never;
3463
3463
  /**
3464
3464
  * Delete an SSO connection
3465
- * @description Permanently deletes an SSO connection and its configuration from the Account. Emits an `sso.connection.deleted` audit row and returns `204` with no body; responds `404` when the connection is not found.
3465
+ * @description Permanently deletes an SSO connection and its configuration from the Account. Emits an `sso.connection.deleted` audit row and returns `204` with no body; responds `404` when the connection is not found, and `409` (`organization.sso_requirement_needs_connection`) while an organization that requires single sign-on has this as its only active connection: turn that organization's `require_sso` off first.
3466
3466
  */
3467
3467
  delete: operations["ApiSsoController_remove"];
3468
3468
  options?: never;
@@ -3505,7 +3505,7 @@ interface paths {
3505
3505
  put?: never;
3506
3506
  /**
3507
3507
  * Disable an SSO connection
3508
- * @description Sets an active connection's status to `disabled`, stopping all login flows through it while preserving the row and its configuration for later re-activation. Emits an `sso.connection.disabled_by_user` audit row and returns the updated connection. Responds `404` when the connection is not found in the Account.
3508
+ * @description Sets an active connection's status to `disabled`, stopping all login flows through it while preserving the row and its configuration for later re-activation. Emits an `sso.connection.disabled_by_user` audit row and returns the updated connection. Refused with `409` (`organization.sso_requirement_needs_connection`) while it is the only active connection of an organization that requires single sign-on: turn `require_sso` off first. Responds `404` when the connection is not found in the Account.
3509
3509
  */
3510
3510
  post: operations["ApiSsoController_disable"];
3511
3511
  delete?: never;
@@ -5099,7 +5099,7 @@ interface components {
5099
5099
  password: string;
5100
5100
  };
5101
5101
  IdentitySessionResponseDto: {
5102
- /** @description The session's current refresh token id: what `DELETE /identities/:id/sessions/:sessionId` takes. It changes on every refresh. */
5102
+ /** @description What `DELETE /identities/:id/sessions/:sessionId` takes: the session's current refresh token id, which changes on every refresh, or, for a hosted sign-in no application has exchanged a code for yet, its session id. */
5103
5103
  id: string;
5104
5104
  /** Format: date-time */
5105
5105
  created_at: string;
@@ -5870,6 +5870,8 @@ interface components {
5870
5870
  /** @description The methods the organization keeps of the Environment's, or null to inherit them all. Each is `password`, `email_otp`, `passkey`, `sso`, a social provider (`google`, `github`, `microsoft`, `apple`), or `oidc:<slug>` for a custom OpenID Connect provider. */
5871
5871
  allowed_sign_in_methods?: string[] | null;
5872
5872
  require_sso: boolean;
5873
+ /** @description Whether `require_sso` can be turned on: the organization has an active SSO connection bound to it and a verified domain. */
5874
+ require_sso_ready: boolean;
5873
5875
  /**
5874
5876
  * @description Whether the Environment's staff (identities holding a role at the Environment root) may enter this organization. `allowed` until the organization refuses them.
5875
5877
  * @enum {string}
@@ -5902,7 +5904,7 @@ interface components {
5902
5904
  mfa_after_sso?: "exempt" | "require" | null;
5903
5905
  /** @description The sign-in methods this organization's members may use. A non-empty subset of the methods the Environment offers (`password` unless the Environment turned it off, `email_otp` and `passkey` where the Environment turned them on, each social provider it enabled, and `sso`); a method the Environment does not offer is refused with `organization.policy_loosens`. `null` inherits the Environment's. While `require_sso` is on, SSO is the only method whatever this says. Each is `password`, `email_otp`, `passkey`, `sso`, a social provider (`google`, `github`, `microsoft`, `apple`), or `oidc:<slug>` for a custom OpenID Connect provider. */
5904
5906
  allowed_sign_in_methods?: string[] | null;
5905
- /** @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. */
5907
+ /** @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. Turning it on is refused with `organization.sso_requirement_not_ready` until the organization has an active SSO connection bound to it and a verified domain. */
5906
5908
  require_sso?: boolean;
5907
5909
  /**
5908
5910
  * @description Whether the Environment's staff (identities holding a role at the Environment root) may enter this organization. `refused` refuses each entry, records it in the organization's activity, and ends the sessions staff already have inside at their next refresh.
@@ -7914,6 +7916,8 @@ interface components {
7914
7916
  scope: "account" | "environment";
7915
7917
  /** @description Capability keys the role grants */
7916
7918
  capabilities: string[];
7919
+ /** @description Every capability a holder of the role has: its own keys and each `view` a `manage` among them implies */
7920
+ conferred_capabilities: string[];
7917
7921
  /** @description Live grants of this role across the whole Account, not just one Environment */
7918
7922
  assignment_count: number;
7919
7923
  /** @description Optimistic-lock version. Send it back in `If-Match` on an update to refuse a stale edit with 409. */
@@ -12494,7 +12498,7 @@ interface operations {
12494
12498
  };
12495
12499
  requestBody?: never;
12496
12500
  responses: {
12497
- /** @description One page of the sessions the identity holds that are neither revoked nor expired, newest first: the session's current refresh token id (what the per-session revoke takes), when it was signed in and when it expires, the browser's address and user agent, and the organization it is acting in. */
12501
+ /** @description One page of the sessions the identity holds that are neither revoked nor expired: first the hosted sign-ins no application has exchanged a code for yet, by their session id, then the sessions that hold a refresh token, by that token's id, each group newest first. Each row has the id the per-session revoke takes, when it was signed in and when it expires, the browser's address and user agent, and the organization it is acting in (null for a sign-in not yet exchanged). */
12498
12502
  200: {
12499
12503
  headers: {
12500
12504
  [name: string]: unknown;
@@ -19518,7 +19522,7 @@ interface operations {
19518
19522
  "application/json": components["schemas"]["ErrorResponseDto"];
19519
19523
  };
19520
19524
  };
19521
- /** @description Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry. */
19525
+ /** @description The policy was modified since the version supplied in `If-Match`; or `require_sso` was turned on for an organization with no active bound SSO connection or no verified domain */
19522
19526
  409: {
19523
19527
  headers: {
19524
19528
  [name: string]: unknown;
@@ -19529,7 +19533,7 @@ interface operations {
19529
19533
  * "error": {
19530
19534
  * "statusCode": 409,
19531
19535
  * "code": "request.conflict",
19532
- * "message": "Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry.",
19536
+ * "message": "The policy was modified since the version supplied in `If-Match`; or `require_sso` was turned on for an organization with no active bound SSO connection or no verified domain",
19533
19537
  * "timestamp": "2026-04-20T12:00:00.000Z",
19534
19538
  * "path": "/api/v1/organizations/{id}/policy",
19535
19539
  * "method": "PATCH"
@@ -20507,6 +20511,27 @@ interface operations {
20507
20511
  "application/json": components["schemas"]["ErrorResponseDto"];
20508
20512
  };
20509
20513
  };
20514
+ /** @description The organization requires single sign-on and this is its only verified domain */
20515
+ 409: {
20516
+ headers: {
20517
+ [name: string]: unknown;
20518
+ };
20519
+ content: {
20520
+ /**
20521
+ * @example {
20522
+ * "error": {
20523
+ * "statusCode": 409,
20524
+ * "code": "request.conflict",
20525
+ * "message": "The organization requires single sign-on and this is its only verified domain",
20526
+ * "timestamp": "2026-04-20T12:00:00.000Z",
20527
+ * "path": "/api/v1/organizations/{id}/domains/{domain}",
20528
+ * "method": "DELETE"
20529
+ * }
20530
+ * }
20531
+ */
20532
+ "application/json": components["schemas"]["ErrorResponseDto"];
20533
+ };
20534
+ };
20510
20535
  };
20511
20536
  };
20512
20537
  ApiOrganizationsController_listSsoConnections: {
@@ -20862,7 +20887,7 @@ interface operations {
20862
20887
  "application/json": components["schemas"]["ErrorResponseDto"];
20863
20888
  };
20864
20889
  };
20865
- /** @description The organization set this connection up itself; it stays bound. Disable or delete the connection instead. */
20890
+ /** @description The organization set this connection up itself, so it stays bound: disable or delete the connection instead; or the organization requires single sign-on and this is its only active connection */
20866
20891
  409: {
20867
20892
  headers: {
20868
20893
  [name: string]: unknown;
@@ -20873,7 +20898,7 @@ interface operations {
20873
20898
  * "error": {
20874
20899
  * "statusCode": 409,
20875
20900
  * "code": "request.conflict",
20876
- * "message": "The organization set this connection up itself; it stays bound. Disable or delete the connection instead.",
20901
+ * "message": "The organization set this connection up itself, so it stays bound: disable or delete the connection instead; or the organization requires single sign-on and this is its only active connection",
20877
20902
  * "timestamp": "2026-04-20T12:00:00.000Z",
20878
20903
  * "path": "/api/v1/organizations/{id}/sso-connections/{connectionId}",
20879
20904
  * "method": "DELETE"
@@ -22395,7 +22420,7 @@ interface operations {
22395
22420
  "application/json": components["schemas"]["ErrorResponseDto"];
22396
22421
  };
22397
22422
  };
22398
- /** @description The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console */
22423
+ /** @description The organization has no SSO connection bound to it, its connection is developer-managed and is changed from the Console, or the organization requires single sign-on and this is its only active connection */
22399
22424
  409: {
22400
22425
  headers: {
22401
22426
  [name: string]: unknown;
@@ -22406,7 +22431,7 @@ interface operations {
22406
22431
  * "error": {
22407
22432
  * "statusCode": 409,
22408
22433
  * "code": "request.conflict",
22409
- * "message": "The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console",
22434
+ * "message": "The organization has no SSO connection bound to it, its connection is developer-managed and is changed from the Console, or the organization requires single sign-on and this is its only active connection",
22410
22435
  * "timestamp": "2026-04-20T12:00:00.000Z",
22411
22436
  * "path": "/api/v1/organizations/{id}/sso-connection",
22412
22437
  * "method": "DELETE"
@@ -22801,7 +22826,7 @@ interface operations {
22801
22826
  "application/json": components["schemas"]["ErrorResponseDto"];
22802
22827
  };
22803
22828
  };
22804
- /** @description The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; or the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`) */
22829
+ /** @description The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`); or the organization requires single sign-on and this is its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first */
22805
22830
  409: {
22806
22831
  headers: {
22807
22832
  [name: string]: unknown;
@@ -22812,7 +22837,7 @@ interface operations {
22812
22837
  * "error": {
22813
22838
  * "statusCode": 409,
22814
22839
  * "code": "request.conflict",
22815
- * "message": "The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; or the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`)",
22840
+ * "message": "The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`); or the organization requires single sign-on and this is its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first",
22816
22841
  * "timestamp": "2026-04-20T12:00:00.000Z",
22817
22842
  * "path": "/api/v1/organizations/{id}/sso-connection/disable",
22818
22843
  * "method": "POST"
@@ -34849,6 +34874,27 @@ interface operations {
34849
34874
  "application/json": components["schemas"]["ErrorResponseDto"];
34850
34875
  };
34851
34876
  };
34877
+ /** @description An organization that requires single sign-on has this as its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first */
34878
+ 409: {
34879
+ headers: {
34880
+ [name: string]: unknown;
34881
+ };
34882
+ content: {
34883
+ /**
34884
+ * @example {
34885
+ * "error": {
34886
+ * "statusCode": 409,
34887
+ * "code": "request.conflict",
34888
+ * "message": "An organization that requires single sign-on has this as its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first",
34889
+ * "timestamp": "2026-04-20T12:00:00.000Z",
34890
+ * "path": "/api/v1/sso/connections/{id}",
34891
+ * "method": "DELETE"
34892
+ * }
34893
+ * }
34894
+ */
34895
+ "application/json": components["schemas"]["ErrorResponseDto"];
34896
+ };
34897
+ };
34852
34898
  };
34853
34899
  };
34854
34900
  ApiSsoController_update: {
@@ -35228,7 +35274,7 @@ interface operations {
35228
35274
  "application/json": components["schemas"]["ErrorResponseDto"];
35229
35275
  };
35230
35276
  };
35231
- /** @description The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`) */
35277
+ /** @description The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`), or it is the only active connection of an organization that requires single sign-on (`organization.sso_requirement_needs_connection`): turn the requirement off first */
35232
35278
  409: {
35233
35279
  headers: {
35234
35280
  [name: string]: unknown;
@@ -35239,7 +35285,7 @@ interface operations {
35239
35285
  * "error": {
35240
35286
  * "statusCode": 409,
35241
35287
  * "code": "request.conflict",
35242
- * "message": "The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`)",
35288
+ * "message": "The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`), or it is the only active connection of an organization that requires single sign-on (`organization.sso_requirement_needs_connection`): turn the requirement off first",
35243
35289
  * "timestamp": "2026-04-20T12:00:00.000Z",
35244
35290
  * "path": "/api/v1/sso/connections/{id}/disable",
35245
35291
  * "method": "POST"
@@ -45115,7 +45161,8 @@ declare class Identities {
45115
45161
  /**
45116
45162
  * Ends one session and leaves the identity's others signed in. `sessionId`
45117
45163
  * is the session's `id` from `sessions`: its current refresh token, which
45118
- * changes on every refresh, so read it shortly before revoking.
45164
+ * changes on every refresh, so read it shortly before revoking; or, for a
45165
+ * hosted sign-in no application has exchanged a code for yet, its session id.
45119
45166
  */
45120
45167
  revokeSession(id: string, sessionId: string): Promise<void>;
45121
45168
  /**
package/dist/index.d.ts CHANGED
@@ -611,7 +611,7 @@ interface paths {
611
611
  };
612
612
  /**
613
613
  * List an identity's active sessions (admin)
614
- * @description Lists one page of an identity's active sessions in the caller's Environment (server-to-server admin), newest first, taking `page` and `take` only: the rows a customer reads to confirm from its own side that a sign-out took, or to show a person where they are signed in. Each row is a session's current refresh token, so `id` changes on every refresh. Sessions the identity holds in its other Environments are not listed. Returns `404` when the identity has no membership in this Environment.
614
+ * @description Lists one page of an identity's active sessions in the caller's Environment (server-to-server admin), newest first, taking `page` and `take` only: the rows a customer reads to confirm from its own side that a sign-out took, or to show a person where they are signed in. A hosted sign-in no application has exchanged a code for yet holds no refresh token and is listed first, by its session id; every other row is a session's current refresh token, so its `id` changes on every refresh. Sessions the identity holds in its other Environments are not listed. Returns `404` when the identity has no membership in this Environment.
615
615
  */
616
616
  get: operations["ApiIdentitiesController_listIdentitySessions"];
617
617
  put?: never;
@@ -634,7 +634,7 @@ interface paths {
634
634
  post?: never;
635
635
  /**
636
636
  * Revoke one of an identity's sessions (admin)
637
- * @description Revokes one of an identity's sessions in the caller's Environment (server-to-server admin) by marking its refresh token revoked, so the next refresh from that device returns `401` while every other session carries on. Audited as `identity.session.revoked`, the same row the person's own per-session sign-out writes. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment, or when the session is not the identity's, belongs to another Environment, or is already revoked.
637
+ * @description Revokes one of an identity's sessions in the caller's Environment (server-to-server admin) by the id the list gave it: a refresh token's is marked revoked, so the next refresh from that device returns `401`, and a hosted sign-in no application has exchanged a code for yet is ended, so its code issues nothing, while every other session carries on. Audited as `identity.session.revoked`, the same row the person's own per-session sign-out writes. Returns `204 No Content`; returns `404` when the identity has no membership in this Environment, or when the session is not the identity's, belongs to another Environment, or is already revoked or ended.
638
638
  */
639
639
  delete: operations["ApiIdentitiesController_revokeIdentitySession"];
640
640
  options?: never;
@@ -1605,7 +1605,7 @@ interface paths {
1605
1605
  head?: never;
1606
1606
  /**
1607
1607
  * Update an organization's authentication policy
1608
- * @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. `staff_entry` is the organization's own decision: `refused` turns away the Environment's staff (a role at the Environment root), records each attempt, and ends the sessions staff have inside at their next refresh. 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`.
1608
+ * @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. Turning `require_sso` on needs an active SSO connection bound to the organization and a verified domain, since members are sent to single sign-on and found by their email's domain; without both it returns `409` (`organization.sso_requirement_not_ready`). `staff_entry` is the organization's own decision: `refused` turns away the Environment's staff (a role at the Environment root), records each attempt, and ends the sessions staff have inside at their next refresh. 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`.
1609
1609
  */
1610
1610
  patch: operations["ApiOrganizationsController_updatePolicy"];
1611
1611
  trace?: never;
@@ -1746,7 +1746,7 @@ interface paths {
1746
1746
  post?: never;
1747
1747
  /**
1748
1748
  * Remove one of the organization's domain claims
1749
- * @description Removes a domain claim from the organization; the bound connection stops routing and admitting that domain on the next login. Emits an `sso.domain.removed` audit row and returns `204`; responds `404` when the organization holds no claim for that domain.
1749
+ * @description Removes a domain claim from the organization; the bound connection stops routing and admitting that domain on the next login. Emits an `sso.domain.removed` audit row and returns `204`; responds `404` when the organization holds no claim for that domain, and `409` (`organization.sso_requirement_needs_domain`) while the organization requires single sign-on and this is its only verified domain: turn `require_sso` off first.
1750
1750
  */
1751
1751
  delete: operations["ApiOrganizationsController_removeDomain"];
1752
1752
  options?: never;
@@ -1790,7 +1790,7 @@ interface paths {
1790
1790
  post?: never;
1791
1791
  /**
1792
1792
  * Unbind an SSO connection from an organization
1793
- * @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, and `409` (`organization.sso_connection_owned_cannot_unbind`) when the organization set the connection up itself: an owned connection stays with its organization, so disable or delete it instead. Requires the `hierarchy.manage` permission at the organization and emits `organization.sso_connection.unbound`.
1793
+ * @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, `409` (`organization.sso_connection_owned_cannot_unbind`) when the organization set the connection up itself: an owned connection stays with its organization, so disable or delete it instead; and `409` (`organization.sso_requirement_needs_connection`) while the organization requires single sign-on and this is its only active connection: turn `require_sso` off first. Requires the `hierarchy.manage` permission at the organization and emits `organization.sso_connection.unbound`.
1794
1794
  */
1795
1795
  delete: operations["ApiOrganizationsController_unbindSsoConnection"];
1796
1796
  options?: never;
@@ -1950,7 +1950,7 @@ interface paths {
1950
1950
  post: operations["ApiOrganizationSsoConnectionController_create"];
1951
1951
  /**
1952
1952
  * Remove an organization's SSO connection
1953
- * @description Unbinds the connection from the organization, unlinks it from the Environment, and deletes it. Existing memberships stay. Refused on a developer-managed connection. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1953
+ * @description Unbinds the connection from the organization, unlinks it from the Environment, and deletes it. Existing memberships stay. Refused on a developer-managed connection, and with `409` (`organization.sso_requirement_needs_connection`) while the organization requires single sign-on and this is its only active connection: turn `require_sso` off first. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1954
1954
  */
1955
1955
  delete: operations["ApiOrganizationSsoConnectionController_remove"];
1956
1956
  options?: never;
@@ -1993,7 +1993,7 @@ interface paths {
1993
1993
  put?: never;
1994
1994
  /**
1995
1995
  * Disable an organization's SSO connection
1996
- * @description Sets the connection `disabled`; sign-ins through it stop and the row stays. Refused on a developer-managed connection. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1996
+ * @description Sets the connection `disabled`; sign-ins through it stop and the row stays. Refused on a developer-managed connection, and with `409` (`organization.sso_requirement_needs_connection`) while the organization requires single sign-on and this is its only active connection: turn `require_sso` off first. Requires `hierarchy.manage` or `canopy:organization.manage` at the organization.
1997
1997
  */
1998
1998
  post: operations["ApiOrganizationSsoConnectionController_disable"];
1999
1999
  delete?: never;
@@ -3462,7 +3462,7 @@ interface paths {
3462
3462
  post?: never;
3463
3463
  /**
3464
3464
  * Delete an SSO connection
3465
- * @description Permanently deletes an SSO connection and its configuration from the Account. Emits an `sso.connection.deleted` audit row and returns `204` with no body; responds `404` when the connection is not found.
3465
+ * @description Permanently deletes an SSO connection and its configuration from the Account. Emits an `sso.connection.deleted` audit row and returns `204` with no body; responds `404` when the connection is not found, and `409` (`organization.sso_requirement_needs_connection`) while an organization that requires single sign-on has this as its only active connection: turn that organization's `require_sso` off first.
3466
3466
  */
3467
3467
  delete: operations["ApiSsoController_remove"];
3468
3468
  options?: never;
@@ -3505,7 +3505,7 @@ interface paths {
3505
3505
  put?: never;
3506
3506
  /**
3507
3507
  * Disable an SSO connection
3508
- * @description Sets an active connection's status to `disabled`, stopping all login flows through it while preserving the row and its configuration for later re-activation. Emits an `sso.connection.disabled_by_user` audit row and returns the updated connection. Responds `404` when the connection is not found in the Account.
3508
+ * @description Sets an active connection's status to `disabled`, stopping all login flows through it while preserving the row and its configuration for later re-activation. Emits an `sso.connection.disabled_by_user` audit row and returns the updated connection. Refused with `409` (`organization.sso_requirement_needs_connection`) while it is the only active connection of an organization that requires single sign-on: turn `require_sso` off first. Responds `404` when the connection is not found in the Account.
3509
3509
  */
3510
3510
  post: operations["ApiSsoController_disable"];
3511
3511
  delete?: never;
@@ -5099,7 +5099,7 @@ interface components {
5099
5099
  password: string;
5100
5100
  };
5101
5101
  IdentitySessionResponseDto: {
5102
- /** @description The session's current refresh token id: what `DELETE /identities/:id/sessions/:sessionId` takes. It changes on every refresh. */
5102
+ /** @description What `DELETE /identities/:id/sessions/:sessionId` takes: the session's current refresh token id, which changes on every refresh, or, for a hosted sign-in no application has exchanged a code for yet, its session id. */
5103
5103
  id: string;
5104
5104
  /** Format: date-time */
5105
5105
  created_at: string;
@@ -5870,6 +5870,8 @@ interface components {
5870
5870
  /** @description The methods the organization keeps of the Environment's, or null to inherit them all. Each is `password`, `email_otp`, `passkey`, `sso`, a social provider (`google`, `github`, `microsoft`, `apple`), or `oidc:<slug>` for a custom OpenID Connect provider. */
5871
5871
  allowed_sign_in_methods?: string[] | null;
5872
5872
  require_sso: boolean;
5873
+ /** @description Whether `require_sso` can be turned on: the organization has an active SSO connection bound to it and a verified domain. */
5874
+ require_sso_ready: boolean;
5873
5875
  /**
5874
5876
  * @description Whether the Environment's staff (identities holding a role at the Environment root) may enter this organization. `allowed` until the organization refuses them.
5875
5877
  * @enum {string}
@@ -5902,7 +5904,7 @@ interface components {
5902
5904
  mfa_after_sso?: "exempt" | "require" | null;
5903
5905
  /** @description The sign-in methods this organization's members may use. A non-empty subset of the methods the Environment offers (`password` unless the Environment turned it off, `email_otp` and `passkey` where the Environment turned them on, each social provider it enabled, and `sso`); a method the Environment does not offer is refused with `organization.policy_loosens`. `null` inherits the Environment's. While `require_sso` is on, SSO is the only method whatever this says. Each is `password`, `email_otp`, `passkey`, `sso`, a social provider (`google`, `github`, `microsoft`, `apple`), or `oidc:<slug>` for a custom OpenID Connect provider. */
5904
5906
  allowed_sign_in_methods?: string[] | null;
5905
- /** @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. */
5907
+ /** @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. Turning it on is refused with `organization.sso_requirement_not_ready` until the organization has an active SSO connection bound to it and a verified domain. */
5906
5908
  require_sso?: boolean;
5907
5909
  /**
5908
5910
  * @description Whether the Environment's staff (identities holding a role at the Environment root) may enter this organization. `refused` refuses each entry, records it in the organization's activity, and ends the sessions staff already have inside at their next refresh.
@@ -7914,6 +7916,8 @@ interface components {
7914
7916
  scope: "account" | "environment";
7915
7917
  /** @description Capability keys the role grants */
7916
7918
  capabilities: string[];
7919
+ /** @description Every capability a holder of the role has: its own keys and each `view` a `manage` among them implies */
7920
+ conferred_capabilities: string[];
7917
7921
  /** @description Live grants of this role across the whole Account, not just one Environment */
7918
7922
  assignment_count: number;
7919
7923
  /** @description Optimistic-lock version. Send it back in `If-Match` on an update to refuse a stale edit with 409. */
@@ -12494,7 +12498,7 @@ interface operations {
12494
12498
  };
12495
12499
  requestBody?: never;
12496
12500
  responses: {
12497
- /** @description One page of the sessions the identity holds that are neither revoked nor expired, newest first: the session's current refresh token id (what the per-session revoke takes), when it was signed in and when it expires, the browser's address and user agent, and the organization it is acting in. */
12501
+ /** @description One page of the sessions the identity holds that are neither revoked nor expired: first the hosted sign-ins no application has exchanged a code for yet, by their session id, then the sessions that hold a refresh token, by that token's id, each group newest first. Each row has the id the per-session revoke takes, when it was signed in and when it expires, the browser's address and user agent, and the organization it is acting in (null for a sign-in not yet exchanged). */
12498
12502
  200: {
12499
12503
  headers: {
12500
12504
  [name: string]: unknown;
@@ -19518,7 +19522,7 @@ interface operations {
19518
19522
  "application/json": components["schemas"]["ErrorResponseDto"];
19519
19523
  };
19520
19524
  };
19521
- /** @description Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry. */
19525
+ /** @description The policy was modified since the version supplied in `If-Match`; or `require_sso` was turned on for an organization with no active bound SSO connection or no verified domain */
19522
19526
  409: {
19523
19527
  headers: {
19524
19528
  [name: string]: unknown;
@@ -19529,7 +19533,7 @@ interface operations {
19529
19533
  * "error": {
19530
19534
  * "statusCode": 409,
19531
19535
  * "code": "request.conflict",
19532
- * "message": "Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry.",
19536
+ * "message": "The policy was modified since the version supplied in `If-Match`; or `require_sso` was turned on for an organization with no active bound SSO connection or no verified domain",
19533
19537
  * "timestamp": "2026-04-20T12:00:00.000Z",
19534
19538
  * "path": "/api/v1/organizations/{id}/policy",
19535
19539
  * "method": "PATCH"
@@ -20507,6 +20511,27 @@ interface operations {
20507
20511
  "application/json": components["schemas"]["ErrorResponseDto"];
20508
20512
  };
20509
20513
  };
20514
+ /** @description The organization requires single sign-on and this is its only verified domain */
20515
+ 409: {
20516
+ headers: {
20517
+ [name: string]: unknown;
20518
+ };
20519
+ content: {
20520
+ /**
20521
+ * @example {
20522
+ * "error": {
20523
+ * "statusCode": 409,
20524
+ * "code": "request.conflict",
20525
+ * "message": "The organization requires single sign-on and this is its only verified domain",
20526
+ * "timestamp": "2026-04-20T12:00:00.000Z",
20527
+ * "path": "/api/v1/organizations/{id}/domains/{domain}",
20528
+ * "method": "DELETE"
20529
+ * }
20530
+ * }
20531
+ */
20532
+ "application/json": components["schemas"]["ErrorResponseDto"];
20533
+ };
20534
+ };
20510
20535
  };
20511
20536
  };
20512
20537
  ApiOrganizationsController_listSsoConnections: {
@@ -20862,7 +20887,7 @@ interface operations {
20862
20887
  "application/json": components["schemas"]["ErrorResponseDto"];
20863
20888
  };
20864
20889
  };
20865
- /** @description The organization set this connection up itself; it stays bound. Disable or delete the connection instead. */
20890
+ /** @description The organization set this connection up itself, so it stays bound: disable or delete the connection instead; or the organization requires single sign-on and this is its only active connection */
20866
20891
  409: {
20867
20892
  headers: {
20868
20893
  [name: string]: unknown;
@@ -20873,7 +20898,7 @@ interface operations {
20873
20898
  * "error": {
20874
20899
  * "statusCode": 409,
20875
20900
  * "code": "request.conflict",
20876
- * "message": "The organization set this connection up itself; it stays bound. Disable or delete the connection instead.",
20901
+ * "message": "The organization set this connection up itself, so it stays bound: disable or delete the connection instead; or the organization requires single sign-on and this is its only active connection",
20877
20902
  * "timestamp": "2026-04-20T12:00:00.000Z",
20878
20903
  * "path": "/api/v1/organizations/{id}/sso-connections/{connectionId}",
20879
20904
  * "method": "DELETE"
@@ -22395,7 +22420,7 @@ interface operations {
22395
22420
  "application/json": components["schemas"]["ErrorResponseDto"];
22396
22421
  };
22397
22422
  };
22398
- /** @description The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console */
22423
+ /** @description The organization has no SSO connection bound to it, its connection is developer-managed and is changed from the Console, or the organization requires single sign-on and this is its only active connection */
22399
22424
  409: {
22400
22425
  headers: {
22401
22426
  [name: string]: unknown;
@@ -22406,7 +22431,7 @@ interface operations {
22406
22431
  * "error": {
22407
22432
  * "statusCode": 409,
22408
22433
  * "code": "request.conflict",
22409
- * "message": "The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console",
22434
+ * "message": "The organization has no SSO connection bound to it, its connection is developer-managed and is changed from the Console, or the organization requires single sign-on and this is its only active connection",
22410
22435
  * "timestamp": "2026-04-20T12:00:00.000Z",
22411
22436
  * "path": "/api/v1/organizations/{id}/sso-connection",
22412
22437
  * "method": "DELETE"
@@ -22801,7 +22826,7 @@ interface operations {
22801
22826
  "application/json": components["schemas"]["ErrorResponseDto"];
22802
22827
  };
22803
22828
  };
22804
- /** @description The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; or the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`) */
22829
+ /** @description The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`); or the organization requires single sign-on and this is its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first */
22805
22830
  409: {
22806
22831
  headers: {
22807
22832
  [name: string]: unknown;
@@ -22812,7 +22837,7 @@ interface operations {
22812
22837
  * "error": {
22813
22838
  * "statusCode": 409,
22814
22839
  * "code": "request.conflict",
22815
- * "message": "The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; or the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`)",
22840
+ * "message": "The organization has no SSO connection bound to it, or its connection is developer-managed and is changed from the Console; the connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection in `data.current`); or the organization requires single sign-on and this is its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first",
22816
22841
  * "timestamp": "2026-04-20T12:00:00.000Z",
22817
22842
  * "path": "/api/v1/organizations/{id}/sso-connection/disable",
22818
22843
  * "method": "POST"
@@ -34849,6 +34874,27 @@ interface operations {
34849
34874
  "application/json": components["schemas"]["ErrorResponseDto"];
34850
34875
  };
34851
34876
  };
34877
+ /** @description An organization that requires single sign-on has this as its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first */
34878
+ 409: {
34879
+ headers: {
34880
+ [name: string]: unknown;
34881
+ };
34882
+ content: {
34883
+ /**
34884
+ * @example {
34885
+ * "error": {
34886
+ * "statusCode": 409,
34887
+ * "code": "request.conflict",
34888
+ * "message": "An organization that requires single sign-on has this as its only active connection (`organization.sso_requirement_needs_connection`): turn the requirement off first",
34889
+ * "timestamp": "2026-04-20T12:00:00.000Z",
34890
+ * "path": "/api/v1/sso/connections/{id}",
34891
+ * "method": "DELETE"
34892
+ * }
34893
+ * }
34894
+ */
34895
+ "application/json": components["schemas"]["ErrorResponseDto"];
34896
+ };
34897
+ };
34852
34898
  };
34853
34899
  };
34854
34900
  ApiSsoController_update: {
@@ -35228,7 +35274,7 @@ interface operations {
35228
35274
  "application/json": components["schemas"]["ErrorResponseDto"];
35229
35275
  };
35230
35276
  };
35231
- /** @description The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`) */
35277
+ /** @description The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`), or it is the only active connection of an organization that requires single sign-on (`organization.sso_requirement_needs_connection`): turn the requirement off first */
35232
35278
  409: {
35233
35279
  headers: {
35234
35280
  [name: string]: unknown;
@@ -35239,7 +35285,7 @@ interface operations {
35239
35285
  * "error": {
35240
35286
  * "statusCode": 409,
35241
35287
  * "code": "request.conflict",
35242
- * "message": "The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`)",
35288
+ * "message": "The connection changed since the version sent in `If-Match` was read (`version_mismatch`, with the connection as it now stands in `data.current`), or it is the only active connection of an organization that requires single sign-on (`organization.sso_requirement_needs_connection`): turn the requirement off first",
35243
35289
  * "timestamp": "2026-04-20T12:00:00.000Z",
35244
35290
  * "path": "/api/v1/sso/connections/{id}/disable",
35245
35291
  * "method": "POST"
@@ -45115,7 +45161,8 @@ declare class Identities {
45115
45161
  /**
45116
45162
  * Ends one session and leaves the identity's others signed in. `sessionId`
45117
45163
  * is the session's `id` from `sessions`: its current refresh token, which
45118
- * changes on every refresh, so read it shortly before revoking.
45164
+ * changes on every refresh, so read it shortly before revoking; or, for a
45165
+ * hosted sign-in no application has exchanged a code for yet, its session id.
45119
45166
  */
45120
45167
  revokeSession(id: string, sessionId: string): Promise<void>;
45121
45168
  /**
package/dist/index.js CHANGED
@@ -684,7 +684,8 @@ var Identities = class {
684
684
  /**
685
685
  * Ends one session and leaves the identity's others signed in. `sessionId`
686
686
  * is the session's `id` from `sessions`: its current refresh token, which
687
- * changes on every refresh, so read it shortly before revoking.
687
+ * changes on every refresh, so read it shortly before revoking; or, for a
688
+ * hosted sign-in no application has exchanged a code for yet, its session id.
688
689
  */
689
690
  revokeSession(id, sessionId) {
690
691
  return this.client.request(