@faable/auth-sdk 2.9.0 → 2.9.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.
@@ -1080,6 +1080,34 @@ export interface paths {
1080
1080
  patch?: never;
1081
1081
  trace?: never;
1082
1082
  };
1083
+ "/role/{role_id}/permissions": {
1084
+ parameters: {
1085
+ query?: never;
1086
+ header?: never;
1087
+ path?: never;
1088
+ cookie?: never;
1089
+ };
1090
+ /**
1091
+ * List the permissions of a Role
1092
+ * @description Lists the Api permissions the Role grants, each with its Api. A user gets them in tokens for an Api with `rbac` enabled when the Role is assigned to them at the account level.
1093
+ */
1094
+ get: operations["role/permissions"];
1095
+ put?: never;
1096
+ /**
1097
+ * Add permissions to a Role
1098
+ * @description Grants Api permissions to a Role. Each must be in the catalog of an Api of this tenant. Permissions the Role already has are kept. Tokens issued from now on (refreshes included) carry them; tokens already issued are unchanged. Leaves an entry in the tenant's log.
1099
+ */
1100
+ post: operations["role/add_permissions"];
1101
+ /**
1102
+ * Remove permissions from a Role
1103
+ * @description Revokes Api permissions from a Role. Permissions the Role does not have are ignored. Tokens already issued keep them until they expire; refreshes drop them. Leaves an entry in the tenant's log.
1104
+ */
1105
+ delete: operations["role/remove_permissions"];
1106
+ options?: never;
1107
+ head?: never;
1108
+ patch?: never;
1109
+ trace?: never;
1110
+ };
1083
1111
  "/role": {
1084
1112
  parameters: {
1085
1113
  query?: never;
@@ -1150,6 +1178,58 @@ export interface paths {
1150
1178
  * @description Assign Users to Role
1151
1179
  */
1152
1180
  post: operations["role/assign_users"];
1181
+ /**
1182
+ * Remove Users from Role
1183
+ * @description Revokes an account-level role from users. Their next tokens (refreshes included) no longer carry its permissions; tokens already issued keep them until they expire. Leaves an entry in the tenant's log.
1184
+ */
1185
+ delete: operations["role/remove_users"];
1186
+ options?: never;
1187
+ head?: never;
1188
+ patch?: never;
1189
+ trace?: never;
1190
+ };
1191
+ "/user/{user_id}/roles": {
1192
+ parameters: {
1193
+ query?: never;
1194
+ header?: never;
1195
+ path?: never;
1196
+ cookie?: never;
1197
+ };
1198
+ /**
1199
+ * List a User's roles
1200
+ * @description Lists the roles assigned to the User at the account level, by name. Account-level roles are what grant Api permissions to a user (in tokens for an Api with `rbac` enabled). Team roles are separate: they live on the team membership and grant no permissions.
1201
+ */
1202
+ get: operations["user/roles"];
1203
+ put?: never;
1204
+ /**
1205
+ * Assign roles to a User
1206
+ * @description Assigns account-level roles to the User and returns all of their roles. Roles the User already has are kept. Their next tokens (refreshes included) carry the new permissions. Leaves an entry in the tenant's log. Account-level roles are what grant Api permissions to a user (in tokens for an Api with `rbac` enabled). Team roles are separate: they live on the team membership and grant no permissions.
1207
+ */
1208
+ post: operations["user/assign_roles"];
1209
+ /**
1210
+ * Remove roles from a User
1211
+ * @description Removes account-level roles from the User and returns the ones left. Roles the User does not have are ignored. Tokens already issued keep the permissions until they expire; refreshes drop them. Leaves an entry in the tenant's log.
1212
+ */
1213
+ delete: operations["user/remove_roles"];
1214
+ options?: never;
1215
+ head?: never;
1216
+ patch?: never;
1217
+ trace?: never;
1218
+ };
1219
+ "/user/{user_id}/permissions": {
1220
+ parameters: {
1221
+ query?: never;
1222
+ header?: never;
1223
+ path?: never;
1224
+ cookie?: never;
1225
+ };
1226
+ /**
1227
+ * List a User's permissions
1228
+ * @description Lists the Api permissions the User holds through their account-level roles, with the roles that grant each one. For an Api with `rbac` enabled, these are exactly what the User's tokens for that Api carry in `permissions`.
1229
+ */
1230
+ get: operations["user/permissions"];
1231
+ put?: never;
1232
+ post?: never;
1153
1233
  delete?: never;
1154
1234
  options?: never;
1155
1235
  head?: never;
@@ -6682,6 +6762,19 @@ export interface components {
6682
6762
  name: string;
6683
6763
  /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
6684
6764
  description: string;
6765
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
6766
+ permissions: {
6767
+ /**
6768
+ * @description Id of the Api that defines the permission.
6769
+ * @example api_6555fd293acc2f0fac0e3452
6770
+ */
6771
+ api: string;
6772
+ /**
6773
+ * @description The permission, as it appears in the Api's `permissions` catalog.
6774
+ * @example invites:write
6775
+ */
6776
+ value: string;
6777
+ }[];
6685
6778
  /** @description Object is related with this account */
6686
6779
  account: string;
6687
6780
  /**
@@ -7021,6 +7114,8 @@ export interface components {
7021
7114
  token_lifetime: number;
7022
7115
  /** @description When true, only scopes that match a permission in `permissions` are forwarded into the access_token. When false, requested scopes are echoed back verbatim with no filtering. */
7023
7116
  enforce_policies: boolean;
7117
+ /** @description Role-based access control. When true, a token issued to a user carries only the permissions of this API granted to the user's roles (account-level role assignments, not team roles): `permissions` lists all of them, and `scope` keeps only the requested ones the user holds. Machine-to-machine tokens (`client_credentials`) are not affected. The `permissions` claim requires `token_dialect: access_token_authz`. */
7118
+ rbac: boolean;
7024
7119
  /** @description When true, the API is eligible to be the target of a `refresh_token` (i.e. clients can request `offline_access` against it). */
7025
7120
  allow_offline_access: boolean;
7026
7121
  consent_options?: {
@@ -7099,6 +7194,8 @@ export interface components {
7099
7194
  token_lifetime?: number;
7100
7195
  /** @description When true, requested scopes are filtered against `permissions` at token issuance. */
7101
7196
  enforce_policies?: boolean;
7197
+ /** @description When true, user tokens carry only the permissions granted to the user's roles. Defaults to false. */
7198
+ rbac?: boolean;
7102
7199
  /** @description When true, clients can request `offline_access` and receive a refresh_token for this API. */
7103
7200
  allow_offline_access?: boolean;
7104
7201
  consent_options?: {
@@ -7146,6 +7243,8 @@ export interface components {
7146
7243
  token_lifetime?: number;
7147
7244
  /** @description When true, requested scopes are filtered against `permissions` at token issuance. */
7148
7245
  enforce_policies?: boolean;
7246
+ /** @description When true, user tokens carry only the permissions granted to the user's roles. Applies to tokens issued after the update, including refreshes. */
7247
+ rbac?: boolean;
7149
7248
  /** @description When true, clients can request `offline_access` and receive a refresh_token for this API. */
7150
7249
  allow_offline_access?: boolean;
7151
7250
  consent_options?: {
@@ -8649,6 +8748,7 @@ export interface components {
8649
8748
  * - `use_team_member_route` (400): This generic route cannot create memberships. Use `POST /team/{team_id}/member` for team members or `POST /role/{role_id}/users` for role grants.
8650
8749
  * - `role_not_found` (404): No role with that id in this account.
8651
8750
  * - `invalid_role` (400): The role belongs to another account.
8751
+ * - `invalid_permission` (400): A permission is not in the catalog of its Api, or the Api is not in this account. `details.permissions` lists the ones refused.
8652
8752
  * - `flow_not_found` (400): The login flow does not exist in this account.
8653
8753
  * - `revision_not_found` (404): The revision is not in the flow history.
8654
8754
  * - `invalid_webhook_event` (400): An event is not in the webhook event catalog. `message` and `details.valid_events` list the valid ones.
@@ -8658,7 +8758,7 @@ export interface components {
8658
8758
  * - `delivery_in_progress` (409): The delivery is being attempted right now; retry the redeliver in a minute.
8659
8759
  * @enum {string}
8660
8760
  */
8661
- ErrorCode: "bad_request" | "validation_error" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "method_not_allowed" | "conflict" | "last_sign_in_method" | "payload_too_large" | "unsupported_media_type" | "unprocessable_entity" | "too_many_requests" | "internal_error" | "already_exists" | "invalid_id" | "account_not_found" | "invalid_query" | "search_not_supported" | "invalid_expand" | "access_denied" | "insufficient_scope" | "team_required" | "account_limit_reached" | "invalid_project_id" | "account_transfer_refused" | "email_sender_domain_not_allowed" | "plan_required" | "invalid_canonical_host" | "canonical_host_breaks_passkeys" | "not_logged_in" | "session_already_revoked" | "invalid_token" | "not_owner" | "user_suspended" | "invalid_credentials" | "login_denied" | "signup_denied" | "client_credentials_denied" | "m2m_quota_exceeded" | "signup_disabled" | "email_taken" | "username_taken" | "invalid_username" | "invalid_email" | "invalid_name" | "same_email" | "user_has_no_email" | "password_too_weak" | "invalid_password_hash" | "weak_password_hash" | "invalid_code" | "invalid_phone" | "phone_changed" | "phone_already_verified" | "sms_unavailable" | "sms_failed" | "invalid_state" | "state_mismatch" | "invalid_ticket" | "ticket_used" | "ticket_expired" | "ticket_not_found" | "credential_not_found" | "invalid_link" | "expired_link" | "invalid_otp" | "invalid_client" | "client_not_found" | "client_mismatch" | "invalid_client_metadata" | "invalid_connection" | "no_database_connection" | "connection_required" | "connection_misconfigured" | "passwordless_unavailable" | "ambiguous_connection" | "invalid_redirect_uri" | "invalid_saml_request" | "saml_sp_mismatch" | "saml_not_enabled" | "invalid_saml_sp" | "origin_not_allowed" | "audience_not_found" | "system_resource" | "invalid_request" | "invalid_device_code" | "provider_error" | "identity_already_linked" | "identity_link_denied" | "identity_conflict" | "identity_orphaned" | "no_provider_token" | "no_refresh_token" | "action_unavailable" | "login_flow_misconfigured" | "mfa_required" | "step_up_required" | "reauth_required" | "invalid_current_password" | "email_not_verified" | "invalid_profile_field" | "interaction_required" | "passkey_login_disabled" | "mfa_pending" | "mfa_invalid_code" | "mfa_invalid_recovery_code" | "too_many_attempts" | "too_many_login_attempts" | "totp_not_allowed" | "no_usable_factor" | "factor_not_found" | "factor_already_confirmed" | "invalid_factor" | "session_missing" | "passkey_verification_failed" | "no_passkey_enrolled" | "malformed_credential" | "unknown_passkey" | "invalid_passkey" | "invalid_invite_url" | "invite_email_mismatch" | "invite_email_unverified" | "invite_not_found" | "invite_used" | "already_member" | "not_a_member" | "consent_options_unavailable" | "consent_choice_invalid" | "registration_disabled" | "invalid_email_domain" | "public_email_domain" | "organization_domain_not_found" | "organization_domain_taken" | "organization_domain_unverified" | "plan_unavailable" | "organization_domain_mismatch" | "team_not_in_organization" | "organization_has_no_idp" | "organization_not_found" | "invalid_user" | "not_an_organization_admin" | "last_organization_admin" | "team_id_unavailable" | "use_team_member_route" | "role_not_found" | "invalid_role" | "flow_not_found" | "revision_not_found" | "invalid_webhook_event" | "invalid_webhook_url" | "not_a_webhook" | "delivery_not_found" | "delivery_in_progress";
8761
+ ErrorCode: "bad_request" | "validation_error" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "method_not_allowed" | "conflict" | "last_sign_in_method" | "payload_too_large" | "unsupported_media_type" | "unprocessable_entity" | "too_many_requests" | "internal_error" | "already_exists" | "invalid_id" | "account_not_found" | "invalid_query" | "search_not_supported" | "invalid_expand" | "access_denied" | "insufficient_scope" | "team_required" | "account_limit_reached" | "invalid_project_id" | "account_transfer_refused" | "email_sender_domain_not_allowed" | "plan_required" | "invalid_canonical_host" | "canonical_host_breaks_passkeys" | "not_logged_in" | "session_already_revoked" | "invalid_token" | "not_owner" | "user_suspended" | "invalid_credentials" | "login_denied" | "signup_denied" | "client_credentials_denied" | "m2m_quota_exceeded" | "signup_disabled" | "email_taken" | "username_taken" | "invalid_username" | "invalid_email" | "invalid_name" | "same_email" | "user_has_no_email" | "password_too_weak" | "invalid_password_hash" | "weak_password_hash" | "invalid_code" | "invalid_phone" | "phone_changed" | "phone_already_verified" | "sms_unavailable" | "sms_failed" | "invalid_state" | "state_mismatch" | "invalid_ticket" | "ticket_used" | "ticket_expired" | "ticket_not_found" | "credential_not_found" | "invalid_link" | "expired_link" | "invalid_otp" | "invalid_client" | "client_not_found" | "client_mismatch" | "invalid_client_metadata" | "invalid_connection" | "no_database_connection" | "connection_required" | "connection_misconfigured" | "passwordless_unavailable" | "ambiguous_connection" | "invalid_redirect_uri" | "invalid_saml_request" | "saml_sp_mismatch" | "saml_not_enabled" | "invalid_saml_sp" | "origin_not_allowed" | "audience_not_found" | "system_resource" | "invalid_request" | "invalid_device_code" | "provider_error" | "identity_already_linked" | "identity_link_denied" | "identity_conflict" | "identity_orphaned" | "no_provider_token" | "no_refresh_token" | "action_unavailable" | "login_flow_misconfigured" | "mfa_required" | "step_up_required" | "reauth_required" | "invalid_current_password" | "email_not_verified" | "invalid_profile_field" | "interaction_required" | "passkey_login_disabled" | "mfa_pending" | "mfa_invalid_code" | "mfa_invalid_recovery_code" | "too_many_attempts" | "too_many_login_attempts" | "totp_not_allowed" | "no_usable_factor" | "factor_not_found" | "factor_already_confirmed" | "invalid_factor" | "session_missing" | "passkey_verification_failed" | "no_passkey_enrolled" | "malformed_credential" | "unknown_passkey" | "invalid_passkey" | "invalid_invite_url" | "invite_email_mismatch" | "invite_email_unverified" | "invite_not_found" | "invite_used" | "already_member" | "not_a_member" | "consent_options_unavailable" | "consent_choice_invalid" | "registration_disabled" | "invalid_email_domain" | "public_email_domain" | "organization_domain_not_found" | "organization_domain_taken" | "organization_domain_unverified" | "plan_unavailable" | "organization_domain_mismatch" | "team_not_in_organization" | "organization_has_no_idp" | "organization_not_found" | "invalid_user" | "not_an_organization_admin" | "last_organization_admin" | "team_id_unavailable" | "use_team_member_route" | "role_not_found" | "invalid_role" | "invalid_permission" | "flow_not_found" | "revision_not_found" | "invalid_webhook_event" | "invalid_webhook_url" | "not_a_webhook" | "delivery_not_found" | "delivery_in_progress";
8662
8762
  /** @description Every error response has this shape. Branch on `error_code`, never on `message`: the message is written for a person and may change. */
8663
8763
  ErrorResponse: {
8664
8764
  /** @description The HTTP status, repeated. */
@@ -18663,24 +18763,13 @@ export interface operations {
18663
18763
  };
18664
18764
  };
18665
18765
  };
18666
- "role/list": {
18766
+ "role/permissions": {
18667
18767
  parameters: {
18668
- query?: {
18669
- /** @description Number of items per page (max 200) */
18670
- pageSize?: number;
18671
- /** @description Cursor for next page */
18672
- cursor?: string;
18673
- /** @description Cursor returned by the previous page */
18674
- next?: string;
18675
- /** @description Also return `total`: the rows matching the whole filter, across every page. */
18676
- count?: boolean;
18677
- /** @description Filter using a FaableQL query */
18678
- query?: string;
18679
- /** @description Full-text search across: `name`, `description`. */
18680
- q?: string;
18681
- };
18768
+ query?: never;
18682
18769
  header?: never;
18683
- path?: never;
18770
+ path: {
18771
+ role_id: string;
18772
+ };
18684
18773
  cookie?: never;
18685
18774
  };
18686
18775
  requestBody?: never;
@@ -18692,22 +18781,26 @@ export interface operations {
18692
18781
  };
18693
18782
  content: {
18694
18783
  "application/json": {
18695
- next: string | null;
18696
- results: components["schemas"]["Role"][];
18697
- /** @description Rows matching the whole filter, across every page. Only with `?count=true`. */
18698
- total?: number;
18699
- };
18784
+ /** @description Id of the Api that defines it. */
18785
+ api: string;
18786
+ /**
18787
+ * @description Audience of that Api: the `aud` of the tokens that carry this permission.
18788
+ * @example https://api.example.com
18789
+ */
18790
+ api_identifier: string;
18791
+ /** @description Name of that Api. */
18792
+ api_name: string;
18793
+ /**
18794
+ * @description The permission, as it appears in the `permissions` claim.
18795
+ * @example invites:write
18796
+ */
18797
+ value: string;
18798
+ /** @description The permission's description in the Api. */
18799
+ description?: string;
18800
+ }[];
18700
18801
  };
18701
18802
  };
18702
- /**
18703
- * @description `invalid_query` — The `?query=` FaableQL expression could not be parsed.
18704
- *
18705
- * `invalid_expand` — An `?expand=` path is not allowed on this resource.
18706
- *
18707
- * `search_not_supported` — This resource does not support `?search=`.
18708
- *
18709
- * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
18710
- */
18803
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
18711
18804
  400: {
18712
18805
  headers: {
18713
18806
  [name: string]: unknown;
@@ -18715,7 +18808,7 @@ export interface operations {
18715
18808
  content: {
18716
18809
  "application/json": components["schemas"]["ErrorResponse"] & {
18717
18810
  /** @enum {string} */
18718
- error_code?: "invalid_query" | "invalid_expand" | "search_not_supported" | "validation_error";
18811
+ error_code?: "validation_error";
18719
18812
  };
18720
18813
  };
18721
18814
  };
@@ -18749,7 +18842,11 @@ export interface operations {
18749
18842
  };
18750
18843
  };
18751
18844
  };
18752
- /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
18845
+ /**
18846
+ * @description `not_found` — The resource does not exist in this account.
18847
+ *
18848
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
18849
+ */
18753
18850
  404: {
18754
18851
  headers: {
18755
18852
  [name: string]: unknown;
@@ -18757,7 +18854,7 @@ export interface operations {
18757
18854
  content: {
18758
18855
  "application/json": components["schemas"]["ErrorResponse"] & {
18759
18856
  /** @enum {string} */
18760
- error_code?: "account_not_found";
18857
+ error_code?: "not_found" | "account_not_found";
18761
18858
  };
18762
18859
  };
18763
18860
  };
@@ -18787,66 +18884,74 @@ export interface operations {
18787
18884
  };
18788
18885
  };
18789
18886
  };
18790
- "role/create": {
18887
+ "role/add_permissions": {
18791
18888
  parameters: {
18792
18889
  query?: never;
18793
18890
  header?: never;
18794
- path?: never;
18891
+ path: {
18892
+ role_id: string;
18893
+ };
18795
18894
  cookie?: never;
18796
18895
  };
18797
- /** @description RoleCreate */
18896
+ /** @description Permissions to add to or remove from a role. */
18798
18897
  requestBody: {
18799
18898
  content: {
18800
18899
  "application/json": {
18801
18900
  /**
18802
- * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`).
18803
- * @example admin
18901
+ * @description Permissions to grant or revoke, each as the Api id plus the value from its catalog.
18902
+ * @example [
18903
+ * {
18904
+ * "api": "api_6555fd293acc2f0fac0e3452",
18905
+ * "value": "invites:write"
18906
+ * }
18907
+ * ]
18804
18908
  */
18805
- name: string;
18806
- /** @description Free-form explanation of what users in this role are expected to do or have access to. */
18807
- description?: string;
18808
- /** @description Add Metadata */
18809
- metadata?: {
18810
- [key: string]: unknown;
18811
- };
18909
+ permissions: {
18910
+ /**
18911
+ * @description Id of the Api that defines the permission.
18912
+ * @example api_6555fd293acc2f0fac0e3452
18913
+ */
18914
+ api: string;
18915
+ /**
18916
+ * @description The permission, as it appears in the Api's `permissions` catalog.
18917
+ * @example invites:write
18918
+ */
18919
+ value: string;
18920
+ }[];
18921
+ /** @description The person making the change, when your backend calls on their behalf with a machine token: it is who the tenant's log names. Must be a user of this tenant. */
18922
+ actor_user_id?: string;
18812
18923
  };
18813
18924
  };
18814
18925
  };
18815
18926
  responses: {
18816
- /** @description Role */
18927
+ /** @description Default Response */
18817
18928
  200: {
18818
18929
  headers: {
18819
18930
  [name: string]: unknown;
18820
18931
  };
18821
18932
  content: {
18822
18933
  "application/json": {
18823
- /** @description Role ID */
18824
- id: string;
18934
+ /** @description Id of the Api that defines it. */
18935
+ api: string;
18825
18936
  /**
18826
- * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
18827
- * @example admin
18937
+ * @description Audience of that Api: the `aud` of the tokens that carry this permission.
18938
+ * @example https://api.example.com
18828
18939
  */
18829
- name: string;
18830
- /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
18831
- description: string;
18832
- /** @description Object is related with this account */
18833
- account: string;
18940
+ api_identifier: string;
18941
+ /** @description Name of that Api. */
18942
+ api_name: string;
18834
18943
  /**
18835
- * @description RoleMetadata
18836
- * @default {}
18944
+ * @description The permission, as it appears in the `permissions` claim.
18945
+ * @example invites:write
18837
18946
  */
18838
- metadata: {
18839
- [key: string]: unknown;
18840
- };
18841
- /** @description Role creation date */
18842
- createdAt: string;
18843
- /** @description Role updated date */
18844
- updatedAt?: string;
18845
- };
18947
+ value: string;
18948
+ /** @description The permission's description in the Api. */
18949
+ description?: string;
18950
+ }[];
18846
18951
  };
18847
18952
  };
18848
18953
  /**
18849
- * @description `already_exists` — A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.
18954
+ * @description `invalid_permission` — A permission is not in the catalog of its Api, or the Api is not in this account. `details.permissions` lists the ones refused.
18850
18955
  *
18851
18956
  * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
18852
18957
  */
@@ -18857,7 +18962,7 @@ export interface operations {
18857
18962
  content: {
18858
18963
  "application/json": components["schemas"]["ErrorResponse"] & {
18859
18964
  /** @enum {string} */
18860
- error_code?: "already_exists" | "validation_error";
18965
+ error_code?: "invalid_permission" | "validation_error";
18861
18966
  };
18862
18967
  };
18863
18968
  };
@@ -18891,7 +18996,11 @@ export interface operations {
18891
18996
  };
18892
18997
  };
18893
18998
  };
18894
- /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
18999
+ /**
19000
+ * @description `not_found` — The resource does not exist in this account.
19001
+ *
19002
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
19003
+ */
18895
19004
  404: {
18896
19005
  headers: {
18897
19006
  [name: string]: unknown;
@@ -18899,7 +19008,7 @@ export interface operations {
18899
19008
  content: {
18900
19009
  "application/json": components["schemas"]["ErrorResponse"] & {
18901
19010
  /** @enum {string} */
18902
- error_code?: "account_not_found";
19011
+ error_code?: "not_found" | "account_not_found";
18903
19012
  };
18904
19013
  };
18905
19014
  };
@@ -18929,7 +19038,7 @@ export interface operations {
18929
19038
  };
18930
19039
  };
18931
19040
  };
18932
- "role/get": {
19041
+ "role/remove_permissions": {
18933
19042
  parameters: {
18934
19043
  query?: never;
18935
19044
  header?: never;
@@ -18938,47 +19047,64 @@ export interface operations {
18938
19047
  };
18939
19048
  cookie?: never;
18940
19049
  };
18941
- requestBody?: never;
19050
+ /** @description Permissions to add to or remove from a role. */
19051
+ requestBody: {
19052
+ content: {
19053
+ "application/json": {
19054
+ /**
19055
+ * @description Permissions to grant or revoke, each as the Api id plus the value from its catalog.
19056
+ * @example [
19057
+ * {
19058
+ * "api": "api_6555fd293acc2f0fac0e3452",
19059
+ * "value": "invites:write"
19060
+ * }
19061
+ * ]
19062
+ */
19063
+ permissions: {
19064
+ /**
19065
+ * @description Id of the Api that defines the permission.
19066
+ * @example api_6555fd293acc2f0fac0e3452
19067
+ */
19068
+ api: string;
19069
+ /**
19070
+ * @description The permission, as it appears in the Api's `permissions` catalog.
19071
+ * @example invites:write
19072
+ */
19073
+ value: string;
19074
+ }[];
19075
+ /** @description The person making the change, when your backend calls on their behalf with a machine token: it is who the tenant's log names. Must be a user of this tenant. */
19076
+ actor_user_id?: string;
19077
+ };
19078
+ };
19079
+ };
18942
19080
  responses: {
18943
- /** @description Role */
19081
+ /** @description Default Response */
18944
19082
  200: {
18945
19083
  headers: {
18946
19084
  [name: string]: unknown;
18947
19085
  };
18948
19086
  content: {
18949
19087
  "application/json": {
18950
- /** @description Role ID */
18951
- id: string;
19088
+ /** @description Id of the Api that defines it. */
19089
+ api: string;
18952
19090
  /**
18953
- * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
18954
- * @example admin
19091
+ * @description Audience of that Api: the `aud` of the tokens that carry this permission.
19092
+ * @example https://api.example.com
18955
19093
  */
18956
- name: string;
18957
- /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
18958
- description: string;
18959
- /** @description Object is related with this account */
18960
- account: string;
19094
+ api_identifier: string;
19095
+ /** @description Name of that Api. */
19096
+ api_name: string;
18961
19097
  /**
18962
- * @description RoleMetadata
18963
- * @default {}
19098
+ * @description The permission, as it appears in the `permissions` claim.
19099
+ * @example invites:write
18964
19100
  */
18965
- metadata: {
18966
- [key: string]: unknown;
18967
- };
18968
- /** @description Role creation date */
18969
- createdAt: string;
18970
- /** @description Role updated date */
18971
- updatedAt?: string;
18972
- };
19101
+ value: string;
19102
+ /** @description The permission's description in the Api. */
19103
+ description?: string;
19104
+ }[];
18973
19105
  };
18974
19106
  };
18975
- /**
18976
- * @description `invalid_id` — The id in the path is not a valid id for this resource.
18977
- *
18978
- * `invalid_expand` — An `?expand=` path is not allowed on this resource.
18979
- *
18980
- * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
18981
- */
19107
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
18982
19108
  400: {
18983
19109
  headers: {
18984
19110
  [name: string]: unknown;
@@ -18986,7 +19112,7 @@ export interface operations {
18986
19112
  content: {
18987
19113
  "application/json": components["schemas"]["ErrorResponse"] & {
18988
19114
  /** @enum {string} */
18989
- error_code?: "invalid_id" | "invalid_expand" | "validation_error";
19115
+ error_code?: "validation_error";
18990
19116
  };
18991
19117
  };
18992
19118
  };
@@ -19062,43 +19188,1130 @@ export interface operations {
19062
19188
  };
19063
19189
  };
19064
19190
  };
19065
- "role/update": {
19191
+ "role/list": {
19066
19192
  parameters: {
19067
- query?: never;
19068
- header?: never;
19069
- path: {
19070
- role_id: string;
19193
+ query?: {
19194
+ /** @description Number of items per page (max 200) */
19195
+ pageSize?: number;
19196
+ /** @description Cursor for next page */
19197
+ cursor?: string;
19198
+ /** @description Cursor returned by the previous page */
19199
+ next?: string;
19200
+ /** @description Also return `total`: the rows matching the whole filter, across every page. */
19201
+ count?: boolean;
19202
+ /** @description Filter using a FaableQL query */
19203
+ query?: string;
19204
+ /** @description Full-text search across: `name`, `description`. */
19205
+ q?: string;
19071
19206
  };
19207
+ header?: never;
19208
+ path?: never;
19072
19209
  cookie?: never;
19073
19210
  };
19074
- /** @description Partial update for a Role. Only the supplied fields are modified. */
19075
- requestBody: {
19076
- content: {
19077
- "application/json": {
19078
- /** @description New human-readable identifier for the role. */
19079
- name?: string;
19080
- /** @description New free-form description of what users in this role do. */
19081
- description?: string;
19082
- };
19083
- };
19084
- };
19211
+ requestBody?: never;
19085
19212
  responses: {
19086
- /** @description Role */
19213
+ /** @description Default Response */
19087
19214
  200: {
19088
19215
  headers: {
19089
19216
  [name: string]: unknown;
19090
19217
  };
19091
19218
  content: {
19092
19219
  "application/json": {
19093
- /** @description Role ID */
19094
- id: string;
19095
- /**
19220
+ next: string | null;
19221
+ results: components["schemas"]["Role"][];
19222
+ /** @description Rows matching the whole filter, across every page. Only with `?count=true`. */
19223
+ total?: number;
19224
+ };
19225
+ };
19226
+ };
19227
+ /**
19228
+ * @description `invalid_query` — The `?query=` FaableQL expression could not be parsed.
19229
+ *
19230
+ * `invalid_expand` — An `?expand=` path is not allowed on this resource.
19231
+ *
19232
+ * `search_not_supported` — This resource does not support `?search=`.
19233
+ *
19234
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19235
+ */
19236
+ 400: {
19237
+ headers: {
19238
+ [name: string]: unknown;
19239
+ };
19240
+ content: {
19241
+ "application/json": components["schemas"]["ErrorResponse"] & {
19242
+ /** @enum {string} */
19243
+ error_code?: "invalid_query" | "invalid_expand" | "search_not_supported" | "validation_error";
19244
+ };
19245
+ };
19246
+ };
19247
+ /** @description `unauthorized` — The request carries no valid credentials. */
19248
+ 401: {
19249
+ headers: {
19250
+ [name: string]: unknown;
19251
+ };
19252
+ content: {
19253
+ "application/json": components["schemas"]["ErrorResponse"] & {
19254
+ /** @enum {string} */
19255
+ error_code?: "unauthorized";
19256
+ };
19257
+ };
19258
+ };
19259
+ /**
19260
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
19261
+ *
19262
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
19263
+ *
19264
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
19265
+ */
19266
+ 403: {
19267
+ headers: {
19268
+ [name: string]: unknown;
19269
+ };
19270
+ content: {
19271
+ "application/json": components["schemas"]["ErrorResponse"] & {
19272
+ /** @enum {string} */
19273
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
19274
+ };
19275
+ };
19276
+ };
19277
+ /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
19278
+ 404: {
19279
+ headers: {
19280
+ [name: string]: unknown;
19281
+ };
19282
+ content: {
19283
+ "application/json": components["schemas"]["ErrorResponse"] & {
19284
+ /** @enum {string} */
19285
+ error_code?: "account_not_found";
19286
+ };
19287
+ };
19288
+ };
19289
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
19290
+ 429: {
19291
+ headers: {
19292
+ [name: string]: unknown;
19293
+ };
19294
+ content: {
19295
+ "application/json": components["schemas"]["ErrorResponse"] & {
19296
+ /** @enum {string} */
19297
+ error_code?: "too_many_requests";
19298
+ };
19299
+ };
19300
+ };
19301
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
19302
+ 500: {
19303
+ headers: {
19304
+ [name: string]: unknown;
19305
+ };
19306
+ content: {
19307
+ "application/json": components["schemas"]["ErrorResponse"] & {
19308
+ /** @enum {string} */
19309
+ error_code?: "internal_error";
19310
+ };
19311
+ };
19312
+ };
19313
+ };
19314
+ };
19315
+ "role/create": {
19316
+ parameters: {
19317
+ query?: never;
19318
+ header?: never;
19319
+ path?: never;
19320
+ cookie?: never;
19321
+ };
19322
+ /** @description RoleCreate */
19323
+ requestBody: {
19324
+ content: {
19325
+ "application/json": {
19326
+ /**
19327
+ * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`).
19328
+ * @example admin
19329
+ */
19330
+ name: string;
19331
+ /** @description Free-form explanation of what users in this role are expected to do or have access to. */
19332
+ description?: string;
19333
+ /** @description Add Metadata */
19334
+ metadata?: {
19335
+ [key: string]: unknown;
19336
+ };
19337
+ };
19338
+ };
19339
+ };
19340
+ responses: {
19341
+ /** @description Role */
19342
+ 200: {
19343
+ headers: {
19344
+ [name: string]: unknown;
19345
+ };
19346
+ content: {
19347
+ "application/json": {
19348
+ /** @description Role ID */
19349
+ id: string;
19350
+ /**
19351
+ * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
19352
+ * @example admin
19353
+ */
19354
+ name: string;
19355
+ /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
19356
+ description: string;
19357
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
19358
+ permissions: {
19359
+ /**
19360
+ * @description Id of the Api that defines the permission.
19361
+ * @example api_6555fd293acc2f0fac0e3452
19362
+ */
19363
+ api: string;
19364
+ /**
19365
+ * @description The permission, as it appears in the Api's `permissions` catalog.
19366
+ * @example invites:write
19367
+ */
19368
+ value: string;
19369
+ }[];
19370
+ /** @description Object is related with this account */
19371
+ account: string;
19372
+ /**
19373
+ * @description RoleMetadata
19374
+ * @default {}
19375
+ */
19376
+ metadata: {
19377
+ [key: string]: unknown;
19378
+ };
19379
+ /** @description Role creation date */
19380
+ createdAt: string;
19381
+ /** @description Role updated date */
19382
+ updatedAt?: string;
19383
+ };
19384
+ };
19385
+ };
19386
+ /**
19387
+ * @description `already_exists` — A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.
19388
+ *
19389
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19390
+ */
19391
+ 400: {
19392
+ headers: {
19393
+ [name: string]: unknown;
19394
+ };
19395
+ content: {
19396
+ "application/json": components["schemas"]["ErrorResponse"] & {
19397
+ /** @enum {string} */
19398
+ error_code?: "already_exists" | "validation_error";
19399
+ };
19400
+ };
19401
+ };
19402
+ /** @description `unauthorized` — The request carries no valid credentials. */
19403
+ 401: {
19404
+ headers: {
19405
+ [name: string]: unknown;
19406
+ };
19407
+ content: {
19408
+ "application/json": components["schemas"]["ErrorResponse"] & {
19409
+ /** @enum {string} */
19410
+ error_code?: "unauthorized";
19411
+ };
19412
+ };
19413
+ };
19414
+ /**
19415
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
19416
+ *
19417
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
19418
+ *
19419
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
19420
+ */
19421
+ 403: {
19422
+ headers: {
19423
+ [name: string]: unknown;
19424
+ };
19425
+ content: {
19426
+ "application/json": components["schemas"]["ErrorResponse"] & {
19427
+ /** @enum {string} */
19428
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
19429
+ };
19430
+ };
19431
+ };
19432
+ /** @description `account_not_found` — No Auth Account matches the request (domain, header or token). */
19433
+ 404: {
19434
+ headers: {
19435
+ [name: string]: unknown;
19436
+ };
19437
+ content: {
19438
+ "application/json": components["schemas"]["ErrorResponse"] & {
19439
+ /** @enum {string} */
19440
+ error_code?: "account_not_found";
19441
+ };
19442
+ };
19443
+ };
19444
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
19445
+ 429: {
19446
+ headers: {
19447
+ [name: string]: unknown;
19448
+ };
19449
+ content: {
19450
+ "application/json": components["schemas"]["ErrorResponse"] & {
19451
+ /** @enum {string} */
19452
+ error_code?: "too_many_requests";
19453
+ };
19454
+ };
19455
+ };
19456
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
19457
+ 500: {
19458
+ headers: {
19459
+ [name: string]: unknown;
19460
+ };
19461
+ content: {
19462
+ "application/json": components["schemas"]["ErrorResponse"] & {
19463
+ /** @enum {string} */
19464
+ error_code?: "internal_error";
19465
+ };
19466
+ };
19467
+ };
19468
+ };
19469
+ };
19470
+ "role/get": {
19471
+ parameters: {
19472
+ query?: never;
19473
+ header?: never;
19474
+ path: {
19475
+ role_id: string;
19476
+ };
19477
+ cookie?: never;
19478
+ };
19479
+ requestBody?: never;
19480
+ responses: {
19481
+ /** @description Role */
19482
+ 200: {
19483
+ headers: {
19484
+ [name: string]: unknown;
19485
+ };
19486
+ content: {
19487
+ "application/json": {
19488
+ /** @description Role ID */
19489
+ id: string;
19490
+ /**
19491
+ * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
19492
+ * @example admin
19493
+ */
19494
+ name: string;
19495
+ /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
19496
+ description: string;
19497
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
19498
+ permissions: {
19499
+ /**
19500
+ * @description Id of the Api that defines the permission.
19501
+ * @example api_6555fd293acc2f0fac0e3452
19502
+ */
19503
+ api: string;
19504
+ /**
19505
+ * @description The permission, as it appears in the Api's `permissions` catalog.
19506
+ * @example invites:write
19507
+ */
19508
+ value: string;
19509
+ }[];
19510
+ /** @description Object is related with this account */
19511
+ account: string;
19512
+ /**
19513
+ * @description RoleMetadata
19514
+ * @default {}
19515
+ */
19516
+ metadata: {
19517
+ [key: string]: unknown;
19518
+ };
19519
+ /** @description Role creation date */
19520
+ createdAt: string;
19521
+ /** @description Role updated date */
19522
+ updatedAt?: string;
19523
+ };
19524
+ };
19525
+ };
19526
+ /**
19527
+ * @description `invalid_id` — The id in the path is not a valid id for this resource.
19528
+ *
19529
+ * `invalid_expand` — An `?expand=` path is not allowed on this resource.
19530
+ *
19531
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19532
+ */
19533
+ 400: {
19534
+ headers: {
19535
+ [name: string]: unknown;
19536
+ };
19537
+ content: {
19538
+ "application/json": components["schemas"]["ErrorResponse"] & {
19539
+ /** @enum {string} */
19540
+ error_code?: "invalid_id" | "invalid_expand" | "validation_error";
19541
+ };
19542
+ };
19543
+ };
19544
+ /** @description `unauthorized` — The request carries no valid credentials. */
19545
+ 401: {
19546
+ headers: {
19547
+ [name: string]: unknown;
19548
+ };
19549
+ content: {
19550
+ "application/json": components["schemas"]["ErrorResponse"] & {
19551
+ /** @enum {string} */
19552
+ error_code?: "unauthorized";
19553
+ };
19554
+ };
19555
+ };
19556
+ /**
19557
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
19558
+ *
19559
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
19560
+ *
19561
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
19562
+ */
19563
+ 403: {
19564
+ headers: {
19565
+ [name: string]: unknown;
19566
+ };
19567
+ content: {
19568
+ "application/json": components["schemas"]["ErrorResponse"] & {
19569
+ /** @enum {string} */
19570
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
19571
+ };
19572
+ };
19573
+ };
19574
+ /**
19575
+ * @description `not_found` — The resource does not exist in this account.
19576
+ *
19577
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
19578
+ */
19579
+ 404: {
19580
+ headers: {
19581
+ [name: string]: unknown;
19582
+ };
19583
+ content: {
19584
+ "application/json": components["schemas"]["ErrorResponse"] & {
19585
+ /** @enum {string} */
19586
+ error_code?: "not_found" | "account_not_found";
19587
+ };
19588
+ };
19589
+ };
19590
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
19591
+ 429: {
19592
+ headers: {
19593
+ [name: string]: unknown;
19594
+ };
19595
+ content: {
19596
+ "application/json": components["schemas"]["ErrorResponse"] & {
19597
+ /** @enum {string} */
19598
+ error_code?: "too_many_requests";
19599
+ };
19600
+ };
19601
+ };
19602
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
19603
+ 500: {
19604
+ headers: {
19605
+ [name: string]: unknown;
19606
+ };
19607
+ content: {
19608
+ "application/json": components["schemas"]["ErrorResponse"] & {
19609
+ /** @enum {string} */
19610
+ error_code?: "internal_error";
19611
+ };
19612
+ };
19613
+ };
19614
+ };
19615
+ };
19616
+ "role/update": {
19617
+ parameters: {
19618
+ query?: never;
19619
+ header?: never;
19620
+ path: {
19621
+ role_id: string;
19622
+ };
19623
+ cookie?: never;
19624
+ };
19625
+ /** @description Partial update for a Role. Only the supplied fields are modified. */
19626
+ requestBody: {
19627
+ content: {
19628
+ "application/json": {
19629
+ /** @description New human-readable identifier for the role. */
19630
+ name?: string;
19631
+ /** @description New free-form description of what users in this role do. */
19632
+ description?: string;
19633
+ };
19634
+ };
19635
+ };
19636
+ responses: {
19637
+ /** @description Role */
19638
+ 200: {
19639
+ headers: {
19640
+ [name: string]: unknown;
19641
+ };
19642
+ content: {
19643
+ "application/json": {
19644
+ /** @description Role ID */
19645
+ id: string;
19646
+ /**
19647
+ * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
19648
+ * @example admin
19649
+ */
19650
+ name: string;
19651
+ /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
19652
+ description: string;
19653
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
19654
+ permissions: {
19655
+ /**
19656
+ * @description Id of the Api that defines the permission.
19657
+ * @example api_6555fd293acc2f0fac0e3452
19658
+ */
19659
+ api: string;
19660
+ /**
19661
+ * @description The permission, as it appears in the Api's `permissions` catalog.
19662
+ * @example invites:write
19663
+ */
19664
+ value: string;
19665
+ }[];
19666
+ /** @description Object is related with this account */
19667
+ account: string;
19668
+ /**
19669
+ * @description RoleMetadata
19670
+ * @default {}
19671
+ */
19672
+ metadata: {
19673
+ [key: string]: unknown;
19674
+ };
19675
+ /** @description Role creation date */
19676
+ createdAt: string;
19677
+ /** @description Role updated date */
19678
+ updatedAt?: string;
19679
+ };
19680
+ };
19681
+ };
19682
+ /**
19683
+ * @description `invalid_id` — The id in the path is not a valid id for this resource.
19684
+ *
19685
+ * `already_exists` — A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.
19686
+ *
19687
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19688
+ */
19689
+ 400: {
19690
+ headers: {
19691
+ [name: string]: unknown;
19692
+ };
19693
+ content: {
19694
+ "application/json": components["schemas"]["ErrorResponse"] & {
19695
+ /** @enum {string} */
19696
+ error_code?: "invalid_id" | "already_exists" | "validation_error";
19697
+ };
19698
+ };
19699
+ };
19700
+ /** @description `unauthorized` — The request carries no valid credentials. */
19701
+ 401: {
19702
+ headers: {
19703
+ [name: string]: unknown;
19704
+ };
19705
+ content: {
19706
+ "application/json": components["schemas"]["ErrorResponse"] & {
19707
+ /** @enum {string} */
19708
+ error_code?: "unauthorized";
19709
+ };
19710
+ };
19711
+ };
19712
+ /**
19713
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
19714
+ *
19715
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
19716
+ *
19717
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
19718
+ */
19719
+ 403: {
19720
+ headers: {
19721
+ [name: string]: unknown;
19722
+ };
19723
+ content: {
19724
+ "application/json": components["schemas"]["ErrorResponse"] & {
19725
+ /** @enum {string} */
19726
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
19727
+ };
19728
+ };
19729
+ };
19730
+ /**
19731
+ * @description `not_found` — The resource does not exist in this account.
19732
+ *
19733
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
19734
+ */
19735
+ 404: {
19736
+ headers: {
19737
+ [name: string]: unknown;
19738
+ };
19739
+ content: {
19740
+ "application/json": components["schemas"]["ErrorResponse"] & {
19741
+ /** @enum {string} */
19742
+ error_code?: "not_found" | "account_not_found";
19743
+ };
19744
+ };
19745
+ };
19746
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
19747
+ 429: {
19748
+ headers: {
19749
+ [name: string]: unknown;
19750
+ };
19751
+ content: {
19752
+ "application/json": components["schemas"]["ErrorResponse"] & {
19753
+ /** @enum {string} */
19754
+ error_code?: "too_many_requests";
19755
+ };
19756
+ };
19757
+ };
19758
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
19759
+ 500: {
19760
+ headers: {
19761
+ [name: string]: unknown;
19762
+ };
19763
+ content: {
19764
+ "application/json": components["schemas"]["ErrorResponse"] & {
19765
+ /** @enum {string} */
19766
+ error_code?: "internal_error";
19767
+ };
19768
+ };
19769
+ };
19770
+ };
19771
+ };
19772
+ "role/delete": {
19773
+ parameters: {
19774
+ query?: never;
19775
+ header?: never;
19776
+ path: {
19777
+ role_id: string;
19778
+ };
19779
+ cookie?: never;
19780
+ };
19781
+ requestBody?: never;
19782
+ responses: {
19783
+ /** @description Role */
19784
+ 200: {
19785
+ headers: {
19786
+ [name: string]: unknown;
19787
+ };
19788
+ content: {
19789
+ "application/json": {
19790
+ /** @description Role ID */
19791
+ id: string;
19792
+ /**
19793
+ * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
19794
+ * @example admin
19795
+ */
19796
+ name: string;
19797
+ /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
19798
+ description: string;
19799
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
19800
+ permissions: {
19801
+ /**
19802
+ * @description Id of the Api that defines the permission.
19803
+ * @example api_6555fd293acc2f0fac0e3452
19804
+ */
19805
+ api: string;
19806
+ /**
19807
+ * @description The permission, as it appears in the Api's `permissions` catalog.
19808
+ * @example invites:write
19809
+ */
19810
+ value: string;
19811
+ }[];
19812
+ /** @description Object is related with this account */
19813
+ account: string;
19814
+ /**
19815
+ * @description RoleMetadata
19816
+ * @default {}
19817
+ */
19818
+ metadata: {
19819
+ [key: string]: unknown;
19820
+ };
19821
+ /** @description Role creation date */
19822
+ createdAt: string;
19823
+ /** @description Role updated date */
19824
+ updatedAt?: string;
19825
+ };
19826
+ };
19827
+ };
19828
+ /**
19829
+ * @description `invalid_id` — The id in the path is not a valid id for this resource.
19830
+ *
19831
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19832
+ */
19833
+ 400: {
19834
+ headers: {
19835
+ [name: string]: unknown;
19836
+ };
19837
+ content: {
19838
+ "application/json": components["schemas"]["ErrorResponse"] & {
19839
+ /** @enum {string} */
19840
+ error_code?: "invalid_id" | "validation_error";
19841
+ };
19842
+ };
19843
+ };
19844
+ /** @description `unauthorized` — The request carries no valid credentials. */
19845
+ 401: {
19846
+ headers: {
19847
+ [name: string]: unknown;
19848
+ };
19849
+ content: {
19850
+ "application/json": components["schemas"]["ErrorResponse"] & {
19851
+ /** @enum {string} */
19852
+ error_code?: "unauthorized";
19853
+ };
19854
+ };
19855
+ };
19856
+ /**
19857
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
19858
+ *
19859
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
19860
+ *
19861
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
19862
+ */
19863
+ 403: {
19864
+ headers: {
19865
+ [name: string]: unknown;
19866
+ };
19867
+ content: {
19868
+ "application/json": components["schemas"]["ErrorResponse"] & {
19869
+ /** @enum {string} */
19870
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
19871
+ };
19872
+ };
19873
+ };
19874
+ /**
19875
+ * @description `not_found` — The resource does not exist in this account.
19876
+ *
19877
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
19878
+ */
19879
+ 404: {
19880
+ headers: {
19881
+ [name: string]: unknown;
19882
+ };
19883
+ content: {
19884
+ "application/json": components["schemas"]["ErrorResponse"] & {
19885
+ /** @enum {string} */
19886
+ error_code?: "not_found" | "account_not_found";
19887
+ };
19888
+ };
19889
+ };
19890
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
19891
+ 429: {
19892
+ headers: {
19893
+ [name: string]: unknown;
19894
+ };
19895
+ content: {
19896
+ "application/json": components["schemas"]["ErrorResponse"] & {
19897
+ /** @enum {string} */
19898
+ error_code?: "too_many_requests";
19899
+ };
19900
+ };
19901
+ };
19902
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
19903
+ 500: {
19904
+ headers: {
19905
+ [name: string]: unknown;
19906
+ };
19907
+ content: {
19908
+ "application/json": components["schemas"]["ErrorResponse"] & {
19909
+ /** @enum {string} */
19910
+ error_code?: "internal_error";
19911
+ };
19912
+ };
19913
+ };
19914
+ };
19915
+ };
19916
+ "role/users": {
19917
+ parameters: {
19918
+ query?: {
19919
+ /** @description Start from this cursor */
19920
+ cursor?: string;
19921
+ /** @description Start from this cursor */
19922
+ next?: string;
19923
+ /** @description Size of the results array */
19924
+ pageSize?: number;
19925
+ };
19926
+ header?: never;
19927
+ path: {
19928
+ role_id: string;
19929
+ };
19930
+ cookie?: never;
19931
+ };
19932
+ requestBody?: never;
19933
+ responses: {
19934
+ /** @description PaginatedResponse */
19935
+ 200: {
19936
+ headers: {
19937
+ [name: string]: unknown;
19938
+ };
19939
+ content: {
19940
+ "application/json": {
19941
+ /** @description next cursor */
19942
+ next: string | null;
19943
+ /** @description List of results */
19944
+ results: components["schemas"]["RoleMember"][];
19945
+ };
19946
+ };
19947
+ };
19948
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
19949
+ 400: {
19950
+ headers: {
19951
+ [name: string]: unknown;
19952
+ };
19953
+ content: {
19954
+ "application/json": components["schemas"]["ErrorResponse"] & {
19955
+ /** @enum {string} */
19956
+ error_code?: "validation_error";
19957
+ };
19958
+ };
19959
+ };
19960
+ /** @description `unauthorized` — The request carries no valid credentials. */
19961
+ 401: {
19962
+ headers: {
19963
+ [name: string]: unknown;
19964
+ };
19965
+ content: {
19966
+ "application/json": components["schemas"]["ErrorResponse"] & {
19967
+ /** @enum {string} */
19968
+ error_code?: "unauthorized";
19969
+ };
19970
+ };
19971
+ };
19972
+ /**
19973
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
19974
+ *
19975
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
19976
+ *
19977
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
19978
+ */
19979
+ 403: {
19980
+ headers: {
19981
+ [name: string]: unknown;
19982
+ };
19983
+ content: {
19984
+ "application/json": components["schemas"]["ErrorResponse"] & {
19985
+ /** @enum {string} */
19986
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
19987
+ };
19988
+ };
19989
+ };
19990
+ /**
19991
+ * @description `role_not_found` — No role with that id in this account.
19992
+ *
19993
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
19994
+ */
19995
+ 404: {
19996
+ headers: {
19997
+ [name: string]: unknown;
19998
+ };
19999
+ content: {
20000
+ "application/json": components["schemas"]["ErrorResponse"] & {
20001
+ /** @enum {string} */
20002
+ error_code?: "role_not_found" | "account_not_found";
20003
+ };
20004
+ };
20005
+ };
20006
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
20007
+ 429: {
20008
+ headers: {
20009
+ [name: string]: unknown;
20010
+ };
20011
+ content: {
20012
+ "application/json": components["schemas"]["ErrorResponse"] & {
20013
+ /** @enum {string} */
20014
+ error_code?: "too_many_requests";
20015
+ };
20016
+ };
20017
+ };
20018
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
20019
+ 500: {
20020
+ headers: {
20021
+ [name: string]: unknown;
20022
+ };
20023
+ content: {
20024
+ "application/json": components["schemas"]["ErrorResponse"] & {
20025
+ /** @enum {string} */
20026
+ error_code?: "internal_error";
20027
+ };
20028
+ };
20029
+ };
20030
+ };
20031
+ };
20032
+ "role/assign_users": {
20033
+ parameters: {
20034
+ query?: never;
20035
+ header?: never;
20036
+ path: {
20037
+ role_id: string;
20038
+ };
20039
+ cookie?: never;
20040
+ };
20041
+ /** @description Payload for granting a role to one or more users in a single call. Posted to `POST /role/:role_id/users`. */
20042
+ requestBody: {
20043
+ content: {
20044
+ "application/json": {
20045
+ /**
20046
+ * @description List of User ids to grant the role to. Existing role memberships are preserved; passing a user that already holds the role is a no-op.
20047
+ * @example [
20048
+ * "user_6555fd293acc2f0fac0e3452"
20049
+ * ]
20050
+ */
20051
+ users: string[];
20052
+ };
20053
+ };
20054
+ };
20055
+ responses: {
20056
+ /** @description Default Response */
20057
+ 200: {
20058
+ headers: {
20059
+ [name: string]: unknown;
20060
+ };
20061
+ content?: never;
20062
+ };
20063
+ /**
20064
+ * @description `invalid_role` — The role belongs to another account.
20065
+ *
20066
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
20067
+ */
20068
+ 400: {
20069
+ headers: {
20070
+ [name: string]: unknown;
20071
+ };
20072
+ content: {
20073
+ "application/json": components["schemas"]["ErrorResponse"] & {
20074
+ /** @enum {string} */
20075
+ error_code?: "invalid_role" | "validation_error";
20076
+ };
20077
+ };
20078
+ };
20079
+ /** @description `unauthorized` — The request carries no valid credentials. */
20080
+ 401: {
20081
+ headers: {
20082
+ [name: string]: unknown;
20083
+ };
20084
+ content: {
20085
+ "application/json": components["schemas"]["ErrorResponse"] & {
20086
+ /** @enum {string} */
20087
+ error_code?: "unauthorized";
20088
+ };
20089
+ };
20090
+ };
20091
+ /**
20092
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
20093
+ *
20094
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
20095
+ *
20096
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
20097
+ */
20098
+ 403: {
20099
+ headers: {
20100
+ [name: string]: unknown;
20101
+ };
20102
+ content: {
20103
+ "application/json": components["schemas"]["ErrorResponse"] & {
20104
+ /** @enum {string} */
20105
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
20106
+ };
20107
+ };
20108
+ };
20109
+ /**
20110
+ * @description `role_not_found` — No role with that id in this account.
20111
+ *
20112
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
20113
+ */
20114
+ 404: {
20115
+ headers: {
20116
+ [name: string]: unknown;
20117
+ };
20118
+ content: {
20119
+ "application/json": components["schemas"]["ErrorResponse"] & {
20120
+ /** @enum {string} */
20121
+ error_code?: "role_not_found" | "account_not_found";
20122
+ };
20123
+ };
20124
+ };
20125
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
20126
+ 429: {
20127
+ headers: {
20128
+ [name: string]: unknown;
20129
+ };
20130
+ content: {
20131
+ "application/json": components["schemas"]["ErrorResponse"] & {
20132
+ /** @enum {string} */
20133
+ error_code?: "too_many_requests";
20134
+ };
20135
+ };
20136
+ };
20137
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
20138
+ 500: {
20139
+ headers: {
20140
+ [name: string]: unknown;
20141
+ };
20142
+ content: {
20143
+ "application/json": components["schemas"]["ErrorResponse"] & {
20144
+ /** @enum {string} */
20145
+ error_code?: "internal_error";
20146
+ };
20147
+ };
20148
+ };
20149
+ };
20150
+ };
20151
+ "role/remove_users": {
20152
+ parameters: {
20153
+ query?: never;
20154
+ header?: never;
20155
+ path: {
20156
+ role_id: string;
20157
+ };
20158
+ cookie?: never;
20159
+ };
20160
+ /** @description Payload for revoking a role from one or more users. Sent to `DELETE /role/:role_id/users`. */
20161
+ requestBody: {
20162
+ content: {
20163
+ "application/json": {
20164
+ /**
20165
+ * @description User ids to revoke the role from. A user that does not hold it is reported in `not_in_role`, not an error.
20166
+ * @example [
20167
+ * "user_6555fd293acc2f0fac0e3452"
20168
+ * ]
20169
+ */
20170
+ users: string[];
20171
+ };
20172
+ };
20173
+ };
20174
+ responses: {
20175
+ /** @description Default Response */
20176
+ 200: {
20177
+ headers: {
20178
+ [name: string]: unknown;
20179
+ };
20180
+ content: {
20181
+ "application/json": {
20182
+ removed_from_role: string[];
20183
+ not_in_role: string[];
20184
+ };
20185
+ };
20186
+ };
20187
+ /**
20188
+ * @description `invalid_role` — The role belongs to another account.
20189
+ *
20190
+ * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
20191
+ */
20192
+ 400: {
20193
+ headers: {
20194
+ [name: string]: unknown;
20195
+ };
20196
+ content: {
20197
+ "application/json": components["schemas"]["ErrorResponse"] & {
20198
+ /** @enum {string} */
20199
+ error_code?: "invalid_role" | "validation_error";
20200
+ };
20201
+ };
20202
+ };
20203
+ /** @description `unauthorized` — The request carries no valid credentials. */
20204
+ 401: {
20205
+ headers: {
20206
+ [name: string]: unknown;
20207
+ };
20208
+ content: {
20209
+ "application/json": components["schemas"]["ErrorResponse"] & {
20210
+ /** @enum {string} */
20211
+ error_code?: "unauthorized";
20212
+ };
20213
+ };
20214
+ };
20215
+ /**
20216
+ * @description `forbidden` — The credentials are valid but do not allow this operation.
20217
+ *
20218
+ * `insufficient_scope` — The token lacks a scope this operation requires. `message` names it.
20219
+ *
20220
+ * `user_suspended` — The user is suspended and cannot sign in or be modified.
20221
+ */
20222
+ 403: {
20223
+ headers: {
20224
+ [name: string]: unknown;
20225
+ };
20226
+ content: {
20227
+ "application/json": components["schemas"]["ErrorResponse"] & {
20228
+ /** @enum {string} */
20229
+ error_code?: "forbidden" | "insufficient_scope" | "user_suspended";
20230
+ };
20231
+ };
20232
+ };
20233
+ /**
20234
+ * @description `not_found` — The resource does not exist in this account.
20235
+ *
20236
+ * `account_not_found` — No Auth Account matches the request (domain, header or token).
20237
+ */
20238
+ 404: {
20239
+ headers: {
20240
+ [name: string]: unknown;
20241
+ };
20242
+ content: {
20243
+ "application/json": components["schemas"]["ErrorResponse"] & {
20244
+ /** @enum {string} */
20245
+ error_code?: "not_found" | "account_not_found";
20246
+ };
20247
+ };
20248
+ };
20249
+ /** @description `too_many_requests` — Rate limit exceeded. Honour the `Retry-After` header. */
20250
+ 429: {
20251
+ headers: {
20252
+ [name: string]: unknown;
20253
+ };
20254
+ content: {
20255
+ "application/json": components["schemas"]["ErrorResponse"] & {
20256
+ /** @enum {string} */
20257
+ error_code?: "too_many_requests";
20258
+ };
20259
+ };
20260
+ };
20261
+ /** @description `internal_error` — Unexpected server error. Retry later; the request id is logged. */
20262
+ 500: {
20263
+ headers: {
20264
+ [name: string]: unknown;
20265
+ };
20266
+ content: {
20267
+ "application/json": components["schemas"]["ErrorResponse"] & {
20268
+ /** @enum {string} */
20269
+ error_code?: "internal_error";
20270
+ };
20271
+ };
20272
+ };
20273
+ };
20274
+ };
20275
+ "user/roles": {
20276
+ parameters: {
20277
+ query?: never;
20278
+ header?: never;
20279
+ path: {
20280
+ user_id: string;
20281
+ };
20282
+ cookie?: never;
20283
+ };
20284
+ requestBody?: never;
20285
+ responses: {
20286
+ /** @description Default Response */
20287
+ 200: {
20288
+ headers: {
20289
+ [name: string]: unknown;
20290
+ };
20291
+ content: {
20292
+ "application/json": {
20293
+ /** @description Role ID */
20294
+ id: string;
20295
+ /**
19096
20296
  * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
19097
20297
  * @example admin
19098
20298
  */
19099
20299
  name: string;
19100
20300
  /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
19101
20301
  description: string;
20302
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
20303
+ permissions: {
20304
+ /**
20305
+ * @description Id of the Api that defines the permission.
20306
+ * @example api_6555fd293acc2f0fac0e3452
20307
+ */
20308
+ api: string;
20309
+ /**
20310
+ * @description The permission, as it appears in the Api's `permissions` catalog.
20311
+ * @example invites:write
20312
+ */
20313
+ value: string;
20314
+ }[];
19102
20315
  /** @description Object is related with this account */
19103
20316
  account: string;
19104
20317
  /**
@@ -19112,16 +20325,10 @@ export interface operations {
19112
20325
  createdAt: string;
19113
20326
  /** @description Role updated date */
19114
20327
  updatedAt?: string;
19115
- };
20328
+ }[];
19116
20329
  };
19117
20330
  };
19118
- /**
19119
- * @description `invalid_id` — The id in the path is not a valid id for this resource.
19120
- *
19121
- * `already_exists` — A resource with the same unique field already exists (for a user, usually `email`). `details.fields` names the field.
19122
- *
19123
- * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19124
- */
20331
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
19125
20332
  400: {
19126
20333
  headers: {
19127
20334
  [name: string]: unknown;
@@ -19129,7 +20336,7 @@ export interface operations {
19129
20336
  content: {
19130
20337
  "application/json": components["schemas"]["ErrorResponse"] & {
19131
20338
  /** @enum {string} */
19132
- error_code?: "invalid_id" | "already_exists" | "validation_error";
20339
+ error_code?: "validation_error";
19133
20340
  };
19134
20341
  };
19135
20342
  };
@@ -19205,18 +20412,33 @@ export interface operations {
19205
20412
  };
19206
20413
  };
19207
20414
  };
19208
- "role/delete": {
20415
+ "user/assign_roles": {
19209
20416
  parameters: {
19210
20417
  query?: never;
19211
20418
  header?: never;
19212
20419
  path: {
19213
- role_id: string;
20420
+ user_id: string;
19214
20421
  };
19215
20422
  cookie?: never;
19216
20423
  };
19217
- requestBody?: never;
20424
+ /** @description Account-level roles to assign to or remove from a user. */
20425
+ requestBody: {
20426
+ content: {
20427
+ "application/json": {
20428
+ /**
20429
+ * @description Role ids of this tenant.
20430
+ * @example [
20431
+ * "role_6555fd293acc2f0fac0e3452"
20432
+ * ]
20433
+ */
20434
+ roles: string[];
20435
+ /** @description The person making the change, when your backend calls on their behalf with a machine token: it is who the tenant's log names. Must be a user of this tenant. */
20436
+ actor_user_id?: string;
20437
+ };
20438
+ };
20439
+ };
19218
20440
  responses: {
19219
- /** @description Role */
20441
+ /** @description Default Response */
19220
20442
  200: {
19221
20443
  headers: {
19222
20444
  [name: string]: unknown;
@@ -19232,6 +20454,19 @@ export interface operations {
19232
20454
  name: string;
19233
20455
  /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
19234
20456
  description: string;
20457
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
20458
+ permissions: {
20459
+ /**
20460
+ * @description Id of the Api that defines the permission.
20461
+ * @example api_6555fd293acc2f0fac0e3452
20462
+ */
20463
+ api: string;
20464
+ /**
20465
+ * @description The permission, as it appears in the Api's `permissions` catalog.
20466
+ * @example invites:write
20467
+ */
20468
+ value: string;
20469
+ }[];
19235
20470
  /** @description Object is related with this account */
19236
20471
  account: string;
19237
20472
  /**
@@ -19245,11 +20480,11 @@ export interface operations {
19245
20480
  createdAt: string;
19246
20481
  /** @description Role updated date */
19247
20482
  updatedAt?: string;
19248
- };
20483
+ }[];
19249
20484
  };
19250
20485
  };
19251
20486
  /**
19252
- * @description `invalid_id` — The id in the path is not a valid id for this resource.
20487
+ * @description `invalid_role` — The role belongs to another account.
19253
20488
  *
19254
20489
  * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19255
20490
  */
@@ -19260,7 +20495,7 @@ export interface operations {
19260
20495
  content: {
19261
20496
  "application/json": components["schemas"]["ErrorResponse"] & {
19262
20497
  /** @enum {string} */
19263
- error_code?: "invalid_id" | "validation_error";
20498
+ error_code?: "invalid_role" | "validation_error";
19264
20499
  };
19265
20500
  };
19266
20501
  };
@@ -19336,36 +20571,75 @@ export interface operations {
19336
20571
  };
19337
20572
  };
19338
20573
  };
19339
- "role/users": {
20574
+ "user/remove_roles": {
19340
20575
  parameters: {
19341
- query?: {
19342
- /** @description Start from this cursor */
19343
- cursor?: string;
19344
- /** @description Start from this cursor */
19345
- next?: string;
19346
- /** @description Size of the results array */
19347
- pageSize?: number;
19348
- };
20576
+ query?: never;
19349
20577
  header?: never;
19350
20578
  path: {
19351
- role_id: string;
20579
+ user_id: string;
19352
20580
  };
19353
20581
  cookie?: never;
19354
20582
  };
19355
- requestBody?: never;
20583
+ /** @description Account-level roles to assign to or remove from a user. */
20584
+ requestBody: {
20585
+ content: {
20586
+ "application/json": {
20587
+ /**
20588
+ * @description Role ids of this tenant.
20589
+ * @example [
20590
+ * "role_6555fd293acc2f0fac0e3452"
20591
+ * ]
20592
+ */
20593
+ roles: string[];
20594
+ /** @description The person making the change, when your backend calls on their behalf with a machine token: it is who the tenant's log names. Must be a user of this tenant. */
20595
+ actor_user_id?: string;
20596
+ };
20597
+ };
20598
+ };
19356
20599
  responses: {
19357
- /** @description PaginatedResponse */
20600
+ /** @description Default Response */
19358
20601
  200: {
19359
20602
  headers: {
19360
20603
  [name: string]: unknown;
19361
20604
  };
19362
20605
  content: {
19363
20606
  "application/json": {
19364
- /** @description next cursor */
19365
- next: string | null;
19366
- /** @description List of results */
19367
- results: components["schemas"]["RoleMember"][];
19368
- };
20607
+ /** @description Role ID */
20608
+ id: string;
20609
+ /**
20610
+ * @description Short, human-readable identifier for the role (e.g. `admin`, `editor`, `billing-manager`). Surfaced in the dashboard role pickers.
20611
+ * @example admin
20612
+ */
20613
+ name: string;
20614
+ /** @description Free-form explanation of what users in this role are expected to do or have access to. Shown alongside the role in the dashboard. */
20615
+ description: string;
20616
+ /** @description Api permissions granted to the users that hold this role at the account level (team roles grant none). Change them with `POST` / `DELETE /role/:role_id/permissions`; `GET /role/:role_id/permissions` lists them with their Api. */
20617
+ permissions: {
20618
+ /**
20619
+ * @description Id of the Api that defines the permission.
20620
+ * @example api_6555fd293acc2f0fac0e3452
20621
+ */
20622
+ api: string;
20623
+ /**
20624
+ * @description The permission, as it appears in the Api's `permissions` catalog.
20625
+ * @example invites:write
20626
+ */
20627
+ value: string;
20628
+ }[];
20629
+ /** @description Object is related with this account */
20630
+ account: string;
20631
+ /**
20632
+ * @description RoleMetadata
20633
+ * @default {}
20634
+ */
20635
+ metadata: {
20636
+ [key: string]: unknown;
20637
+ };
20638
+ /** @description Role creation date */
20639
+ createdAt: string;
20640
+ /** @description Role updated date */
20641
+ updatedAt?: string;
20642
+ }[];
19369
20643
  };
19370
20644
  };
19371
20645
  /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
@@ -19411,7 +20685,7 @@ export interface operations {
19411
20685
  };
19412
20686
  };
19413
20687
  /**
19414
- * @description `role_not_found` — No role with that id in this account.
20688
+ * @description `not_found` — The resource does not exist in this account.
19415
20689
  *
19416
20690
  * `account_not_found` — No Auth Account matches the request (domain, header or token).
19417
20691
  */
@@ -19422,7 +20696,7 @@ export interface operations {
19422
20696
  content: {
19423
20697
  "application/json": components["schemas"]["ErrorResponse"] & {
19424
20698
  /** @enum {string} */
19425
- error_code?: "role_not_found" | "account_not_found";
20699
+ error_code?: "not_found" | "account_not_found";
19426
20700
  };
19427
20701
  };
19428
20702
  };
@@ -19452,42 +20726,49 @@ export interface operations {
19452
20726
  };
19453
20727
  };
19454
20728
  };
19455
- "role/assign_users": {
20729
+ "user/permissions": {
19456
20730
  parameters: {
19457
20731
  query?: never;
19458
20732
  header?: never;
19459
20733
  path: {
19460
- role_id: string;
20734
+ user_id: string;
19461
20735
  };
19462
20736
  cookie?: never;
19463
20737
  };
19464
- /** @description Payload for granting a role to one or more users in a single call. Posted to `POST /role/:role_id/users`. */
19465
- requestBody: {
19466
- content: {
19467
- "application/json": {
19468
- /**
19469
- * @description List of User ids to grant the role to. Existing role memberships are preserved; passing a user that already holds the role is a no-op.
19470
- * @example [
19471
- * "user_6555fd293acc2f0fac0e3452"
19472
- * ]
19473
- */
19474
- users: string[];
19475
- };
19476
- };
19477
- };
20738
+ requestBody?: never;
19478
20739
  responses: {
19479
20740
  /** @description Default Response */
19480
20741
  200: {
19481
20742
  headers: {
19482
20743
  [name: string]: unknown;
19483
20744
  };
19484
- content?: never;
20745
+ content: {
20746
+ "application/json": {
20747
+ /** @description Id of the Api that defines it. */
20748
+ api: string;
20749
+ /**
20750
+ * @description Audience of that Api: the `aud` of the tokens that carry this permission.
20751
+ * @example https://api.example.com
20752
+ */
20753
+ api_identifier: string;
20754
+ /** @description Name of that Api. */
20755
+ api_name: string;
20756
+ /**
20757
+ * @description The permission, as it appears in the `permissions` claim.
20758
+ * @example invites:write
20759
+ */
20760
+ value: string;
20761
+ /** @description The permission's description in the Api. */
20762
+ description?: string;
20763
+ /** @description The roles of the user that grant it. */
20764
+ roles: {
20765
+ id: string;
20766
+ name: string;
20767
+ }[];
20768
+ }[];
20769
+ };
19485
20770
  };
19486
- /**
19487
- * @description `invalid_role` — The role belongs to another account.
19488
- *
19489
- * `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field.
19490
- */
20771
+ /** @description `validation_error` — The body, query or path failed schema validation. `details.issues` lists each failing field. */
19491
20772
  400: {
19492
20773
  headers: {
19493
20774
  [name: string]: unknown;
@@ -19495,7 +20776,7 @@ export interface operations {
19495
20776
  content: {
19496
20777
  "application/json": components["schemas"]["ErrorResponse"] & {
19497
20778
  /** @enum {string} */
19498
- error_code?: "invalid_role" | "validation_error";
20779
+ error_code?: "validation_error";
19499
20780
  };
19500
20781
  };
19501
20782
  };
@@ -19530,7 +20811,7 @@ export interface operations {
19530
20811
  };
19531
20812
  };
19532
20813
  /**
19533
- * @description `role_not_found` — No role with that id in this account.
20814
+ * @description `not_found` — The resource does not exist in this account.
19534
20815
  *
19535
20816
  * `account_not_found` — No Auth Account matches the request (domain, header or token).
19536
20817
  */
@@ -19541,7 +20822,7 @@ export interface operations {
19541
20822
  content: {
19542
20823
  "application/json": components["schemas"]["ErrorResponse"] & {
19543
20824
  /** @enum {string} */
19544
- error_code?: "role_not_found" | "account_not_found";
20825
+ error_code?: "not_found" | "account_not_found";
19545
20826
  };
19546
20827
  };
19547
20828
  };
@@ -25075,6 +26356,8 @@ export interface operations {
25075
26356
  token_dialect?: string;
25076
26357
  /** @description Exact match on `enforce_policies`. Equivalent to `?query=enforce_policies:<value>`. */
25077
26358
  enforce_policies?: string;
26359
+ /** @description Exact match on `rbac`. Equivalent to `?query=rbac:<value>`. */
26360
+ rbac?: string;
25078
26361
  /** @description Exact match on `allow_offline_access`. Equivalent to `?query=allow_offline_access:<value>`. */
25079
26362
  allow_offline_access?: string;
25080
26363
  /** @description Also return `total`: the rows matching the whole filter, across every page. */
@@ -25228,6 +26511,8 @@ export interface operations {
25228
26511
  token_lifetime?: number;
25229
26512
  /** @description When true, requested scopes are filtered against `permissions` at token issuance. */
25230
26513
  enforce_policies?: boolean;
26514
+ /** @description When true, user tokens carry only the permissions granted to the user's roles. Defaults to false. */
26515
+ rbac?: boolean;
25231
26516
  /** @description When true, clients can request `offline_access` and receive a refresh_token for this API. */
25232
26517
  allow_offline_access?: boolean;
25233
26518
  consent_options?: {
@@ -25295,6 +26580,8 @@ export interface operations {
25295
26580
  token_lifetime: number;
25296
26581
  /** @description When true, only scopes that match a permission in `permissions` are forwarded into the access_token. When false, requested scopes are echoed back verbatim with no filtering. */
25297
26582
  enforce_policies: boolean;
26583
+ /** @description Role-based access control. When true, a token issued to a user carries only the permissions of this API granted to the user's roles (account-level role assignments, not team roles): `permissions` lists all of them, and `scope` keeps only the requested ones the user holds. Machine-to-machine tokens (`client_credentials`) are not affected. The `permissions` claim requires `token_dialect: access_token_authz`. */
26584
+ rbac: boolean;
25298
26585
  /** @description When true, the API is eligible to be the target of a `refresh_token` (i.e. clients can request `offline_access` against it). */
25299
26586
  allow_offline_access: boolean;
25300
26587
  consent_options?: {
@@ -25469,6 +26756,8 @@ export interface operations {
25469
26756
  token_lifetime: number;
25470
26757
  /** @description When true, only scopes that match a permission in `permissions` are forwarded into the access_token. When false, requested scopes are echoed back verbatim with no filtering. */
25471
26758
  enforce_policies: boolean;
26759
+ /** @description Role-based access control. When true, a token issued to a user carries only the permissions of this API granted to the user's roles (account-level role assignments, not team roles): `permissions` lists all of them, and `scope` keeps only the requested ones the user holds. Machine-to-machine tokens (`client_credentials`) are not affected. The `permissions` claim requires `token_dialect: access_token_authz`. */
26760
+ rbac: boolean;
25472
26761
  /** @description When true, the API is eligible to be the target of a `refresh_token` (i.e. clients can request `offline_access` against it). */
25473
26762
  allow_offline_access: boolean;
25474
26763
  consent_options?: {
@@ -25632,6 +26921,8 @@ export interface operations {
25632
26921
  token_lifetime?: number;
25633
26922
  /** @description When true, requested scopes are filtered against `permissions` at token issuance. */
25634
26923
  enforce_policies?: boolean;
26924
+ /** @description When true, user tokens carry only the permissions granted to the user's roles. Applies to tokens issued after the update, including refreshes. */
26925
+ rbac?: boolean;
25635
26926
  /** @description When true, clients can request `offline_access` and receive a refresh_token for this API. */
25636
26927
  allow_offline_access?: boolean;
25637
26928
  consent_options?: {
@@ -25699,6 +26990,8 @@ export interface operations {
25699
26990
  token_lifetime: number;
25700
26991
  /** @description When true, only scopes that match a permission in `permissions` are forwarded into the access_token. When false, requested scopes are echoed back verbatim with no filtering. */
25701
26992
  enforce_policies: boolean;
26993
+ /** @description Role-based access control. When true, a token issued to a user carries only the permissions of this API granted to the user's roles (account-level role assignments, not team roles): `permissions` lists all of them, and `scope` keeps only the requested ones the user holds. Machine-to-machine tokens (`client_credentials`) are not affected. The `permissions` claim requires `token_dialect: access_token_authz`. */
26994
+ rbac: boolean;
25702
26995
  /** @description When true, the API is eligible to be the target of a `refresh_token` (i.e. clients can request `offline_access` against it). */
25703
26996
  allow_offline_access: boolean;
25704
26997
  consent_options?: {
@@ -25879,6 +27172,8 @@ export interface operations {
25879
27172
  token_lifetime: number;
25880
27173
  /** @description When true, only scopes that match a permission in `permissions` are forwarded into the access_token. When false, requested scopes are echoed back verbatim with no filtering. */
25881
27174
  enforce_policies: boolean;
27175
+ /** @description Role-based access control. When true, a token issued to a user carries only the permissions of this API granted to the user's roles (account-level role assignments, not team roles): `permissions` lists all of them, and `scope` keeps only the requested ones the user holds. Machine-to-machine tokens (`client_credentials`) are not affected. The `permissions` claim requires `token_dialect: access_token_authz`. */
27176
+ rbac: boolean;
25882
27177
  /** @description When true, the API is eligible to be the target of a `refresh_token` (i.e. clients can request `offline_access` against it). */
25883
27178
  allow_offline_access: boolean;
25884
27179
  consent_options?: {