@productcraft/auth 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { LastResponse, WebhookPayload, WebhookHeaders, APIClient, RequestOptions, APIPromise, PagePromise, ClientOptions, PollOptions, APIError } from '@productcraft/core';
1
+ import { LastResponse, WebhookPayload, WebhookHeaders, APIClient, RequestOptions, APIPromise, PagePromise, SignedWebhook, ClientOptions, PollOptions, APIError } from '@productcraft/core';
2
2
  export { APIConnectionError, APIError, APITimeoutError, APIUserAbortError, AuthenticationError, BadRequestError, ConfigurationError, ConflictError, IdempotencyKeyReuseError, InternalServerError, NotFoundError, PCAuth, PCClientConfig, PermissionDeniedError, ProductCraftError, RateLimitError, UnprocessableEntityError, WebhookVerificationError } from '@productcraft/core';
3
3
  import { Client } from 'openapi-fetch';
4
4
 
@@ -23,6 +23,8 @@ type paths = {
23
23
  /**
24
24
  * Create a new app owned by the caller
25
25
  * @description The new app starts with emails to its users turned on: they go out from the workspace default sender chosen in Mail, and the default verification, welcome, password-reset, invite and sign-in code templates are created in the workspace's Mail templates (an existing template with the same name is reused). Change or turn this off with `PATCH /v1/apps/{appId}/notification-settings`.
26
+ *
27
+ * **Sign-up starts off.** A new app has `signup_enabled: false`, so `POST /{app_slug}/v1/auth/signup` answers 403 `FORBIDDEN` ("Signup is disabled for this app") until you turn it on with `PATCH /v1/apps/{app_id}/auth-config` and `{ "signup_enabled": true }`. Sign-in, invites and admin-created users work either way.
26
28
  */
27
29
  post: operations["AppController_createApp"];
28
30
  delete?: never;
@@ -3392,7 +3394,10 @@ type components = {
3392
3394
  * @enum {string}
3393
3395
  */
3394
3396
  type: "email" | "phone";
3395
- /** @description Email or phone value (E.164 recommended for phone) */
3397
+ /**
3398
+ * @description Email or phone value (E.164 recommended for phone)
3399
+ * @example ada@example.com
3400
+ */
3396
3401
  value: string;
3397
3402
  };
3398
3403
  AddMemberDto: {
@@ -3423,7 +3428,10 @@ type components = {
3423
3428
  AdminCreateUserDto: {
3424
3429
  /** @description Human-readable display name. */
3425
3430
  display_name?: string;
3426
- /** @description Primary email — becomes the account's primary email contact (unverified). */
3431
+ /**
3432
+ * @description Primary email — becomes the account's primary email contact (unverified).
3433
+ * @example ada@example.com
3434
+ */
3427
3435
  email: string;
3428
3436
  /** @description Optional initial password. When omitted, the account has no credential — the customer triggers the password-reset flow to onboard the user. When supplied it must satisfy the SAME rules as `/auth/signup`: the app-configured length and character classes, the common-password deny-list (400 `PASSWORD_TOO_COMMON`) and, unless the app sets `password_breach_check` to `off` or `warn`, the breach corpus (400 `PASSWORD_BREACHED`). */
3429
3437
  password?: string;
@@ -3443,7 +3451,10 @@ type components = {
3443
3451
  recovery_codes: string[];
3444
3452
  };
3445
3453
  AdminUpdateRoleDto: {
3446
- /** @description Target role name (must already exist in this app). */
3454
+ /**
3455
+ * @description Target role name (must already exist in this app).
3456
+ * @example member
3457
+ */
3447
3458
  role_name: string;
3448
3459
  };
3449
3460
  AdminUpdateStatusDto: {
@@ -3454,7 +3465,10 @@ type components = {
3454
3465
  status: "active" | "suspended" | "deactivated";
3455
3466
  };
3456
3467
  AdminUpdateUserDto: {
3457
- /** @description New display name. Empty string clears. */
3468
+ /**
3469
+ * @description New display name. Empty string clears.
3470
+ * @example Ada Lovelace
3471
+ */
3458
3472
  display_name?: string;
3459
3473
  /** @description New primary email address. Replaces the current primary email contact (still unverified after the change). */
3460
3474
  email?: string;
@@ -3992,7 +4006,10 @@ type components = {
3992
4006
  /** @enum {string} */
3993
4007
  ApplyPlanResult: "created" | "unchanged" | "failed";
3994
4008
  AssignRoleDto: {
3995
- /** @description Account ID of the user */
4009
+ /**
4010
+ * @description Account ID of the user
4011
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
4012
+ */
3996
4013
  account_id: string;
3997
4014
  /**
3998
4015
  * @description Role name to assign
@@ -4386,7 +4403,10 @@ type components = {
4386
4403
  missing_permissions: string[];
4387
4404
  };
4388
4405
  AuthorizeBody: {
4389
- /** @description Single permission to check, e.g. 'user.read'. Use this OR `permissions`. */
4406
+ /**
4407
+ * @description Single permission to check, e.g. 'user.read'. Use this OR `permissions`.
4408
+ * @example invoice.read
4409
+ */
4390
4410
  permission?: string;
4391
4411
  /** @description Multiple permissions; the token must hold ALL of them. */
4392
4412
  permissions?: string[];
@@ -4477,7 +4497,10 @@ type components = {
4477
4497
  status?: "active" | "suspended" | "deactivated";
4478
4498
  };
4479
4499
  BulkUpdateRoleDto: {
4480
- /** @description Role name to assign to all selected users */
4500
+ /**
4501
+ * @description Role name to assign to all selected users
4502
+ * @example member
4503
+ */
4481
4504
  role_name: string;
4482
4505
  selection: components["schemas"]["BulkSelectionDto"];
4483
4506
  };
@@ -4492,9 +4515,15 @@ type components = {
4492
4515
  };
4493
4516
  CallbackBodyDto: Record<string, unknown>;
4494
4517
  ChangePasswordDto: {
4495
- /** @description The current password — required even when changing. */
4518
+ /**
4519
+ * @description The current password — required even when changing.
4520
+ * @example correct horse battery staple
4521
+ */
4496
4522
  current_password: string;
4497
- /** @description The new password. Must be at least 8 chars; the app may enforce a stricter policy. */
4523
+ /**
4524
+ * @description The new password. Must be at least 8 chars; the app may enforce a stricter policy.
4525
+ * @example a new long passphrase 42
4526
+ */
4498
4527
  new_password: string;
4499
4528
  };
4500
4529
  ClientCredentialsDto: {
@@ -4503,7 +4532,10 @@ type components = {
4503
4532
  * @example m2m_a1b2c3d4e5f6...
4504
4533
  */
4505
4534
  client_id: string;
4506
- /** @description M2M client secret (issued at client creation, never returned again). */
4535
+ /**
4536
+ * @description M2M client secret (issued at client creation, never returned again).
4537
+ * @example the-secret-returned-by-credentials-create
4538
+ */
4507
4539
  client_secret: string;
4508
4540
  /**
4509
4541
  * @description OAuth grant type. Only 'client_credentials' is supported.
@@ -4778,7 +4810,10 @@ type components = {
4778
4810
  expires_at: string;
4779
4811
  };
4780
4812
  ConsumerLogoutDto: {
4781
- /** @description Refresh token to revoke. The matching session is destroyed; the access token continues to verify until its TTL expires. */
4813
+ /**
4814
+ * @description Refresh token to revoke. The matching session is destroyed; the access token continues to verify until its TTL expires.
4815
+ * @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl
4816
+ */
4782
4817
  refresh_token: string;
4783
4818
  };
4784
4819
  ConsumerMfaChallengeFactorDto: {
@@ -4823,7 +4858,10 @@ type components = {
4823
4858
  contact_id?: string;
4824
4859
  /** @description Optional human-readable label for the factor (e.g. "iPhone 15"). */
4825
4860
  label?: string;
4826
- /** @description The `mfa_token` from an `mfa_enrollment_required: true` signin response. UUID. */
4861
+ /**
4862
+ * @description The `mfa_token` from an `mfa_enrollment_required: true` signin response. UUID.
4863
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
4864
+ */
4827
4865
  mfa_token: string;
4828
4866
  /**
4829
4867
  * @description Factor type to enrol — `totp` (authenticator app) or `email` (single-use code to a verified email contact).
@@ -4851,7 +4889,10 @@ type components = {
4851
4889
  * @description Id of the pending factor returned by `/auth/mfa/enroll`.
4852
4890
  */
4853
4891
  factor_id: string;
4854
- /** @description The same `mfa_token` used to start the enrolment. UUID. */
4892
+ /**
4893
+ * @description The same `mfa_token` used to start the enrolment. UUID.
4894
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
4895
+ */
4855
4896
  mfa_token: string;
4856
4897
  };
4857
4898
  ConsumerMfaEnrollVerifyResponseDto: {
@@ -4924,7 +4965,10 @@ type components = {
4924
4965
  result: "mfa_enrollment_required";
4925
4966
  };
4926
4967
  ConsumerMfaRecoverDto: {
4927
- /** @description The `mfa_token` returned by `/auth/signin`. UUID. */
4968
+ /**
4969
+ * @description The `mfa_token` returned by `/auth/signin`. UUID.
4970
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
4971
+ */
4928
4972
  mfa_token: string;
4929
4973
  /**
4930
4974
  * @description A single-use recovery code (16 hex chars, hyphens optional). Consumes the code on success — the user should regenerate the set afterwards via `/me/mfa/recovery-codes/regenerate`.
@@ -4938,7 +4982,10 @@ type components = {
4938
4982
  * @description Id of the email factor (from the challenge `factors` list) to deliver the code through.
4939
4983
  */
4940
4984
  factor_id: string;
4941
- /** @description The `mfa_token` returned by `/auth/signin`. UUID. */
4985
+ /**
4986
+ * @description The `mfa_token` returned by `/auth/signin`. UUID.
4987
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
4988
+ */
4942
4989
  mfa_token: string;
4943
4990
  };
4944
4991
  ConsumerMfaSendCodeResponseDto: {
@@ -4963,11 +5010,17 @@ type components = {
4963
5010
  credential?: {
4964
5011
  [key: string]: unknown;
4965
5012
  };
4966
- /** @description The `mfa_token` returned by `/auth/signin`. UUID. */
5013
+ /**
5014
+ * @description The `mfa_token` returned by `/auth/signin`. UUID.
5015
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
5016
+ */
4967
5017
  mfa_token: string;
4968
5018
  };
4969
5019
  ConsumerMfaWebauthnOptionsDto: {
4970
- /** @description The `mfa_token` returned by `/auth/signin`. UUID. */
5020
+ /**
5021
+ * @description The `mfa_token` returned by `/auth/signin`. UUID.
5022
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
5023
+ */
4971
5024
  mfa_token: string;
4972
5025
  };
4973
5026
  ConsumerPasskeyOptionsDto: {
@@ -4984,7 +5037,10 @@ type components = {
4984
5037
  };
4985
5038
  };
4986
5039
  ConsumerRefreshDto: {
4987
- /** @description Refresh token returned from signin/signup/previous refresh. Each refresh rotates the token; the previous one is revoked. */
5040
+ /**
5041
+ * @description Refresh token returned from signin/signup/previous refresh. Each refresh rotates the token; the previous one is revoked.
5042
+ * @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl
5043
+ */
4988
5044
  refresh_token: string;
4989
5045
  };
4990
5046
  ConsumerRequestPasswordResetDto: {
@@ -5017,7 +5073,10 @@ type components = {
5017
5073
  * @example 123456
5018
5074
  */
5019
5075
  code: string;
5020
- /** @description New password. Must satisfy the app-configured policy. */
5076
+ /**
5077
+ * @description New password. Must satisfy the app-configured policy.
5078
+ * @example a new long passphrase 42
5079
+ */
5021
5080
  new_password: string;
5022
5081
  };
5023
5082
  ConsumerRoleListResponseDto: {
@@ -5107,7 +5166,10 @@ type components = {
5107
5166
  * @example jane_doe
5108
5167
  */
5109
5168
  identifier: string;
5110
- /** @description EndUser password. */
5169
+ /**
5170
+ * @description EndUser password.
5171
+ * @example correct horse battery staple
5172
+ */
5111
5173
  password: string;
5112
5174
  /** @description Optional tenant UUID. When set, the issued JWT carries `tid` + `trole` claims and the user must already be a member of that tenant — non-membership returns 403. */
5113
5175
  tenant_id?: string;
@@ -5140,7 +5202,10 @@ type components = {
5140
5202
  username: string;
5141
5203
  };
5142
5204
  ConsumerSwitchTenantDto: {
5143
- /** @description Tenant UUID to switch the EndUser's session into. Caller must already hold a tenant_membership row for this tenant in the app, else 403. */
5205
+ /**
5206
+ * @description Tenant UUID to switch the EndUser's session into. Caller must already hold a tenant_membership row for this tenant in the app, else 403.
5207
+ * @example 3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
5208
+ */
5144
5209
  tenant_id: string;
5145
5210
  };
5146
5211
  ConsumerTenantListResponseDto: {
@@ -6237,7 +6302,10 @@ type components = {
6237
6302
  status_code: number;
6238
6303
  };
6239
6304
  ExchangeRequestDto: {
6240
- /** @description The opaque `heimdall_code` the customer received on the OAuth callback `return_to`. Single-use; expires after 60 seconds. */
6305
+ /**
6306
+ * @description The opaque `heimdall_code` the customer received on the OAuth callback `return_to`. Single-use; expires after 60 seconds.
6307
+ * @example hc_8f14e45fceea167a5a36dedd4bea2543
6308
+ */
6241
6309
  code: string;
6242
6310
  };
6243
6311
  ExchangeResponseDto: {
@@ -6294,9 +6362,15 @@ type components = {
6294
6362
  result: "mfa_enrollment_required";
6295
6363
  };
6296
6364
  IdpNativeSigninDto: {
6297
- /** @description Provider-issued ID token (JWT). For Apple, the value returned by `ASAuthorizationAppleIDCredential.identityToken` after UTF-8 decoding the data. */
6365
+ /**
6366
+ * @description Provider-issued ID token (JWT). For Apple, the value returned by `ASAuthorizationAppleIDCredential.identityToken` after UTF-8 decoding the data.
6367
+ * @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl
6368
+ */
6298
6369
  id_token: string;
6299
- /** @description Raw nonce the client generated and SHA-256-hashed into the authorize request. Backend recomputes the hash and compares to the token's `nonce` claim. Must be at least 32 bytes of entropy (base64url-encoded ~43 chars). */
6370
+ /**
6371
+ * @description Raw nonce the client generated and SHA-256-hashed into the authorize request. Backend recomputes the hash and compares to the token's `nonce` claim. Must be at least 32 bytes of entropy (base64url-encoded ~43 chars).
6372
+ * @example n-0S6_WzA2Mj
6373
+ */
6300
6374
  nonce: string;
6301
6375
  /** @description Apple-specific first-signin payload: { name, email }. Persist for display only — the verified JWT is the source of truth. */
6302
6376
  user?: components["schemas"]["IdpNativeUserHintDto"];
@@ -6470,7 +6544,10 @@ type components = {
6470
6544
  requested: number;
6471
6545
  };
6472
6546
  IntrospectDto: {
6473
- /** @description The access token to introspect. Optional — when omitted the endpoint introspects the `Authorization: Bearer` token. When present, it must match the bearer (we refuse cross-token introspection so a stolen token cannot be probed against a different active credential). */
6547
+ /**
6548
+ * @description The access token to introspect. Optional — when omitted the endpoint introspects the `Authorization: Bearer` token. When present, it must match the bearer (we refuse cross-token introspection so a stolen token cannot be probed against a different active credential).
6549
+ * @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl
6550
+ */
6474
6551
  token?: string;
6475
6552
  /**
6476
6553
  * @description Optional `token_type_hint` per RFC 7662. We only issue access tokens at this endpoint so the only meaningful value is `access_token`; the field is accepted for client-library compatibility.
@@ -9170,7 +9247,10 @@ type components = {
9170
9247
  site_key?: string;
9171
9248
  };
9172
9249
  UpdateEndUserDto: {
9173
- /** @description New display name */
9250
+ /**
9251
+ * @description New display name
9252
+ * @example Ada Lovelace
9253
+ */
9174
9254
  display_name?: string;
9175
9255
  /** @description New primary email */
9176
9256
  email?: string;
@@ -9230,7 +9310,10 @@ type components = {
9230
9310
  description?: string;
9231
9311
  };
9232
9312
  UpdateTenantDto: {
9233
- /** @description Human-readable name of the tenant. */
9313
+ /**
9314
+ * @description Human-readable name of the tenant.
9315
+ * @example Acme Inc
9316
+ */
9234
9317
  display_name?: string;
9235
9318
  /** @description Free-form JSON object you attach to the tenant; returned as stored. */
9236
9319
  metadata?: {
@@ -10130,7 +10213,10 @@ type components = {
10130
10213
  type: "user.suspended";
10131
10214
  };
10132
10215
  VerifyBody: {
10133
- /** @description EndUser or M2M JWT to verify against the app JWKS. Optional — if omitted, the token is read from the `Authorization: Bearer <jwt>` header instead. */
10216
+ /**
10217
+ * @description EndUser or M2M JWT to verify against the app JWKS. Optional — if omitted, the token is read from the `Authorization: Bearer <jwt>` header instead.
10218
+ * @example eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl
10219
+ */
10134
10220
  token?: string;
10135
10221
  };
10136
10222
  VerifyPrincipalDto: {
@@ -24930,7 +25016,7 @@ interface operations {
24930
25016
  "application/json": components["schemas"]["ErrorResponseDto"];
24931
25017
  };
24932
25018
  };
24933
- /** @description `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app, the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`). */
25019
+ /** @description `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app (new apps start with `signup_enabled: false`; turn it on with `PATCH /v1/apps/{app_id}/auth-config`), the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`). */
24934
25020
  403: {
24935
25021
  headers: {
24936
25022
  "X-Request-Id": components["headers"]["RequestId"];
@@ -29156,8 +29242,8 @@ interface operations {
29156
29242
 
29157
29243
  type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
29158
29244
  type OpenString<T extends string> = string extends T ? T : true extends IsUnion<T> ? T | (string & {}) : T;
29159
- type OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ? Open<I>[] : T extends object ? {
29160
- [K in keyof T]: Open<T[K]>;
29245
+ type OpenValue<T> = [T] extends [string] ? OpenString<T> : T extends readonly (infer I)[] ? (OpenValue<Exclude<I, null | undefined>> | Extract<I, null | undefined>)[] : T extends object ? {
29246
+ [K in keyof T]: OpenValue<Exclude<T[K], null | undefined>> | Extract<T[K], null | undefined>;
29161
29247
  } : T;
29162
29248
  /** A response type: string-literal unions also accept values added after this SDK was built. */
29163
29249
  type Open<T> = OpenValue<Exclude<T, null | undefined>> | Extract<T, null | undefined>;
@@ -30116,6 +30202,17 @@ interface WebhookUnwrapParams {
30116
30202
  /** Accepted clock skew in seconds. Default 300. */
30117
30203
  toleranceSeconds?: number;
30118
30204
  }
30205
+ /** `webhooks.sign()`: what to sign. Tests only; ProductCraft signs real deliveries. */
30206
+ interface WebhookSignParams {
30207
+ /** The event: an `UnwrapWebhookEvent`-shaped object (JSON-encoded) or the exact body string. */
30208
+ payload: WebhookPayload | Record<string, unknown>;
30209
+ /** Signing secret. Default: the client's `webhookSecret` (the first, when several), then `PRODUCTCRAFT_AUTH_WEBHOOK_SECRET`. */
30210
+ secret?: string;
30211
+ /** `webhook-id`. Default: a random `msg_…` id. */
30212
+ id?: string;
30213
+ /** Unix seconds for `webhook-timestamp`. Default: now. */
30214
+ timestamp?: number;
30215
+ }
30119
30216
 
30120
30217
  type Bound = Readonly<Record<string, string | undefined>>;
30121
30218
  declare class APIResource {
@@ -30131,6 +30228,11 @@ declare class AppsResource extends APIResource {
30131
30228
  *
30132
30229
  * The new app starts with emails to its users turned on: they go out from the workspace default sender chosen in Mail, and the default verification, welcome, password-reset, invite and sign-in code templates are created in the workspace's Mail templates (an existing template with the same name is reused). Change or turn this off with `PATCH /v1/apps/{appId}/notification-settings`.
30133
30230
  *
30231
+ * **Sign-up starts off.** A new app has `signup_enabled: false`, so `POST /{app_slug}/v1/auth/signup` answers 403 `FORBIDDEN` ("Signup is disabled for this app") until you turn it on with `PATCH /v1/apps/{app_id}/auth-config` and `{ "signup_enabled": true }`. Sign-in, invites and admin-created users work either way.
30232
+ *
30233
+ * Credential: `workspace_key`.
30234
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30235
+ *
30134
30236
  * @param params - `Auth.AppCreateParams`.
30135
30237
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
30136
30238
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (slug, display name, or workspaceId).
@@ -30153,6 +30255,9 @@ declare class AppsResource extends APIResource {
30153
30255
  /**
30154
30256
  * Delete an app permanently
30155
30257
  *
30258
+ * Credential: `workspace_key`.
30259
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30260
+ *
30156
30261
  * @param appId - Id of the app.
30157
30262
  * @param options - Per-request options.
30158
30263
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -30163,13 +30268,16 @@ declare class AppsResource extends APIResource {
30163
30268
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id
30164
30269
  * @example
30165
30270
  * ```ts
30166
- * await auth.apps.delete("app");
30271
+ * await auth.apps.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
30167
30272
  * ```
30168
30273
  */
30169
30274
  delete(appId: string, options?: RequestOptions): APIPromise<void>;
30170
30275
  /**
30171
30276
  * List apps in workspaces the caller is a member of. Pass `workspace_id` to scope the result to a single workspace — required from the per-workspace console page so cross-tenant memberships do not leak.
30172
30277
  *
30278
+ * Credential: `workspace_key`.
30279
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30280
+ *
30173
30281
  * @param params - `Auth.AppListParams`.
30174
30282
  * @param options - Per-request options.
30175
30283
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid pagination cursor.
@@ -30189,6 +30297,9 @@ declare class AppsResource extends APIResource {
30189
30297
  /**
30190
30298
  * Get app details
30191
30299
  *
30300
+ * Credential: `workspace_key`.
30301
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30302
+ *
30192
30303
  * @param appId - Id of the app.
30193
30304
  * @param options - Per-request options.
30194
30305
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -30199,13 +30310,16 @@ declare class AppsResource extends APIResource {
30199
30310
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id
30200
30311
  * @example
30201
30312
  * ```ts
30202
- * const app = await auth.apps.retrieve("app");
30313
+ * const app = await auth.apps.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
30203
30314
  * ```
30204
30315
  */
30205
30316
  retrieve(appId: string, options?: RequestOptions): APIPromise<WithLastResponse<App>>;
30206
30317
  /**
30207
30318
  * Update app display name, slug, metadata, and retention settings
30208
30319
  *
30320
+ * Credential: `workspace_key`.
30321
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30322
+ *
30209
30323
  * @param appId - Id of the app.
30210
30324
  * @param params - `Auth.AppUpdateParams`.
30211
30325
  * @param options - Per-request options.
@@ -30216,7 +30330,7 @@ declare class AppsResource extends APIResource {
30216
30330
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id
30217
30331
  * @example
30218
30332
  * ```ts
30219
- * const app = await auth.apps.update("app", { audit_retention_days: 365 });
30333
+ * const app = await auth.apps.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { audit_retention_days: 365 });
30220
30334
  * ```
30221
30335
  */
30222
30336
  update(appId: string, params?: AppUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<App>>;
@@ -30228,6 +30342,9 @@ declare class StatsResource extends APIResource {
30228
30342
  *
30229
30343
  * Returns total Auth apps owned by workspaces the caller is a member of, end-users across those apps, and active API keys across those apps. Pass `workspace_id` to scope the counts to a single workspace — required from the dashboard so cross-tenant data does not bleed into the totals.
30230
30344
  *
30345
+ * Credential: `workspace_key`.
30346
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30347
+ *
30231
30348
  * @param params - `Auth.StatsMeParams`.
30232
30349
  * @param options - Per-request options.
30233
30350
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -30249,6 +30366,9 @@ declare class StatsResource extends APIResource {
30249
30366
  *
30250
30367
  * Days are UTC. Counts only: no end-user identifiers. Cached for up to 60 seconds (`generated_at`).
30251
30368
  *
30369
+ * Credential: `workspace_key`.
30370
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30371
+ *
30252
30372
  * @param params - `Auth.StatsRetrieveParams`.
30253
30373
  * @param options - Per-request options.
30254
30374
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `workspaceId` is not a UUID or `window` is not one of 1d, 7d, 30d.
@@ -30281,6 +30401,14 @@ declare class WebhooksResource extends APIResource {
30281
30401
  * @throws {ConfigurationError} No secret was passed or configured.
30282
30402
  */
30283
30403
  unwrap(params: WebhookUnwrapParams): Promise<UnwrapWebhookEvent>;
30404
+ /**
30405
+ * Sign a test event the way ProductCraft signs deliveries (Standard Webhooks), so a handler
30406
+ * test can call `unwrap` without a live delivery. Returns the exact body and the headers.
30407
+ *
30408
+ * @param params - The event (an object is JSON-encoded), and optionally the secret, `id` and `timestamp`.
30409
+ * @throws {ConfigurationError} No secret was passed or configured.
30410
+ */
30411
+ sign(params: WebhookSignParams): Promise<SignedWebhook>;
30284
30412
  }
30285
30413
  /** `auth` */
30286
30414
  declare class AuthResources extends APIResource {
@@ -30294,6 +30422,9 @@ declare class AppApiKeysResource extends APIResource {
30294
30422
  /**
30295
30423
  * Mint a new hdk_live_* API key with an explicit permission scope. The raw key is returned ONCE.
30296
30424
  *
30425
+ * Credential: `workspace_key`.
30426
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30427
+ *
30297
30428
  * @param params - `Auth.ApiKeyCreateParams`.
30298
30429
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
30299
30430
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (name, empty `permissions`, a permission not matching `resource.action`, unsupported `expiresInDays`), or a malformed `Idempotency-Key`.
@@ -30306,13 +30437,16 @@ declare class AppApiKeysResource extends APIResource {
30306
30437
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-api-keys
30307
30438
  * @example
30308
30439
  * ```ts
30309
- * const createApiKey = await auth.admin.app("app").apiKeys.create({ name: "CI deploy bot", permissions: ["user.read", "user.list"] });
30440
+ * const createApiKey = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.create({ name: "CI deploy bot", permissions: ["user.read", "user.list"] });
30310
30441
  * ```
30311
30442
  */
30312
30443
  create(params: ApiKeyCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CreateApiKey>>;
30313
30444
  /**
30314
30445
  * Revoke an API key. The key stops authenticating immediately; the row is kept (soft delete) so the list and the audit trail can still answer who revoked it and when.
30315
30446
  *
30447
+ * Credential: `workspace_key`.
30448
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30449
+ *
30316
30450
  * @param keyId - Id of the key.
30317
30451
  * @param options - Per-request options.
30318
30452
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -30322,13 +30456,16 @@ declare class AppApiKeysResource extends APIResource {
30322
30456
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-api-keys-key-id
30323
30457
  * @example
30324
30458
  * ```ts
30325
- * await auth.admin.app("app").apiKeys.delete("key");
30459
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
30326
30460
  * ```
30327
30461
  */
30328
30462
  delete(keyId: string, options?: RequestOptions): APIPromise<void>;
30329
30463
  /**
30330
30464
  * List API keys for an app (no raw secret), newest first. Cursor-paginated: 20/page by default, 100 max.
30331
30465
  *
30466
+ * Credential: `workspace_key`.
30467
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30468
+ *
30332
30469
  * @param params - `Auth.ApiKeyListParams`.
30333
30470
  * @param options - Per-request options.
30334
30471
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
@@ -30338,16 +30475,19 @@ declare class AppApiKeysResource extends APIResource {
30338
30475
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-api-keys
30339
30476
  * @example
30340
30477
  * ```ts
30341
- * for await (const apiKey of auth.admin.app("app").apiKeys.list()) {
30478
+ * for await (const apiKey of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.list()) {
30342
30479
  * console.log(apiKey);
30343
30480
  * }
30344
- * const page = await auth.admin.app("app").apiKeys.list({}, { timeout: 5_000 });
30481
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.list({}, { timeout: 5_000 });
30345
30482
  * ```
30346
30483
  */
30347
30484
  list(params?: ApiKeyListParams, options?: RequestOptions): PagePromise<ApiKeySummary>;
30348
30485
  /**
30349
30486
  * Mint a replacement for an existing key, carrying its name and permissions over. The outgoing key keeps working for `grace_hours` (24 by default) so a fleet can roll over without downtime. The raw key is returned ONCE.
30350
30487
  *
30488
+ * Credential: `workspace_key`.
30489
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30490
+ *
30351
30491
  * @param keyId - Id of the key.
30352
30492
  * @param params - `Auth.ApiKeyRotateParams`.
30353
30493
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -30359,7 +30499,7 @@ declare class AppApiKeysResource extends APIResource {
30359
30499
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-api-keys-key-id-rotate
30360
30500
  * @example
30361
30501
  * ```ts
30362
- * const rotateApiKey = await auth.admin.app("app").apiKeys.rotate("key", { grace_hours: 24 });
30502
+ * const rotateApiKey = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").apiKeys.rotate("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { grace_hours: 24 });
30363
30503
  * ```
30364
30504
  */
30365
30505
  rotate(keyId: string, params?: ApiKeyRotateParams, options?: RequestOptions): APIPromise<WithLastResponse<RotateApiKey>>;
@@ -30371,6 +30511,9 @@ declare class AppAuditLogsResource extends APIResource {
30371
30511
  *
30372
30512
  * The response is streamed: rows are walked in keyset batches and written as they are read, so neither the service nor the client has to hold the whole result set. Works on both lanes — a platform bearer token and a `pcft_live_*` Platform API Key with `auth.audit.read` hit the same route. Hard cap of 1,000,000 rows per call; a wider request is refused with 413 before any body is written, so a truncated file can never masquerade as a complete one.
30373
30513
  *
30514
+ * Credential: `workspace_key`.
30515
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30516
+ *
30374
30517
  * @param params - `Auth.AuditLogExportParams`.
30375
30518
  * @param options - Per-request options.
30376
30519
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `format`, or malformed `since` / `until`.
@@ -30383,7 +30526,7 @@ declare class AppAuditLogsResource extends APIResource {
30383
30526
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-logs-export
30384
30527
  * @example
30385
30528
  * ```ts
30386
- * const response = await auth.admin.app("app").auditLogs.export();
30529
+ * const response = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditLogs.export();
30387
30530
  * const text = await response.text();
30388
30531
  * ```
30389
30532
  */
@@ -30391,6 +30534,9 @@ declare class AppAuditLogsResource extends APIResource {
30391
30534
  /**
30392
30535
  * Append-only audit log for this app, newest first. Filter by `?action=`, `?actor_id=`, and/or the `?since=` / `?until=` date range. 20/page (max 100), cursor-paginated.
30393
30536
  *
30537
+ * Credential: `workspace_key`.
30538
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30539
+ *
30394
30540
  * @param params - `Auth.AuditLogListParams`.
30395
30541
  * @param options - Per-request options.
30396
30542
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, `since`, or `until`.
@@ -30402,10 +30548,10 @@ declare class AppAuditLogsResource extends APIResource {
30402
30548
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-logs
30403
30549
  * @example
30404
30550
  * ```ts
30405
- * for await (const auditLog of auth.admin.app("app").auditLogs.list()) {
30551
+ * for await (const auditLog of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditLogs.list()) {
30406
30552
  * console.log(auditLog);
30407
30553
  * }
30408
- * const page = await auth.admin.app("app").auditLogs.list({}, { timeout: 5_000 });
30554
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditLogs.list({}, { timeout: 5_000 });
30409
30555
  * ```
30410
30556
  */
30411
30557
  list(params?: AuditLogListParams, options?: RequestOptions): PagePromise<AuditLogEntry>;
@@ -30415,6 +30561,9 @@ declare class AppAuditSinkResource extends APIResource {
30415
30561
  /**
30416
30562
  * Remove the audit sink. Shipping stops immediately; the audit log itself is untouched.
30417
30563
  *
30564
+ * Credential: `workspace_key`.
30565
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30566
+ *
30418
30567
  * @param options - Per-request options.
30419
30568
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
30420
30569
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.update`.
@@ -30424,7 +30573,7 @@ declare class AppAuditSinkResource extends APIResource {
30424
30573
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-audit-sink
30425
30574
  * @example
30426
30575
  * ```ts
30427
- * await auth.admin.app("app").auditSink.disconnect();
30576
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.disconnect();
30428
30577
  * ```
30429
30578
  */
30430
30579
  disconnect(options?: RequestOptions): APIPromise<void>;
@@ -30433,6 +30582,9 @@ declare class AppAuditSinkResource extends APIResource {
30433
30582
  *
30434
30583
  * Audit rows are POSTed in batches of up to 100, signed with the same `X-Auth-Signature: t=<unix>,v1=<hex>` HMAC header as the outbound webhooks. Delivery is at-least-once: the cursor advances only after a 2xx, so a batch that times out after the receiver processed it is re-sent. Every record carries its immutable `audit_log` id, so dedupe on that. A new sink starts from the moment it is created — configuring one does not replay the existing history into your SIEM. Replacing an existing sink clears the auto-disabled state (the same "I fixed my receiver" signal a webhook PUT carries) but does NOT rewind the cursor.
30435
30584
  *
30585
+ * Credential: `workspace_key`.
30586
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30587
+ *
30436
30588
  * @param params - `Auth.AuditSinkReplaceParams`.
30437
30589
  * @param options - Per-request options.
30438
30590
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: URL is not HTTPS, or the SSRF guard refused it (private address, unresolvable host, non-public TLD).
@@ -30444,13 +30596,16 @@ declare class AppAuditSinkResource extends APIResource {
30444
30596
  * @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-audit-sink
30445
30597
  * @example
30446
30598
  * ```ts
30447
- * const auditSinkWithSecret = await auth.admin.app("app").auditSink.replace({ url: "https://siem.customer.example.com/ingest/productcraft-auth" });
30599
+ * const auditSinkWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.replace({ url: "https://siem.customer.example.com/ingest/productcraft-auth" });
30448
30600
  * ```
30449
30601
  */
30450
30602
  replace(params: AuditSinkReplaceParams, options?: RequestOptions): APIPromise<WithLastResponse<AuditSinkWithSecret>>;
30451
30603
  /**
30452
30604
  * Current audit sink for this app, or 404 when none is configured. Never returns the signing secret — only its last-4 hint.
30453
30605
  *
30606
+ * Credential: `workspace_key`.
30607
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30608
+ *
30454
30609
  * @param options - Per-request options.
30455
30610
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
30456
30611
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read`.
@@ -30460,7 +30615,7 @@ declare class AppAuditSinkResource extends APIResource {
30460
30615
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-sink
30461
30616
  * @example
30462
30617
  * ```ts
30463
- * const auditSink = await auth.admin.app("app").auditSink.retrieve();
30618
+ * const auditSink = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.retrieve();
30464
30619
  * ```
30465
30620
  */
30466
30621
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<AuditSink>>;
@@ -30469,6 +30624,9 @@ declare class AppAuditSinkResource extends APIResource {
30469
30624
  *
30470
30625
  * The new secret signs every batch from now on; the old one stops at once. Update your receiver right away: batches it rejects in between are retried every minute (the position only moves after a 2xx), so nothing is lost, but export stops after 20 failures in a row. Clears the receiver-test proof.
30471
30626
  *
30627
+ * Credential: `workspace_key`.
30628
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30629
+ *
30472
30630
  * @param options - Per-request options.
30473
30631
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
30474
30632
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.update`.
@@ -30478,7 +30636,7 @@ declare class AppAuditSinkResource extends APIResource {
30478
30636
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-audit-sink-rotate-secret
30479
30637
  * @example
30480
30638
  * ```ts
30481
- * const auditSinkWithSecret = await auth.admin.app("app").auditSink.rotateSecret();
30639
+ * const auditSinkWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.rotateSecret();
30482
30640
  * ```
30483
30641
  */
30484
30642
  rotateSecret(options?: RequestOptions): APIPromise<WithLastResponse<AuditSinkWithSecret>>;
@@ -30487,6 +30645,9 @@ declare class AppAuditSinkResource extends APIResource {
30487
30645
  *
30488
30646
  * Rows, in order: `destination` (not_set until a sink exists), `test_batch` (pass once the receiver accepted a test batch with the current address and secret; blocked when the last test was refused; carries `test.action: audit_sink.test`, run with `POST /v1/apps/{appId}/audit-sink/test`), and `delivery` (blocked when export stopped after repeated failures, attention while paused or while recent batches fail). Computed from the stored sink on every request; answers 200 whether or not a sink exists.
30489
30647
  *
30648
+ * Credential: `workspace_key`.
30649
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30650
+ *
30490
30651
  * @param options - Per-request options.
30491
30652
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
30492
30653
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read`, or the app is suspended or archived.
@@ -30496,7 +30657,7 @@ declare class AppAuditSinkResource extends APIResource {
30496
30657
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-audit-sink-setup-status
30497
30658
  * @example
30498
30659
  * ```ts
30499
- * const setupStatus = await auth.admin.app("app").auditSink.setupStatus();
30660
+ * const setupStatus = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.setupStatus();
30500
30661
  * ```
30501
30662
  */
30502
30663
  setupStatus(options?: RequestOptions): APIPromise<WithLastResponse<SetupStatus>>;
@@ -30505,6 +30666,9 @@ declare class AppAuditSinkResource extends APIResource {
30505
30666
  *
30506
30667
  * POSTs one signed batch, shaped exactly like a real one (`type: audit.batch`, same headers and signature), with `test: true` and a single synthetic record whose `id` starts with `test_`. Works while export is paused or stopped, so a fix can be proven before export is turned back on. The outcome is recorded on the sink (`last_attempt_*`, `last_test_succeeded_at`) but never moves the position in the audit log or counts toward the automatic stop. A refused test is still a 200 with `delivered: false`. At most 20 tests per app per hour.
30507
30668
  *
30669
+ * Credential: `workspace_key`.
30670
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30671
+ *
30508
30672
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
30509
30673
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
30510
30674
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.update`.
@@ -30515,7 +30679,7 @@ declare class AppAuditSinkResource extends APIResource {
30515
30679
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-audit-sink-test
30516
30680
  * @example
30517
30681
  * ```ts
30518
- * const auditSinkTestResult = await auth.admin.app("app").auditSink.test();
30682
+ * const auditSinkTestResult = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.test();
30519
30683
  * ```
30520
30684
  */
30521
30685
  test(options?: RequestOptions): APIPromise<WithLastResponse<AuditSinkTestResult>>;
@@ -30524,6 +30688,9 @@ declare class AppAuditSinkResource extends APIResource {
30524
30688
  *
30525
30689
  * Send `url`, `enabled` or both. `enabled: false` pauses export; `enabled: true` resumes it and clears a stop after repeated failures and the failure count. The position in the audit log is never moved: nothing is skipped and nothing is replayed twice on purpose. A new `url` is checked by the same address guard as `PUT`.
30526
30690
  *
30691
+ * Credential: `workspace_key`.
30692
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30693
+ *
30527
30694
  * @param params - `Auth.AuditSinkUpdateParams`.
30528
30695
  * @param options - Per-request options.
30529
30696
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: URL is not HTTPS, or the address guard refused it (private address, unresolvable host).
@@ -30535,7 +30702,7 @@ declare class AppAuditSinkResource extends APIResource {
30535
30702
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-audit-sink
30536
30703
  * @example
30537
30704
  * ```ts
30538
- * const auditSink = await auth.admin.app("app").auditSink.update({ enabled: true });
30705
+ * const auditSink = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditSink.update({ enabled: true });
30539
30706
  * ```
30540
30707
  */
30541
30708
  update(params?: AuditSinkUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<AuditSink>>;
@@ -30547,6 +30714,9 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30547
30714
  *
30548
30715
  * Calls the provider's token endpoint with a dummy sign-in code. If the provider refuses the client (`invalid_client`, GitHub `incorrect_client_credentials` or `unknown_client`), the result is `credentials_rejected` and the provider shows as `blocked` with reason `credentials_rejected` until the credentials are fixed. If it only refuses the code (`invalid_grant`, `bad_verification_code`), the credentials are valid. Nobody is signed in. The result is saved on the provider (`last_check_*`). The same check runs automatically whenever the credentials are saved. Works for a provider that is saved but not switched on yet.
30549
30716
  *
30717
+ * Credential: `workspace_key`.
30718
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30719
+ *
30550
30720
  * @param provider - The sign-in provider: `google`, `github` or `apple`.
30551
30721
  * @param options - Per-request options.
30552
30722
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown provider id, or the saved config can no longer be read.
@@ -30558,13 +30728,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30558
30728
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-auth-config-providers-provider-check
30559
30729
  * @example
30560
30730
  * ```ts
30561
- * const providerCheck = await auth.admin.app("app").authConfig.providers.check("provider");
30731
+ * const providerCheck = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.check("google");
30562
30732
  * ```
30563
30733
  */
30564
30734
  check(provider: string, options?: RequestOptions): APIPromise<WithLastResponse<ProviderCheck>>;
30565
30735
  /**
30566
30736
  * Remove the config for an (app, provider). Existing identity rows (people who already signed in with this provider) stay; they just lose the ability to sign in again until config is re-uploaded.
30567
30737
  *
30738
+ * Credential: `workspace_key`.
30739
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30740
+ *
30568
30741
  * @param provider - The sign-in provider: `google`, `github` or `apple`.
30569
30742
  * @param options - Per-request options.
30570
30743
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown provider id.
@@ -30574,7 +30747,7 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30574
30747
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-auth-config-providers-provider
30575
30748
  * @example
30576
30749
  * ```ts
30577
- * await auth.admin.app("app").authConfig.providers.delete("provider");
30750
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.delete("google");
30578
30751
  * ```
30579
30752
  */
30580
30753
  delete(provider: string, options?: RequestOptions): APIPromise<void>;
@@ -30583,6 +30756,9 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30583
30756
  *
30584
30757
  * Each entry carries `status` (`ready` | `blocked` | `disabled` | `not_configured`) and `blocked_reasons`, computed on the server with the same rule the web sign-in flow enforces, so a provider shown as `ready` is one people can actually sign in with.
30585
30758
  *
30759
+ * Credential: `workspace_key`.
30760
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30761
+ *
30586
30762
  * @param options - Per-request options.
30587
30763
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
30588
30764
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -30592,13 +30768,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30592
30768
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-auth-config-providers
30593
30769
  * @example
30594
30770
  * ```ts
30595
- * const result = await auth.admin.app("app").authConfig.providers.list();
30771
+ * const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.list();
30596
30772
  * ```
30597
30773
  */
30598
30774
  list(options?: RequestOptions): APIPromise<WithLastResponse<AuthConfigProviderListResponse>>;
30599
30775
  /**
30600
30776
  * Write or replace the config for an (app, provider). Validates the body via the provider impl's `parseConfig` before encrypting; malformed config 400s. Default `enabled=false`.
30601
30777
  *
30778
+ * Credential: `workspace_key`.
30779
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30780
+ *
30602
30781
  * @param provider - The sign-in provider: `google`, `github` or `apple`.
30603
30782
  * @param params - `Auth.AuthConfigProviderReplaceParams`.
30604
30783
  * @param options - Per-request options.
@@ -30609,13 +30788,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30609
30788
  * @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-auth-config-providers-provider
30610
30789
  * @example
30611
30790
  * ```ts
30612
- * const providerDetail = await auth.admin.app("app").authConfig.providers.replace("provider", { config: {} });
30791
+ * const providerDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.replace("google", { config: {} });
30613
30792
  * ```
30614
30793
  */
30615
30794
  replace(provider: string, params: AuthConfigProviderReplaceParams, options?: RequestOptions): APIPromise<WithLastResponse<ProviderDetail>>;
30616
30795
  /**
30617
30796
  * Get the config for one (app, provider). Secrets are redacted — `private_key_present: true` is the only acknowledgement that a private key is on file.
30618
30797
  *
30798
+ * Credential: `workspace_key`.
30799
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30800
+ *
30619
30801
  * @param provider - The sign-in provider: `google`, `github` or `apple`.
30620
30802
  * @param options - Per-request options.
30621
30803
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown provider id.
@@ -30626,13 +30808,16 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30626
30808
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-auth-config-providers-provider
30627
30809
  * @example
30628
30810
  * ```ts
30629
- * const providerDetail = await auth.admin.app("app").authConfig.providers.retrieve("provider");
30811
+ * const providerDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.retrieve("google");
30630
30812
  * ```
30631
30813
  */
30632
30814
  retrieve(provider: string, options?: RequestOptions): APIPromise<WithLastResponse<ProviderDetail>>;
30633
30815
  /**
30634
30816
  * Partially update the config for an (app, provider). Only top-level keys present in `config` are changed; omitted keys — secrets included — keep their stored values. The merged config is validated by the provider impl's `parseConfig`; 404 if the provider is not configured yet (create it with PUT).
30635
30817
  *
30818
+ * Credential: `workspace_key`.
30819
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30820
+ *
30636
30821
  * @param provider - The sign-in provider: `google`, `github` or `apple`.
30637
30822
  * @param params - `Auth.AuthConfigProviderUpdateParams`.
30638
30823
  * @param options - Per-request options.
@@ -30644,7 +30829,7 @@ declare class AppAuthConfigProvidersResource extends APIResource {
30644
30829
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-auth-config-providers-provider
30645
30830
  * @example
30646
30831
  * ```ts
30647
- * const providerDetail = await auth.admin.app("app").authConfig.providers.update("provider", { config: {} });
30832
+ * const providerDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.update("google", { config: {} });
30648
30833
  * ```
30649
30834
  */
30650
30835
  update(provider: string, params?: AuthConfigProviderUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ProviderDetail>>;
@@ -30656,6 +30841,9 @@ declare class AppAuthConfigResource extends APIResource {
30656
30841
  /**
30657
30842
  * Get the per-app auth config (signup, signin, password policy, sessions).
30658
30843
  *
30844
+ * Credential: `workspace_key`.
30845
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30846
+ *
30659
30847
  * @param options - Per-request options.
30660
30848
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
30661
30849
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -30665,13 +30853,16 @@ declare class AppAuthConfigResource extends APIResource {
30665
30853
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-auth-config
30666
30854
  * @example
30667
30855
  * ```ts
30668
- * const authConfig = await auth.admin.app("app").authConfig.retrieve();
30856
+ * const authConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.retrieve();
30669
30857
  * ```
30670
30858
  */
30671
30859
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<AuthConfig>>;
30672
30860
  /**
30673
30861
  * Update the per-app auth config. Only fields you pass are changed.
30674
30862
  *
30863
+ * Credential: `workspace_key`.
30864
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30865
+ *
30675
30866
  * @param params - `Auth.AuthConfigUpdateParams`.
30676
30867
  * @param options - Per-request options.
30677
30868
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure — a value out of range (password length, token/session lifetimes, lockout threshold, max sessions, MFA grace days, unverified-account window), an unknown enum value, a `signup_default_role` that does not exist in this app, or a `bot_protection` change that cannot stand: no provider or site key on first setup, a hostname that is not a hostname, or `enabled: true` with no secret stored or sent.
@@ -30684,7 +30875,7 @@ declare class AppAuthConfigResource extends APIResource {
30684
30875
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-auth-config
30685
30876
  * @example
30686
30877
  * ```ts
30687
- * const authConfig = await auth.admin.app("app").authConfig.update({ access_token_minutes: 60 });
30878
+ * const authConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.update({ access_token_minutes: 60 });
30688
30879
  * ```
30689
30880
  */
30690
30881
  update(params?: AuthConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<AuthConfig>>;
@@ -30700,6 +30891,9 @@ declare class AppCredentialsResource extends APIResource {
30700
30891
  /**
30701
30892
  * Create a new M2M client
30702
30893
  *
30894
+ * Credential: `workspace_key`.
30895
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30896
+ *
30703
30897
  * @param params - `Auth.CredentialCreateParams`.
30704
30898
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
30705
30899
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (missing or invalid name).
@@ -30712,13 +30906,16 @@ declare class AppCredentialsResource extends APIResource {
30712
30906
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-credentials
30713
30907
  * @example
30714
30908
  * ```ts
30715
- * const m2mClientCreate = await auth.admin.app("app").credentials.create({ name: "CI Pipeline" });
30909
+ * const m2mClientCreate = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.create({ name: "CI Pipeline" });
30716
30910
  * ```
30717
30911
  */
30718
30912
  create(params: CredentialCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<M2mClientCreate>>;
30719
30913
  /**
30720
30914
  * Delete an M2M client
30721
30915
  *
30916
+ * Credential: `workspace_key`.
30917
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30918
+ *
30722
30919
  * @param clientId - Id of the client.
30723
30920
  * @param options - Per-request options.
30724
30921
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -30729,13 +30926,16 @@ declare class AppCredentialsResource extends APIResource {
30729
30926
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-credentials-client-id
30730
30927
  * @example
30731
30928
  * ```ts
30732
- * await auth.admin.app("app").credentials.delete("client");
30929
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.delete("m2m_a1b2c3d4e5f6");
30733
30930
  * ```
30734
30931
  */
30735
30932
  delete(clientId: string, options?: RequestOptions): APIPromise<void>;
30736
30933
  /**
30737
30934
  * List M2M clients
30738
30935
  *
30936
+ * Credential: `workspace_key`.
30937
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30938
+ *
30739
30939
  * @param params - `Auth.CredentialListParams`.
30740
30940
  * @param options - Per-request options.
30741
30941
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -30746,16 +30946,19 @@ declare class AppCredentialsResource extends APIResource {
30746
30946
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-credentials
30747
30947
  * @example
30748
30948
  * ```ts
30749
- * for await (const credential of auth.admin.app("app").credentials.list()) {
30949
+ * for await (const credential of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.list()) {
30750
30950
  * console.log(credential);
30751
30951
  * }
30752
- * const page = await auth.admin.app("app").credentials.list({}, { timeout: 5_000 });
30952
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.list({}, { timeout: 5_000 });
30753
30953
  * ```
30754
30954
  */
30755
30955
  list(params?: CredentialListParams, options?: RequestOptions): PagePromise<M2mClientSummary>;
30756
30956
  /**
30757
30957
  * Get M2M client details
30758
30958
  *
30959
+ * Credential: `workspace_key`.
30960
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30961
+ *
30759
30962
  * @param clientId - Id of the client.
30760
30963
  * @param options - Per-request options.
30761
30964
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -30766,13 +30969,16 @@ declare class AppCredentialsResource extends APIResource {
30766
30969
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-credentials-client-id
30767
30970
  * @example
30768
30971
  * ```ts
30769
- * const m2mClientDetail = await auth.admin.app("app").credentials.retrieve("client");
30972
+ * const m2mClientDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.retrieve("m2m_a1b2c3d4e5f6");
30770
30973
  * ```
30771
30974
  */
30772
30975
  retrieve(clientId: string, options?: RequestOptions): APIPromise<WithLastResponse<M2mClientDetail>>;
30773
30976
  /**
30774
30977
  * Rotate M2M client secret
30775
30978
  *
30979
+ * Credential: `workspace_key`.
30980
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
30981
+ *
30776
30982
  * @param clientId - Id of the client.
30777
30983
  * @param options - Per-request options.
30778
30984
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -30783,13 +30989,16 @@ declare class AppCredentialsResource extends APIResource {
30783
30989
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-credentials-client-id-rotate
30784
30990
  * @example
30785
30991
  * ```ts
30786
- * const m2mRotateSecret = await auth.admin.app("app").credentials.rotate("client");
30992
+ * const m2mRotateSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.rotate("m2m_a1b2c3d4e5f6");
30787
30993
  * ```
30788
30994
  */
30789
30995
  rotate(clientId: string, options?: RequestOptions): APIPromise<WithLastResponse<M2mRotateSecret>>;
30790
30996
  /**
30791
30997
  * Update M2M client status
30792
30998
  *
30999
+ * Credential: `workspace_key`.
31000
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31001
+ *
30793
31002
  * @param clientId - Id of the client.
30794
31003
  * @param params - `Auth.CredentialUpdateParams`.
30795
31004
  * @param options - Per-request options.
@@ -30802,13 +31011,16 @@ declare class AppCredentialsResource extends APIResource {
30802
31011
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-credentials-client-id
30803
31012
  * @example
30804
31013
  * ```ts
30805
- * const m2mClientDetail = await auth.admin.app("app").credentials.update("client", { is_active: true });
31014
+ * const m2mClientDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.update("m2m_a1b2c3d4e5f6", { is_active: true });
30806
31015
  * ```
30807
31016
  */
30808
31017
  update(clientId: string, params?: CredentialUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<M2mClientDetail>>;
30809
31018
  /**
30810
31019
  * Set scopes for an M2M client
30811
31020
  *
31021
+ * Credential: `workspace_key`.
31022
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31023
+ *
30812
31024
  * @param clientId - Id of the client.
30813
31025
  * @param params - `Auth.CredentialUpdateScopesParams`.
30814
31026
  * @param options - Per-request options.
@@ -30821,7 +31033,7 @@ declare class AppCredentialsResource extends APIResource {
30821
31033
  * @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-credentials-client-id-scopes
30822
31034
  * @example
30823
31035
  * ```ts
30824
- * const result = await auth.admin.app("app").credentials.updateScopes("client", { permissions: ["user.read", "app.read"] });
31036
+ * const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.updateScopes("m2m_a1b2c3d4e5f6", { permissions: ["user.read", "app.read"] });
30825
31037
  * ```
30826
31038
  */
30827
31039
  updateScopes(clientId: string, params: CredentialUpdateScopesParams, options?: RequestOptions): APIPromise<WithLastResponse<CredentialUpdateScopesResponse>>;
@@ -30851,6 +31063,9 @@ declare class AppCustomDomainsResource extends APIResource {
30851
31063
  *
30852
31064
  * Reads the zone through the provider's API and plans both records: `create`, or `skip` when already there. Nothing is ever changed or deleted, and only names at or under the custom host are written (Cloudflare records are DNS-only, not proxied). Anything in the way (another CNAME at the host, A/MX/TXT records where the CNAME must go) refuses the whole apply with 409 and the plan, before anything is written. `dry_run: true` returns the plan and changes nothing; `dry_run: false` writes exactly that plan and runs a check straight away (the records are usually `propagating` for a few minutes). The token is used for this request only: never stored, logged, queued or returned; revoke it afterwards (`warnings` says so when it could see more than this zone).
30853
31065
  *
31066
+ * Credential: `workspace_key`.
31067
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31068
+ *
30854
31069
  * @param domainId - Id of the domain.
30855
31070
  * @param params - `Auth.CustomDomainApplyParams`.
30856
31071
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -30865,7 +31080,7 @@ declare class AppCustomDomainsResource extends APIResource {
30865
31080
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-custom-domains-domain-id-apply
30866
31081
  * @example
30867
31082
  * ```ts
30868
- * const customDomainApplyResult = await auth.admin.app("app").customDomains.apply("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", { dry_run: true, provider: "cloudflare", token: "cf-token-from-your-dashboard" });
31083
+ * const customDomainApplyResult = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.apply("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { dry_run: true, provider: "cloudflare", token: "cf-token-from-your-dashboard" });
30869
31084
  * ```
30870
31085
  */
30871
31086
  apply(domainId: string, params: CustomDomainApplyParams, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomainApplyResult>>;
@@ -30874,6 +31089,9 @@ declare class AppCustomDomainsResource extends APIResource {
30874
31089
  *
30875
31090
  * Asks the zone's own nameservers and a public resolver for both records, stores each record's state and conflicts, and moves the status: `active` once both are verified; an active domain turns `failing` only when a record is definitely gone or blocked (a DNS outage never takes a working domain down). Safe to repeat.
30876
31091
  *
31092
+ * Credential: `workspace_key`.
31093
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31094
+ *
30877
31095
  * @param domainId - Id of the domain.
30878
31096
  * @param options - Per-request options.
30879
31097
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domainId` is not a UUID.
@@ -30885,7 +31103,7 @@ declare class AppCustomDomainsResource extends APIResource {
30885
31103
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-custom-domains-domain-id-check
30886
31104
  * @example
30887
31105
  * ```ts
30888
- * const customDomain = await auth.admin.app("app").customDomains.check("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
31106
+ * const customDomain = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.check("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
30889
31107
  * ```
30890
31108
  */
30891
31109
  check(domainId: string, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomain>>;
@@ -30894,6 +31112,9 @@ declare class AppCustomDomainsResource extends APIResource {
30894
31112
  *
30895
31113
  * Returns the two records to publish: a CNAME from the host to `edge_target`, and a TXT token at `_productcraft-auth.<host>` that proves the domain is yours. The zone and its DNS provider are detected, and the first check runs straight away, so `records[].state` and `conflicts` already say what is missing or in the way. Publish the records by hand, import `…/export`, or let `…/apply` write them with a short-lived provider token. The domain turns `active` once both records are seen. Sign-in tokens keep the canonical issuer (`https://api.auth.productcraft.co/{slug}`), so nothing changes for code that verifies them. One custom domain per app. While the feature is in early access it is switched on per workspace.
30896
31114
  *
31115
+ * Credential: `workspace_key`.
31116
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31117
+ *
30897
31118
  * @param params - `Auth.CustomDomainCreateParams`.
30898
31119
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
30899
31120
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, INVALID_HOSTNAME, HOSTNAME_RESERVED, APEX_NOT_SUPPORTED: Not a usable host name (`INVALID_HOSTNAME`), one of ours (`HOSTNAME_RESERVED`), or the root of a DNS zone, which cannot hold a CNAME (`APEX_NOT_SUPPORTED`).
@@ -30906,7 +31127,7 @@ declare class AppCustomDomainsResource extends APIResource {
30906
31127
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-custom-domains
30907
31128
  * @example
30908
31129
  * ```ts
30909
- * const customDomain = await auth.admin.app("app").customDomains.create({ hostname: "auth.acme.com" });
31130
+ * const customDomain = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.create({ hostname: "auth.acme.com" });
30910
31131
  * ```
30911
31132
  */
30912
31133
  create(params: CustomDomainCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomain>>;
@@ -30915,6 +31136,9 @@ declare class AppCustomDomainsResource extends APIResource {
30915
31136
  *
30916
31137
  * The host stops serving this app at once and its certificate is no longer renewed. Your DNS records are not touched: delete the CNAME and the `_productcraft-auth` TXT record at your DNS provider. Sign-ins on the canonical host are unaffected.
30917
31138
  *
31139
+ * Credential: `workspace_key`.
31140
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31141
+ *
30918
31142
  * @param domainId - Id of the domain.
30919
31143
  * @param options - Per-request options.
30920
31144
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domainId` is not a UUID.
@@ -30926,7 +31150,7 @@ declare class AppCustomDomainsResource extends APIResource {
30926
31150
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-custom-domains-domain-id
30927
31151
  * @example
30928
31152
  * ```ts
30929
- * await auth.admin.app("app").customDomains.delete("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
31153
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
30930
31154
  * ```
30931
31155
  */
30932
31156
  delete(domainId: string, options?: RequestOptions): APIPromise<void>;
@@ -30935,6 +31159,9 @@ declare class AppCustomDomainsResource extends APIResource {
30935
31159
  *
30936
31160
  * `format=bind`: a zone-file fragment (`$ORIGIN <zone>.`, `$TTL 3600`, names relative to the zone, a comment per record with its purpose and any conflict) that Cloudflare and Route 53 import directly. `format=csv`: `type,name,value,priority,ttl,purpose,required`, fully qualified names. By default only records not verified yet; `all=true` for both. Served as an attachment.
30937
31161
  *
31162
+ * Credential: `workspace_key`.
31163
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31164
+ *
30938
31165
  * @param domainId - Id of the domain.
30939
31166
  * @param params - `Auth.CustomDomainExportParams`.
30940
31167
  * @param options - Per-request options.
@@ -30947,7 +31174,7 @@ declare class AppCustomDomainsResource extends APIResource {
30947
31174
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-custom-domains-domain-id-export
30948
31175
  * @example
30949
31176
  * ```ts
30950
- * const response = await auth.admin.app("app").customDomains.export("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", { format: "bind" });
31177
+ * const response = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.export("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { format: "bind" });
30951
31178
  * const text = await response.text();
30952
31179
  * ```
30953
31180
  */
@@ -30957,6 +31184,9 @@ declare class AppCustomDomainsResource extends APIResource {
30957
31184
  *
30958
31185
  * Each with its status and the last check of its records, plus `available`: whether custom domains are switched on for the workspace. Always a single page.
30959
31186
  *
31187
+ * Credential: `workspace_key`.
31188
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31189
+ *
30960
31190
  * @param options - Per-request options.
30961
31191
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
30962
31192
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -30966,7 +31196,7 @@ declare class AppCustomDomainsResource extends APIResource {
30966
31196
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-custom-domains
30967
31197
  * @example
30968
31198
  * ```ts
30969
- * for await (const customDomain of auth.admin.app("app").customDomains.list()) {
31199
+ * for await (const customDomain of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.list()) {
30970
31200
  * console.log(customDomain);
30971
31201
  * }
30972
31202
  * ```
@@ -30977,6 +31207,9 @@ declare class AppCustomDomainsResource extends APIResource {
30977
31207
  *
30978
31208
  * Reads stored state only; `POST …/check` runs a new DNS check.
30979
31209
  *
31210
+ * Credential: `workspace_key`.
31211
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31212
+ *
30980
31213
  * @param domainId - Id of the domain.
30981
31214
  * @param options - Per-request options.
30982
31215
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `domainId` is not a UUID.
@@ -30988,7 +31221,7 @@ declare class AppCustomDomainsResource extends APIResource {
30988
31221
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-custom-domains-domain-id
30989
31222
  * @example
30990
31223
  * ```ts
30991
- * const customDomain = await auth.admin.app("app").customDomains.retrieve("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
31224
+ * const customDomain = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").customDomains.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
30992
31225
  * ```
30993
31226
  */
30994
31227
  retrieve(domainId: string, options?: RequestOptions): APIPromise<WithLastResponse<CustomDomain>>;
@@ -30998,6 +31231,9 @@ declare class AppEndUserInsightsUsersResource extends APIResource {
30998
31231
  /**
30999
31232
  * One end-user's recorded activity: their audit trail, their sessions with device/IP, and their enrolled factors. `noActivityRecorded` distinguishes "nothing happened" from "no data".
31000
31233
  *
31234
+ * Credential: `workspace_key`.
31235
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31236
+ *
31001
31237
  * @param userId - Id of the user.
31002
31238
  * @param options - Per-request options.
31003
31239
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `appId` or `userId` is not a UUID.
@@ -31009,7 +31245,7 @@ declare class AppEndUserInsightsUsersResource extends APIResource {
31009
31245
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-user-insights-users-user-id
31010
31246
  * @example
31011
31247
  * ```ts
31012
- * const endUserDetailInsights = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").endUserInsights.users.retrieve("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
31248
+ * const endUserDetailInsights = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUserInsights.users.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31013
31249
  * ```
31014
31250
  */
31015
31251
  retrieve(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<EndUserDetailInsights>>;
@@ -31021,6 +31257,9 @@ declare class AppEndUserInsightsResource extends APIResource {
31021
31257
  /**
31022
31258
  * Auth health for this app over the last 30 days: verification completion, sign-in failure rate, MFA adoption, password-reset follow-through, and session counts. Rates are null when there is nothing to divide by.
31023
31259
  *
31260
+ * Credential: `workspace_key`.
31261
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31262
+ *
31024
31263
  * @param options - Per-request options.
31025
31264
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `appId` is not a UUID.
31026
31265
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -31030,7 +31269,7 @@ declare class AppEndUserInsightsResource extends APIResource {
31030
31269
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-user-insights
31031
31270
  * @example
31032
31271
  * ```ts
31033
- * const endUserInsights = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").endUserInsights.retrieve();
31272
+ * const endUserInsights = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUserInsights.retrieve();
31034
31273
  * ```
31035
31274
  */
31036
31275
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<EndUserInsights>>;
@@ -31040,6 +31279,9 @@ declare class AppEndUsersContactsResource extends APIResource {
31040
31279
  /**
31041
31280
  * Add a contact for an end-user (unverified).
31042
31281
  *
31282
+ * Credential: `workspace_key`.
31283
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31284
+ *
31043
31285
  * @param userId - Id of the user.
31044
31286
  * @param params - `Auth.EndUserContactCreateParams`.
31045
31287
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -31053,13 +31295,16 @@ declare class AppEndUsersContactsResource extends APIResource {
31053
31295
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-contacts
31054
31296
  * @example
31055
31297
  * ```ts
31056
- * const accountContact = await auth.admin.app("app").endUsers.contacts.create("user", { type: "email", value: "string" });
31298
+ * const accountContact = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { type: "email", value: "ada@example.com" });
31057
31299
  * ```
31058
31300
  */
31059
31301
  create(userId: string, params: EndUserContactCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<AccountContact>>;
31060
31302
  /**
31061
31303
  * Delete a contact from an end-user.
31062
31304
  *
31305
+ * Credential: `workspace_key`.
31306
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31307
+ *
31063
31308
  * @param userId - Id of the user.
31064
31309
  * @param contactId - Id of the contact.
31065
31310
  * @param options - Per-request options.
@@ -31072,13 +31317,16 @@ declare class AppEndUsersContactsResource extends APIResource {
31072
31317
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-end-users-user-id-contacts-contact-id
31073
31318
  * @example
31074
31319
  * ```ts
31075
- * await auth.admin.app("app").endUsers.contacts.delete("user", "contact");
31320
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31076
31321
  * ```
31077
31322
  */
31078
31323
  delete(userId: string, contactId: string, options?: RequestOptions): APIPromise<void>;
31079
31324
  /**
31080
31325
  * List an end-user's contacts.
31081
31326
  *
31327
+ * Credential: `workspace_key`.
31328
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31329
+ *
31082
31330
  * @param userId - Id of the user.
31083
31331
  * @param options - Per-request options.
31084
31332
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31089,13 +31337,16 @@ declare class AppEndUsersContactsResource extends APIResource {
31089
31337
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-user-id-contacts
31090
31338
  * @example
31091
31339
  * ```ts
31092
- * const accountContactList = await auth.admin.app("app").endUsers.contacts.list("user");
31340
+ * const accountContactList = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31093
31341
  * ```
31094
31342
  */
31095
31343
  list(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<AccountContactList>>;
31096
31344
  /**
31097
31345
  * Promote a verified contact to primary.
31098
31346
  *
31347
+ * Credential: `workspace_key`.
31348
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31349
+ *
31099
31350
  * @param userId - Id of the user.
31100
31351
  * @param contactId - Id of the contact.
31101
31352
  * @param options - Per-request options.
@@ -31108,13 +31359,16 @@ declare class AppEndUsersContactsResource extends APIResource {
31108
31359
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-contacts-contact-id-promote
31109
31360
  * @example
31110
31361
  * ```ts
31111
- * await auth.admin.app("app").endUsers.contacts.promote("user", "contact");
31362
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.promote("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31112
31363
  * ```
31113
31364
  */
31114
31365
  promote(userId: string, contactId: string, options?: RequestOptions): APIPromise<void>;
31115
31366
  /**
31116
31367
  * Reissue a verification code for a contact.
31117
31368
  *
31369
+ * Credential: `workspace_key`.
31370
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31371
+ *
31118
31372
  * @param userId - Id of the user.
31119
31373
  * @param contactId - Id of the contact.
31120
31374
  * @param options - Per-request options.
@@ -31127,7 +31381,7 @@ declare class AppEndUsersContactsResource extends APIResource {
31127
31381
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-contacts-contact-id-resend-verification
31128
31382
  * @example
31129
31383
  * ```ts
31130
- * const issuedVerificationCode = await auth.admin.app("app").endUsers.contacts.resendVerification("user", "contact");
31384
+ * const issuedVerificationCode = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.resendVerification("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31131
31385
  * ```
31132
31386
  */
31133
31387
  resendVerification(userId: string, contactId: string, options?: RequestOptions): APIPromise<WithLastResponse<IssuedVerificationCode>>;
@@ -31139,6 +31393,9 @@ declare class AppEndUsersImportsResource extends APIResource {
31139
31393
  *
31140
31394
  * Row fields: `email` (required), `username`, `display_name`, `role`, `tenant_slugs` (array), `external_id`, `metadata`, `email_verified`, and `password_hash` + `password_hash_algorithm`. `password_hash_algorithm` is `argon2id` or `bcrypt`. **argon2id** hashes are accepted at any parameters. **bcrypt** hashes (`$2a$`, `$2b$`, `$2y$` — Auth0, PHP `password_hash`, Spring, node `bcrypt`, Devise / Rails, Laravel, Django) are accepted at any valid cost (4-31), verified on the user's first signin and replaced by an argon2id hash of the same password in that request, so the user keeps their password and never notices. Signin pads a bcrypt verify up to the argon2id floor, so at cost 10 and below an imported account cannot be told apart by timing; at cost 11 and above the verify is slower than the floor and answers when it finishes — a small timing difference on migrated accounts only, gone after each one's first signin. A re-run is idempotent: rows match on `external_id` first, then the primary email, and update rather than duplicate. An existing password, an already-verified address and an existing member's role are never overwritten — see the module docs for why each one.
31141
31395
  *
31396
+ * Credential: `workspace_key`.
31397
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31398
+ *
31142
31399
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
31143
31400
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Body is empty or contains no NDJSON rows.
31144
31401
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -31150,7 +31407,7 @@ declare class AppEndUsersImportsResource extends APIResource {
31150
31407
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-import
31151
31408
  * @example
31152
31409
  * ```ts
31153
- * const importJob = await auth.admin.app("app").endUsers.imports.create();
31410
+ * const importJob = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.imports.create();
31154
31411
  * ```
31155
31412
  */
31156
31413
  create(options?: RequestOptions): APIPromise<WithLastResponse<ImportJob>>;
@@ -31159,6 +31416,9 @@ declare class AppEndUsersImportsResource extends APIResource {
31159
31416
  *
31160
31417
  * `status: succeeded` means the job RAN TO COMPLETION, not that every row landed — read `failed_count` and `errors` for that. `errors` is capped at the first 500 entries; the counts stay exact.
31161
31418
  *
31419
+ * Credential: `workspace_key`.
31420
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31421
+ *
31162
31422
  * @param jobId - Id of the job.
31163
31423
  * @param options - Per-request options.
31164
31424
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -31169,7 +31429,7 @@ declare class AppEndUsersImportsResource extends APIResource {
31169
31429
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-import-job-id
31170
31430
  * @example
31171
31431
  * ```ts
31172
- * const importJob = await auth.admin.app("app").endUsers.imports.retrieve("job");
31432
+ * const importJob = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.imports.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31173
31433
  * ```
31174
31434
  */
31175
31435
  retrieve(jobId: string, options?: RequestOptions): APIPromise<WithLastResponse<ImportJob>>;
@@ -31179,6 +31439,9 @@ declare class AppEndUsersInvitesResource extends APIResource {
31179
31439
  /**
31180
31440
  * Pre-allocate an EndUser invite. Dispatches an invitation email via the workspace's Mail sender.
31181
31441
  *
31442
+ * Credential: `workspace_key`.
31443
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31444
+ *
31182
31445
  * @param params - `Auth.EndUserInviteCreateParams`.
31183
31446
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
31184
31447
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown role, or maxUses / expiresInHours out of range.
@@ -31189,13 +31452,16 @@ declare class AppEndUsersInvitesResource extends APIResource {
31189
31452
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-invites
31190
31453
  * @example
31191
31454
  * ```ts
31192
- * const endUserInvite = await auth.admin.app("app").endUsers.invites.create({ email: "alice@example.com" });
31455
+ * const endUserInvite = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.create({ email: "alice@example.com" });
31193
31456
  * ```
31194
31457
  */
31195
31458
  create(params: EndUserInviteCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserInvite>>;
31196
31459
  /**
31197
31460
  * Revoke an EndUser invite (soft-delete).
31198
31461
  *
31462
+ * Credential: `workspace_key`.
31463
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31464
+ *
31199
31465
  * @param inviteId - Id of the invite.
31200
31466
  * @param options - Per-request options.
31201
31467
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31206,13 +31472,16 @@ declare class AppEndUsersInvitesResource extends APIResource {
31206
31472
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-end-users-invites-invite-id
31207
31473
  * @example
31208
31474
  * ```ts
31209
- * await auth.admin.app("app").endUsers.invites.delete("invite");
31475
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31210
31476
  * ```
31211
31477
  */
31212
31478
  delete(inviteId: string, options?: RequestOptions): APIPromise<void>;
31213
31479
  /**
31214
31480
  * List EndUser invites for this app, newest first. Filter by `?status=`.
31215
31481
  *
31482
+ * Credential: `workspace_key`.
31483
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31484
+ *
31216
31485
  * @param params - `Auth.EndUserInviteListParams`.
31217
31486
  * @param options - Per-request options.
31218
31487
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` value.
@@ -31222,10 +31491,10 @@ declare class AppEndUsersInvitesResource extends APIResource {
31222
31491
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-invites
31223
31492
  * @example
31224
31493
  * ```ts
31225
- * for await (const invite of auth.admin.app("app").endUsers.invites.list()) {
31494
+ * for await (const invite of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.list()) {
31226
31495
  * console.log(invite);
31227
31496
  * }
31228
- * const page = await auth.admin.app("app").endUsers.invites.list({}, { timeout: 5_000 });
31497
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.invites.list({}, { timeout: 5_000 });
31229
31498
  * ```
31230
31499
  */
31231
31500
  list(params?: EndUserInviteListParams, options?: RequestOptions): PagePromise<EndUserInvite>;
@@ -31237,6 +31506,9 @@ declare class AppEndUsersMfaResource extends APIResource {
31237
31506
  *
31238
31507
  * Disables every enabled factor on the account, destroys its recovery codes, and revokes every live session. The next sign-in on an app running `auth_config.mfa: "required"` returns `mfa_enrollment_required` and the user must enrol a new factor before a session is minted. On an app running `mfa: "optional"` the user simply ends up with no MFA, which is the pre-existing meaning of deleting their factors. All three steps matter: leaving the recovery codes alive would let whoever holds the old printout complete `/auth/mfa/recover` and skip enrolment entirely. Audited, and emits `user.mfa.factor_disabled` per factor plus one `user.mfa.reenrollment_required`. Idempotent.
31239
31508
  *
31509
+ * Credential: `workspace_key`.
31510
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31511
+ *
31240
31512
  * @param userId - Id of the user.
31241
31513
  * @param options - Per-request options.
31242
31514
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -31247,7 +31519,7 @@ declare class AppEndUsersMfaResource extends APIResource {
31247
31519
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-mfa-require-reenrollment
31248
31520
  * @example
31249
31521
  * ```ts
31250
- * const requireMfaReenrollment = await auth.admin.app("app").endUsers.mfa.requireReenrollment("user");
31522
+ * const requireMfaReenrollment = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.mfa.requireReenrollment("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31251
31523
  * ```
31252
31524
  */
31253
31525
  requireReenrollment(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<RequireMfaReenrollment>>;
@@ -31257,6 +31529,9 @@ declare class AppEndUsersSessionsResource extends APIResource {
31257
31529
  /**
31258
31530
  * Revoke every active session for an end-user.
31259
31531
  *
31532
+ * Credential: `workspace_key`.
31533
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31534
+ *
31260
31535
  * @param userId - Id of the user.
31261
31536
  * @param options - Per-request options.
31262
31537
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31267,7 +31542,7 @@ declare class AppEndUsersSessionsResource extends APIResource {
31267
31542
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-sessions-revoke-all
31268
31543
  * @example
31269
31544
  * ```ts
31270
- * await auth.admin.app("app").endUsers.sessions.revokeAll("user");
31545
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.sessions.revokeAll("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31271
31546
  * ```
31272
31547
  */
31273
31548
  revokeAll(userId: string, options?: RequestOptions): APIPromise<void>;
@@ -31285,6 +31560,9 @@ declare class AppEndUsersResource extends APIResource {
31285
31560
  *
31286
31561
  * Deletes every matched account in one transaction. Each deleted account gets an `auth.account.deleted` audit row (`via: platform_bulk`) whose metadata carries the `selection` (`{ mode: "ids" }`, or `{ mode: "filter", filter }`), so a filter sweep reads as one. The workspace audit log gets one `auth.end_users.deleted` row with the count. `user.deleted` (`via: "platform_bulk"`) fires per account only when 100 or fewer were deleted.
31287
31562
  *
31563
+ * Credential: `workspace_key`.
31564
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31565
+ *
31288
31566
  * @param params - `Auth.EndUserBulkDeleteParams`.
31289
31567
  * @param options - Per-request options.
31290
31568
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body, or an unfiltered selection without `confirm_all_in_app: true` (including more than 5,000 ids).
@@ -31296,13 +31574,16 @@ declare class AppEndUsersResource extends APIResource {
31296
31574
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-delete
31297
31575
  * @example
31298
31576
  * ```ts
31299
- * const bulkAffectedUsers = await auth.admin.app("app").endUsers.bulkDelete({ selection: { mode: "ids" } });
31577
+ * const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkDelete({ selection: { mode: "ids" } });
31300
31578
  * ```
31301
31579
  */
31302
31580
  bulkDelete(params: EndUserBulkDeleteParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
31303
31581
  /**
31304
31582
  * Bulk-revoke sessions across a selection.
31305
31583
  *
31584
+ * Credential: `workspace_key`.
31585
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31586
+ *
31306
31587
  * @param params - `Auth.EndUserBulkRevokeSessionsParams`.
31307
31588
  * @param options - Per-request options.
31308
31589
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body (including more than 5,000 ids).
@@ -31314,13 +31595,16 @@ declare class AppEndUsersResource extends APIResource {
31314
31595
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-revoke-sessions
31315
31596
  * @example
31316
31597
  * ```ts
31317
- * const bulkAffectedUsers = await auth.admin.app("app").endUsers.bulkRevokeSessions({ selection: { mode: "ids" } });
31598
+ * const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkRevokeSessions({ selection: { mode: "ids" } });
31318
31599
  * ```
31319
31600
  */
31320
31601
  bulkRevokeSessions(params: EndUserBulkRevokeSessionsParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
31321
31602
  /**
31322
31603
  * Bulk-assign a role across a selection.
31323
31604
  *
31605
+ * Credential: `workspace_key`.
31606
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31607
+ *
31324
31608
  * @param params - `Auth.EndUserBulkUpdateRoleParams`.
31325
31609
  * @param options - Per-request options.
31326
31610
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body or empty `roleName`.
@@ -31332,13 +31616,16 @@ declare class AppEndUsersResource extends APIResource {
31332
31616
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-update-role
31333
31617
  * @example
31334
31618
  * ```ts
31335
- * const bulkAffectedUsers = await auth.admin.app("app").endUsers.bulkUpdateRole({ role_name: "string", selection: { mode: "ids" } });
31619
+ * const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkUpdateRole({ role_name: "member", selection: { mode: "ids" } });
31336
31620
  * ```
31337
31621
  */
31338
31622
  bulkUpdateRole(params: EndUserBulkUpdateRoleParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
31339
31623
  /**
31340
31624
  * Bulk-update status across a selection.
31341
31625
  *
31626
+ * Credential: `workspace_key`.
31627
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31628
+ *
31342
31629
  * @param params - `Auth.EndUserBulkUpdateStatusParams`.
31343
31630
  * @param options - Per-request options.
31344
31631
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `selection` body, or `status` is not one of active, suspended, deactivated.
@@ -31350,7 +31637,7 @@ declare class AppEndUsersResource extends APIResource {
31350
31637
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-bulk-update-status
31351
31638
  * @example
31352
31639
  * ```ts
31353
- * const bulkAffectedUsers = await auth.admin.app("app").endUsers.bulkUpdateStatus({ selection: { mode: "ids" }, status: "suspended" });
31640
+ * const bulkAffectedUsers = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.bulkUpdateStatus({ selection: { mode: "ids" }, status: "suspended" });
31354
31641
  * ```
31355
31642
  */
31356
31643
  bulkUpdateStatus(params: EndUserBulkUpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<BulkAffectedUsers>>;
@@ -31359,6 +31646,9 @@ declare class AppEndUsersResource extends APIResource {
31359
31646
  *
31360
31647
  * Removes the account with its contacts, sessions and tenant memberships. Writes one `auth.account.deleted` audit row (`via: platform`) in the same transaction, mirrors the deletion into the workspace audit log as `auth.end_users.deleted`, and fires `user.deleted` with `via: "platform"`.
31361
31648
  *
31649
+ * Credential: `workspace_key`.
31650
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31651
+ *
31362
31652
  * @param userId - Id of the user.
31363
31653
  * @param options - Per-request options.
31364
31654
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31369,7 +31659,7 @@ declare class AppEndUsersResource extends APIResource {
31369
31659
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-end-users-user-id
31370
31660
  * @example
31371
31661
  * ```ts
31372
- * await auth.admin.app("app").endUsers.delete("user");
31662
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31373
31663
  * ```
31374
31664
  */
31375
31665
  delete(userId: string, options?: RequestOptions): APIPromise<void>;
@@ -31378,6 +31668,9 @@ declare class AppEndUsersResource extends APIResource {
31378
31668
  *
31379
31669
  * Streamed in keyset batches — neither the service nor the client holds the whole directory. Ordered oldest-first by `(created_at, id)` so a re-run is stable. Gated on `auth.user.export`, which is escalation class: this hands over every address in the directory in one call, where `auth.list` pages it. Hard cap of 1,000,000 rows; a wider request is refused with 413 before any body is written.
31380
31670
  *
31671
+ * Credential: `workspace_key`.
31672
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31673
+ *
31381
31674
  * @param params - `Auth.EndUserExportParams`.
31382
31675
  * @param options - Per-request options.
31383
31676
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `format`.
@@ -31390,7 +31683,7 @@ declare class AppEndUsersResource extends APIResource {
31390
31683
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-export
31391
31684
  * @example
31392
31685
  * ```ts
31393
- * const response = await auth.admin.app("app").endUsers.export();
31686
+ * const response = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.export();
31394
31687
  * const text = await response.text();
31395
31688
  * ```
31396
31689
  */
@@ -31398,6 +31691,9 @@ declare class AppEndUsersResource extends APIResource {
31398
31691
  /**
31399
31692
  * List end-users in this app (cursor-paginated).
31400
31693
  *
31694
+ * Credential: `workspace_key`.
31695
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31696
+ *
31401
31697
  * @param params - `Auth.EndUserListParams`.
31402
31698
  * @param options - Per-request options.
31403
31699
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `signal` / `sort` / `order`, or a `cursor` minted under a different ordering than the one requested.
@@ -31407,16 +31703,19 @@ declare class AppEndUsersResource extends APIResource {
31407
31703
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users
31408
31704
  * @example
31409
31705
  * ```ts
31410
- * for await (const endUser of auth.admin.app("app").endUsers.list()) {
31706
+ * for await (const endUser of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.list()) {
31411
31707
  * console.log(endUser);
31412
31708
  * }
31413
- * const page = await auth.admin.app("app").endUsers.list({}, { timeout: 5_000 });
31709
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.list({}, { timeout: 5_000 });
31414
31710
  * ```
31415
31711
  */
31416
31712
  list(params?: EndUserListParams, options?: RequestOptions): PagePromise<EndUserSummary>;
31417
31713
  /**
31418
31714
  * Resend verification to the primary email contact.
31419
31715
  *
31716
+ * Credential: `workspace_key`.
31717
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31718
+ *
31420
31719
  * @param userId - Id of the user.
31421
31720
  * @param options - Per-request options.
31422
31721
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31428,13 +31727,16 @@ declare class AppEndUsersResource extends APIResource {
31428
31727
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-end-users-user-id-resend-verification
31429
31728
  * @example
31430
31729
  * ```ts
31431
- * const issuedVerificationCode = await auth.admin.app("app").endUsers.resendVerification("user");
31730
+ * const issuedVerificationCode = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.resendVerification("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31432
31731
  * ```
31433
31732
  */
31434
31733
  resendVerification(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<IssuedVerificationCode>>;
31435
31734
  /**
31436
31735
  * Get one end-user.
31437
31736
  *
31737
+ * Credential: `workspace_key`.
31738
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31739
+ *
31438
31740
  * @param userId - Id of the user.
31439
31741
  * @param options - Per-request options.
31440
31742
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31445,13 +31747,16 @@ declare class AppEndUsersResource extends APIResource {
31445
31747
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-end-users-user-id
31446
31748
  * @example
31447
31749
  * ```ts
31448
- * const endUserSummary = await auth.admin.app("app").endUsers.retrieve("user");
31750
+ * const endUserSummary = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31449
31751
  * ```
31450
31752
  */
31451
31753
  retrieve(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<EndUserSummary>>;
31452
31754
  /**
31453
31755
  * Update end-user display name, primary email, or metadata keys (merged).
31454
31756
  *
31757
+ * Credential: `workspace_key`.
31758
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31759
+ *
31455
31760
  * @param userId - Id of the user.
31456
31761
  * @param params - `Auth.EndUserUpdateParams`.
31457
31762
  * @param options - Per-request options.
@@ -31464,13 +31769,16 @@ declare class AppEndUsersResource extends APIResource {
31464
31769
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-end-users-user-id
31465
31770
  * @example
31466
31771
  * ```ts
31467
- * const endUserSummary = await auth.admin.app("app").endUsers.update("user", { display_name: "string" });
31772
+ * const endUserSummary = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Ada Lovelace" });
31468
31773
  * ```
31469
31774
  */
31470
31775
  update(userId: string, params?: EndUserUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserSummary>>;
31471
31776
  /**
31472
31777
  * Assign an end-user a role.
31473
31778
  *
31779
+ * Credential: `workspace_key`.
31780
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31781
+ *
31474
31782
  * @param userId - Id of the user.
31475
31783
  * @param params - `Auth.EndUserUpdateRoleParams`.
31476
31784
  * @param options - Per-request options.
@@ -31483,13 +31791,16 @@ declare class AppEndUsersResource extends APIResource {
31483
31791
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-end-users-user-id-role
31484
31792
  * @example
31485
31793
  * ```ts
31486
- * const endUserRoleAssignment = await auth.admin.app("app").endUsers.updateRole("user", { role_name: "admin" });
31794
+ * const endUserRoleAssignment = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.updateRole("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "admin" });
31487
31795
  * ```
31488
31796
  */
31489
31797
  updateRole(userId: string, params: EndUserUpdateRoleParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserRoleAssignment>>;
31490
31798
  /**
31491
31799
  * Change end-user status (active / suspended / deactivated).
31492
31800
  *
31801
+ * Credential: `workspace_key`.
31802
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31803
+ *
31493
31804
  * @param userId - Id of the user.
31494
31805
  * @param params - `Auth.EndUserUpdateStatusParams`.
31495
31806
  * @param options - Per-request options.
@@ -31502,7 +31813,7 @@ declare class AppEndUsersResource extends APIResource {
31502
31813
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-end-users-user-id-status
31503
31814
  * @example
31504
31815
  * ```ts
31505
- * const endUserSummary = await auth.admin.app("app").endUsers.updateStatus("user", { status: "suspended" });
31816
+ * const endUserSummary = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.updateStatus("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { status: "suspended" });
31506
31817
  * ```
31507
31818
  */
31508
31819
  updateStatus(userId: string, params: EndUserUpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<EndUserSummary>>;
@@ -31545,6 +31856,9 @@ declare class AppMembersResource extends APIResource {
31545
31856
  /**
31546
31857
  * Remove a member from the app
31547
31858
  *
31859
+ * Credential: `workspace_key`.
31860
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31861
+ *
31548
31862
  * @param accountId - Id of the account.
31549
31863
  * @param options - Per-request options.
31550
31864
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31555,13 +31869,16 @@ declare class AppMembersResource extends APIResource {
31555
31869
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-members-account-id
31556
31870
  * @example
31557
31871
  * ```ts
31558
- * await auth.admin.app("app").members.delete("account");
31872
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").members.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31559
31873
  * ```
31560
31874
  */
31561
31875
  delete(accountId: string, options?: RequestOptions): APIPromise<void>;
31562
31876
  /**
31563
31877
  * List app members (PlatformUser view of EndUser memberships)
31564
31878
  *
31879
+ * Credential: `workspace_key`.
31880
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31881
+ *
31565
31882
  * @param params - `Auth.MemberListParams`.
31566
31883
  * @param options - Per-request options.
31567
31884
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid pagination cursor.
@@ -31573,10 +31890,10 @@ declare class AppMembersResource extends APIResource {
31573
31890
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-members
31574
31891
  * @example
31575
31892
  * ```ts
31576
- * for await (const member of auth.admin.app("app").members.list()) {
31893
+ * for await (const member of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").members.list()) {
31577
31894
  * console.log(member);
31578
31895
  * }
31579
- * const page = await auth.admin.app("app").members.list({}, { timeout: 5_000 });
31896
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").members.list({}, { timeout: 5_000 });
31580
31897
  * ```
31581
31898
  */
31582
31899
  list(params?: MemberListParams, options?: RequestOptions): PagePromise<AppMemberSummary>;
@@ -31594,6 +31911,9 @@ declare class AppNotificationSettingsResource extends APIResource {
31594
31911
  *
31595
31912
  * `effective_sender` is the sender emails actually go out from, checked live in Mail with your own access (the workspace default sender, or the app's custom address).
31596
31913
  *
31914
+ * Credential: `workspace_key`.
31915
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31916
+ *
31597
31917
  * @param options - Per-request options.
31598
31918
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
31599
31919
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -31603,7 +31923,7 @@ declare class AppNotificationSettingsResource extends APIResource {
31603
31923
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-notification-settings
31604
31924
  * @example
31605
31925
  * ```ts
31606
- * const appNotificationSettings = await auth.admin.app("app").notificationSettings.retrieve();
31926
+ * const appNotificationSettings = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").notificationSettings.retrieve();
31607
31927
  * ```
31608
31928
  */
31609
31929
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<AppNotificationSettings>>;
@@ -31612,6 +31932,9 @@ declare class AppNotificationSettingsResource extends APIResource {
31612
31932
  *
31613
31933
  * Turning `notifications_via_envoi` on (from off) creates the default template of every empty slot in the workspace's Mail templates (`auth-verification`, `auth-welcome`, `auth-password-reset`, `auth-invite`, `auth-mfa-code`), reusing a template that already has that name, and fills the slot. Templates are created with your own Mail access; a slot that could not be created stays empty. A slot you clear later is not refilled until emails are switched off and on again.
31614
31934
  *
31935
+ * Credential: `workspace_key`.
31936
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31937
+ *
31615
31938
  * @param params - `Auth.NotificationSettingUpdateParams`.
31616
31939
  * @param options - Per-request options.
31617
31940
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid payload.
@@ -31624,7 +31947,7 @@ declare class AppNotificationSettingsResource extends APIResource {
31624
31947
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-notification-settings
31625
31948
  * @example
31626
31949
  * ```ts
31627
- * const appNotificationSettings = await auth.admin.app("app").notificationSettings.update({ default_sender_address: "ada@example.com" });
31950
+ * const appNotificationSettings = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").notificationSettings.update({ default_sender_address: "ada@example.com" });
31628
31951
  * ```
31629
31952
  */
31630
31953
  update(params?: NotificationSettingUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<AppNotificationSettings>>;
@@ -31636,6 +31959,9 @@ declare class AppNotificationsResource extends APIResource {
31636
31959
  *
31637
31960
  * Sends the slot's real Mail template, with this app's real sender (the workspace default or the custom address) and example values for every variable, to your own verified account address. It cannot be sent anywhere else. It uses your own Mail access, goes through the same send path as real emails, and shows up in Mail > Emails. At most 10 tests per person per hour. Not available to API keys (a key has no inbox).
31638
31961
  *
31962
+ * Credential: `workspace_key`.
31963
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31964
+ *
31639
31965
  * @param slot - The email to test.
31640
31966
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
31641
31967
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `slot`.
@@ -31651,7 +31977,7 @@ declare class AppNotificationsResource extends APIResource {
31651
31977
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-notifications-slot-test
31652
31978
  * @example
31653
31979
  * ```ts
31654
- * const notificationTest = await auth.admin.app("app").notifications.test("slot");
31980
+ * const notificationTest = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").notifications.test("verification");
31655
31981
  * ```
31656
31982
  */
31657
31983
  test(slot: string, options?: RequestOptions): APIPromise<WithLastResponse<NotificationTest>>;
@@ -31663,6 +31989,9 @@ declare class AppPermissionsEnforcementResource extends APIResource {
31663
31989
  *
31664
31990
  * Returns the deduplicated set of permission strings that any handler in this users-api build gates via `@RequireAppPermission`. Drives the console "Enforced" badge — a customer who binds `user.delete` to a role can see whether any route in this deploy actually checks for it. App-agnostic in shape; the path parameter is included for URN symmetry with the rest of the per-app surface, not to narrow the response.
31665
31991
  *
31992
+ * Credential: `workspace_key`.
31993
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
31994
+ *
31666
31995
  * @param options - Per-request options.
31667
31996
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
31668
31997
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -31672,7 +32001,7 @@ declare class AppPermissionsEnforcementResource extends APIResource {
31672
32001
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-permissions-enforcement
31673
32002
  * @example
31674
32003
  * ```ts
31675
- * const enforcedPermissions = await auth.admin.app("app").permissions.enforcement.list();
32004
+ * const enforcedPermissions = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.enforcement.list();
31676
32005
  * ```
31677
32006
  */
31678
32007
  list(options?: RequestOptions): APIPromise<WithLastResponse<EnforcedPermissions>>;
@@ -31684,6 +32013,9 @@ declare class AppPermissionsResource extends APIResource {
31684
32013
  /**
31685
32014
  * Create a custom permission
31686
32015
  *
32016
+ * Credential: `workspace_key`.
32017
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32018
+ *
31687
32019
  * @param params - `Auth.AppScopedPermissionCreateParams`.
31688
32020
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
31689
32021
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`resource` / `action` segment format, or `description` over 256 chars).
@@ -31696,13 +32028,16 @@ declare class AppPermissionsResource extends APIResource {
31696
32028
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-permissions
31697
32029
  * @example
31698
32030
  * ```ts
31699
- * const permission = await auth.admin.app("app").permissions.create({ action: "read", resource: "project" });
32031
+ * const permission = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.create({ action: "read", resource: "project" });
31700
32032
  * ```
31701
32033
  */
31702
32034
  create(params: AppScopedPermissionCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Permission>>;
31703
32035
  /**
31704
32036
  * Delete a custom permission
31705
32037
  *
32038
+ * Credential: `workspace_key`.
32039
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32040
+ *
31706
32041
  * @param permissionKey - Permission key, `resource.action` (e.g. `invoice.read`).
31707
32042
  * @param options - Per-request options.
31708
32043
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `permissionKey` is not in `resource.action` format.
@@ -31714,13 +32049,16 @@ declare class AppPermissionsResource extends APIResource {
31714
32049
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-permissions-permission-key
31715
32050
  * @example
31716
32051
  * ```ts
31717
- * await auth.admin.app("app").permissions.delete("permission_key");
32052
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.delete("invoice.read");
31718
32053
  * ```
31719
32054
  */
31720
32055
  delete(permissionKey: string, options?: RequestOptions): APIPromise<void>;
31721
32056
  /**
31722
32057
  * List all permissions (system + custom)
31723
32058
  *
32059
+ * Credential: `workspace_key`.
32060
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32061
+ *
31724
32062
  * @param options - Per-request options.
31725
32063
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
31726
32064
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -31730,7 +32068,7 @@ declare class AppPermissionsResource extends APIResource {
31730
32068
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-permissions
31731
32069
  * @example
31732
32070
  * ```ts
31733
- * const result = await auth.admin.app("app").permissions.list();
32071
+ * const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").permissions.list();
31734
32072
  * ```
31735
32073
  */
31736
32074
  list(options?: RequestOptions): APIPromise<WithLastResponse<AppScopedPermissionListResponse>>;
@@ -31740,6 +32078,9 @@ declare class AppRolesPermissionsResource extends APIResource {
31740
32078
  /**
31741
32079
  * List all available permissions
31742
32080
  *
32081
+ * Credential: `workspace_key`.
32082
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32083
+ *
31743
32084
  * @param options - Per-request options.
31744
32085
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
31745
32086
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -31749,7 +32090,7 @@ declare class AppRolesPermissionsResource extends APIResource {
31749
32090
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-roles-permissions
31750
32091
  * @example
31751
32092
  * ```ts
31752
- * const result = await auth.admin.app("app").roles.permissions.list();
32093
+ * const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.permissions.list();
31753
32094
  * ```
31754
32095
  */
31755
32096
  list(options?: RequestOptions): APIPromise<WithLastResponse<RolePermissionListResponse>>;
@@ -31761,6 +32102,9 @@ declare class AppRolesResource extends APIResource {
31761
32102
  /**
31762
32103
  * Assign a role to a user
31763
32104
  *
32105
+ * Credential: `workspace_key`.
32106
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32107
+ *
31764
32108
  * @param params - `Auth.RoleAssignParams`.
31765
32109
  * @param options - Per-request options.
31766
32110
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`accountId` not a UUID, or `role` empty / over 64 chars).
@@ -31772,13 +32116,16 @@ declare class AppRolesResource extends APIResource {
31772
32116
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-roles-assign
31773
32117
  * @example
31774
32118
  * ```ts
31775
- * const appMembership = await auth.admin.app("app").roles.assign({ account_id: "string", role: "admin" });
32119
+ * const appMembership = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.assign({ account_id: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", role: "admin" });
31776
32120
  * ```
31777
32121
  */
31778
32122
  assign(params: RoleAssignParams, options?: RequestOptions): APIPromise<WithLastResponse<AppMembership>>;
31779
32123
  /**
31780
32124
  * Create a new role (no permissions yet — set them via PUT /:roleName/permissions)
31781
32125
  *
32126
+ * Credential: `workspace_key`.
32127
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32128
+ *
31782
32129
  * @param params - `Auth.AppScopedRoleCreateParams`.
31783
32130
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
31784
32131
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`name` 1-64 chars, `description` up to 256).
@@ -31791,13 +32138,16 @@ declare class AppRolesResource extends APIResource {
31791
32138
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-roles
31792
32139
  * @example
31793
32140
  * ```ts
31794
- * const role = await auth.admin.app("app").roles.create({ name: "editor" });
32141
+ * const role = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.create({ name: "editor" });
31795
32142
  * ```
31796
32143
  */
31797
32144
  create(params: AppScopedRoleCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Role>>;
31798
32145
  /**
31799
32146
  * Delete a custom role
31800
32147
  *
32148
+ * Credential: `workspace_key`.
32149
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32150
+ *
31801
32151
  * @param roleName - Name of the role (e.g. `admin`).
31802
32152
  * @param options - Per-request options.
31803
32153
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31809,13 +32159,16 @@ declare class AppRolesResource extends APIResource {
31809
32159
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-roles-role-name
31810
32160
  * @example
31811
32161
  * ```ts
31812
- * await auth.admin.app("app").roles.delete("role_name");
32162
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.delete("admin");
31813
32163
  * ```
31814
32164
  */
31815
32165
  delete(roleName: string, options?: RequestOptions): APIPromise<void>;
31816
32166
  /**
31817
32167
  * List all roles in an app. Filter by `?search=` on the role name.
31818
32168
  *
32169
+ * Credential: `workspace_key`.
32170
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32171
+ *
31819
32172
  * @param params - `Auth.AppScopedRoleListParams`.
31820
32173
  * @param options - Per-request options.
31821
32174
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
@@ -31827,16 +32180,19 @@ declare class AppRolesResource extends APIResource {
31827
32180
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-roles
31828
32181
  * @example
31829
32182
  * ```ts
31830
- * for await (const role of auth.admin.app("app").roles.list()) {
32183
+ * for await (const role of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.list()) {
31831
32184
  * console.log(role);
31832
32185
  * }
31833
- * const page = await auth.admin.app("app").roles.list({}, { timeout: 5_000 });
32186
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.list({}, { timeout: 5_000 });
31834
32187
  * ```
31835
32188
  */
31836
32189
  list(params?: AppScopedRoleListParams, options?: RequestOptions): PagePromise<Role>;
31837
32190
  /**
31838
32191
  * Get role details with permissions
31839
32192
  *
32193
+ * Credential: `workspace_key`.
32194
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32195
+ *
31840
32196
  * @param roleName - Name of the role (e.g. `admin`).
31841
32197
  * @param options - Per-request options.
31842
32198
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -31847,13 +32203,16 @@ declare class AppRolesResource extends APIResource {
31847
32203
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-roles-role-name
31848
32204
  * @example
31849
32205
  * ```ts
31850
- * const roleWithPermissions = await auth.admin.app("app").roles.retrieve("role_name");
32206
+ * const roleWithPermissions = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.retrieve("admin");
31851
32207
  * ```
31852
32208
  */
31853
32209
  retrieve(roleName: string, options?: RequestOptions): APIPromise<WithLastResponse<RoleWithPermissions>>;
31854
32210
  /**
31855
32211
  * Update role name or description
31856
32212
  *
32213
+ * Credential: `workspace_key`.
32214
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32215
+ *
31857
32216
  * @param roleName - Name of the role (e.g. `admin`).
31858
32217
  * @param params - `Auth.AppScopedRoleUpdateParams`.
31859
32218
  * @param options - Per-request options.
@@ -31866,13 +32225,16 @@ declare class AppRolesResource extends APIResource {
31866
32225
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-roles-role-name
31867
32226
  * @example
31868
32227
  * ```ts
31869
- * const role = await auth.admin.app("app").roles.update("role_name", { description: "Updated description" });
32228
+ * const role = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.update("admin", { description: "Updated description" });
31870
32229
  * ```
31871
32230
  */
31872
32231
  update(roleName: string, params?: AppScopedRoleUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<Role>>;
31873
32232
  /**
31874
32233
  * Set permissions for a role (caller-narrowed: caller must hold every requested permission)
31875
32234
  *
32235
+ * Credential: `workspace_key`.
32236
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32237
+ *
31876
32238
  * @param roleName - Name of the role (e.g. `admin`).
31877
32239
  * @param params - `Auth.AppScopedRoleUpdatePermissionsParams`.
31878
32240
  * @param options - Per-request options.
@@ -31885,7 +32247,7 @@ declare class AppRolesResource extends APIResource {
31885
32247
  * @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-roles-role-name-permissions
31886
32248
  * @example
31887
32249
  * ```ts
31888
- * const result = await auth.admin.app("app").roles.updatePermissions("role_name", { permissions: ["user.read", "role.create"] });
32250
+ * const result = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").roles.updatePermissions("admin", { permissions: ["user.read", "role.create"] });
31889
32251
  * ```
31890
32252
  */
31891
32253
  updatePermissions(roleName: string, params: AppScopedRoleUpdatePermissionsParams, options?: RequestOptions): APIPromise<WithLastResponse<AppScopedRoleUpdatePermissionsResponse>>;
@@ -31915,6 +32277,9 @@ declare class AppSetupStatusResource extends APIResource {
31915
32277
  *
31916
32278
  * Rows, in order: `signups` (attention while sign-ups are off), `redirect_origins` (blocked until at least one site may start sign-in), one `provider_<id>` row per switched-on sign-in provider (blocked while its status is blocked), `email` (sender chosen and a template for every email; attention while emails are off), `api_key` (attention until an active app key exists), `webhook` (attention until an endpoint has accepted a delivery), and `passkeys` (only while passkeys are on; blocked when no allowed redirect origin is on the passkey site). `complete` is true once no row is `not_set` or `blocked`. Each `fix.href` is a console path to the exact setting. Computed on every request from stored settings, plus the workspace default sender read from Mail with your own access when emails use it: nothing here calls DNS or a sign-in provider (a provider whose last credential check was rejected shows as blocked). A ready provider row carries `test.action: sign_in.try`: run it with `POST /v1/apps/{appId}/sign-in-tests` `{ method: "oauth", provider }`.
31917
32279
  *
32280
+ * Credential: `workspace_key`.
32281
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32282
+ *
31918
32283
  * @param options - Per-request options.
31919
32284
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
31920
32285
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -31924,7 +32289,7 @@ declare class AppSetupStatusResource extends APIResource {
31924
32289
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-setup-status
31925
32290
  * @example
31926
32291
  * ```ts
31927
- * const setupStatus = await auth.admin.app("app").setupStatus.retrieve();
32292
+ * const setupStatus = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").setupStatus.retrieve();
31928
32293
  * ```
31929
32294
  */
31930
32295
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<SetupStatus>>;
@@ -31936,6 +32301,9 @@ declare class AppSignInTestsResource extends APIResource {
31936
32301
  *
31937
32302
  * For `oauth`, the server first checks what it can on its own (an allowed redirect origin, saved credentials, and the provider credential check). If one fails, the test comes back `failed` at once with the fix. Otherwise open `start_url` in a popup: the person signs in at the provider, the provider returns to Auth, Auth resolves who it is exactly as a real sign-in would, records `would_sign_in_existing` or `would_create` (or the provider error mapped to its fix), creates no account and issues no token, then sends the popup to the console result page. Poll `GET …/sign-in-tests/{id}` until `state` is not `pending`. Works with a provider that is saved but not switched on yet. For `password` / `otp`, the test runs now: it checks the sign-up or sign-in rules for your own email and sends the real email to your own verified address. At most 20 tests per app per hour; tests are deleted after 24 hours.
31938
32303
  *
32304
+ * Credential: `workspace_key`.
32305
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32306
+ *
31939
32307
  * @param params - `Auth.SignInTestCreateParams`.
31940
32308
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
31941
32309
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, CUSTOM_DOMAIN_OAUTH_ONLY: Unknown `method` or provider, `provider` missing for `oauth`, or `custom_domain` on a `password` / `otp` test (`CUSTOM_DOMAIN_OAUTH_ONLY`).
@@ -31948,7 +32316,7 @@ declare class AppSignInTestsResource extends APIResource {
31948
32316
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-sign-in-tests
31949
32317
  * @example
31950
32318
  * ```ts
31951
- * const signInTest = await auth.admin.app("app").signInTests.create({ method: "oauth" });
32319
+ * const signInTest = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").signInTests.create({ method: "oauth" });
31952
32320
  * ```
31953
32321
  */
31954
32322
  create(params: SignInTestCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<SignInTest>>;
@@ -31957,6 +32325,9 @@ declare class AppSignInTestsResource extends APIResource {
31957
32325
  *
31958
32326
  * Poll this after opening `start_url`. `state` turns `succeeded` (with `outcome` and `identity`) or `failed` (with `error.fix`). A test that is never finished turns `failed` with code `expired` 15 minutes after it was created.
31959
32327
  *
32328
+ * Credential: `workspace_key`.
32329
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32330
+ *
31960
32331
  * @param testId - Id of the test.
31961
32332
  * @param options - Per-request options.
31962
32333
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `testId` is not a UUID.
@@ -31968,7 +32339,7 @@ declare class AppSignInTestsResource extends APIResource {
31968
32339
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-sign-in-tests-test-id
31969
32340
  * @example
31970
32341
  * ```ts
31971
- * const signInTest = await auth.admin.app("app").signInTests.retrieve("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
32342
+ * const signInTest = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").signInTests.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
31972
32343
  * ```
31973
32344
  */
31974
32345
  retrieve(testId: string, options?: RequestOptions): APIPromise<WithLastResponse<SignInTest>>;
@@ -31980,6 +32351,9 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
31980
32351
  *
31981
32352
  * Includes the platform kill switch `suspended`. Requires `auth.read` on the app.
31982
32353
  *
32354
+ * Credential: `workspace_key`.
32355
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32356
+ *
31983
32357
  * @param options - Per-request options.
31984
32358
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
31985
32359
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app.
@@ -31989,7 +32363,7 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
31989
32363
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenant-api-keys-config
31990
32364
  * @example
31991
32365
  * ```ts
31992
- * const tenantApiKeysConfig = await auth.admin.app("app").tenantApiKeys.config.retrieve();
32366
+ * const tenantApiKeysConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.config.retrieve();
31993
32367
  * ```
31994
32368
  */
31995
32369
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
@@ -31998,6 +32372,9 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
31998
32372
  *
31999
32373
  * Fields you leave out keep their stored value. `suspended: true` is the kill switch: introspection answers `{"active": false}` for every key of the app at once, and key management is refused, until you set it back to `false`. The app's own config push (`PUT /:appSlug/v1/tenant-api-keys/config`) can never change it. Requires `auth.update` on the app.
32000
32374
  *
32375
+ * Credential: `workspace_key`.
32376
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32377
+ *
32001
32378
  * @param params - `Auth.AppScopedTenantApiKeyConfigUpdateParams`.
32002
32379
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
32003
32380
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, TENANT_API_KEYS_SCOPE_INVALID, TENANT_API_KEYS_UNKNOWN_ROLE, TENANT_API_KEY_EXPIRY_INVALID, TENANT_API_KEYS_NO_SCOPES: `VALIDATION_ERROR`, `TENANT_API_KEYS_SCOPE_INVALID`, `TENANT_API_KEYS_UNKNOWN_ROLE`, `TENANT_API_KEY_EXPIRY_INVALID`, `TENANT_API_KEYS_NO_SCOPES`, or a malformed `Idempotency-Key`.
@@ -32010,7 +32387,7 @@ declare class AppTenantApiKeysConfigResource extends APIResource {
32010
32387
  * @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-tenant-api-keys-config
32011
32388
  * @example
32012
32389
  * ```ts
32013
- * const tenantApiKeysConfig = await auth.admin.app("app").tenantApiKeys.config.update({ default_expiry_days: 7 });
32390
+ * const tenantApiKeysConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.config.update({ default_expiry_days: 7 });
32014
32391
  * ```
32015
32392
  */
32016
32393
  update(params?: AppScopedTenantApiKeyConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
@@ -32024,6 +32401,9 @@ declare class AppTenantApiKeysResource extends APIResource {
32024
32401
  *
32025
32402
  * Immediate and final; recorded as revoked by you (`revoked_by_type: platform_user`) in the key and in the audit log. Idempotent: revoking a revoked key is a 204 that changes nothing. Requires `auth.revoke` on the app.
32026
32403
  *
32404
+ * Credential: `workspace_key`.
32405
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32406
+ *
32027
32407
  * @param keyId - Key id (UUID) or display id (`tak_…`).
32028
32408
  * @param options - Per-request options.
32029
32409
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -32034,7 +32414,7 @@ declare class AppTenantApiKeysResource extends APIResource {
32034
32414
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenant-api-keys-key-id
32035
32415
  * @example
32036
32416
  * ```ts
32037
- * await auth.admin.app("app").tenantApiKeys.delete("key");
32417
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32038
32418
  * ```
32039
32419
  */
32040
32420
  delete(keyId: string, options?: RequestOptions): APIPromise<void>;
@@ -32043,6 +32423,9 @@ declare class AppTenantApiKeysResource extends APIResource {
32043
32423
  *
32044
32424
  * Every tenant of the app, newest first, cursor-paginated (20 per page, max 100). Secrets are never returned. Each key names its creator (`created_by`), and its `status` is `orphaned` when it is neither revoked nor expired but its creator left the tenant or the tenant is not active (introspection refuses it). Requires `auth.read` on the app.
32045
32425
  *
32426
+ * Credential: `workspace_key`.
32427
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32428
+ *
32046
32429
  * @param params - `Auth.AppScopedTenantApiKeyListParams`.
32047
32430
  * @param options - Per-request options.
32048
32431
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` or malformed `cursor`.
@@ -32054,10 +32437,10 @@ declare class AppTenantApiKeysResource extends APIResource {
32054
32437
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenant-api-keys
32055
32438
  * @example
32056
32439
  * ```ts
32057
- * for await (const tenantApiKey of auth.admin.app("app").tenantApiKeys.list()) {
32440
+ * for await (const tenantApiKey of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.list()) {
32058
32441
  * console.log(tenantApiKey);
32059
32442
  * }
32060
- * const page = await auth.admin.app("app").tenantApiKeys.list({}, { timeout: 5_000 });
32443
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenantApiKeys.list({}, { timeout: 5_000 });
32061
32444
  * ```
32062
32445
  */
32063
32446
  list(params?: AppScopedTenantApiKeyListParams, options?: RequestOptions): PagePromise<PlatformTenantApiKey>;
@@ -32067,6 +32450,9 @@ declare class AppTenantsInvitesResource extends APIResource {
32067
32450
  /**
32068
32451
  * Invite an email address into a tenant. Returns the plaintext code once; only its SHA-256 digest is stored.
32069
32452
  *
32453
+ * Credential: `workspace_key`.
32454
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32455
+ *
32070
32456
  * @param tenantId - Id of the tenant.
32071
32457
  * @param params - `Auth.AppScopedTenantInviteCreateParams`.
32072
32458
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -32079,13 +32465,16 @@ declare class AppTenantsInvitesResource extends APIResource {
32079
32465
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-tenants-tenant-id-invites
32080
32466
  * @example
32081
32467
  * ```ts
32082
- * const createTenantInvite = await auth.admin.app("app").tenants.invites.create("tenant", { email: "alice@example.com", role_name: "member" });
32468
+ * const createTenantInvite = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { email: "alice@example.com", role_name: "member" });
32083
32469
  * ```
32084
32470
  */
32085
32471
  create(tenantId: string, params: AppScopedTenantInviteCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CreateTenantInvite>>;
32086
32472
  /**
32087
32473
  * Revoke a pending invite. Idempotent — a second revoke is a 204 no-op and fires no second webhook.
32088
32474
  *
32475
+ * Credential: `workspace_key`.
32476
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32477
+ *
32089
32478
  * @param tenantId - Id of the tenant.
32090
32479
  * @param inviteId - Id of the invite.
32091
32480
  * @param options - Per-request options.
@@ -32096,13 +32485,16 @@ declare class AppTenantsInvitesResource extends APIResource {
32096
32485
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenants-tenant-id-invites-invite-id
32097
32486
  * @example
32098
32487
  * ```ts
32099
- * await auth.admin.app("app").tenants.invites.delete("tenant", "invite");
32488
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32100
32489
  * ```
32101
32490
  */
32102
32491
  delete(tenantId: string, inviteId: string, options?: RequestOptions): APIPromise<void>;
32103
32492
  /**
32104
32493
  * List a tenant's invites, newest first. Optional `?status=pending|revoked|expired|used`. Codes are never returned.
32105
32494
  *
32495
+ * Credential: `workspace_key`.
32496
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32497
+ *
32106
32498
  * @param tenantId - Id of the tenant.
32107
32499
  * @param params - `Auth.AppScopedTenantInviteListParams`.
32108
32500
  * @param options - Per-request options.
@@ -32114,10 +32506,10 @@ declare class AppTenantsInvitesResource extends APIResource {
32114
32506
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants-tenant-id-invites
32115
32507
  * @example
32116
32508
  * ```ts
32117
- * for await (const invite of auth.admin.app("app").tenants.invites.list("tenant")) {
32509
+ * for await (const invite of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
32118
32510
  * console.log(invite);
32119
32511
  * }
32120
- * const page = await auth.admin.app("app").tenants.invites.list("tenant", {}, { timeout: 5_000 });
32512
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
32121
32513
  * ```
32122
32514
  */
32123
32515
  list(tenantId: string, params?: AppScopedTenantInviteListParams, options?: RequestOptions): PagePromise<TenantInvite>;
@@ -32127,6 +32519,9 @@ declare class AppTenantsMembersResource extends APIResource {
32127
32519
  /**
32128
32520
  * Add a member to a tenant.
32129
32521
  *
32522
+ * Credential: `workspace_key`.
32523
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32524
+ *
32130
32525
  * @param tenantId - Id of the tenant.
32131
32526
  * @param params - `Auth.AppScopedTenantMemberCreateParams`.
32132
32527
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -32140,13 +32535,16 @@ declare class AppTenantsMembersResource extends APIResource {
32140
32535
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-tenants-tenant-id-members
32141
32536
  * @example
32142
32537
  * ```ts
32143
- * const addMember = await auth.admin.app("app").tenants.members.create("tenant", { role_name: "member" });
32538
+ * const addMember = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "member" });
32144
32539
  * ```
32145
32540
  */
32146
32541
  create(tenantId: string, params: AppScopedTenantMemberCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<AddMember>>;
32147
32542
  /**
32148
32543
  * Remove a member from a tenant.
32149
32544
  *
32545
+ * Credential: `workspace_key`.
32546
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32547
+ *
32150
32548
  * @param tenantId - Id of the tenant.
32151
32549
  * @param accountId - Id of the account.
32152
32550
  * @param options - Per-request options.
@@ -32158,13 +32556,16 @@ declare class AppTenantsMembersResource extends APIResource {
32158
32556
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenants-tenant-id-members-account-id
32159
32557
  * @example
32160
32558
  * ```ts
32161
- * await auth.admin.app("app").tenants.members.delete("tenant", "account");
32559
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32162
32560
  * ```
32163
32561
  */
32164
32562
  delete(tenantId: string, accountId: string, options?: RequestOptions): APIPromise<void>;
32165
32563
  /**
32166
32564
  * List members of a tenant, newest membership first. Filter by `?search=` and/or `?role=`.
32167
32565
  *
32566
+ * Credential: `workspace_key`.
32567
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32568
+ *
32168
32569
  * @param tenantId - Id of the tenant.
32169
32570
  * @param params - `Auth.AppScopedTenantMemberListParams`.
32170
32571
  * @param options - Per-request options.
@@ -32177,16 +32578,19 @@ declare class AppTenantsMembersResource extends APIResource {
32177
32578
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants-tenant-id-members
32178
32579
  * @example
32179
32580
  * ```ts
32180
- * for await (const member of auth.admin.app("app").tenants.members.list("tenant")) {
32581
+ * for await (const member of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
32181
32582
  * console.log(member);
32182
32583
  * }
32183
- * const page = await auth.admin.app("app").tenants.members.list("tenant", {}, { timeout: 5_000 });
32584
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
32184
32585
  * ```
32185
32586
  */
32186
32587
  list(tenantId: string, params?: AppScopedTenantMemberListParams, options?: RequestOptions): PagePromise<TenantMembership>;
32187
32588
  /**
32188
32589
  * Change a member's role inside a tenant.
32189
32590
  *
32591
+ * Credential: `workspace_key`.
32592
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32593
+ *
32190
32594
  * @param tenantId - Id of the tenant.
32191
32595
  * @param accountId - Id of the account.
32192
32596
  * @param params - `Auth.AppScopedTenantMemberUpdateParams`.
@@ -32200,7 +32604,7 @@ declare class AppTenantsMembersResource extends APIResource {
32200
32604
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-tenants-tenant-id-members-account-id
32201
32605
  * @example
32202
32606
  * ```ts
32203
- * const tenantMembership = await auth.admin.app("app").tenants.members.update("tenant", "account", { role_name: "admin" });
32607
+ * const tenantMembership = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "admin" });
32204
32608
  * ```
32205
32609
  */
32206
32610
  update(tenantId: string, accountId: string, params: AppScopedTenantMemberUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantMembership>>;
@@ -32213,6 +32617,9 @@ declare class AppTenantsResource extends APIResource {
32213
32617
  /**
32214
32618
  * Create a tenant in this app. Auth-admin lane; requires auth.tenant.create on the app URN.
32215
32619
  *
32620
+ * Credential: `workspace_key`.
32621
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32622
+ *
32216
32623
  * @param params - `Auth.AppScopedTenantCreateParams`.
32217
32624
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
32218
32625
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid body, empty `displayName`, or `slug` not 1-64 chars of [a-z0-9-].
@@ -32225,13 +32632,16 @@ declare class AppTenantsResource extends APIResource {
32225
32632
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-tenants
32226
32633
  * @example
32227
32634
  * ```ts
32228
- * const tenant = await auth.admin.app("app").tenants.create({ display_name: "Acme Co" });
32635
+ * const tenant = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.create({ display_name: "Acme Co" });
32229
32636
  * ```
32230
32637
  */
32231
32638
  create(params: AppScopedTenantCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<Tenant>>;
32232
32639
  /**
32233
32640
  * Delete a tenant.
32234
32641
  *
32642
+ * Credential: `workspace_key`.
32643
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32644
+ *
32235
32645
  * @param tenantId - Id of the tenant.
32236
32646
  * @param options - Per-request options.
32237
32647
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -32242,13 +32652,16 @@ declare class AppTenantsResource extends APIResource {
32242
32652
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-tenants-tenant-id
32243
32653
  * @example
32244
32654
  * ```ts
32245
- * await auth.admin.app("app").tenants.delete("tenant");
32655
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32246
32656
  * ```
32247
32657
  */
32248
32658
  delete(tenantId: string, options?: RequestOptions): APIPromise<void>;
32249
32659
  /**
32250
32660
  * List tenants in this app, paginated by created_at desc.
32251
32661
  *
32662
+ * Credential: `workspace_key`.
32663
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32664
+ *
32252
32665
  * @param params - `Auth.AppScopedTenantListParams`.
32253
32666
  * @param options - Per-request options.
32254
32667
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` value.
@@ -32260,16 +32673,19 @@ declare class AppTenantsResource extends APIResource {
32260
32673
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants
32261
32674
  * @example
32262
32675
  * ```ts
32263
- * for await (const tenant of auth.admin.app("app").tenants.list()) {
32676
+ * for await (const tenant of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.list()) {
32264
32677
  * console.log(tenant);
32265
32678
  * }
32266
- * const page = await auth.admin.app("app").tenants.list({}, { timeout: 5_000 });
32679
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.list({}, { timeout: 5_000 });
32267
32680
  * ```
32268
32681
  */
32269
32682
  list(params?: AppScopedTenantListParams, options?: RequestOptions): PagePromise<Tenant>;
32270
32683
  /**
32271
32684
  * Get a single tenant by id or display id.
32272
32685
  *
32686
+ * Credential: `workspace_key`.
32687
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32688
+ *
32273
32689
  * @param tenantId - Id of the tenant.
32274
32690
  * @param options - Per-request options.
32275
32691
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -32280,13 +32696,16 @@ declare class AppTenantsResource extends APIResource {
32280
32696
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-tenants-tenant-id
32281
32697
  * @example
32282
32698
  * ```ts
32283
- * const tenant = await auth.admin.app("app").tenants.retrieve("tenant");
32699
+ * const tenant = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32284
32700
  * ```
32285
32701
  */
32286
32702
  retrieve(tenantId: string, options?: RequestOptions): APIPromise<WithLastResponse<Tenant>>;
32287
32703
  /**
32288
32704
  * Update a tenant (display_name, slug, status, metadata).
32289
32705
  *
32706
+ * Credential: `workspace_key`.
32707
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32708
+ *
32290
32709
  * @param tenantId - Id of the tenant.
32291
32710
  * @param params - `Auth.AppScopedTenantUpdateParams`.
32292
32711
  * @param options - Per-request options.
@@ -32300,7 +32719,7 @@ declare class AppTenantsResource extends APIResource {
32300
32719
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-tenants-tenant-id
32301
32720
  * @example
32302
32721
  * ```ts
32303
- * const tenant = await auth.admin.app("app").tenants.update("tenant", { display_name: "string" });
32722
+ * const tenant = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Acme Inc" });
32304
32723
  * ```
32305
32724
  */
32306
32725
  update(tenantId: string, params?: AppScopedTenantUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<Tenant>>;
@@ -32310,6 +32729,9 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
32310
32729
  /**
32311
32730
  * Get the unverified-account expiry setting and how many accounts it deleted in the last 30 days.
32312
32731
  *
32732
+ * Credential: `workspace_key`.
32733
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32734
+ *
32313
32735
  * @param options - Per-request options.
32314
32736
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
32315
32737
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -32319,7 +32741,7 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
32319
32741
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-unverified-account-expiry
32320
32742
  * @example
32321
32743
  * ```ts
32322
- * const unverifiedAccountExpiryStatus = await auth.admin.app("app").unverifiedAccountExpiry.retrieve();
32744
+ * const unverifiedAccountExpiryStatus = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").unverifiedAccountExpiry.retrieve();
32323
32745
  * ```
32324
32746
  */
32325
32747
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<UnverifiedAccountExpiryStatus>>;
@@ -32328,6 +32750,9 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
32328
32750
  *
32329
32751
  * Permanently deletes every account that qualifies under the app's `unverified_account_ttl_days`, exactly as the nightly job does: each deletion is audited as `auth.account.expired_unverified` and fires `user.deleted` with `reason: "unverified_expired"`. Use `dry_run: true` to preview.
32330
32752
  *
32753
+ * Credential: `workspace_key`.
32754
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32755
+ *
32331
32756
  * @param params - `Auth.UnverifiedAccountExpiryRunParams`.
32332
32757
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
32333
32758
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure (`min_age_minutes` out of range).
@@ -32341,7 +32766,7 @@ declare class AppUnverifiedAccountExpiryResource extends APIResource {
32341
32766
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-unverified-account-expiry-run
32342
32767
  * @example
32343
32768
  * ```ts
32344
- * const unverifiedAccountExpiryRun = await auth.admin.app("app").unverifiedAccountExpiry.run({ dry_run: false });
32769
+ * const unverifiedAccountExpiryRun = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").unverifiedAccountExpiry.run({ dry_run: false });
32345
32770
  * ```
32346
32771
  */
32347
32772
  run(params?: UnverifiedAccountExpiryRunParams, options?: RequestOptions): APIPromise<WithLastResponse<UnverifiedAccountExpiryRun>>;
@@ -32353,6 +32778,9 @@ declare class AppWebauthnConfigResource extends APIResource {
32353
32778
  *
32354
32779
  * Returns defaults with `enabled: false` and a null `rp_id` when passkeys have never been configured for the app.
32355
32780
  *
32781
+ * Credential: `workspace_key`.
32782
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32783
+ *
32356
32784
  * @param options - Per-request options.
32357
32785
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
32358
32786
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` on this app, or the app is suspended or archived.
@@ -32362,13 +32790,16 @@ declare class AppWebauthnConfigResource extends APIResource {
32362
32790
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webauthn-config
32363
32791
  * @example
32364
32792
  * ```ts
32365
- * const webauthnConfig = await auth.admin.app("app").webauthnConfig.retrieve();
32793
+ * const webauthnConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webauthnConfig.retrieve();
32366
32794
  * ```
32367
32795
  */
32368
32796
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<WebauthnConfig>>;
32369
32797
  /**
32370
32798
  * Set the per-app passkey (WebAuthn) relying-party settings.
32371
32799
  *
32800
+ * Credential: `workspace_key`.
32801
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32802
+ *
32372
32803
  * @param params - `Auth.WebauthnConfigUpdateParams`.
32373
32804
  * @param options - Per-request options.
32374
32805
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `rp_id` is malformed, or is not a registrable suffix of any origin in `allowed_redirect_origins`.
@@ -32380,7 +32811,7 @@ declare class AppWebauthnConfigResource extends APIResource {
32380
32811
  * @see https://productcraft.co/docs/auth/api-reference#put-v1-apps-app-id-webauthn-config
32381
32812
  * @example
32382
32813
  * ```ts
32383
- * const webauthnConfig = await auth.admin.app("app").webauthnConfig.update({ enabled: true, rp_id: "example.com" });
32814
+ * const webauthnConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webauthnConfig.update({ enabled: true, rp_id: "example.com" });
32384
32815
  * ```
32385
32816
  */
32386
32817
  update(params: WebauthnConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<WebauthnConfig>>;
@@ -32392,6 +32823,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32392
32823
  *
32393
32824
  * Deliveries are signed with the Standard Webhooks headers `webhook-id`, `webhook-timestamp` and `webhook-signature` (`v1,<base64 HMAC-SHA256 of "<id>.<timestamp>.<body>">`); the returned `whsec_…` secret works unchanged with any Standard Webhooks library. Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h.
32394
32825
  *
32826
+ * Credential: `workspace_key`.
32827
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32828
+ *
32395
32829
  * @param params - `Auth.WebhookEndpointCreateParams`.
32396
32830
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
32397
32831
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, WEBHOOK_EVENT_TYPE_UNKNOWN: Validation failure: URL not https with a public host, or an unknown event type (`WEBHOOK_EVENT_TYPE_UNKNOWN`).
@@ -32405,7 +32839,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32405
32839
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-endpoints
32406
32840
  * @example
32407
32841
  * ```ts
32408
- * const webhookEndpointWithSecret = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.endpoints.create({ url: "https://api.acme.com/webhooks" });
32842
+ * const webhookEndpointWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.create({ url: "https://api.acme.com/webhooks" });
32409
32843
  * ```
32410
32844
  */
32411
32845
  create(params: WebhookEndpointCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpointWithSecret>>;
@@ -32414,6 +32848,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32414
32848
  *
32415
32849
  * Queued retries are dropped. Its past attempts stay in the event log until the events expire.
32416
32850
  *
32851
+ * Credential: `workspace_key`.
32852
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32853
+ *
32417
32854
  * @param endpointId - Id of the endpoint.
32418
32855
  * @param options - Per-request options.
32419
32856
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `endpoint_id` is not a UUID.
@@ -32425,7 +32862,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32425
32862
  * @see https://productcraft.co/docs/auth/api-reference#delete-v1-apps-app-id-webhooks-endpoints-endpoint-id
32426
32863
  * @example
32427
32864
  * ```ts
32428
- * await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.endpoints.delete("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
32865
+ * await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32429
32866
  * ```
32430
32867
  */
32431
32868
  delete(endpointId: string, options?: RequestOptions): APIPromise<void>;
@@ -32434,6 +32871,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32434
32871
  *
32435
32872
  * At most 10, so this is always one page. Signing secrets are never returned here, only their last 4 characters.
32436
32873
  *
32874
+ * Credential: `workspace_key`.
32875
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32876
+ *
32437
32877
  * @param options - Per-request options.
32438
32878
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: The scope id in the path is malformed.
32439
32879
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
@@ -32444,7 +32884,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32444
32884
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-endpoints
32445
32885
  * @example
32446
32886
  * ```ts
32447
- * for await (const endpoint of auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.endpoints.list()) {
32887
+ * for await (const endpoint of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.list()) {
32448
32888
  * console.log(endpoint);
32449
32889
  * }
32450
32890
  * ```
@@ -32455,6 +32895,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32455
32895
  *
32456
32896
  * The endpoint's URL, subscription, on/off state, failure streak and the last 4 characters of its signing secret. The full secret is only returned when the endpoint is created or its secret is rotated.
32457
32897
  *
32898
+ * Credential: `workspace_key`.
32899
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32900
+ *
32458
32901
  * @param endpointId - Id of the endpoint.
32459
32902
  * @param options - Per-request options.
32460
32903
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `endpoint_id` is not a UUID.
@@ -32466,7 +32909,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32466
32909
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-endpoints-endpoint-id
32467
32910
  * @example
32468
32911
  * ```ts
32469
- * const webhookEndpoint = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.endpoints.retrieve("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b");
32912
+ * const webhookEndpoint = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32470
32913
  * ```
32471
32914
  */
32472
32915
  retrieve(endpointId: string, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpoint>>;
@@ -32475,6 +32918,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32475
32918
  *
32476
32919
  * For `grace_hours` (default 24) the previous secret keeps signing too: `webhook-signature` then lists one `v1,` signature per secret, so receivers can switch over without dropping a delivery.
32477
32920
  *
32921
+ * Credential: `workspace_key`.
32922
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32923
+ *
32478
32924
  * @param endpointId - Id of the endpoint.
32479
32925
  * @param params - `Auth.WebhookEndpointRotateSecretParams`.
32480
32926
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -32488,7 +32934,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32488
32934
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-endpoints-endpoint-id-rotate-secret
32489
32935
  * @example
32490
32936
  * ```ts
32491
- * const webhookEndpointWithSecret = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.endpoints.rotateSecret("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", { grace_hours: 24 });
32937
+ * const webhookEndpointWithSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.rotateSecret("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { grace_hours: 24 });
32492
32938
  * ```
32493
32939
  */
32494
32940
  rotateSecret(endpointId: string, params?: WebhookEndpointRotateSecretParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpointWithSecret>>;
@@ -32497,6 +32943,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32497
32943
  *
32498
32944
  * Delivers the catalogue example of `event_type`, signed like any delivery, with `"test": true` in the body. Works while the endpoint is switched off or not subscribed to that type, is logged in the event log, and is never retried or counted toward an automatic disable. Waits up to 15 s for your receiver.
32499
32945
  *
32946
+ * Credential: `workspace_key`.
32947
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32948
+ *
32500
32949
  * @param endpointId - Id of the endpoint.
32501
32950
  * @param params - `Auth.WebhookEndpointTestParams`.
32502
32951
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -32510,7 +32959,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32510
32959
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-endpoints-endpoint-id-test
32511
32960
  * @example
32512
32961
  * ```ts
32513
- * const webhookDeliveryAttempt = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.endpoints.test("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", { event_type: "user.signup" });
32962
+ * const webhookDeliveryAttempt = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.test("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { event_type: "user.signup" });
32514
32963
  * ```
32515
32964
  */
32516
32965
  test(endpointId: string, params: WebhookEndpointTestParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookDeliveryAttempt>>;
@@ -32519,6 +32968,9 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32519
32968
  *
32520
32969
  * Only the fields sent change. `enabled: true` (or a new URL) also clears an automatic disable. Switching off cancels queued retries. The secret is unchanged; rotate it with `POST …/rotate-secret`.
32521
32970
  *
32971
+ * Credential: `workspace_key`.
32972
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
32973
+ *
32522
32974
  * @param endpointId - Id of the endpoint.
32523
32975
  * @param params - `Auth.WebhookEndpointUpdateParams`.
32524
32976
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -32533,7 +32985,7 @@ declare class AppWebhooksEndpointsResource extends APIResource {
32533
32985
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-webhooks-endpoints-endpoint-id
32534
32986
  * @example
32535
32987
  * ```ts
32536
- * const webhookEndpoint = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.endpoints.update("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b", { description: "Production receiver" });
32988
+ * const webhookEndpoint = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.endpoints.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { description: "Production receiver" });
32537
32989
  * ```
32538
32990
  */
32539
32991
  update(endpointId: string, params?: WebhookEndpointUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEndpoint>>;
@@ -32545,6 +32997,9 @@ declare class AppWebhooksEventTypesResource extends APIResource {
32545
32997
  *
32546
32998
  * Each type with a plain description, its group and an example `data` object (what "Send test" delivers).
32547
32999
  *
33000
+ * Credential: `workspace_key`.
33001
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
33002
+ *
32548
33003
  * @param options - Per-request options.
32549
33004
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid bearer token.
32550
33005
  * @throws {PermissionDeniedError} 403 FORBIDDEN: Caller lacks `auth.read` (reads) or `auth.update` (changes, Send test, replay), or the app is suspended or archived.
@@ -32554,7 +33009,7 @@ declare class AppWebhooksEventTypesResource extends APIResource {
32554
33009
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-event-types
32555
33010
  * @example
32556
33011
  * ```ts
32557
- * const listWebhookEventTypes = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.eventTypes.list();
33012
+ * const listWebhookEventTypes = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.eventTypes.list();
32558
33013
  * ```
32559
33014
  */
32560
33015
  list(options?: RequestOptions): APIPromise<WithLastResponse<ListWebhookEventTypes>>;
@@ -32566,6 +33021,9 @@ declare class AppWebhooksEventsResource extends APIResource {
32566
33021
  *
32567
33022
  * Every event logged while at least one endpoint existed, with the latest state per endpoint and when the next retry is due.
32568
33023
  *
33024
+ * Credential: `workspace_key`.
33025
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
33026
+ *
32569
33027
  * @param params - `Auth.WebhookEventListParams`.
32570
33028
  * @param options - Per-request options.
32571
33029
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid filter value or cursor.
@@ -32577,10 +33035,10 @@ declare class AppWebhooksEventsResource extends APIResource {
32577
33035
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-events
32578
33036
  * @example
32579
33037
  * ```ts
32580
- * for await (const event of auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.events.list()) {
33038
+ * for await (const event of auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.list()) {
32581
33039
  * console.log(event);
32582
33040
  * }
32583
- * const page = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.events.list({}, { timeout: 5_000 });
33041
+ * const page = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.list({}, { timeout: 5_000 });
32584
33042
  * ```
32585
33043
  */
32586
33044
  list(params?: WebhookEventListParams, options?: RequestOptions): PagePromise<WebhookEvent>;
@@ -32589,6 +33047,9 @@ declare class AppWebhooksEventsResource extends APIResource {
32589
33047
  *
32590
33048
  * Same body and `webhook-id`, freshly signed, to every switched-on endpoint that receives this event type now, or only to `endpoint_id`. Waits for the receivers (up to 15 s each) and returns the attempts. A success cancels a retry still queued for that endpoint.
32591
33049
  *
33050
+ * Credential: `workspace_key`.
33051
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
33052
+ *
32592
33053
  * @param eventId - The event id, `evt_<uuid>`.
32593
33054
  * @param params - `Auth.WebhookEventReplayParams`.
32594
33055
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -32602,7 +33063,7 @@ declare class AppWebhooksEventsResource extends APIResource {
32602
33063
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-webhooks-events-event-id-replay
32603
33064
  * @example
32604
33065
  * ```ts
32605
- * const replayWebhookEvent = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.events.replay("event");
33066
+ * const replayWebhookEvent = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.replay("evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32606
33067
  * ```
32607
33068
  */
32608
33069
  replay(eventId: string, params?: WebhookEventReplayParams, options?: RequestOptions): APIPromise<WithLastResponse<ReplayWebhookEvent>>;
@@ -32611,6 +33072,9 @@ declare class AppWebhooksEventsResource extends APIResource {
32611
33072
  *
32612
33073
  * The event as it was sent (`type`, `data`) and every delivery attempt to every endpoint, with its trigger, HTTP status, error and the start of the response body. Use it to debug a receiver, then `replay` to send it again.
32613
33074
  *
33075
+ * Credential: `workspace_key`.
33076
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
33077
+ *
32614
33078
  * @param eventId - The event id, `evt_<uuid>`.
32615
33079
  * @param options - Per-request options.
32616
33080
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `event_id` is not `evt_<uuid>`.
@@ -32622,7 +33086,7 @@ declare class AppWebhooksEventsResource extends APIResource {
32622
33086
  * @see https://productcraft.co/docs/auth/api-reference#get-v1-apps-app-id-webhooks-events-event-id
32623
33087
  * @example
32624
33088
  * ```ts
32625
- * const webhookEventDetail = await auth.admin.app("3f0c1a2b-4c5d-4e6f-8a9b-0c1d2e3f4a5b").webhooks.events.retrieve("event");
33089
+ * const webhookEventDetail = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webhooks.events.retrieve("evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32626
33090
  * ```
32627
33091
  */
32628
33092
  retrieve(eventId: string, options?: RequestOptions): APIPromise<WithLastResponse<WebhookEventDetail>>;
@@ -32664,6 +33128,9 @@ declare class AuthApp extends APIResource {
32664
33128
  /**
32665
33129
  * Create a second app in the same workspace whose configuration matches this one — the "staging app" flow. Copies the auth config, roles, permissions, notification settings and the webhook target (with a NEW signing secret), and optionally tenants. Never copies credentials, end-users, sessions, signing keys, federated provider configs or audit history.
32666
33130
  *
33131
+ * Credential: `workspace_key`.
33132
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
33133
+ *
32667
33134
  * @param params - `Auth.CloneParams`.
32668
33135
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
32669
33136
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Validation failure, or the slug matches the source.
@@ -32676,13 +33143,16 @@ declare class AuthApp extends APIResource {
32676
33143
  * @see https://productcraft.co/docs/auth/api-reference#post-v1-apps-app-id-clone
32677
33144
  * @example
32678
33145
  * ```ts
32679
- * const cloneApp = await auth.admin.app("app").clone({ environment: "staging", slug: "acme-app-staging" });
33146
+ * const cloneApp = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").clone({ environment: "staging", slug: "acme-app-staging" });
32680
33147
  * ```
32681
33148
  */
32682
33149
  clone(params: CloneParams, options?: RequestOptions): APIPromise<WithLastResponse<CloneApp>>;
32683
33150
  /**
32684
33151
  * Update app status (active, suspended, archived)
32685
33152
  *
33153
+ * Credential: `workspace_key`.
33154
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
33155
+ *
32686
33156
  * @param params - `Auth.UpdateStatusParams`.
32687
33157
  * @param options - Per-request options.
32688
33158
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid status transition (e.g. archived → active).
@@ -32694,7 +33164,7 @@ declare class AuthApp extends APIResource {
32694
33164
  * @see https://productcraft.co/docs/auth/api-reference#patch-v1-apps-app-id-status
32695
33165
  * @example
32696
33166
  * ```ts
32697
- * const app = await auth.admin.app("app").updateStatus({ status: "suspended" });
33167
+ * const app = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").updateStatus({ status: "suspended" });
32698
33168
  * ```
32699
33169
  */
32700
33170
  updateStatus(params: UpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<App>>;
@@ -32801,6 +33271,9 @@ declare class ConsumerMeActivityResource extends APIResource {
32801
33271
  *
32802
33272
  * Login events, password changes, and other security-relevant records, scoped to this EndUser.
32803
33273
  *
33274
+ * Credential: `end_user_token`.
33275
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33276
+ *
32804
33277
  * @param options - Per-request options.
32805
33278
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
32806
33279
  * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.
@@ -32808,7 +33281,7 @@ declare class ConsumerMeActivityResource extends APIResource {
32808
33281
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-activity
32809
33282
  * @example
32810
33283
  * ```ts
32811
- * for await (const activity of auth.consumer("app").me.activity.list()) {
33284
+ * for await (const activity of auth.consumer("my-app").me.activity.list()) {
32812
33285
  * console.log(activity);
32813
33286
  * }
32814
33287
  * ```
@@ -32822,6 +33295,9 @@ declare class ConsumerMeContactsResource extends APIResource {
32822
33295
  *
32823
33296
  * Adds an email or phone contact to the EndUser. The contact starts unverified and non-primary. Verification is a separate flow — call /auth/request-verification with the contact value and the customer's PAK to mint a code, then submit via /auth/verify.
32824
33297
  *
33298
+ * Credential: `end_user_token`.
33299
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33300
+ *
32825
33301
  * @param params - `Auth.MeContactCreateParams`.
32826
33302
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
32827
33303
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: unsupported `type`, invalid email, or empty/over-long `value`.
@@ -32832,13 +33308,16 @@ declare class ConsumerMeContactsResource extends APIResource {
32832
33308
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-contacts
32833
33309
  * @example
32834
33310
  * ```ts
32835
- * const meContact = await auth.consumer("app").me.contacts.create({ type: "email", value: "string" });
33311
+ * const meContact = await auth.consumer("my-app").me.contacts.create({ type: "email", value: "ada@example.com" });
32836
33312
  * ```
32837
33313
  */
32838
33314
  create(params: MeContactCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<MeContact>>;
32839
33315
  /**
32840
33316
  * Delete a contact
32841
33317
  *
33318
+ * Credential: `end_user_token`.
33319
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33320
+ *
32842
33321
  * @param id - Id of the contact.
32843
33322
  * @param options - Per-request options.
32844
33323
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
@@ -32849,13 +33328,16 @@ declare class ConsumerMeContactsResource extends APIResource {
32849
33328
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-contacts-id
32850
33329
  * @example
32851
33330
  * ```ts
32852
- * await auth.consumer("app").me.contacts.delete("id");
33331
+ * await auth.consumer("my-app").me.contacts.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32853
33332
  * ```
32854
33333
  */
32855
33334
  delete(id: string, options?: RequestOptions): APIPromise<void>;
32856
33335
  /**
32857
33336
  * List the EndUser's contacts
32858
33337
  *
33338
+ * Credential: `end_user_token`.
33339
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33340
+ *
32859
33341
  * @param options - Per-request options.
32860
33342
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
32861
33343
  * @throws {RateLimitError} 429 RATE_LIMITED: Per-IP rate limit (`RATE_LIMITED`): the general bucket, 60 requests per minute per IP. Adding, verifying or removing a contact is in the strict `auth` bucket (10 per minute).
@@ -32863,7 +33345,7 @@ declare class ConsumerMeContactsResource extends APIResource {
32863
33345
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-contacts
32864
33346
  * @example
32865
33347
  * ```ts
32866
- * const meContacts = await auth.consumer("app").me.contacts.list();
33348
+ * const meContacts = await auth.consumer("my-app").me.contacts.list();
32867
33349
  * ```
32868
33350
  */
32869
33351
  list(options?: RequestOptions): APIPromise<WithLastResponse<MeContacts>>;
@@ -32872,6 +33354,9 @@ declare class ConsumerMeContactsResource extends APIResource {
32872
33354
  *
32873
33355
  * Demotes the previous primary of the same type. Refused (409) when the target contact is unverified — promoting an unverified contact would let an attacker who registered the contact bypass verification by routing reset codes through it.
32874
33356
  *
33357
+ * Credential: `end_user_token`.
33358
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33359
+ *
32875
33360
  * @param id - Id of the contact.
32876
33361
  * @param options - Per-request options.
32877
33362
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
@@ -32882,7 +33367,7 @@ declare class ConsumerMeContactsResource extends APIResource {
32882
33367
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-contacts-id-promote
32883
33368
  * @example
32884
33369
  * ```ts
32885
- * await auth.consumer("app").me.contacts.promote("id");
33370
+ * await auth.consumer("my-app").me.contacts.promote("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32886
33371
  * ```
32887
33372
  */
32888
33373
  promote(id: string, options?: RequestOptions): APIPromise<void>;
@@ -32894,6 +33379,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32894
33379
  *
32895
33380
  * Creates a pending factor and returns the type-specific enrollment payload. TOTP: the otpauth URI, QR data URL, and shared secret; confirm with two consecutive codes. Email: a 6-digit code is sent to the bound verified email contact (primary by default, `contact_id` to override); confirm with that single code. The factor stays disabled until `/factors/:id/verify` succeeds.
32896
33381
  *
33382
+ * Credential: `end_user_token`.
33383
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33384
+ *
32897
33385
  * @param params - `Auth.MeMfaFactorCreateParams`.
32898
33386
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
32899
33387
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: unsupported `type`, over-long `label`, or `contact_id` is not a UUID.
@@ -32906,7 +33394,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32906
33394
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-factors
32907
33395
  * @example
32908
33396
  * ```ts
32909
- * const startEnrollment = await auth.consumer("app").me.mfa.factors.create({ type: "totp" });
33397
+ * const startEnrollment = await auth.consumer("my-app").me.mfa.factors.create({ type: "totp" });
32910
33398
  * ```
32911
33399
  */
32912
33400
  create(params: MeMfaFactorCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<StartEnrollment>>;
@@ -32915,6 +33403,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32915
33403
  *
32916
33404
  * Soft-disable. The row is preserved (with `disabled_at` set) for audit. Has no effect on existing sessions — their `amr` claim still reflects whatever satisfied sign-in at the time. Disabling the only enabled factor removes the MFA requirement on future sign-ins.
32917
33405
  *
33406
+ * Credential: `end_user_token`.
33407
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33408
+ *
32918
33409
  * @param id - Id of the factor.
32919
33410
  * @param options - Per-request options.
32920
33411
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
@@ -32924,7 +33415,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32924
33415
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-mfa-factors-id
32925
33416
  * @example
32926
33417
  * ```ts
32927
- * await auth.consumer("app").me.mfa.factors.delete("id");
33418
+ * await auth.consumer("my-app").me.mfa.factors.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
32928
33419
  * ```
32929
33420
  */
32930
33421
  delete(id: string, options?: RequestOptions): APIPromise<void>;
@@ -32933,6 +33424,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32933
33424
  *
32934
33425
  * Includes factors in any state (pending enrollment + enabled). Disabled factors are not listed.
32935
33426
  *
33427
+ * Credential: `end_user_token`.
33428
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33429
+ *
32936
33430
  * @param options - Per-request options.
32937
33431
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
32938
33432
  * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.
@@ -32940,7 +33434,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32940
33434
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-mfa-factors
32941
33435
  * @example
32942
33436
  * ```ts
32943
- * const factorList = await auth.consumer("app").me.mfa.factors.list();
33437
+ * const factorList = await auth.consumer("my-app").me.mfa.factors.list();
32944
33438
  * ```
32945
33439
  */
32946
33440
  list(options?: RequestOptions): APIPromise<WithLastResponse<FactorList>>;
@@ -32949,6 +33443,9 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32949
33443
  *
32950
33444
  * TOTP: submit two `codes` from consecutive 30-second windows. Email: submit the emailed 6-digit `code`. On success the factor flips to enabled, recovery codes are minted (returned once), and prior recovery codes for the account are invalidated. Subsequent calls with the same `:id` fail with 400.
32951
33445
  *
33446
+ * Credential: `end_user_token`.
33447
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33448
+ *
32952
33449
  * @param id - Id of the factor.
32953
33450
  * @param params - `Auth.MeMfaFactorVerifyParams`.
32954
33451
  * @param options - Per-request options.
@@ -32959,7 +33456,7 @@ declare class ConsumerMeMfaFactorsResource extends APIResource {
32959
33456
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-factors-id-verify
32960
33457
  * @example
32961
33458
  * ```ts
32962
- * const confirmEnrollment = await auth.consumer("app").me.mfa.factors.verify("id", { code: "123456" });
33459
+ * const confirmEnrollment = await auth.consumer("my-app").me.mfa.factors.verify("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { code: "123456" });
32963
33460
  * ```
32964
33461
  */
32965
33462
  verify(id: string, params?: MeMfaFactorVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<ConfirmEnrollment>>;
@@ -32971,6 +33468,9 @@ declare class ConsumerMeMfaRecoveryCodesResource extends APIResource {
32971
33468
  *
32972
33469
  * Mints a fresh set of single-use recovery codes and invalidates every prior code for the account. The new codes are returned once — store them now.
32973
33470
  *
33471
+ * Credential: `end_user_token`.
33472
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33473
+ *
32974
33474
  * @param options - Per-request options.
32975
33475
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
32976
33476
  * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.
@@ -32978,7 +33478,7 @@ declare class ConsumerMeMfaRecoveryCodesResource extends APIResource {
32978
33478
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-recovery-codes-regenerate
32979
33479
  * @example
32980
33480
  * ```ts
32981
- * const recoveryCodes = await auth.consumer("app").me.mfa.recoveryCodes.regenerate();
33481
+ * const recoveryCodes = await auth.consumer("my-app").me.mfa.recoveryCodes.regenerate();
32982
33482
  * ```
32983
33483
  */
32984
33484
  regenerate(options?: RequestOptions): APIPromise<WithLastResponse<RecoveryCodes>>;
@@ -32990,6 +33490,9 @@ declare class ConsumerMeMfaStepUpWebauthnResource extends APIResource {
32990
33490
  *
32991
33491
  * Mints a single-use WebAuthn challenge for the enabled passkeys on this account and returns the `publicKey` member for `navigator.credentials.get()`. Submit the result to `/step-up` as `credential`. Refused while step-up is locked on this session — a locked session must not be able to keep minting challenges.
32992
33492
  *
33493
+ * Credential: `end_user_token`.
33494
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33495
+ *
32993
33496
  * @param options - Per-request options.
32994
33497
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: No passkey is enrolled on this account.
32995
33498
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -32999,7 +33502,7 @@ declare class ConsumerMeMfaStepUpWebauthnResource extends APIResource {
32999
33502
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-step-up-webauthn-options
33000
33503
  * @example
33001
33504
  * ```ts
33002
- * const webauthnOptions = await auth.consumer("app").me.mfa.stepUp.webauthn.options();
33505
+ * const webauthnOptions = await auth.consumer("my-app").me.mfa.stepUp.webauthn.options();
33003
33506
  * ```
33004
33507
  */
33005
33508
  options(options?: RequestOptions): APIPromise<WithLastResponse<WebauthnOptions>>;
@@ -33013,6 +33516,9 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
33013
33516
  *
33014
33517
  * Mints a single-use 6-digit code against one of the account's enabled email factors and delivers it to the bound address. Follow with `/step-up` submitting the code. Codes expire after 5 minutes; sends are throttled per contact (30s between sends, shared with the sign-in path). Refused while step-up is locked on this session.
33015
33518
  *
33519
+ * Credential: `end_user_token`.
33520
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33521
+ *
33016
33522
  * @param params - `Auth.MeMfaStepUpSendCodeParams`.
33017
33523
  * @param options - Per-request options.
33018
33524
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Account has no enabled email factor (or the named factor is not an email factor).
@@ -33024,7 +33530,7 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
33024
33530
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-step-up-send-code
33025
33531
  * @example
33026
33532
  * ```ts
33027
- * const stepUpSendCode = await auth.consumer("app").me.mfa.stepUp.sendCode({ factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
33533
+ * const stepUpSendCode = await auth.consumer("my-app").me.mfa.stepUp.sendCode({ factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
33028
33534
  * ```
33029
33535
  */
33030
33536
  sendCode(params?: MeMfaStepUpSendCodeParams, options?: RequestOptions): APIPromise<WithLastResponse<StepUpSendCode>>;
@@ -33033,6 +33539,9 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
33033
33539
  *
33034
33540
  * Verify a fresh code (TOTP, emailed via `/step-up/send-code`, or recovery) against any enabled factor on the account, and update the session's `auth_methods` + `mfa_at`. Call `/auth/refresh` after this to mint a token whose claims reflect the new state. Customers reading `mfa_at` from access tokens to gate sensitive actions should require a `/step-up` + refresh cycle when the timestamp is older than their policy window. 5 consecutive wrong codes lock step-up on this session for 15 minutes.
33035
33541
  *
33542
+ * Credential: `end_user_token`.
33543
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33544
+ *
33036
33545
  * @param params - `Auth.MeMfaStepUpVerifyParams`.
33037
33546
  * @param options - Per-request options.
33038
33547
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Code did not match any enabled factor or recovery code.
@@ -33042,7 +33551,7 @@ declare class ConsumerMeMfaStepUpResource extends APIResource {
33042
33551
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-mfa-step-up
33043
33552
  * @example
33044
33553
  * ```ts
33045
- * const stepUp = await auth.consumer("app").me.mfa.stepUp.verify({ code: "123456" });
33554
+ * const stepUp = await auth.consumer("my-app").me.mfa.stepUp.verify({ code: "123456" });
33046
33555
  * ```
33047
33556
  */
33048
33557
  verify(params?: MeMfaStepUpVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<StepUp>>;
@@ -33061,6 +33570,9 @@ declare class ConsumerMeSessionsResource extends APIResource {
33061
33570
  *
33062
33571
  * Sign the EndUser out of one device. The session's refresh token is destroyed; its access token expires on its TTL. Requires the `session.revoke` permission when the app's `enforce_app_permissions` flag is on; otherwise (the default) any valid token can call this. Self-revoke (revoking your own session as a member with no perms) is something to enforce separately if needed; this guard does not exempt the principal from the role check.
33063
33572
  *
33573
+ * Credential: `end_user_token`.
33574
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33575
+ *
33064
33576
  * @param id - Id of the session.
33065
33577
  * @param options - Per-request options.
33066
33578
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
@@ -33070,7 +33582,7 @@ declare class ConsumerMeSessionsResource extends APIResource {
33070
33582
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-sessions-id
33071
33583
  * @example
33072
33584
  * ```ts
33073
- * await auth.consumer("app").me.sessions.delete("id");
33585
+ * await auth.consumer("my-app").me.sessions.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
33074
33586
  * ```
33075
33587
  */
33076
33588
  delete(id: string, options?: RequestOptions): APIPromise<void>;
@@ -33079,6 +33591,9 @@ declare class ConsumerMeSessionsResource extends APIResource {
33079
33591
  *
33080
33592
  * Each session includes a `current` flag identifying the one belonging to the bearer token used for this request.
33081
33593
  *
33594
+ * Credential: `end_user_token`.
33595
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33596
+ *
33082
33597
  * @param options - Per-request options.
33083
33598
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
33084
33599
  * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.
@@ -33086,7 +33601,7 @@ declare class ConsumerMeSessionsResource extends APIResource {
33086
33601
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-sessions
33087
33602
  * @example
33088
33603
  * ```ts
33089
- * for await (const session of auth.consumer("app").me.sessions.list()) {
33604
+ * for await (const session of auth.consumer("my-app").me.sessions.list()) {
33090
33605
  * console.log(session);
33091
33606
  * }
33092
33607
  * ```
@@ -33100,6 +33615,9 @@ declare class ConsumerMeTenantInvitesResource extends APIResource {
33100
33615
  *
33101
33616
  * Adds the caller to the invited tenant with the role the invite names, and consumes the invite. Requires the invited address to be one of the caller's own VERIFIED email contacts in this app — holding the code is not sufficient, because whoever minted the invite also holds it, and an unverified contact is not proof of owning the address. A refused accept leaves the invite redeemable.
33102
33617
  *
33618
+ * Credential: `end_user_token`.
33619
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33620
+ *
33103
33621
  * @param params - `Auth.MeTenantInviteAcceptParams`.
33104
33622
  * @param options - Per-request options.
33105
33623
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -33112,7 +33630,7 @@ declare class ConsumerMeTenantInvitesResource extends APIResource {
33112
33630
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-tenant-invites-accept
33113
33631
  * @example
33114
33632
  * ```ts
33115
- * const acceptedTenantInvite = await auth.consumer("app").me.tenantInvites.accept({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU" });
33633
+ * const acceptedTenantInvite = await auth.consumer("my-app").me.tenantInvites.accept({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU" });
33116
33634
  * ```
33117
33635
  */
33118
33636
  accept(params: MeTenantInviteAcceptParams, options?: RequestOptions): APIPromise<WithLastResponse<AcceptedTenantInvite>>;
@@ -33124,6 +33642,9 @@ declare class ConsumerMeTenantsResource extends APIResource {
33124
33642
  *
33125
33643
  * Returns each tenant the caller is a member of, including the tenant slug + display name and the member's role. Powers a tenant-switcher UI on the customer's product.
33126
33644
  *
33645
+ * Credential: `end_user_token`.
33646
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33647
+ *
33127
33648
  * @param options - Per-request options.
33128
33649
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing / invalid bearer, or the session behind the token is revoked, expired or no longer exists.
33129
33650
  * @throws {PermissionDeniedError} 403 FORBIDDEN, APP_SUSPENDED, APP_ARCHIVED: The app exists but is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`). Decided by `AppStatusGuard` before the handler runs.
@@ -33133,7 +33654,7 @@ declare class ConsumerMeTenantsResource extends APIResource {
33133
33654
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-auth-me-tenants
33134
33655
  * @example
33135
33656
  * ```ts
33136
- * const myTenants = await auth.consumer("app").me.tenants.list();
33657
+ * const myTenants = await auth.consumer("my-app").me.tenants.list();
33137
33658
  * ```
33138
33659
  */
33139
33660
  list(options?: RequestOptions): APIPromise<WithLastResponse<MyTenants>>;
@@ -33152,6 +33673,9 @@ declare class ConsumerMeResource extends APIResource {
33152
33673
  *
33153
33674
  * Verifies `current_password`, sets the new hash, and revokes every OTHER active session for the account (the calling session is preserved). 401 if the current password is wrong or the account has no password credential — admin-provisioned accounts without an initial password should use the reset flow instead. The new password is held to exactly the same policy as signup: the app's length + character-class rules, the common-password deny-list, and the breach corpus.
33154
33675
  *
33676
+ * Credential: `end_user_token`.
33677
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33678
+ *
33155
33679
  * @param params - `Auth.MeChangePasswordParams`.
33156
33680
  * @param options - Per-request options.
33157
33681
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PASSWORD_TOO_COMMON, PASSWORD_BREACHED: The new password fails the app-configured policy, is on the common-password deny-list (`PASSWORD_TOO_COMMON`), appears in a public breach corpus (`PASSWORD_BREACHED`), or is identical to the current one.
@@ -33162,7 +33686,10 @@ declare class ConsumerMeResource extends APIResource {
33162
33686
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-change-password
33163
33687
  * @example
33164
33688
  * ```ts
33165
- * await auth.consumer("app").me.changePassword({ current_password: "string", new_password: "string" });
33689
+ * await auth.consumer("my-app").me.changePassword({
33690
+ * current_password: "correct horse battery staple",
33691
+ * new_password: "a new long passphrase 42",
33692
+ * });
33166
33693
  * ```
33167
33694
  */
33168
33695
  changePassword(params: MeChangePasswordParams, options?: RequestOptions): APIPromise<void>;
@@ -33171,6 +33698,9 @@ declare class ConsumerMeResource extends APIResource {
33171
33698
  *
33172
33699
  * Removes the EndUser, all sessions, and all related records inside this app. Cannot be undone. The app audit log keeps one `auth.account.deleted` row (`via: self`; username and email domain only, never the address), and `user.deleted` fires with `via: "self"`.
33173
33700
  *
33701
+ * Credential: `end_user_token`.
33702
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33703
+ *
33174
33704
  * @param options - Per-request options.
33175
33705
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
33176
33706
  * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.
@@ -33178,7 +33708,7 @@ declare class ConsumerMeResource extends APIResource {
33178
33708
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me
33179
33709
  * @example
33180
33710
  * ```ts
33181
- * await auth.consumer("app").me.deleteAccount();
33711
+ * await auth.consumer("my-app").me.deleteAccount();
33182
33712
  * ```
33183
33713
  */
33184
33714
  deleteAccount(options?: RequestOptions): APIPromise<void>;
@@ -33187,6 +33717,9 @@ declare class ConsumerMeResource extends APIResource {
33187
33717
  *
33188
33718
  * Clears both the uploaded avatar and any provider-captured picture, and deletes the stored object. A later Google/GitHub sign-in re-populates the provider picture — that is "sync from provider" behavior, by design.
33189
33719
  *
33720
+ * Credential: `end_user_token`.
33721
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33722
+ *
33190
33723
  * @param options - Per-request options.
33191
33724
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
33192
33725
  * @throws {NotFoundError} 404 NOT_FOUND, ACCOUNT_NOT_FOUND: Account not found in this app (`ACCOUNT_NOT_FOUND`).
@@ -33195,7 +33728,7 @@ declare class ConsumerMeResource extends APIResource {
33195
33728
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-me-avatar
33196
33729
  * @example
33197
33730
  * ```ts
33198
- * await auth.consumer("app").me.deleteAvatar();
33731
+ * await auth.consumer("my-app").me.deleteAvatar();
33199
33732
  * ```
33200
33733
  */
33201
33734
  deleteAvatar(options?: RequestOptions): APIPromise<void>;
@@ -33204,6 +33737,9 @@ declare class ConsumerMeResource extends APIResource {
33204
33737
  *
33205
33738
  * Returns the union of the app-level role permissions and the tenant-level role permissions (when the token carries an `org_id`). Resolved per-request through a 60-second LRU — role-permission edits propagate within ~1 minute. Use this instead of decoding a `permissions[]` claim from the JWT, which is no longer included. M2M tokens cannot call this — use `POST /:appSlug/v1/oauth/introspect` to inspect M2M scopes.
33206
33739
  *
33740
+ * Credential: `end_user_token`.
33741
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33742
+ *
33207
33743
  * @param options - Per-request options.
33208
33744
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token, unknown or inactive app, or the account/session is no longer active.
33209
33745
  * @throws {RateLimitError} 429 RATE_LIMITED: Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds.
@@ -33211,7 +33747,7 @@ declare class ConsumerMeResource extends APIResource {
33211
33747
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me-permissions
33212
33748
  * @example
33213
33749
  * ```ts
33214
- * const mePermissions = await auth.consumer("app").me.permissions();
33750
+ * const mePermissions = await auth.consumer("my-app").me.permissions();
33215
33751
  * ```
33216
33752
  */
33217
33753
  permissions(options?: RequestOptions): APIPromise<WithLastResponse<MePermissions>>;
@@ -33220,6 +33756,9 @@ declare class ConsumerMeResource extends APIResource {
33220
33756
  *
33221
33757
  * Returns the EndUser identity, app membership, and role name. The flat `permissions[]` array is intentionally NOT included — permissions resolve from the role on demand. Call `GET /me/permissions` for the flat list when the client needs it for UI gating.
33222
33758
  *
33759
+ * Credential: `end_user_token`.
33760
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33761
+ *
33223
33762
  * @param options - Per-request options.
33224
33763
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
33225
33764
  * @throws {NotFoundError} 404 NOT_FOUND: Account not found.
@@ -33228,7 +33767,7 @@ declare class ConsumerMeResource extends APIResource {
33228
33767
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-me
33229
33768
  * @example
33230
33769
  * ```ts
33231
- * const meProfile = await auth.consumer("app").me.retrieve();
33770
+ * const meProfile = await auth.consumer("my-app").me.retrieve();
33232
33771
  * ```
33233
33772
  */
33234
33773
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<MeProfile>>;
@@ -33237,6 +33776,9 @@ declare class ConsumerMeResource extends APIResource {
33237
33776
  *
33238
33777
  * Editable fields: `display_name` and `username`. The username is unique per app (case-insensitive, same rule as signup); sending the current username is a no-op. Usernames cannot be cleared.
33239
33778
  *
33779
+ * Credential: `end_user_token`.
33780
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33781
+ *
33240
33782
  * @param params - `Auth.MeUpdateParams`.
33241
33783
  * @param options - Per-request options.
33242
33784
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -33246,7 +33788,7 @@ declare class ConsumerMeResource extends APIResource {
33246
33788
  * @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-me
33247
33789
  * @example
33248
33790
  * ```ts
33249
- * const meUpdatedAccount = await auth.consumer("app").me.update({ display_name: "Ada Lovelace" });
33791
+ * const meUpdatedAccount = await auth.consumer("my-app").me.update({ display_name: "Ada Lovelace" });
33250
33792
  * ```
33251
33793
  */
33252
33794
  update(params?: MeUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<MeUpdatedAccount>>;
@@ -33255,6 +33797,9 @@ declare class ConsumerMeResource extends APIResource {
33255
33797
  *
33256
33798
  * PNG/JPEG/WEBP only — SVG is rejected (stored-XSS vector). ≤2 MB. Magic bytes are sniffed; a mislabeled file is rejected. The image is re-encoded server-side (orientation baked in, all metadata incl. EXIF/GPS stripped, bounded to 512×512, webp). An uploaded avatar takes precedence over a provider-captured picture.
33257
33799
  *
33800
+ * Credential: `end_user_token`.
33801
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
33802
+ *
33258
33803
  * @param params - `Auth.MeUploadAvatarParams`.
33259
33804
  * @param options - Per-request options.
33260
33805
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -33265,7 +33810,7 @@ declare class ConsumerMeResource extends APIResource {
33265
33810
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-me-avatar
33266
33811
  * @example
33267
33812
  * ```ts
33268
- * const avatarUrl = await auth.consumer("app").me.uploadAvatar({ file: new File(["…"], "image.png", { type: "image/png" }) });
33813
+ * const avatarUrl = await auth.consumer("my-app").me.uploadAvatar({ file: new File(["…"], "image.png", { type: "image/png" }) });
33269
33814
  * ```
33270
33815
  */
33271
33816
  uploadAvatar(params: MeUploadAvatarParams, options?: RequestOptions): APIPromise<WithLastResponse<AvatarUrl>>;
@@ -33320,7 +33865,7 @@ declare class ConsumerMfaWebauthnResource extends APIResource {
33320
33865
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-webauthn-options
33321
33866
  * @example
33322
33867
  * ```ts
33323
- * const consumerWebauthnOptions = await auth.consumer("app").mfa.webauthn.options({ mfa_token: "string" });
33868
+ * const consumerWebauthnOptions = await auth.consumer("my-app").mfa.webauthn.options({ mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f" });
33324
33869
  * ```
33325
33870
  */
33326
33871
  options(params: MfaWebauthnOptionsParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerWebauthnOptions>>;
@@ -33347,7 +33892,7 @@ declare class ConsumerMfaResource extends APIResource {
33347
33892
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-enroll
33348
33893
  * @example
33349
33894
  * ```ts
33350
- * const startEnrollment = await auth.consumer("app").mfa.enroll({ mfa_token: "string", type: "totp" });
33895
+ * const startEnrollment = await auth.consumer("my-app").mfa.enroll({ mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", type: "totp" });
33351
33896
  * ```
33352
33897
  */
33353
33898
  enroll(params: MfaEnrollParams, options?: RequestOptions): APIPromise<WithLastResponse<StartEnrollment>>;
@@ -33369,7 +33914,10 @@ declare class ConsumerMfaResource extends APIResource {
33369
33914
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-recover
33370
33915
  * @example
33371
33916
  * ```ts
33372
- * const consumerToken = await auth.consumer("app").mfa.recover({ mfa_token: "string", recovery_code: "1a2b-3c4d-5e6f-7890" });
33917
+ * const consumerToken = await auth.consumer("my-app").mfa.recover({
33918
+ * mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
33919
+ * recovery_code: "1a2b-3c4d-5e6f-7890",
33920
+ * });
33373
33921
  * ```
33374
33922
  */
33375
33923
  recover(params: MfaRecoverParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
@@ -33392,7 +33940,10 @@ declare class ConsumerMfaResource extends APIResource {
33392
33940
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-send-code
33393
33941
  * @example
33394
33942
  * ```ts
33395
- * const consumerMfaSendCode = await auth.consumer("app").mfa.sendCode({ factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b", mfa_token: "string" });
33943
+ * const consumerMfaSendCode = await auth.consumer("my-app").mfa.sendCode({
33944
+ * factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
33945
+ * mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
33946
+ * });
33396
33947
  * ```
33397
33948
  */
33398
33949
  sendCode(params: MfaSendCodeParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerMfaSendCode>>;
@@ -33413,7 +33964,7 @@ declare class ConsumerMfaResource extends APIResource {
33413
33964
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-verify
33414
33965
  * @example
33415
33966
  * ```ts
33416
- * const consumerToken = await auth.consumer("app").mfa.verify({ mfa_token: "string" });
33967
+ * const consumerToken = await auth.consumer("my-app").mfa.verify({ mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f" });
33417
33968
  * ```
33418
33969
  */
33419
33970
  verify(params: MfaVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
@@ -33434,7 +33985,10 @@ declare class ConsumerMfaResource extends APIResource {
33434
33985
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-mfa-enroll-verify
33435
33986
  * @example
33436
33987
  * ```ts
33437
- * const consumerMfaEnrollVerify = await auth.consumer("app").mfa.verifyEnrollment({ factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b", mfa_token: "string" });
33988
+ * const consumerMfaEnrollVerify = await auth.consumer("my-app").mfa.verifyEnrollment({
33989
+ * factor_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
33990
+ * mfa_token: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
33991
+ * });
33438
33992
  * ```
33439
33993
  */
33440
33994
  verifyEnrollment(params: MfaVerifyEnrollmentParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerMfaEnrollVerify>>;
@@ -33446,6 +34000,10 @@ declare class ConsumerOauthResource extends APIResource {
33446
34000
  *
33447
34001
  * OAuth 2.0 token introspection. Send the access token via `Authorization: Bearer <token>` and receive either `{ active: false }` (invalid / expired / wrong app, or a session that is revoked, past its `expires_at`, or gone because the end user was deleted) or the active claim set including `scopes` (M2M) or `role` (EndUser), `exp`, `iat`, `iss`, `aid`. The body `token` field is optional and, if present, must match the bearer — RFC 7662 allows a separate `token` body field but we deliberately refuse cross-token introspection so a stolen token can't be probed against another active credential. The endpoint accepts both M2M and EndUser tokens — use it as the canonical way for a service to know what its own token can do, instead of decoding the JWT by hand. Returns 401 when the bearer is missing.
33448
34002
  *
34003
+ * Credential: one of `m2m_token`, `end_user_token`.
34004
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34005
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34006
+ *
33449
34007
  * @param params - `Auth.OauthIntrospectParams`.
33450
34008
  * @param options - Per-request options.
33451
34009
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed in the global `ValidationPipe`.
@@ -33458,7 +34016,7 @@ declare class ConsumerOauthResource extends APIResource {
33458
34016
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-oauth-introspect
33459
34017
  * @example
33460
34018
  * ```ts
33461
- * const introspect = await auth.consumer("app").oauth.introspect({ token: "string" });
34019
+ * const introspect = await auth.consumer("my-app").oauth.introspect({ token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl" });
33462
34020
  * ```
33463
34021
  */
33464
34022
  introspect(params?: OauthIntrospectParams, options?: RequestOptions): APIPromise<WithLastResponse<Introspect>>;
@@ -33479,9 +34037,9 @@ declare class ConsumerOauthResource extends APIResource {
33479
34037
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-oauth-token
33480
34038
  * @example
33481
34039
  * ```ts
33482
- * const oAuthToken = await auth.consumer("app").oauth.token({
34040
+ * const oAuthToken = await auth.consumer("my-app").oauth.token({
33483
34041
  * client_id: "m2m_a1b2c3d4e5f6...",
33484
- * client_secret: "string",
34042
+ * client_secret: "the-secret-returned-by-credentials-create",
33485
34043
  * grant_type: "client_credentials",
33486
34044
  * });
33487
34045
  * ```
@@ -33513,7 +34071,7 @@ declare class ConsumerPasskeyResource extends APIResource {
33513
34071
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-passkey-options
33514
34072
  * @example
33515
34073
  * ```ts
33516
- * const consumerWebauthnOptions = await auth.consumer("app").passkey.options({ tenant_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
34074
+ * const consumerWebauthnOptions = await auth.consumer("my-app").passkey.options({ tenant_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" });
33517
34075
  * ```
33518
34076
  */
33519
34077
  options(params?: PasskeyOptionsParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerWebauthnOptions>>;
@@ -33534,7 +34092,7 @@ declare class ConsumerPasskeyResource extends APIResource {
33534
34092
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-passkey-verify
33535
34093
  * @example
33536
34094
  * ```ts
33537
- * const consumerToken = await auth.consumer("app").passkey.verify({ credential: {} });
34095
+ * const consumerToken = await auth.consumer("my-app").passkey.verify({ credential: {} });
33538
34096
  * ```
33539
34097
  */
33540
34098
  verify(params: PasskeyVerifyParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
@@ -33546,6 +34104,11 @@ declare class ConsumerPermissionsResource extends APIResource {
33546
34104
  *
33547
34105
  * Inserts a `<resource>.<action>` row in the per-app permission catalogue. The resource and action segments must each match `^[a-z][a-z0-9_-]{1,47}$`. Conflicts with a system permission name return 409. Customers usually then bind the new permission to a role via `PUT /admin/roles/:roleName/permissions`.
33548
34106
  *
34107
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34108
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34109
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34110
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34111
+ *
33549
34112
  * @param params - `Auth.ConsumerScopedPermissionCreateParams`.
33550
34113
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
33551
34114
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -33555,7 +34118,7 @@ declare class ConsumerPermissionsResource extends APIResource {
33555
34118
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-admin-permissions
33556
34119
  * @example
33557
34120
  * ```ts
33558
- * const consumerAdminPermission = await auth.consumer("app").permissions.create({ action: "read", resource: "project" });
34121
+ * const consumerAdminPermission = await auth.consumer("my-app").permissions.create({ action: "read", resource: "project" });
33559
34122
  * ```
33560
34123
  */
33561
34124
  create(params: ConsumerScopedPermissionCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminPermission>>;
@@ -33564,6 +34127,11 @@ declare class ConsumerPermissionsResource extends APIResource {
33564
34127
  *
33565
34128
  * The `permissionKey` path parameter is the literal `<resource>.<action>` string. System permissions cannot be deleted — attempts return 403. Removing a permission also removes every `role_permission` row that bound it (cascade); role lookups dropped of that perm on the next request.
33566
34129
  *
34130
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34131
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34132
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34133
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34134
+ *
33567
34135
  * @param permissionKey - Permission key, `resource.action` (e.g. `invoice.read`).
33568
34136
  * @param options - Per-request options.
33569
34137
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: permissionKey must be in `resource.action` format.
@@ -33575,7 +34143,7 @@ declare class ConsumerPermissionsResource extends APIResource {
33575
34143
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-admin-permissions-permission-key
33576
34144
  * @example
33577
34145
  * ```ts
33578
- * await auth.consumer("app").permissions.delete("permission_key");
34146
+ * await auth.consumer("my-app").permissions.delete("invoice.read");
33579
34147
  * ```
33580
34148
  */
33581
34149
  delete(permissionKey: string, options?: RequestOptions): APIPromise<void>;
@@ -33584,6 +34152,11 @@ declare class ConsumerPermissionsResource extends APIResource {
33584
34152
  *
33585
34153
  * Returns the union of system permissions (shared across every app — `is_system: true` in the response) and any custom entries this app has defined (`is_system: false`). Useful for driving a role-editor UI that picks from the full catalogue.
33586
34154
  *
34155
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34156
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34157
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34158
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34159
+ *
33587
34160
  * @param options - Per-request options.
33588
34161
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired Consumer-API bearer: an EndUser or M2M token, or an app API key (`hdk_live_*` / `hdk_test_*`); or the account, session, M2M client or key is no longer active, or the key belongs to another app.
33589
34162
  * @throws {PermissionDeniedError} 403 FORBIDDEN, APP_SUSPENDED, APP_ARCHIVED: The app is suspended or archived (`APP_SUSPENDED` / `APP_ARCHIVED`), or the caller lacks `permission.read`: an app API key always needs it in its permissions; a role or M2M scopes need it once the app enforces permissions.
@@ -33593,7 +34166,7 @@ declare class ConsumerPermissionsResource extends APIResource {
33593
34166
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-permissions
33594
34167
  * @example
33595
34168
  * ```ts
33596
- * const result = await auth.consumer("app").permissions.list();
34169
+ * const result = await auth.consumer("my-app").permissions.list();
33597
34170
  * ```
33598
34171
  */
33599
34172
  list(options?: RequestOptions): APIPromise<WithLastResponse<ConsumerScopedPermissionListResponse>>;
@@ -33605,6 +34178,11 @@ declare class ConsumerRolesResource extends APIResource {
33605
34178
  *
33606
34179
  * Creates a role with no permissions bound yet. Use `PUT /:roleName/permissions` to attach a permission set after creation — that route also runs caller-narrowing so an EndUser admin can't grant verbs they don't themselves hold.
33607
34180
  *
34181
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34182
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34183
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34184
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34185
+ *
33608
34186
  * @param params - `Auth.ConsumerScopedRoleCreateParams`.
33609
34187
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
33610
34188
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -33614,7 +34192,7 @@ declare class ConsumerRolesResource extends APIResource {
33614
34192
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-admin-roles
33615
34193
  * @example
33616
34194
  * ```ts
33617
- * const consumerRole = await auth.consumer("app").roles.create({ name: "editor" });
34195
+ * const consumerRole = await auth.consumer("my-app").roles.create({ name: "editor" });
33618
34196
  * ```
33619
34197
  */
33620
34198
  create(params: ConsumerScopedRoleCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerRole>>;
@@ -33623,6 +34201,11 @@ declare class ConsumerRolesResource extends APIResource {
33623
34201
  *
33624
34202
  * System roles (`owner`, `admin`, `member`) cannot be deleted — attempts return 403. Roles currently assigned to any member return 409 `ROLE_IN_USE`; reassign the affected members first.
33625
34203
  *
34204
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34205
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34206
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34207
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34208
+ *
33626
34209
  * @param roleName - Name of the role (e.g. `admin`).
33627
34210
  * @param options - Per-request options.
33628
34211
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -33633,7 +34216,7 @@ declare class ConsumerRolesResource extends APIResource {
33633
34216
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-admin-roles-role-name
33634
34217
  * @example
33635
34218
  * ```ts
33636
- * await auth.consumer("app").roles.delete("role_name");
34219
+ * await auth.consumer("my-app").roles.delete("admin");
33637
34220
  * ```
33638
34221
  */
33639
34222
  delete(roleName: string, options?: RequestOptions): APIPromise<void>;
@@ -33642,6 +34225,11 @@ declare class ConsumerRolesResource extends APIResource {
33642
34225
  *
33643
34226
  * Cursor-paginated by `created_at`. Use the returned `next_cursor` in subsequent calls — offset pagination is not exposed.
33644
34227
  *
34228
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34229
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34230
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34231
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34232
+ *
33645
34233
  * @param params - `Auth.ConsumerScopedRoleListParams`.
33646
34234
  * @param options - Per-request options.
33647
34235
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`.
@@ -33653,10 +34241,10 @@ declare class ConsumerRolesResource extends APIResource {
33653
34241
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-roles
33654
34242
  * @example
33655
34243
  * ```ts
33656
- * for await (const role of auth.consumer("app").roles.list()) {
34244
+ * for await (const role of auth.consumer("my-app").roles.list()) {
33657
34245
  * console.log(role);
33658
34246
  * }
33659
- * const page = await auth.consumer("app").roles.list({}, { timeout: 5_000 });
34247
+ * const page = await auth.consumer("my-app").roles.list({}, { timeout: 5_000 });
33660
34248
  * ```
33661
34249
  */
33662
34250
  list(params?: ConsumerScopedRoleListParams, options?: RequestOptions): PagePromise<ConsumerRole>;
@@ -33665,6 +34253,11 @@ declare class ConsumerRolesResource extends APIResource {
33665
34253
  *
33666
34254
  * Returns the role plus the flat `permissions[]` array currently bound. Use this to drive a "configure role" UI in the customer product without having to call `/permissions` separately.
33667
34255
  *
34256
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34257
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34258
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34259
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34260
+ *
33668
34261
  * @param roleName - Name of the role (e.g. `admin`).
33669
34262
  * @param options - Per-request options.
33670
34263
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -33674,7 +34267,7 @@ declare class ConsumerRolesResource extends APIResource {
33674
34267
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-roles-role-name
33675
34268
  * @example
33676
34269
  * ```ts
33677
- * const consumerRoleWithPermissions = await auth.consumer("app").roles.retrieve("role_name");
34270
+ * const consumerRoleWithPermissions = await auth.consumer("my-app").roles.retrieve("admin");
33678
34271
  * ```
33679
34272
  */
33680
34273
  retrieve(roleName: string, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerRoleWithPermissions>>;
@@ -33683,6 +34276,11 @@ declare class ConsumerRolesResource extends APIResource {
33683
34276
  *
33684
34277
  * Renames are intentionally NOT supported — the role name is part of every issued EndUser JWT, so changing it would silently break live sessions. Create a new role and migrate users instead.
33685
34278
  *
34279
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34280
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34281
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34282
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34283
+ *
33686
34284
  * @param roleName - Name of the role (e.g. `admin`).
33687
34285
  * @param params - `Auth.ConsumerScopedRoleUpdateParams`.
33688
34286
  * @param options - Per-request options.
@@ -33693,7 +34291,7 @@ declare class ConsumerRolesResource extends APIResource {
33693
34291
  * @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-roles-role-name
33694
34292
  * @example
33695
34293
  * ```ts
33696
- * const consumerRole = await auth.consumer("app").roles.update("role_name", { description: "Updated description" });
34294
+ * const consumerRole = await auth.consumer("my-app").roles.update("admin", { description: "Updated description" });
33697
34295
  * ```
33698
34296
  */
33699
34297
  update(roleName: string, params?: ConsumerScopedRoleUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerRole>>;
@@ -33702,6 +34300,11 @@ declare class ConsumerRolesResource extends APIResource {
33702
34300
  *
33703
34301
  * Destructive — the role's permission set is replaced wholesale with the supplied array. Caller-narrowed: the caller must hold every permission in the request, otherwise 403 `Cannot grant actions you don't have: ...`. For EndUser callers the caller-held set is their app-membership role's effective permissions. For M2M callers the held set is the token's `scopes[]` claim — the M2M cannot grant a role any verb that wasn't configured on the M2M credential. Unknown permission strings return 400.
33704
34302
  *
34303
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34304
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34305
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34306
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34307
+ *
33705
34308
  * @param roleName - Name of the role (e.g. `admin`).
33706
34309
  * @param params - `Auth.ConsumerScopedRoleUpdatePermissionsParams`.
33707
34310
  * @param options - Per-request options.
@@ -33714,7 +34317,7 @@ declare class ConsumerRolesResource extends APIResource {
33714
34317
  * @see https://productcraft.co/docs/auth/api-reference#put-app-slug-v1-admin-roles-role-name-permissions
33715
34318
  * @example
33716
34319
  * ```ts
33717
- * const result = await auth.consumer("app").roles.updatePermissions("role_name", { permissions: ["user.read", "role.create"] });
34320
+ * const result = await auth.consumer("my-app").roles.updatePermissions("admin", { permissions: ["user.read", "role.create"] });
33718
34321
  * ```
33719
34322
  */
33720
34323
  updatePermissions(roleName: string, params: ConsumerScopedRoleUpdatePermissionsParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerScopedRoleUpdatePermissionsResponse>>;
@@ -33726,6 +34329,9 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
33726
34329
  *
33727
34330
  * Requires `auth.tenant.api_keys.configure` on the app.
33728
34331
  *
34332
+ * Credential: `workspace_key`.
34333
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34334
+ *
33729
34335
  * @param options - Per-request options.
33730
34336
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or revoked Platform API Key (`Authorization: Bearer pcft_live_…`).
33731
34337
  * @throws {PermissionDeniedError} 403 FORBIDDEN, PAK_WORKSPACE_MISMATCH: `PAK_WORKSPACE_MISMATCH` (the PAK belongs to another workspace than the app), or the PAK's policy does not allow `auth.tenant.api_keys.configure` on `pcft:heimdall:app/<appId>`.
@@ -33736,7 +34342,7 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
33736
34342
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenant-api-keys-config
33737
34343
  * @example
33738
34344
  * ```ts
33739
- * const tenantApiKeysConfig = await auth.consumer("app").tenantApiKeys.config.retrieve();
34345
+ * const tenantApiKeysConfig = await auth.consumer("my-app").tenantApiKeys.config.retrieve();
33740
34346
  * ```
33741
34347
  */
33742
34348
  retrieve(options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
@@ -33745,6 +34351,9 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
33745
34351
  *
33746
34352
  * Call it on boot: your code is the source of truth for the scopes a key can carry. Fields you leave out keep their stored value. `suspended` is the platform's kill switch: this route never changes it, and a body that carries it is refused. Requires `auth.tenant.api_keys.configure` on the app.
33747
34353
  *
34354
+ * Credential: `workspace_key`.
34355
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34356
+ *
33748
34357
  * @param params - `Auth.ConsumerScopedTenantApiKeyConfigUpdateParams`.
33749
34358
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
33750
34359
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, TENANT_API_KEYS_SCOPE_INVALID, TENANT_API_KEYS_UNKNOWN_ROLE, TENANT_API_KEY_EXPIRY_INVALID, TENANT_API_KEYS_NO_SCOPES, TENANT_API_KEYS_SUSPENDED_NOT_WRITABLE: `VALIDATION_ERROR`, `TENANT_API_KEYS_SCOPE_INVALID` (`details.scopes`), `TENANT_API_KEYS_UNKNOWN_ROLE` (`details.roles`: `manage_roles` names a role this app does not have), `TENANT_API_KEY_EXPIRY_INVALID`, `TENANT_API_KEYS_NO_SCOPES` (enabling with no scope), `TENANT_API_KEYS_SUSPENDED_NOT_WRITABLE` (the body carries `suspended`), or a malformed `Idempotency-Key`.
@@ -33757,7 +34366,7 @@ declare class ConsumerTenantApiKeysConfigResource extends APIResource {
33757
34366
  * @see https://productcraft.co/docs/auth/api-reference#put-app-slug-v1-tenant-api-keys-config
33758
34367
  * @example
33759
34368
  * ```ts
33760
- * const tenantApiKeysConfig = await auth.consumer("app").tenantApiKeys.config.update({ default_expiry_days: 7 });
34369
+ * const tenantApiKeysConfig = await auth.consumer("my-app").tenantApiKeys.config.update({ default_expiry_days: 7 });
33761
34370
  * ```
33762
34371
  */
33763
34372
  update(params?: ConsumerScopedTenantApiKeyConfigUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeysConfig>>;
@@ -33771,6 +34380,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33771
34380
  *
33772
34381
  * Returns the secret ONCE (`key`). Scopes must be grantable by the app and held by your own tenant role. At most 25 active keys per tenant. If the app requires recent MFA, verify a factor first (403 `step_up_required`). Responses carry `Cache-Control: no-store`.
33773
34382
  *
34383
+ * Credential: `end_user_token`.
34384
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34385
+ *
33774
34386
  * @param params - `Auth.TenantApiKeyCreateParams`.
33775
34387
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
33776
34388
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, TENANT_API_KEY_SCOPE_NOT_GRANTABLE, TENANT_API_KEY_EXPIRY_INVALID: `VALIDATION_ERROR`, `TENANT_API_KEY_SCOPE_NOT_GRANTABLE` (`details.scopes`), `TENANT_API_KEY_EXPIRY_INVALID` (`details.allowed`), or a malformed `Idempotency-Key`.
@@ -33783,7 +34395,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33783
34395
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenant-api-keys
33784
34396
  * @example
33785
34397
  * ```ts
33786
- * const tenantApiKeyWithSecret = await auth.consumer("app").tenantApiKeys.create({ name: "CI e2e", scopes: ["disputes.read", "audit.read"] });
34398
+ * const tenantApiKeyWithSecret = await auth.consumer("my-app").tenantApiKeys.create({ name: "CI e2e", scopes: ["disputes.read", "audit.read"] });
33787
34399
  * ```
33788
34400
  */
33789
34401
  create(params: TenantApiKeyCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyWithSecret>>;
@@ -33792,6 +34404,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33792
34404
  *
33793
34405
  * Immediate and final. Idempotent: revoking a revoked key is a 204 that changes nothing.
33794
34406
  *
34407
+ * Credential: `end_user_token`.
34408
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34409
+ *
33795
34410
  * @param keyId - Key id (UUID) or display id (`tak_…`).
33796
34411
  * @param options - Per-request options.
33797
34412
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing or invalid end-user bearer token (M2M tokens, PAKs and API keys are refused).
@@ -33802,7 +34417,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33802
34417
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenant-api-keys-key-id
33803
34418
  * @example
33804
34419
  * ```ts
33805
- * await auth.consumer("app").tenantApiKeys.delete("key");
34420
+ * await auth.consumer("my-app").tenantApiKeys.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
33806
34421
  * ```
33807
34422
  */
33808
34423
  delete(keyId: string, options?: RequestOptions): APIPromise<void>;
@@ -33811,6 +34426,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33811
34426
  *
33812
34427
  * For your backend: is this `pctk_` key, presented to YOUR API, usable right now, for which tenant and with which scopes? A key of another app is `{"active": false}`. Cache answers by the key's SHA-256: positives up to 30 s (never past `expires_at`), negatives up to 60 s. Intersect `scopes` with the permissions of `created_by.tenant_role` in your app. Requires `auth.tenant.api_keys.introspect` on the app. Not audited per call; `last_used_at` records use (5-minute granularity). This route has its own per-app rate bucket (1200 calls a minute by default), separate from your PAK's other calls; over it the answer is 429 with `Retry-After`, never a false `active: false`, so keep serving keys you hold a fresh positive for.
33813
34428
  *
34429
+ * Credential: `workspace_key`.
34430
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34431
+ *
33814
34432
  * @param params - `Auth.TenantApiKeyIntrospectParams`.
33815
34433
  * @param options - Per-request options.
33816
34434
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `key` missing or not a string.
@@ -33823,7 +34441,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33823
34441
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenant-api-keys-introspect
33824
34442
  * @example
33825
34443
  * ```ts
33826
- * const tenantApiKeyIntrospection = await auth.consumer("app").tenantApiKeys.introspect({ key: "pctk_live_4fQ2aZ0000000000000000000000000000000000000_1a2B3c" });
34444
+ * const tenantApiKeyIntrospection = await auth.consumer("my-app").tenantApiKeys.introspect({ key: "pctk_live_4fQ2aZ0000000000000000000000000000000000000_1a2B3c" });
33827
34445
  * ```
33828
34446
  */
33829
34447
  introspect(params: TenantApiKeyIntrospectParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyIntrospection>>;
@@ -33832,6 +34450,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33832
34450
  *
33833
34451
  * Newest first, cursor-paginated (20 per page, max 100). Secrets are never returned; `key_prefix` and `last4` identify a key.
33834
34452
  *
34453
+ * Credential: `end_user_token`.
34454
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34455
+ *
33835
34456
  * @param params - `Auth.ConsumerScopedTenantApiKeyListParams`.
33836
34457
  * @param options - Per-request options.
33837
34458
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Unknown `status` or malformed `cursor`.
@@ -33843,10 +34464,10 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33843
34464
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenant-api-keys
33844
34465
  * @example
33845
34466
  * ```ts
33846
- * for await (const tenantApiKey of auth.consumer("app").tenantApiKeys.list()) {
34467
+ * for await (const tenantApiKey of auth.consumer("my-app").tenantApiKeys.list()) {
33847
34468
  * console.log(tenantApiKey);
33848
34469
  * }
33849
- * const page = await auth.consumer("app").tenantApiKeys.list({}, { timeout: 5_000 });
34470
+ * const page = await auth.consumer("my-app").tenantApiKeys.list({}, { timeout: 5_000 });
33850
34471
  * ```
33851
34472
  */
33852
34473
  list(params?: ConsumerScopedTenantApiKeyListParams, options?: RequestOptions): PagePromise<TenantApiKey>;
@@ -33855,6 +34476,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33855
34476
  *
33856
34477
  * Mints a replacement with the same name and scopes and returns its secret ONCE. You become the replacement's creator, so its scopes must be within your own tenant role. The outgoing key is revoked now (`grace_hours: 0`, the default) or keeps working for up to 24 hours. To kill a leaked key, revoke it. Responses carry `Cache-Control: no-store`.
33857
34478
  *
34479
+ * Credential: `end_user_token`.
34480
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34481
+ *
33858
34482
  * @param keyId - Key id (UUID) or display id (`tak_…`).
33859
34483
  * @param params - `Auth.TenantApiKeyRotateParams`.
33860
34484
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -33868,7 +34492,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33868
34492
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenant-api-keys-key-id-rotate
33869
34493
  * @example
33870
34494
  * ```ts
33871
- * const tenantApiKeyWithSecret = await auth.consumer("app").tenantApiKeys.rotate("key", { expires_in_days: 7 });
34495
+ * const tenantApiKeyWithSecret = await auth.consumer("my-app").tenantApiKeys.rotate("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { expires_in_days: 7 });
33872
34496
  * ```
33873
34497
  */
33874
34498
  rotate(keyId: string, params?: TenantApiKeyRotateParams, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyWithSecret>>;
@@ -33877,6 +34501,9 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33877
34501
  *
33878
34502
  * For your own audit trail: record why a key you saw go inactive died (revoked in the console, creator left the tenant, expired, keys suspended). Only keys of this app; another app's key is 404. Requires `auth.tenant.api_keys.introspect` on the app.
33879
34503
  *
34504
+ * Credential: `workspace_key`.
34505
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34506
+ *
33880
34507
  * @param keyId - Key id (UUID) or display id (`tak_…`), as `introspect` returned it.
33881
34508
  * @param options - Per-request options.
33882
34509
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, malformed or revoked Platform API Key (`Authorization: Bearer pcft_live_…`).
@@ -33888,7 +34515,7 @@ declare class ConsumerTenantApiKeysResource extends APIResource {
33888
34515
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenant-api-keys-key-id-status
33889
34516
  * @example
33890
34517
  * ```ts
33891
- * const tenantApiKeyStatus = await auth.consumer("app").tenantApiKeys.status("key");
34518
+ * const tenantApiKeyStatus = await auth.consumer("my-app").tenantApiKeys.status("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
33892
34519
  * ```
33893
34520
  */
33894
34521
  status(keyId: string, options?: RequestOptions): APIPromise<WithLastResponse<TenantApiKeyStatus>>;
@@ -33900,6 +34527,9 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
33900
34527
  *
33901
34528
  * Unlike `POST /members`, nothing is granted until the invitee accepts at `POST /:appSlug/v1/auth/accept-tenant-invite`. Only a SHA-256 digest of the code is stored, so the `code` in this response is unrecoverable afterwards.
33902
34529
  *
34530
+ * Credential: `workspace_key`.
34531
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34532
+ *
33903
34533
  * @param tenantId - Id of the tenant.
33904
34534
  * @param params - `Auth.ConsumerScopedTenantInviteCreateParams`.
33905
34535
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -33913,13 +34543,16 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
33913
34543
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenants-tenant-id-invites
33914
34544
  * @example
33915
34545
  * ```ts
33916
- * const createTenantInvite = await auth.consumer("app").tenants.invites.create("tenant", { email: "alice@example.com", role_name: "member" });
34546
+ * const createTenantInvite = await auth.consumer("my-app").tenants.invites.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { email: "alice@example.com", role_name: "member" });
33917
34547
  * ```
33918
34548
  */
33919
34549
  create(tenantId: string, params: ConsumerScopedTenantInviteCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<CreateTenantInvite>>;
33920
34550
  /**
33921
34551
  * Revoke a pending invite. Idempotent — revoking an already-revoked invite is a 204 no-op and fires no second webhook. PAK must hold auth.tenant.members.remove.
33922
34552
  *
34553
+ * Credential: `workspace_key`.
34554
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34555
+ *
33923
34556
  * @param tenantId - Id of the tenant.
33924
34557
  * @param inviteId - Id of the invite.
33925
34558
  * @param options - Per-request options.
@@ -33930,7 +34563,7 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
33930
34563
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenants-tenant-id-invites-invite-id
33931
34564
  * @example
33932
34565
  * ```ts
33933
- * await auth.consumer("app").tenants.invites.delete("tenant", "invite");
34566
+ * await auth.consumer("my-app").tenants.invites.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
33934
34567
  * ```
33935
34568
  */
33936
34569
  delete(tenantId: string, inviteId: string, options?: RequestOptions): APIPromise<void>;
@@ -33939,6 +34572,9 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
33939
34572
  *
33940
34573
  * Codes are never returned here — only the digest is stored. Use `status=pending` to show outstanding invitations.
33941
34574
  *
34575
+ * Credential: `workspace_key`.
34576
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34577
+ *
33942
34578
  * @param tenantId - Id of the tenant.
33943
34579
  * @param params - `Auth.ConsumerScopedTenantInviteListParams`.
33944
34580
  * @param options - Per-request options.
@@ -33950,10 +34586,10 @@ declare class ConsumerTenantsInvitesResource extends APIResource {
33950
34586
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants-tenant-id-invites
33951
34587
  * @example
33952
34588
  * ```ts
33953
- * for await (const invite of auth.consumer("app").tenants.invites.list("tenant")) {
34589
+ * for await (const invite of auth.consumer("my-app").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
33954
34590
  * console.log(invite);
33955
34591
  * }
33956
- * const page = await auth.consumer("app").tenants.invites.list("tenant", {}, { timeout: 5_000 });
34592
+ * const page = await auth.consumer("my-app").tenants.invites.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
33957
34593
  * ```
33958
34594
  */
33959
34595
  list(tenantId: string, params?: ConsumerScopedTenantInviteListParams, options?: RequestOptions): PagePromise<TenantInvite>;
@@ -33963,6 +34599,9 @@ declare class ConsumerTenantsMembersResource extends APIResource {
33963
34599
  /**
33964
34600
  * Add a member to a tenant. Pass `accountId` for an existing user, or `email` (+ optional `display_name`/`username`) to auto-create the account inline. PAK must hold auth.tenant.members.add.
33965
34601
  *
34602
+ * Credential: `workspace_key`.
34603
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34604
+ *
33966
34605
  * @param tenantId - Id of the tenant.
33967
34606
  * @param params - `Auth.ConsumerScopedTenantMemberCreateParams`.
33968
34607
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -33975,13 +34614,16 @@ declare class ConsumerTenantsMembersResource extends APIResource {
33975
34614
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenants-tenant-id-members
33976
34615
  * @example
33977
34616
  * ```ts
33978
- * const consumerAddMember = await auth.consumer("app").tenants.members.create("tenant", { role_name: "member" });
34617
+ * const consumerAddMember = await auth.consumer("my-app").tenants.members.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "member" });
33979
34618
  * ```
33980
34619
  */
33981
34620
  create(tenantId: string, params: ConsumerScopedTenantMemberCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAddMember>>;
33982
34621
  /**
33983
34622
  * Remove a member from a tenant. The underlying account row stays in the app — only the tenant_membership row is deleted. PAK must hold auth.tenant.members.remove.
33984
34623
  *
34624
+ * Credential: `workspace_key`.
34625
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34626
+ *
33985
34627
  * @param tenantId - Id of the tenant.
33986
34628
  * @param accountId - Id of the account.
33987
34629
  * @param options - Per-request options.
@@ -33992,13 +34634,16 @@ declare class ConsumerTenantsMembersResource extends APIResource {
33992
34634
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenants-tenant-id-members-account-id
33993
34635
  * @example
33994
34636
  * ```ts
33995
- * await auth.consumer("app").tenants.members.delete("tenant", "account");
34637
+ * await auth.consumer("my-app").tenants.members.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
33996
34638
  * ```
33997
34639
  */
33998
34640
  delete(tenantId: string, accountId: string, options?: RequestOptions): APIPromise<void>;
33999
34641
  /**
34000
34642
  * List members of a tenant. Cursor-paginated by joined_at desc. Filter by `?search=` and/or `?role=`. PAK must hold auth.tenant.read.
34001
34643
  *
34644
+ * Credential: `workspace_key`.
34645
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34646
+ *
34002
34647
  * @param tenantId - Id of the tenant.
34003
34648
  * @param params - `Auth.ConsumerScopedTenantMemberListParams`.
34004
34649
  * @param options - Per-request options.
@@ -34012,16 +34657,19 @@ declare class ConsumerTenantsMembersResource extends APIResource {
34012
34657
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants-tenant-id-members
34013
34658
  * @example
34014
34659
  * ```ts
34015
- * for await (const member of auth.consumer("app").tenants.members.list("tenant")) {
34660
+ * for await (const member of auth.consumer("my-app").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
34016
34661
  * console.log(member);
34017
34662
  * }
34018
- * const page = await auth.consumer("app").tenants.members.list("tenant", {}, { timeout: 5_000 });
34663
+ * const page = await auth.consumer("my-app").tenants.members.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
34019
34664
  * ```
34020
34665
  */
34021
34666
  list(tenantId: string, params?: ConsumerScopedTenantMemberListParams, options?: RequestOptions): PagePromise<ConsumerTenantMembership>;
34022
34667
  /**
34023
34668
  * Change a member's role. PAK must hold auth.tenant.members.update-role.
34024
34669
  *
34670
+ * Credential: `workspace_key`.
34671
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34672
+ *
34025
34673
  * @param tenantId - Id of the tenant.
34026
34674
  * @param accountId - Id of the account.
34027
34675
  * @param params - `Auth.ConsumerScopedTenantMemberUpdateParams`.
@@ -34034,7 +34682,7 @@ declare class ConsumerTenantsMembersResource extends APIResource {
34034
34682
  * @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-tenants-tenant-id-members-account-id
34035
34683
  * @example
34036
34684
  * ```ts
34037
- * const consumerTenantMembership = await auth.consumer("app").tenants.members.update("tenant", "account", { role_name: "admin" });
34685
+ * const consumerTenantMembership = await auth.consumer("my-app").tenants.members.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "admin" });
34038
34686
  * ```
34039
34687
  */
34040
34688
  update(tenantId: string, accountId: string, params: ConsumerScopedTenantMemberUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenantMembership>>;
@@ -34047,6 +34695,9 @@ declare class ConsumerTenantsResource extends APIResource {
34047
34695
  /**
34048
34696
  * Create a tenant inside this app. Returns the new tenant with a `display_id` (`tnt_<12hex>`). PAK must hold auth.tenant.create.
34049
34697
  *
34698
+ * Credential: `workspace_key`.
34699
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34700
+ *
34050
34701
  * @param params - `Auth.ConsumerScopedTenantCreateParams`.
34051
34702
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
34052
34703
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid display_name or slug.
@@ -34059,13 +34710,16 @@ declare class ConsumerTenantsResource extends APIResource {
34059
34710
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-tenants
34060
34711
  * @example
34061
34712
  * ```ts
34062
- * const consumerTenant = await auth.consumer("app").tenants.create({ display_name: "Acme Co" });
34713
+ * const consumerTenant = await auth.consumer("my-app").tenants.create({ display_name: "Acme Co" });
34063
34714
  * ```
34064
34715
  */
34065
34716
  create(params: ConsumerScopedTenantCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenant>>;
34066
34717
  /**
34067
34718
  * Delete a tenant. Cascades to tenant_membership rows; account rows are unaffected. PAK must hold auth.tenant.delete.
34068
34719
  *
34720
+ * Credential: `workspace_key`.
34721
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34722
+ *
34069
34723
  * @param tenantId - Id of the tenant.
34070
34724
  * @param options - Per-request options.
34071
34725
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -34075,13 +34729,16 @@ declare class ConsumerTenantsResource extends APIResource {
34075
34729
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-tenants-tenant-id
34076
34730
  * @example
34077
34731
  * ```ts
34078
- * await auth.consumer("app").tenants.delete("tenant");
34732
+ * await auth.consumer("my-app").tenants.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
34079
34733
  * ```
34080
34734
  */
34081
34735
  delete(tenantId: string, options?: RequestOptions): APIPromise<void>;
34082
34736
  /**
34083
34737
  * List tenants in this app, paginated by created_at desc. PAK must hold auth.tenant.read.
34084
34738
  *
34739
+ * Credential: `workspace_key`.
34740
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34741
+ *
34085
34742
  * @param params - `Auth.ConsumerScopedTenantListParams`.
34086
34743
  * @param options - Per-request options.
34087
34744
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Invalid `status` filter or malformed `cursor`.
@@ -34094,16 +34751,19 @@ declare class ConsumerTenantsResource extends APIResource {
34094
34751
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants
34095
34752
  * @example
34096
34753
  * ```ts
34097
- * for await (const tenant of auth.consumer("app").tenants.list()) {
34754
+ * for await (const tenant of auth.consumer("my-app").tenants.list()) {
34098
34755
  * console.log(tenant);
34099
34756
  * }
34100
- * const page = await auth.consumer("app").tenants.list({}, { timeout: 5_000 });
34757
+ * const page = await auth.consumer("my-app").tenants.list({}, { timeout: 5_000 });
34101
34758
  * ```
34102
34759
  */
34103
34760
  list(params?: ConsumerScopedTenantListParams, options?: RequestOptions): PagePromise<ConsumerTenant>;
34104
34761
  /**
34105
34762
  * Fetch a single tenant by its UUID or `tnt_<12hex>` display id. PAK must hold auth.tenant.read.
34106
34763
  *
34764
+ * Credential: `workspace_key`.
34765
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34766
+ *
34107
34767
  * @param tenantId - Id of the tenant.
34108
34768
  * @param options - Per-request options.
34109
34769
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -34113,13 +34773,16 @@ declare class ConsumerTenantsResource extends APIResource {
34113
34773
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-tenants-tenant-id
34114
34774
  * @example
34115
34775
  * ```ts
34116
- * const consumerTenant = await auth.consumer("app").tenants.retrieve("tenant");
34776
+ * const consumerTenant = await auth.consumer("my-app").tenants.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
34117
34777
  * ```
34118
34778
  */
34119
34779
  retrieve(tenantId: string, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenant>>;
34120
34780
  /**
34121
34781
  * Patch a tenant. Any subset of {display_name, slug, status, metadata}. PAK must hold auth.tenant.update.
34122
34782
  *
34783
+ * Credential: `workspace_key`.
34784
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34785
+ *
34123
34786
  * @param tenantId - Id of the tenant.
34124
34787
  * @param params - `Auth.ConsumerScopedTenantUpdateParams`.
34125
34788
  * @param options - Per-request options.
@@ -34132,7 +34795,7 @@ declare class ConsumerTenantsResource extends APIResource {
34132
34795
  * @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-tenants-tenant-id
34133
34796
  * @example
34134
34797
  * ```ts
34135
- * const consumerTenant = await auth.consumer("app").tenants.update("tenant", { display_name: "string" });
34798
+ * const consumerTenant = await auth.consumer("my-app").tenants.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Acme Inc" });
34136
34799
  * ```
34137
34800
  */
34138
34801
  update(tenantId: string, params?: ConsumerScopedTenantUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerTenant>>;
@@ -34144,6 +34807,9 @@ declare class ConsumerUsersFactorsResource extends APIResource {
34144
34807
  *
34145
34808
  * Creates the factor in the enabled state. TOTP: returns the cleartext secret + otpauth URI + recovery codes in the response — intended for synthetic-account-style flows where the caller bundles credentials and ships them out once. Email: binds the user's verified email contact (primary by default, `contact_id` to override; 412 when unverified) and returns the masked address + recovery codes — sign-in codes are then delivered on demand via `/auth/mfa/send-code`.
34146
34809
  *
34810
+ * Credential: `workspace_key`.
34811
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34812
+ *
34147
34813
  * @param userId - Id of the user.
34148
34814
  * @param params - `Auth.UserFactorCreateParams`.
34149
34815
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
@@ -34158,13 +34824,16 @@ declare class ConsumerUsersFactorsResource extends APIResource {
34158
34824
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-users-user-id-factors
34159
34825
  * @example
34160
34826
  * ```ts
34161
- * const adminProvisionFactor = await auth.consumer("app").users.factors.create("user", { type: "totp" });
34827
+ * const adminProvisionFactor = await auth.consumer("my-app").users.factors.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { type: "totp" });
34162
34828
  * ```
34163
34829
  */
34164
34830
  create(userId: string, params: UserFactorCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<AdminProvisionFactor>>;
34165
34831
  /**
34166
34832
  * Disable a user's MFA factor
34167
34833
  *
34834
+ * Credential: `workspace_key`.
34835
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34836
+ *
34168
34837
  * @param userId - Id of the user.
34169
34838
  * @param factorId - Id of the factor.
34170
34839
  * @param options - Per-request options.
@@ -34177,13 +34846,16 @@ declare class ConsumerUsersFactorsResource extends APIResource {
34177
34846
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-users-user-id-factors-factor-id
34178
34847
  * @example
34179
34848
  * ```ts
34180
- * await auth.consumer("app").users.factors.delete("user", "factor");
34849
+ * await auth.consumer("my-app").users.factors.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
34181
34850
  * ```
34182
34851
  */
34183
34852
  delete(userId: string, factorId: string, options?: RequestOptions): APIPromise<void>;
34184
34853
  /**
34185
34854
  * List a user's MFA factors
34186
34855
  *
34856
+ * Credential: `workspace_key`.
34857
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
34858
+ *
34187
34859
  * @param userId - Id of the user.
34188
34860
  * @param options - Per-request options.
34189
34861
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing bearer token, or the Platform API Key is malformed, unknown or revoked.
@@ -34195,7 +34867,7 @@ declare class ConsumerUsersFactorsResource extends APIResource {
34195
34867
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-users-user-id-factors
34196
34868
  * @example
34197
34869
  * ```ts
34198
- * const factorList = await auth.consumer("app").users.factors.list("user");
34870
+ * const factorList = await auth.consumer("my-app").users.factors.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
34199
34871
  * ```
34200
34872
  */
34201
34873
  list(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<FactorList>>;
@@ -34211,6 +34883,11 @@ declare class ConsumerUsersResource extends APIResource {
34211
34883
  *
34212
34884
  * What is NOT distinct: the password policy. A supplied `password` goes through the same app-configured rules, the same common-password deny-list and the same breach check as `/auth/signup`.
34213
34885
  *
34886
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34887
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34888
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34889
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34890
+ *
34214
34891
  * @param params - `Auth.UserCreateParams`.
34215
34892
  * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
34216
34893
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, PASSWORD_TOO_COMMON, PASSWORD_BREACHED: Invalid email, unknown role, or a password that fails the app policy — `PASSWORD_TOO_COMMON` / `PASSWORD_BREACHED`.
@@ -34222,7 +34899,7 @@ declare class ConsumerUsersResource extends APIResource {
34222
34899
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-admin-users
34223
34900
  * @example
34224
34901
  * ```ts
34225
- * const consumerAdminCreatedUser = await auth.consumer("app").users.create({ email: "string" });
34902
+ * const consumerAdminCreatedUser = await auth.consumer("my-app").users.create({ email: "ada@example.com" });
34226
34903
  * ```
34227
34904
  */
34228
34905
  create(params: UserCreateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminCreatedUser>>;
@@ -34231,6 +34908,11 @@ declare class ConsumerUsersResource extends APIResource {
34231
34908
  *
34232
34909
  * Removes the account, its sessions, contacts, and tenant memberships. Audit rows are preserved, and the deletion itself is audited as `auth.account.deleted` with `via: consumer_admin` and the caller as actor. Fires `user.deleted` with `via: "consumer_admin"`.
34233
34910
  *
34911
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34912
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34913
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34914
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34915
+ *
34234
34916
  * @param userId - Id of the user.
34235
34917
  * @param options - Per-request options.
34236
34918
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired Consumer-API bearer: an EndUser or M2M token, or an app API key (`hdk_live_*` / `hdk_test_*`); or the account, session, M2M client or key is no longer active, or the key belongs to another app.
@@ -34241,7 +34923,7 @@ declare class ConsumerUsersResource extends APIResource {
34241
34923
  * @see https://productcraft.co/docs/auth/api-reference#delete-app-slug-v1-admin-users-user-id
34242
34924
  * @example
34243
34925
  * ```ts
34244
- * await auth.consumer("app").users.delete("user");
34926
+ * await auth.consumer("my-app").users.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
34245
34927
  * ```
34246
34928
  */
34247
34929
  delete(userId: string, options?: RequestOptions): APIPromise<void>;
@@ -34250,6 +34932,11 @@ declare class ConsumerUsersResource extends APIResource {
34250
34932
  *
34251
34933
  * Cursor-paginated. Supports the same `status` and `search` filters as the auth-admin equivalent. Use the cursor in subsequent calls — Auth does not expose offset pagination.
34252
34934
  *
34935
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34936
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34937
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34938
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34939
+ *
34253
34940
  * @param params - `Auth.UserListParams`.
34254
34941
  * @param options - Per-request options.
34255
34942
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Malformed `cursor`, or a cursor issued for a different sort order.
@@ -34261,16 +34948,21 @@ declare class ConsumerUsersResource extends APIResource {
34261
34948
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-users
34262
34949
  * @example
34263
34950
  * ```ts
34264
- * for await (const user of auth.consumer("app").users.list()) {
34951
+ * for await (const user of auth.consumer("my-app").users.list()) {
34265
34952
  * console.log(user);
34266
34953
  * }
34267
- * const page = await auth.consumer("app").users.list({}, { timeout: 5_000 });
34954
+ * const page = await auth.consumer("my-app").users.list({}, { timeout: 5_000 });
34268
34955
  * ```
34269
34956
  */
34270
34957
  list(params?: UserListParams, options?: RequestOptions): PagePromise<ConsumerAdminEndUser>;
34271
34958
  /**
34272
34959
  * Read one end-user
34273
34960
  *
34961
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34962
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34963
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34964
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34965
+ *
34274
34966
  * @param userId - Id of the user.
34275
34967
  * @param options - Per-request options.
34276
34968
  * @throws {AuthenticationError} 401 UNAUTHORIZED: Missing, invalid or expired bearer token.
@@ -34280,7 +34972,7 @@ declare class ConsumerUsersResource extends APIResource {
34280
34972
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-v1-admin-users-user-id
34281
34973
  * @example
34282
34974
  * ```ts
34283
- * const consumerAdminEndUser = await auth.consumer("app").users.retrieve("user");
34975
+ * const consumerAdminEndUser = await auth.consumer("my-app").users.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
34284
34976
  * ```
34285
34977
  */
34286
34978
  retrieve(userId: string, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminEndUser>>;
@@ -34289,6 +34981,11 @@ declare class ConsumerUsersResource extends APIResource {
34289
34981
  *
34290
34982
  * Email update promotes an existing contact to primary (not for creating new contacts — that goes through the per-contact flow).
34291
34983
  *
34984
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
34985
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
34986
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
34987
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
34988
+ *
34292
34989
  * @param userId - Id of the user.
34293
34990
  * @param params - `Auth.UserUpdateParams`.
34294
34991
  * @param options - Per-request options.
@@ -34301,7 +34998,7 @@ declare class ConsumerUsersResource extends APIResource {
34301
34998
  * @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-users-user-id
34302
34999
  * @example
34303
35000
  * ```ts
34304
- * const consumerAdminEndUser = await auth.consumer("app").users.update("user", { display_name: "string" });
35001
+ * const consumerAdminEndUser = await auth.consumer("my-app").users.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Ada Lovelace" });
34305
35002
  * ```
34306
35003
  */
34307
35004
  update(userId: string, params?: UserUpdateParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminEndUser>>;
@@ -34310,6 +35007,11 @@ declare class ConsumerUsersResource extends APIResource {
34310
35007
  *
34311
35008
  * Sets `app_membership.role_id` for the target user. For M2M callers the assignable role is bounded by the token's scopes (the guard already enforced `role.assign`); the role's own permission set is NOT additionally narrowed against the M2M scopes because M2M scopes are typically broader than per-user role perms by design (a backend cron with `user.list` + `role.assign` SHOULD be able to promote a user into a role carrying any per-app perm). EndUser admins are bounded by their own role's perms transitively — they couldn't authenticate as an admin without holding the perm.
34312
35009
  *
35010
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
35011
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
35012
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
35013
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
35014
+ *
34313
35015
  * @param userId - Id of the user.
34314
35016
  * @param params - `Auth.UserUpdateRoleParams`.
34315
35017
  * @param options - Per-request options.
@@ -34322,7 +35024,7 @@ declare class ConsumerUsersResource extends APIResource {
34322
35024
  * @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-users-user-id-role
34323
35025
  * @example
34324
35026
  * ```ts
34325
- * const consumerAdminRoleAssignment = await auth.consumer("app").users.updateRole("user", { role_name: "string" });
35027
+ * const consumerAdminRoleAssignment = await auth.consumer("my-app").users.updateRole("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "member" });
34326
35028
  * ```
34327
35029
  */
34328
35030
  updateRole(userId: string, params: UserUpdateRoleParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminRoleAssignment>>;
@@ -34331,6 +35033,11 @@ declare class ConsumerUsersResource extends APIResource {
34331
35033
  *
34332
35034
  * Setting status to `suspended` or `deactivated` also revokes all active sessions for the user (same behaviour as the auth-admin equivalent).
34333
35035
  *
35036
+ * Credential: one of `app_api_key`, `m2m_token`, `end_user_token`.
35037
+ * - `app_api_key`: An app API key (`hdk_live_…` or `hdk_test_…`) minted for this app (`POST /v1/apps/{app_id}/api-keys`). Its permissions are always enforced. A workspace key is refused.
35038
+ * - `m2m_token`: An access token from this app's client-credentials grant (`POST /{app_slug}/v1/oauth/token`).
35039
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
35040
+ *
34334
35041
  * @param userId - Id of the user.
34335
35042
  * @param params - `Auth.UserUpdateStatusParams`.
34336
35043
  * @param options - Per-request options.
@@ -34343,7 +35050,7 @@ declare class ConsumerUsersResource extends APIResource {
34343
35050
  * @see https://productcraft.co/docs/auth/api-reference#patch-app-slug-v1-admin-users-user-id-status
34344
35051
  * @example
34345
35052
  * ```ts
34346
- * const consumerAdminEndUser = await auth.consumer("app").users.updateStatus("user", { status: "active" });
35053
+ * const consumerAdminEndUser = await auth.consumer("my-app").users.updateStatus("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { status: "active" });
34347
35054
  * ```
34348
35055
  */
34349
35056
  updateStatus(userId: string, params: UserUpdateStatusParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerAdminEndUser>>;
@@ -34366,7 +35073,7 @@ declare class ConsumerVerifyResource extends APIResource {
34366
35073
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-authorize
34367
35074
  * @example
34368
35075
  * ```ts
34369
- * const authorize = await auth.consumer("app").verify.authorize({ permission: "string" });
35076
+ * const authorize = await auth.consumer("my-app").verify.authorize({ permission: "invoice.read" });
34370
35077
  * ```
34371
35078
  */
34372
35079
  authorize(params?: VerifyAuthorizeParams, options?: RequestOptions): APIPromise<WithLastResponse<Authorize>>;
@@ -34386,7 +35093,7 @@ declare class ConsumerVerifyResource extends APIResource {
34386
35093
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-authorize-batch
34387
35094
  * @example
34388
35095
  * ```ts
34389
- * const authorizeBatch = await auth.consumer("app").verify.authorizeBatch({ checks: [{}] });
35096
+ * const authorizeBatch = await auth.consumer("my-app").verify.authorizeBatch({ checks: [{}] });
34390
35097
  * ```
34391
35098
  */
34392
35099
  authorizeBatch(params: VerifyAuthorizeBatchParams, options?: RequestOptions): APIPromise<WithLastResponse<AuthorizeBatch>>;
@@ -34406,7 +35113,7 @@ declare class ConsumerVerifyResource extends APIResource {
34406
35113
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-verify
34407
35114
  * @example
34408
35115
  * ```ts
34409
- * const verify = await auth.consumer("app").verify.token({ token: "string" });
35116
+ * const verify = await auth.consumer("my-app").verify.token({ token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl" });
34410
35117
  * ```
34411
35118
  */
34412
35119
  token(params?: VerifyTokenParams, options?: RequestOptions): APIPromise<WithLastResponse<Verify>>;
@@ -34431,7 +35138,7 @@ declare class ConsumerWellKnownResource extends APIResource {
34431
35138
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-well-known-jwks-json
34432
35139
  * @example
34433
35140
  * ```ts
34434
- * const jwks = await auth.consumer("app").wellKnown.jwks();
35141
+ * const jwks = await auth.consumer("my-app").wellKnown.jwks();
34435
35142
  * ```
34436
35143
  */
34437
35144
  jwks(options?: RequestOptions): APIPromise<WithLastResponse<Jwks>>;
@@ -34447,7 +35154,7 @@ declare class ConsumerWellKnownResource extends APIResource {
34447
35154
  * @see https://productcraft.co/docs/auth/api-reference#get-app-slug-well-known-openid-configuration
34448
35155
  * @example
34449
35156
  * ```ts
34450
- * const openIdConfiguration = await auth.consumer("app").wellKnown.openidConfiguration();
35157
+ * const openIdConfiguration = await auth.consumer("my-app").wellKnown.openidConfiguration();
34451
35158
  * ```
34452
35159
  */
34453
35160
  openidConfiguration(options?: RequestOptions): APIPromise<WithLastResponse<OpenIdConfiguration>>;
@@ -34487,7 +35194,7 @@ declare class AuthConsumer extends APIResource {
34487
35194
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-accept-invite
34488
35195
  * @example
34489
35196
  * ```ts
34490
- * const result = await auth.consumer("app").acceptInvite({ code: "inv_x7H2k3jLqXr", password: "CorrectHorseBatteryStaple" });
35197
+ * const result = await auth.consumer("my-app").acceptInvite({ code: "inv_x7H2k3jLqXr", password: "CorrectHorseBatteryStaple" });
34491
35198
  * ```
34492
35199
  */
34493
35200
  acceptInvite(params: AcceptInviteParams, options?: RequestOptions): APIPromise<WithLastResponse<AcceptInviteResponse>>;
@@ -34510,7 +35217,7 @@ declare class AuthConsumer extends APIResource {
34510
35217
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-accept-tenant-invite
34511
35218
  * @example
34512
35219
  * ```ts
34513
- * const consumerToken = await auth.consumer("app").acceptTenantInvite({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU", password: "CorrectHorseBatteryStaple" });
35220
+ * const consumerToken = await auth.consumer("my-app").acceptTenantInvite({ code: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU", password: "CorrectHorseBatteryStaple" });
34514
35221
  * ```
34515
35222
  */
34516
35223
  acceptTenantInvite(params: AcceptTenantInviteParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
@@ -34526,7 +35233,7 @@ declare class AuthConsumer extends APIResource {
34526
35233
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-oauth-exchange
34527
35234
  * @example
34528
35235
  * ```ts
34529
- * const exchange = await auth.consumer("app").exchangeProviderCode({ code: "string" });
35236
+ * const exchange = await auth.consumer("my-app").exchangeProviderCode({ code: "hc_8f14e45fceea167a5a36dedd4bea2543" });
34530
35237
  * ```
34531
35238
  */
34532
35239
  exchangeProviderCode(params: ExchangeProviderCodeParams, options?: RequestOptions): APIPromise<WithLastResponse<Exchange>>;
@@ -34547,7 +35254,9 @@ declare class AuthConsumer extends APIResource {
34547
35254
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-logout
34548
35255
  * @example
34549
35256
  * ```ts
34550
- * await auth.consumer("app").logout({ refresh_token: "string" });
35257
+ * await auth.consumer("my-app").logout({
35258
+ * refresh_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl",
35259
+ * });
34551
35260
  * ```
34552
35261
  */
34553
35262
  logout(params: LogoutParams, options?: RequestOptions): APIPromise<void>;
@@ -34568,7 +35277,9 @@ declare class AuthConsumer extends APIResource {
34568
35277
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-refresh
34569
35278
  * @example
34570
35279
  * ```ts
34571
- * const consumerToken = await auth.consumer("app").refresh({ refresh_token: "string" });
35280
+ * const consumerToken = await auth.consumer("my-app").refresh({
35281
+ * refresh_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJ0eXAiOiJyZWZyZXNoIn0.c2lnbmF0dXJl",
35282
+ * });
34572
35283
  * ```
34573
35284
  */
34574
35285
  refresh(params: RefreshParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
@@ -34581,6 +35292,9 @@ declare class AuthConsumer extends APIResource {
34581
35292
  *
34582
35293
  * Renamed from /auth/request-reset.
34583
35294
  *
35295
+ * Credential: `workspace_key`.
35296
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
35297
+ *
34584
35298
  * @param params - `Auth.RequestPasswordResetParams`.
34585
35299
  * @param options - Per-request options.
34586
35300
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Provide exactly one of `email` or `phone`, or request validation failed in the global `ValidationPipe`.
@@ -34593,7 +35307,7 @@ declare class AuthConsumer extends APIResource {
34593
35307
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-request-password-reset
34594
35308
  * @example
34595
35309
  * ```ts
34596
- * const consumerCodeIssue = await auth.consumer("app").requestPasswordReset({ email: "jane@example.com" });
35310
+ * const consumerCodeIssue = await auth.consumer("my-app").requestPasswordReset({ email: "jane@example.com" });
34597
35311
  * ```
34598
35312
  */
34599
35313
  requestPasswordReset(params?: RequestPasswordResetParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeIssue>>;
@@ -34606,6 +35320,9 @@ declare class AuthConsumer extends APIResource {
34606
35320
  *
34607
35321
  * Issuing a code invalidates any previously issued, unconsumed code for the same contact — including the one auto-emailed at signup. Only the most recently minted code is accepted.
34608
35322
  *
35323
+ * Credential: `workspace_key`.
35324
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
35325
+ *
34609
35326
  * @param params - `Auth.RequestVerificationParams`.
34610
35327
  * @param options - Per-request options.
34611
35328
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Provide exactly one of `email` or `phone`, or request validation failed in the global `ValidationPipe`.
@@ -34618,7 +35335,7 @@ declare class AuthConsumer extends APIResource {
34618
35335
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-request-verification
34619
35336
  * @example
34620
35337
  * ```ts
34621
- * const consumerCodeIssue = await auth.consumer("app").requestVerification({ email: "jane@example.com" });
35338
+ * const consumerCodeIssue = await auth.consumer("my-app").requestVerification({ email: "jane@example.com" });
34622
35339
  * ```
34623
35340
  */
34624
35341
  requestVerification(params?: RequestVerificationParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeIssue>>;
@@ -34640,7 +35357,7 @@ declare class AuthConsumer extends APIResource {
34640
35357
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-reset-password
34641
35358
  * @example
34642
35359
  * ```ts
34643
- * await auth.consumer("app").resetPassword({ code: "123456", new_password: "string" });
35360
+ * await auth.consumer("my-app").resetPassword({ code: "123456", new_password: "a new long passphrase 42" });
34644
35361
  * ```
34645
35362
  */
34646
35363
  resetPassword(params: ResetPasswordParams, options?: RequestOptions): APIPromise<void>;
@@ -34649,6 +35366,9 @@ declare class AuthConsumer extends APIResource {
34649
35366
  *
34650
35367
  * Same shape as `send-verification-email` but for the reset slot. PAK perm: `auth.user.password-reset.send-email`. Same loud precondition errors. Email-only.
34651
35368
  *
35369
+ * Credential: `workspace_key`.
35370
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
35371
+ *
34652
35372
  * @param params - `Auth.SendPasswordResetEmailParams`.
34653
35373
  * @param options - Per-request options.
34654
35374
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
@@ -34663,7 +35383,7 @@ declare class AuthConsumer extends APIResource {
34663
35383
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-send-password-reset-email
34664
35384
  * @example
34665
35385
  * ```ts
34666
- * const consumerCodeDispatch = await auth.consumer("app").sendPasswordResetEmail({ email: "jane@example.com" });
35386
+ * const consumerCodeDispatch = await auth.consumer("my-app").sendPasswordResetEmail({ email: "jane@example.com" });
34667
35387
  * ```
34668
35388
  */
34669
35389
  sendPasswordResetEmail(params: SendPasswordResetEmailParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeDispatch>>;
@@ -34685,6 +35405,9 @@ declare class AuthConsumer extends APIResource {
34685
35405
  *
34686
35406
  * Issuing a code invalidates any previously issued, unconsumed code for the same contact — including the one auto-emailed at signup. Only the most recently minted code is accepted.
34687
35407
  *
35408
+ * Credential: `workspace_key`.
35409
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
35410
+ *
34688
35411
  * @param params - `Auth.SendVerificationEmailParams`.
34689
35412
  * @param options - Per-request options.
34690
35413
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
@@ -34699,7 +35422,7 @@ declare class AuthConsumer extends APIResource {
34699
35422
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-send-verification-email
34700
35423
  * @example
34701
35424
  * ```ts
34702
- * const consumerCodeDispatch = await auth.consumer("app").sendVerificationEmail({ email: "jane@example.com" });
35425
+ * const consumerCodeDispatch = await auth.consumer("my-app").sendVerificationEmail({ email: "jane@example.com" });
34703
35426
  * ```
34704
35427
  */
34705
35428
  sendVerificationEmail(params: SendVerificationEmailParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerCodeDispatch>>;
@@ -34721,7 +35444,7 @@ declare class AuthConsumer extends APIResource {
34721
35444
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-signin
34722
35445
  * @example
34723
35446
  * ```ts
34724
- * const result = await auth.consumer("app").signin({ identifier: "jane_doe", password: "string" });
35447
+ * const result = await auth.consumer("my-app").signin({ identifier: "jane_doe", password: "correct horse battery staple" });
34725
35448
  * ```
34726
35449
  */
34727
35450
  signin(params: SigninParams, options?: RequestOptions): APIPromise<WithLastResponse<SigninResponse>>;
@@ -34740,7 +35463,10 @@ declare class AuthConsumer extends APIResource {
34740
35463
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-oauth-provider
34741
35464
  * @example
34742
35465
  * ```ts
34743
- * const result = await auth.consumer("app").signinWithProvider("provider", { id_token: "string", nonce: "string" });
35466
+ * const result = await auth.consumer("my-app").signinWithProvider("google", {
35467
+ * id_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6ImsxIn0.eyJzdWIiOiJ1c3JfMSJ9.c2lnbmF0dXJl",
35468
+ * nonce: "n-0S6_WzA2Mj",
35469
+ * });
34744
35470
  * ```
34745
35471
  */
34746
35472
  signinWithProvider(provider: string, params: SigninWithProviderParams, options?: RequestOptions): APIPromise<WithLastResponse<SigninWithProviderResponse>>;
@@ -34753,11 +35479,14 @@ declare class AuthConsumer extends APIResource {
34753
35479
  *
34754
35480
  * When the app has bot protection on (`auth_config.bot_protection`, Cloudflare Turnstile or hCaptcha), send the widget response as `bot_protection_token`. Auth verifies it with the provider before it looks at the email, username or password, and refuses the sign-up when the token is missing (400 `BOT_PROTECTION_REQUIRED`), rejected (403 `BOT_PROTECTION_FAILED`) or cannot be checked (503 `BOT_PROTECTION_UNAVAILABLE`; no account is created). This applies to PAK-authenticated calls too: a backend forwards the token its browser received.
34755
35481
  *
35482
+ * Credential (optional): `workspace_key`.
35483
+ * - `workspace_key`: A workspace API key (`pcft_live_…`, what the SDKs read from `PRODUCTCRAFT_API_KEY`) or a signed-in ProductCraft platform session token. Its workspace policy decides what it may do.
35484
+ *
34756
35485
  * @param params - `Auth.SignupParams`.
34757
35486
  * @param options - Per-request options.
34758
35487
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, BOT_PROTECTION_REQUIRED: `BOT_PROTECTION_REQUIRED`: the app has bot protection on and the request carried no `bot_protection_token`. Also: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
34759
35488
  * @throws {AuthenticationError} 401 UNAUTHORIZED: The app sets `signup_requires_pak` and no Platform API Key was presented on `Authorization: Bearer`.
34760
- * @throws {PermissionDeniedError} 403 FORBIDDEN, BOT_PROTECTION_FAILED, APP_SUSPENDED, APP_ARCHIVED: `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app, the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`).
35489
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, BOT_PROTECTION_FAILED, APP_SUSPENDED, APP_ARCHIVED: `BOT_PROTECTION_FAILED`: the bot-protection provider rejected the `bot_protection_token` (bad, expired or already used), or the hostname it reported is not one of the app's `bot_protection.expected_hostnames`; render a fresh widget and retry. Otherwise: signup is disabled for this app (new apps start with `signup_enabled: false`; turn it on with `PATCH /v1/apps/{app_id}/auth-config`), the email domain is not on the app's allow-list, the presented PAK belongs to a different workspace, or its policy denies `auth.signup.create` on this app. Also returned when the app itself is suspended (`APP_SUSPENDED`) or archived (`APP_ARCHIVED`).
34761
35490
  * @throws {NotFoundError} 404 NOT_FOUND: The `:appSlug` in the path matches no app (or no live rename alias for one). This is about the **app**, not the account — it is decided before any identifier, code or credential in the body is looked at, so it is never a signal about whether an account or a contact exists.
34762
35491
  * @throws {ConflictError} 409 CONFLICT: Email or username already in use in this app, or the app has no workspace binding and therefore cannot accept a PAK signup.
34763
35492
  * @throws {APIError} 415 UNSUPPORTED_MEDIA_TYPE: The request body was sent as `application/x-www-form-urlencoded` (`UNSUPPORTED_MEDIA_TYPE`). This API is JSON-only: a form body is a CORS-simple request that skips preflight, so accepting one would widen the CSRF surface. Send `application/json`. Rejected in `main.ts` before routing, on every non-GET request.
@@ -34767,7 +35496,7 @@ declare class AuthConsumer extends APIResource {
34767
35496
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-signup
34768
35497
  * @example
34769
35498
  * ```ts
34770
- * const result = await auth.consumer("app").signup({ email: "jane@example.com", password: "CorrectHorseBatteryStaple", username: "john_doe" });
35499
+ * const result = await auth.consumer("my-app").signup({ email: "jane@example.com", password: "CorrectHorseBatteryStaple", username: "john_doe" });
34771
35500
  * ```
34772
35501
  */
34773
35502
  signup(params: SignupParams, options?: RequestOptions): APIPromise<WithLastResponse<SignupResponse>>;
@@ -34776,6 +35505,9 @@ declare class AuthConsumer extends APIResource {
34776
35505
  *
34777
35506
  * Re-issues the EndUser's access + refresh tokens with the new `org_id` + `org_role` claims, after verifying the caller holds a tenant_membership for the target tenant. The session row is updated to the new tenant so subsequent refreshes preserve the context. The new access token keeps the session's `amr` and `mfa_at` (as `/auth/refresh` does), so a sign-in that completed MFA still proves it after a switch. Refresh-token rotation runs as usual; the previous refresh token enters the standard 60-second grace window.
34778
35507
  *
35508
+ * Credential: `end_user_token`.
35509
+ * - `end_user_token`: An end user's access token for this app, from `signin`, `signup` or `refresh`. Acts as that user.
35510
+ *
34779
35511
  * @param params - `Auth.SwitchTenantParams`.
34780
35512
  * @param options - Per-request options.
34781
35513
  * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: Request validation failed: a required body field is missing, has the wrong type, or fails its format constraint. Produced by the global `ValidationPipe` before the handler runs; the response body lists the offending fields.
@@ -34788,7 +35520,7 @@ declare class AuthConsumer extends APIResource {
34788
35520
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-switch-tenant
34789
35521
  * @example
34790
35522
  * ```ts
34791
- * const consumerToken = await auth.consumer("app").switchTenant({ tenant_id: "string" });
35523
+ * const consumerToken = await auth.consumer("my-app").switchTenant({ tenant_id: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f" });
34792
35524
  * ```
34793
35525
  */
34794
35526
  switchTenant(params: SwitchTenantParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerToken>>;
@@ -34811,7 +35543,7 @@ declare class AuthConsumer extends APIResource {
34811
35543
  * @see https://productcraft.co/docs/auth/api-reference#post-app-slug-v1-auth-verify
34812
35544
  * @example
34813
35545
  * ```ts
34814
- * const consumerVerify = await auth.consumer("app").verifyEmail({ code: "123456" });
35546
+ * const consumerVerify = await auth.consumer("my-app").verifyEmail({ code: "123456" });
34815
35547
  * ```
34816
35548
  */
34817
35549
  verifyEmail(params: VerifyEmailParams, options?: RequestOptions): APIPromise<WithLastResponse<ConsumerVerify>>;
@@ -35793,6 +36525,7 @@ type __UserSignupEvent = UserSignupEvent;
35793
36525
  type __UserSuspendedEvent = UserSuspendedEvent;
35794
36526
  type __UnknownWebhookEvent = UnknownWebhookEvent;
35795
36527
  type __UnwrapWebhookEvent = UnwrapWebhookEvent;
36528
+ type __WebhookSignParams = WebhookSignParams;
35796
36529
  type __WebhookUnwrapParams = WebhookUnwrapParams;
35797
36530
  /**
35798
36531
  * ProductCraft Auth API client (apps, end users, roles, sign-in flows, sessions, MFA and tenants). Every method is generated from the API's OpenAPI document.
@@ -36418,6 +37151,7 @@ declare namespace Auth {
36418
37151
  type UserSuspendedEvent = __UserSuspendedEvent;
36419
37152
  type UnknownWebhookEvent = __UnknownWebhookEvent;
36420
37153
  type UnwrapWebhookEvent = __UnwrapWebhookEvent;
37154
+ type WebhookSignParams = __WebhookSignParams;
36421
37155
  type WebhookUnwrapParams = __WebhookUnwrapParams;
36422
37156
  }
36423
37157