From ba42a56afa22769289109c42a0ff9787c7465464 Mon Sep 17 00:00:00 2001 From: Flo Date: Tue, 28 Oct 2025 13:04:44 +0100 Subject: [PATCH 1/6] feat: add identity-based credits OpenAPI specifications - Add Credits and CreditsRefill schema definitions - Add CreditOperation and CreditInterval enums - Add updateCredits endpoints for keys and identities - Update key and identity schemas to include credits field - Add UpdateCredits and UpdateCreditsRefill request/response types - Update generated OpenAPI specs --- apps/docs/docs.json | 45 ++- go/apps/api/openapi/gen.go | 167 +++++++---- go/apps/api/openapi/openapi-generated.yaml | 280 +++++++++++++----- go/apps/api/openapi/openapi-split.yaml | 2 + go/apps/api/openapi/overlay.yaml | 22 +- .../openapi/spec/common/CreditInterval.yaml | 6 + .../openapi/spec/common/CreditOperation.yaml | 8 + go/apps/api/openapi/spec/common/Credits.yaml | 17 ++ .../openapi/spec/common/CreditsRefill.yaml | 25 ++ go/apps/api/openapi/spec/common/Identity.yaml | 2 + .../openapi/spec/common/KeyResponseData.yaml | 2 +- .../openapi/spec/common/UpdateCredits.yaml | 21 ++ .../spec/common/UpdateCreditsRefill.yaml | 27 ++ ...V2IdentitiesCreateIdentityRequestBody.yaml | 9 + .../v2/identities/deleteIdentity/index.yaml | 2 +- .../v2/identities/getIdentity/index.yaml | 2 +- .../V2IdentitiesUpdateCreditsRequestBody.yaml | 70 +++++ ...V2IdentitiesUpdateCreditsResponseBody.yaml | 56 ++++ .../v2/identities/updateCredits/index.yaml | 70 +++++ ...V2IdentitiesUpdateIdentityRequestBody.yaml | 2 + .../createKey/V2KeysCreateKeyRequestBody.yaml | 2 +- .../V2KeysUpdateCreditsRequestBody.yaml | 9 +- .../V2KeysUpdateCreditsResponseBody.yaml | 2 +- .../paths/v2/keys/updateCredits/index.yaml | 4 +- .../updateKey/V2KeysUpdateKeyRequestBody.yaml | 2 +- 25 files changed, 677 insertions(+), 177 deletions(-) create mode 100644 go/apps/api/openapi/spec/common/CreditInterval.yaml create mode 100644 go/apps/api/openapi/spec/common/CreditOperation.yaml create mode 100644 go/apps/api/openapi/spec/common/Credits.yaml create mode 100644 go/apps/api/openapi/spec/common/CreditsRefill.yaml create mode 100644 go/apps/api/openapi/spec/common/UpdateCredits.yaml create mode 100644 go/apps/api/openapi/spec/common/UpdateCreditsRefill.yaml create mode 100644 go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsRequestBody.yaml create mode 100644 go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsResponseBody.yaml create mode 100644 go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml diff --git a/apps/docs/docs.json b/apps/docs/docs.json index 0f1c806bd8..ed595cb096 100644 --- a/apps/docs/docs.json +++ b/apps/docs/docs.json @@ -79,7 +79,9 @@ }, { "group": "Identities", - "pages": ["quickstart/identities/shared-ratelimits"] + "pages": [ + "quickstart/identities/shared-ratelimits" + ] } ] }, @@ -113,7 +115,10 @@ { "group": "Identities", "icon": "fingerprint", - "pages": ["concepts/identities/overview", "concepts/identities/ratelimits"] + "pages": [ + "concepts/identities/overview", + "concepts/identities/ratelimits" + ] } ] }, @@ -130,7 +135,9 @@ "pages": [ { "group": "Ratelimiting", - "pages": ["apis/features/ratelimiting/overview"] + "pages": [ + "apis/features/ratelimiting/overview" + ] }, "apis/features/temp-keys", "apis/features/remaining", @@ -165,7 +172,10 @@ { "group": "Audit logs", "icon": "scroll", - "pages": ["audit-log/introduction", "audit-log/types"] + "pages": [ + "audit-log/introduction", + "audit-log/types" + ] }, { "group": "Analytics", @@ -187,7 +197,10 @@ { "group": "Migrating API Keys", "icon": "plane", - "pages": ["migrations/introduction", "migrations/keys"] + "pages": [ + "migrations/introduction", + "migrations/keys" + ] } ] }, @@ -269,7 +282,9 @@ }, { "group": "Too Many Requests", - "pages": ["errors/user/too_many_requests/query_quota_exceeded"] + "pages": [ + "errors/user/too_many_requests/query_quota_exceeded" + ] }, { "group": "Unprocessable Entity", @@ -375,11 +390,15 @@ }, { "group": "Go", - "pages": ["libraries/go/api"] + "pages": [ + "libraries/go/api" + ] }, { "group": "Python", - "pages": ["libraries/py/api"] + "pages": [ + "libraries/py/api" + ] } ] }, @@ -404,11 +423,15 @@ }, { "group": "Nuxt", - "pages": ["libraries/nuxt/overview"] + "pages": [ + "libraries/nuxt/overview" + ] }, { "group": "Rust", - "pages": ["libraries/rs/overview"] + "pages": [ + "libraries/rs/overview" + ] }, { "group": "Springboot", @@ -451,4 +474,4 @@ "codeblocks": "system" }, "theme": "maple" -} +} \ No newline at end of file diff --git a/go/apps/api/openapi/gen.go b/go/apps/api/openapi/gen.go index cdc207dbca..7ed9c82c62 100644 --- a/go/apps/api/openapi/gen.go +++ b/go/apps/api/openapi/gen.go @@ -11,23 +11,17 @@ const ( RootKeyScopes = "rootKey.Scopes" ) -// Defines values for KeyCreditsRefillInterval. +// Defines values for CreditInterval. const ( - KeyCreditsRefillIntervalDaily KeyCreditsRefillInterval = "daily" - KeyCreditsRefillIntervalMonthly KeyCreditsRefillInterval = "monthly" + Daily CreditInterval = "daily" + Monthly CreditInterval = "monthly" ) -// Defines values for UpdateKeyCreditsRefillInterval. +// Defines values for CreditOperation. const ( - UpdateKeyCreditsRefillIntervalDaily UpdateKeyCreditsRefillInterval = "daily" - UpdateKeyCreditsRefillIntervalMonthly UpdateKeyCreditsRefillInterval = "monthly" -) - -// Defines values for V2KeysUpdateCreditsRequestBodyOperation. -const ( - Decrement V2KeysUpdateCreditsRequestBodyOperation = "decrement" - Increment V2KeysUpdateCreditsRequestBodyOperation = "increment" - Set V2KeysUpdateCreditsRequestBodyOperation = "set" + Decrement CreditOperation = "decrement" + Increment CreditOperation = "increment" + Set CreditOperation = "set" ) // Defines values for V2KeysVerifyKeyResponseDataCode. @@ -126,6 +120,35 @@ type ConflictErrorResponse struct { Meta Meta `json:"meta"` } +// CreditInterval How often credits are automatically refilled. +type CreditInterval string + +// CreditOperation Defines how to modify credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. +type CreditOperation string + +// Credits Credit configuration and remaining balance. +type Credits struct { + // Refill Configuration for automatic credit refill behavior. + Refill *CreditsRefill `json:"refill,omitempty"` + + // Remaining Number of credits remaining (null for unlimited). + Remaining nullable.Nullable[int64] `json:"remaining"` +} + +// CreditsRefill Configuration for automatic credit refill behavior. +type CreditsRefill struct { + // Amount Number of credits to add during each refill cycle. + Amount int64 `json:"amount"` + + // Interval How often credits are automatically refilled. + Interval CreditInterval `json:"interval"` + + // RefillDay Day of the month for monthly refills (1-31). + // Only required when interval is 'monthly'. + // For days beyond the month's length, refill occurs on the last day of the month. + RefillDay *int `json:"refillDay,omitempty"` +} + // EmptyResponse Empty response object by design. A successful response indicates this operation was successfully executed. type EmptyResponse = map[string]interface{} @@ -159,6 +182,9 @@ type GoneErrorResponse struct { // Identity defines model for Identity. type Identity struct { + // Credits Credit configuration and remaining balance. + Credits *Credits `json:"credits,omitempty"` + // ExternalId External identity ID ExternalId string `json:"externalId"` @@ -186,39 +212,13 @@ type InternalServerErrorResponse struct { Meta Meta `json:"meta"` } -// KeyCreditsData Credit configuration and remaining balance for this key. -type KeyCreditsData struct { - // Refill Configuration for automatic credit refill behavior. - Refill *KeyCreditsRefill `json:"refill,omitempty"` - - // Remaining Number of credits remaining (null for unlimited). - Remaining nullable.Nullable[int64] `json:"remaining"` -} - -// KeyCreditsRefill Configuration for automatic credit refill behavior. -type KeyCreditsRefill struct { - // Amount Number of credits to add during each refill cycle. - Amount int64 `json:"amount"` - - // Interval How often credits are automatically refilled. - Interval KeyCreditsRefillInterval `json:"interval"` - - // RefillDay Day of the month for monthly refills (1-31). - // Only required when interval is 'monthly'. - // For days beyond the month's length, refill occurs on the last day of the month. - RefillDay *int `json:"refillDay,omitempty"` -} - -// KeyCreditsRefillInterval How often credits are automatically refilled. -type KeyCreditsRefillInterval string - // KeyResponseData defines model for KeyResponseData. type KeyResponseData struct { // CreatedAt Unix timestamp in milliseconds when key was created. CreatedAt int64 `json:"createdAt"` - // Credits Credit configuration and remaining balance for this key. - Credits *KeyCreditsData `json:"credits,omitempty"` + // Credits Credit configuration and remaining balance. + Credits *Credits `json:"credits,omitempty"` // Enabled Whether the key is enabled or disabled. Enabled bool `json:"enabled"` @@ -520,22 +520,25 @@ type UnprocessableEntityErrorResponse struct { Meta Meta `json:"meta"` } -// UpdateKeyCreditsData Credit configuration and remaining balance for this key. -type UpdateKeyCreditsData struct { - // Refill Configuration for automatic credit refill behavior. - Refill nullable.Nullable[UpdateKeyCreditsRefill] `json:"refill,omitempty"` +// UpdateCredits Update credit configuration. +// Omitting this field preserves existing credits, while setting to null removes credit limits entirely. +// +// Use this for adjusting usage quotas when users change subscription plans or purchase additional credits. +type UpdateCredits struct { + // Refill Configuration for automatic credit refill behavior. Set to null to disable refills. + Refill nullable.Nullable[UpdateCreditsRefill] `json:"refill,omitempty"` - // Remaining Number of credits remaining (null for unlimited). This also clears the refilling schedule. + // Remaining Number of credits remaining (null for unlimited). Remaining nullable.Nullable[int64] `json:"remaining,omitempty"` } -// UpdateKeyCreditsRefill Configuration for automatic credit refill behavior. -type UpdateKeyCreditsRefill struct { +// UpdateCreditsRefill Configuration for automatic credit refill behavior. Set to null to disable refills. +type UpdateCreditsRefill struct { // Amount Number of credits to add during each refill cycle. Amount int64 `json:"amount"` // Interval How often credits are automatically refilled. - Interval UpdateKeyCreditsRefillInterval `json:"interval"` + Interval CreditInterval `json:"interval"` // RefillDay Day of the month for monthly refills (1-31). // Only required when interval is 'monthly'. @@ -543,9 +546,6 @@ type UpdateKeyCreditsRefill struct { RefillDay *int `json:"refillDay,omitempty"` } -// UpdateKeyCreditsRefillInterval How often credits are automatically refilled. -type UpdateKeyCreditsRefillInterval string - // V2AnalyticsGetVerificationsRequestBody defines model for V2AnalyticsGetVerificationsRequestBody. type V2AnalyticsGetVerificationsRequestBody struct { // Query SQL query to execute against your analytics data. @@ -696,6 +696,9 @@ type V2ApisListKeysResponseData = []KeyResponseData // V2IdentitiesCreateIdentityRequestBody defines model for V2IdentitiesCreateIdentityRequestBody. type V2IdentitiesCreateIdentityRequestBody struct { + // Credits Credit configuration and remaining balance. + Credits *Credits `json:"credits,omitempty"` + // ExternalId Creates an identity using your system's unique identifier for a user, organization, or entity. // Must be stable and unique across your workspace - duplicate externalIds return CONFLICT errors. // This identifier links Unkey identities to your authentication system, database records, or tenant structure. @@ -792,8 +795,39 @@ type V2IdentitiesListIdentitiesResponseBody struct { // V2IdentitiesListIdentitiesResponseData List of identities matching the specified criteria. type V2IdentitiesListIdentitiesResponseData = []Identity +// V2IdentitiesUpdateCreditsRequestBody defines model for V2IdentitiesUpdateCreditsRequestBody. +type V2IdentitiesUpdateCreditsRequestBody struct { + // Identity The ID of the identity to update. Accepts either the externalId (your system-generated identifier) or the identityId (internal identifier returned by the identity service). This uniquely identifies which identity's credits will be updated across all associated keys. + Identity string `json:"identity"` + + // Operation Defines how to modify credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. + Operation CreditOperation `json:"operation"` + + // Value The credit value to use with the specified operation. The meaning depends on the operation: for 'set', this becomes the new remaining credits value; for 'increment', this amount is added to current credits; for 'decrement', this amount is subtracted from current credits. + // + // Set to null when using 'set' operation to make the identity unlimited (removes usage restrictions entirely). When decrementing, if the result would be negative, remaining credits are automatically set to zero. Credits are consumed during successful key verification for keys associated with this identity, and when credits reach zero, verification fails with `code=INSUFFICIENT_CREDITS`. + // + // Required when using 'increment' or 'decrement' operations. Optional for 'set' operation (null creates unlimited usage). + Value nullable.Nullable[int64] `json:"value,omitempty"` +} + +// V2IdentitiesUpdateCreditsResponseBody defines model for V2IdentitiesUpdateCreditsResponseBody. +type V2IdentitiesUpdateCreditsResponseBody struct { + // Data Credit configuration and remaining balance. + Data Credits `json:"data"` + + // Meta Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team. + Meta Meta `json:"meta"` +} + // V2IdentitiesUpdateIdentityRequestBody defines model for V2IdentitiesUpdateIdentityRequestBody. type V2IdentitiesUpdateIdentityRequestBody struct { + // Credits Update credit configuration. + // Omitting this field preserves existing credits, while setting to null removes credit limits entirely. + // + // Use this for adjusting usage quotas when users change subscription plans or purchase additional credits. + Credits nullable.Nullable[UpdateCredits] `json:"credits,omitempty"` + // Identity The ID of the identity to update. Accepts either the externalId (your system-generated identifier) or the identityId (internal identifier returned by the identity service). Identity string `json:"identity"` @@ -923,8 +957,8 @@ type V2KeysCreateKeyRequestBody struct { // Consider 32 bytes for highly sensitive APIs, but avoid values above 64 bytes unless specifically required. ByteLength *int `json:"byteLength,omitempty"` - // Credits Credit configuration and remaining balance for this key. - Credits *KeyCreditsData `json:"credits,omitempty"` + // Credits Credit configuration and remaining balance. + Credits *Credits `json:"credits,omitempty"` // Enabled Controls whether the key is active immediately upon creation. // When set to `false`, the key exists but all verification attempts fail with `code=DISABLED`. @@ -1320,8 +1354,8 @@ type V2KeysUpdateCreditsRequestBody struct { // KeyId The ID of the key to update (begins with `key_`). This is the database reference ID for the key, not the actual API key string that users authenticate with. This ID uniquely identifies which key's credits will be updated. KeyId string `json:"keyId"` - // Operation Defines how to modify the key's remaining credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. - Operation V2KeysUpdateCreditsRequestBodyOperation `json:"operation"` + // Operation Defines how to modify credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. + Operation CreditOperation `json:"operation"` // Value The credit value to use with the specified operation. The meaning depends on the operation: for 'set', this becomes the new remaining credits value; for 'increment', this amount is added to current credits; for 'decrement', this amount is subtracted from current credits. // @@ -1331,13 +1365,10 @@ type V2KeysUpdateCreditsRequestBody struct { Value nullable.Nullable[int64] `json:"value,omitempty"` } -// V2KeysUpdateCreditsRequestBodyOperation Defines how to modify the key's remaining credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. -type V2KeysUpdateCreditsRequestBodyOperation string - // V2KeysUpdateCreditsResponseBody defines model for V2KeysUpdateCreditsResponseBody. type V2KeysUpdateCreditsResponseBody struct { - // Data Credit configuration and remaining balance for this key. - Data KeyCreditsData `json:"data"` + // Data Credit configuration and remaining balance. + Data Credits `json:"data"` // Meta Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team. Meta Meta `json:"meta"` @@ -1345,8 +1376,11 @@ type V2KeysUpdateCreditsResponseBody struct { // V2KeysUpdateKeyRequestBody defines model for V2KeysUpdateKeyRequestBody. type V2KeysUpdateKeyRequestBody struct { - // Credits Credit configuration and remaining balance for this key. - Credits nullable.Nullable[UpdateKeyCreditsData] `json:"credits,omitempty"` + // Credits Update credit configuration. + // Omitting this field preserves existing credits, while setting to null removes credit limits entirely. + // + // Use this for adjusting usage quotas when users change subscription plans or purchase additional credits. + Credits nullable.Nullable[UpdateCredits] `json:"credits,omitempty"` // Enabled Controls whether the key is currently active for verification requests. // When set to `false`, all verification attempts fail with `code=DISABLED` regardless of other settings. @@ -2107,6 +2141,9 @@ type IdentitiesGetIdentityJSONRequestBody = V2IdentitiesGetIdentityRequestBody // IdentitiesListIdentitiesJSONRequestBody defines body for IdentitiesListIdentities for application/json ContentType. type IdentitiesListIdentitiesJSONRequestBody = V2IdentitiesListIdentitiesRequestBody +// UpdateIdentityCreditsJSONRequestBody defines body for UpdateIdentityCredits for application/json ContentType. +type UpdateIdentityCreditsJSONRequestBody = V2IdentitiesUpdateCreditsRequestBody + // V2IdentitiesUpdateIdentityJSONRequestBody defines body for V2IdentitiesUpdateIdentity for application/json ContentType. type V2IdentitiesUpdateIdentityJSONRequestBody = V2IdentitiesUpdateIdentityRequestBody @@ -2140,8 +2177,8 @@ type SetPermissionsJSONRequestBody = V2KeysSetPermissionsRequestBody // SetRolesJSONRequestBody defines body for SetRoles for application/json ContentType. type SetRolesJSONRequestBody = V2KeysSetRolesRequestBody -// UpdateCreditsJSONRequestBody defines body for UpdateCredits for application/json ContentType. -type UpdateCreditsJSONRequestBody = V2KeysUpdateCreditsRequestBody +// UpdateKeyCreditsJSONRequestBody defines body for UpdateKeyCredits for application/json ContentType. +type UpdateKeyCreditsJSONRequestBody = V2KeysUpdateCreditsRequestBody // UpdateKeyJSONRequestBody defines body for UpdateKey for application/json ContentType. type UpdateKeyJSONRequestBody = V2KeysUpdateKeyRequestBody diff --git a/go/apps/api/openapi/openapi-generated.yaml b/go/apps/api/openapi/openapi-generated.yaml index 22bf93a6f1..d8756f5044 100644 --- a/go/apps/api/openapi/openapi-generated.yaml +++ b/go/apps/api/openapi/openapi-generated.yaml @@ -432,6 +432,15 @@ components: - Each named limit can have different thresholds and windows When verifying keys, you can specify which limits you want to use and all keys attached to this identity will share the limits, regardless of which specific key is used. + credits: + "$ref": "#/components/schemas/Credits" + description: | + Configure credit limits for this identity that are shared across all associated keys. + When a key belonging to this identity is verified, credits are deducted from the identity's balance rather than individual key limits. + Essential for implementing usage-based billing and quota management at the user or organization level. + + Identity credits take priority over key-level credits during verification. + If not specified, the identity has unlimited credits by default. V2IdentitiesCreateIdentityResponseBody: type: object required: @@ -528,6 +537,45 @@ components: pagination: "$ref": "#/components/schemas/Pagination" additionalProperties: false + V2IdentitiesUpdateCreditsRequestBody: + type: object + required: + - identity + - operation + properties: + identity: + type: string + minLength: 3 + description: The ID of the identity to update. Accepts either the externalId (your system-generated identifier) or the identityId (internal identifier returned by the identity service). This uniquely identifies which identity's credits will be updated across all associated keys. + example: user_123 + value: + type: + - integer + - "null" + format: int64 + minimum: 0 + maximum: 9223372036854776000 + description: | + The credit value to use with the specified operation. The meaning depends on the operation: for 'set', this becomes the new remaining credits value; for 'increment', this amount is added to current credits; for 'decrement', this amount is subtracted from current credits. + + Set to null when using 'set' operation to make the identity unlimited (removes usage restrictions entirely). When decrementing, if the result would be negative, remaining credits are automatically set to zero. Credits are consumed during successful key verification for keys associated with this identity, and when credits reach zero, verification fails with `code=INSUFFICIENT_CREDITS`. + + Required when using 'increment' or 'decrement' operations. Optional for 'set' operation (null creates unlimited usage). + example: 10000 + operation: + "$ref": "#/components/schemas/CreditOperation" + additionalProperties: false + V2IdentitiesUpdateCreditsResponseBody: + type: object + required: + - meta + - data + properties: + meta: + "$ref": "#/components/schemas/Meta" + data: + "$ref": "#/components/schemas/Credits" + additionalProperties: false V2IdentitiesUpdateIdentityRequestBody: type: object properties: @@ -564,6 +612,8 @@ components: limit: 1000 duration: 3600000 autoApply: true + credits: + "$ref": "#/components/schemas/UpdateCredits" additionalProperties: false required: - identity @@ -784,7 +834,7 @@ components: Essential for trial periods, temporary access, and security compliance requiring key rotation. example: 1704067200000 credits: - "$ref": "#/components/schemas/KeyCreditsData" + "$ref": "#/components/schemas/Credits" description: | Controls usage-based limits through credit consumption with optional automatic refills. Unlike rate limits which control frequency, credits control total usage with global consistency. @@ -1166,14 +1216,7 @@ components: Required when using 'increment' or 'decrement' operations. Optional for 'set' operation (null creates unlimited usage). example: 1000 operation: - type: string - enum: - - set - - increment - - decrement - description: | - Defines how to modify the key's remaining credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. - example: set + "$ref": "#/components/schemas/CreditOperation" additionalProperties: false V2KeysUpdateCreditsResponseBody: type: object @@ -1184,7 +1227,7 @@ components: meta: "$ref": "#/components/schemas/Meta" data: - "$ref": "#/components/schemas/KeyCreditsData" + "$ref": "#/components/schemas/Credits" additionalProperties: false V2KeysUpdateKeyRequestBody: type: object @@ -1266,7 +1309,7 @@ components: Active sessions continue until their next verification attempt after expiry. example: 1704067200000 credits: - "$ref": "#/components/schemas/UpdateKeyCreditsData" + "$ref": "#/components/schemas/UpdateCredits" description: | Controls usage-based limits for this key through credit consumption. Omitting this field preserves current credit settings, while setting null enables unlimited usage. @@ -2277,7 +2320,7 @@ components: - editor - viewer credits: - "$ref": "#/components/schemas/KeyCreditsData" + "$ref": "#/components/schemas/Credits" identity: "$ref": "#/components/schemas/Identity" plaintext: @@ -2295,9 +2338,9 @@ components: - createdAt - enabled additionalProperties: false - KeyCreditsData: + Credits: type: object - description: Credit configuration and remaining balance for this key. + description: Credit configuration and remaining balance. properties: remaining: type: @@ -2309,7 +2352,7 @@ components: description: Number of credits remaining (null for unlimited). example: 1000 refill: - "$ref": "#/components/schemas/KeyCreditsRefill" + "$ref": "#/components/schemas/CreditsRefill" required: - remaining additionalProperties: false @@ -2331,6 +2374,8 @@ components: description: Identity ratelimits items: "$ref": "#/components/schemas/RatelimitResponse" + credits: + "$ref": "#/components/schemas/Credits" required: - externalId - id @@ -2375,17 +2420,12 @@ components: - duration - autoApply additionalProperties: false - KeyCreditsRefill: + CreditsRefill: type: object description: Configuration for automatic credit refill behavior. properties: interval: - type: string - enum: - - daily - - monthly - description: How often credits are automatically refilled. - example: daily + "$ref": "#/components/schemas/CreditInterval" amount: type: integer format: int64 @@ -2406,6 +2446,13 @@ components: - interval - amount additionalProperties: false + CreditInterval: + type: string + enum: + - daily + - monthly + description: How often credits are automatically refilled. + example: monthly RatelimitRequest: type: object required: @@ -2474,6 +2521,65 @@ components: items: "$ref": "#/components/schemas/Identity" description: List of identities matching the specified criteria. + CreditOperation: + type: string + enum: + - set + - increment + - decrement + description: | + Defines how to modify credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. + example: set + UpdateCredits: + type: + - object + - "null" + description: | + Update credit configuration. + Omitting this field preserves existing credits, while setting to null removes credit limits entirely. + + Use this for adjusting usage quotas when users change subscription plans or purchase additional credits. + properties: + remaining: + type: + - integer + - "null" + format: int64 + minimum: 0 + maximum: 9223372036854776000 + description: Number of credits remaining (null for unlimited). + example: 1000 + refill: + "$ref": "#/components/schemas/UpdateCreditsRefill" + additionalProperties: false + UpdateCreditsRefill: + type: + - object + - "null" + description: Configuration for automatic credit refill behavior. Set to null to disable refills. + properties: + interval: + "$ref": "#/components/schemas/CreditInterval" + amount: + type: integer + format: int64 + minimum: 1 + maximum: 9223372036854776000 + description: Number of credits to add during each refill cycle. + example: 1000 + refillDay: + type: integer + minimum: 1 + maximum: 31 + description: | + Day of the month for monthly refills (1-31). + Only required when interval is 'monthly'. + For days beyond the month's length, refill occurs on the last day of the month. + example: 15 + required: + - interval + - amount + additionalProperties: false V2KeysAddPermissionsResponseData: type: array description: |- @@ -2702,57 +2808,6 @@ components: - An empty array indicates the key now has no roles assigned at all items: "$ref": "#/components/schemas/Role" - UpdateKeyCreditsData: - type: - - object - - "null" - description: Credit configuration and remaining balance for this key. - properties: - remaining: - type: - - integer - - "null" - format: int64 - minimum: 0 - maximum: 9223372036854776000 - description: Number of credits remaining (null for unlimited). This also clears the refilling schedule. - example: 1000 - refill: - "$ref": "#/components/schemas/UpdateKeyCreditsRefill" - additionalProperties: false - UpdateKeyCreditsRefill: - type: - - object - - "null" - description: Configuration for automatic credit refill behavior. - properties: - interval: - type: string - enum: - - daily - - monthly - description: How often credits are automatically refilled. - example: daily - amount: - type: integer - format: int64 - minimum: 1 - maximum: 9223372036854776000 - description: Number of credits to add during each refill cycle. - example: 1000 - refillDay: - type: integer - minimum: 1 - maximum: 31 - description: | - Day of the month for monthly refills (1-31). - Only required when interval is 'monthly'. - For days beyond the month's length, refill occurs on the last day of the month. - example: 15 - required: - - interval - - amount - additionalProperties: false KeysVerifyKeyCredits: type: object required: @@ -3802,7 +3857,7 @@ paths: basic: summary: Delete identity value: - identity: user_123 + externalId: user_123 schema: $ref: '#/components/schemas/V2IdentitiesDeleteIdentityRequestBody' required: true @@ -3888,7 +3943,7 @@ paths: basic: summary: Get identity value: - identity: user_123 + externalId: user_123 schema: $ref: '#/components/schemas/V2IdentitiesGetIdentityRequestBody' required: true @@ -4078,6 +4133,77 @@ paths: outputs: nextCursor: $.data.cursor type: cursor + /v2/identities.updateCredits: + post: + description: | + Update credit quotas for an identity in response to plan changes, billing cycles, or usage purchases. + + Use this for user upgrades/downgrades, monthly quota resets, credit purchases, or promotional bonuses. Supports three operations: set, increment, or decrement credits. Set to null for unlimited usage. + + Identity credits are shared across all keys belonging to the identity and take priority over key-level credits during verification. + + **Important**: Setting unlimited credits automatically clears existing refill configurations. + + **Required Permissions** + + Your root key must have one of the following permissions: + - `identity.*.update_identity` (to update any identity) + - `identity..update_identity` (to update a specific identity) + + **Side Effects** + + Credit updates take effect immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes propagate instantly but may take up to 30 seconds to reach all edge regions. + operationId: updateIdentityCredits + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/V2IdentitiesUpdateCreditsRequestBody' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/V2IdentitiesUpdateCreditsResponseBody' + description: | + Credits updated successfully. Response includes updated remaining credits and refill settings. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestErrorResponse' + description: Bad request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedErrorResponse' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/ForbiddenErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundErrorResponse' + description: Not found + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerErrorResponse' + description: Internal server error + security: + - rootKey: [] + summary: Update identity credits + tags: + - identities + x-speakeasy-name-override: updateIdentityCredits /v2/identities.updateIdentity: post: description: | @@ -4882,7 +5008,7 @@ paths: **Side Effects** Credit updates remove the key from cache immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes take effect instantly but may take up to 30 seconds to propagate to all edge regions. - operationId: updateCredits + operationId: updateKeyCredits requestBody: content: application/json: @@ -4932,7 +5058,7 @@ paths: summary: Update key credits tags: - keys - x-speakeasy-name-override: updateCredits + x-speakeasy-name-override: updateKeyCredits /v2/keys.updateKey: post: description: | diff --git a/go/apps/api/openapi/openapi-split.yaml b/go/apps/api/openapi/openapi-split.yaml index 8b2c348a3d..538f909dbf 100644 --- a/go/apps/api/openapi/openapi-split.yaml +++ b/go/apps/api/openapi/openapi-split.yaml @@ -143,6 +143,8 @@ paths: $ref: "./spec/paths/v2/identities/listIdentities/index.yaml" /v2/identities.updateIdentity: $ref: "./spec/paths/v2/identities/updateIdentity/index.yaml" + /v2/identities.updateCredits: + $ref: "./spec/paths/v2/identities/updateCredits/index.yaml" # Key Endpoints /v2/keys.addPermissions: diff --git a/go/apps/api/openapi/overlay.yaml b/go/apps/api/openapi/overlay.yaml index bb716ea8d4..13f384e17a 100644 --- a/go/apps/api/openapi/overlay.yaml +++ b/go/apps/api/openapi/overlay.yaml @@ -31,23 +31,29 @@ actions: - target: $["components"]["schemas"]["V2KeysUpdateKeyRequestBody"]["properties"]["expires"] update: nullable: true - - target: $["components"]["schemas"]["KeyCreditsData"]["properties"]["remaining"]["type"] + # Credits overlays (now consolidated) + - target: $["components"]["schemas"]["Credits"]["properties"]["remaining"]["type"] update: integer - - target: $["components"]["schemas"]["KeyCreditsData"]["properties"]["remaining"] + - target: $["components"]["schemas"]["Credits"]["properties"]["remaining"] update: nullable: true - - target: $["components"]["schemas"]["UpdateKeyCreditsData"]["type"] + - target: $["components"]["schemas"]["UpdateCredits"]["type"] update: object - - target: $["components"]["schemas"]["UpdateKeyCreditsData"] + - target: $["components"]["schemas"]["UpdateCredits"] update: nullable: true - - target: $["components"]["schemas"]["UpdateKeyCreditsData"]["properties"]["remaining"]["type"] + - target: $["components"]["schemas"]["UpdateCredits"]["properties"]["remaining"]["type"] update: integer - - target: $["components"]["schemas"]["UpdateKeyCreditsData"]["properties"]["remaining"] + - target: $["components"]["schemas"]["UpdateCredits"]["properties"]["remaining"] update: nullable: true - - target: $["components"]["schemas"]["UpdateKeyCreditsRefill"]["type"] + - target: $["components"]["schemas"]["UpdateCreditsRefill"]["type"] update: object - - target: $["components"]["schemas"]["UpdateKeyCreditsRefill"] + - target: $["components"]["schemas"]["UpdateCreditsRefill"] + update: + nullable: true + - target: $["components"]["schemas"]["V2IdentitiesUpdateCreditsRequestBody"]["properties"]["value"]["type"] + update: integer + - target: $["components"]["schemas"]["V2IdentitiesUpdateCreditsRequestBody"]["properties"]["value"] update: nullable: true diff --git a/go/apps/api/openapi/spec/common/CreditInterval.yaml b/go/apps/api/openapi/spec/common/CreditInterval.yaml new file mode 100644 index 0000000000..f17fc00c21 --- /dev/null +++ b/go/apps/api/openapi/spec/common/CreditInterval.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - daily + - monthly +description: How often credits are automatically refilled. +example: monthly diff --git a/go/apps/api/openapi/spec/common/CreditOperation.yaml b/go/apps/api/openapi/spec/common/CreditOperation.yaml new file mode 100644 index 0000000000..925b8d85c2 --- /dev/null +++ b/go/apps/api/openapi/spec/common/CreditOperation.yaml @@ -0,0 +1,8 @@ +type: string +enum: + - set + - increment + - decrement +description: | + Defines how to modify credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. +example: set diff --git a/go/apps/api/openapi/spec/common/Credits.yaml b/go/apps/api/openapi/spec/common/Credits.yaml new file mode 100644 index 0000000000..3cebc63c63 --- /dev/null +++ b/go/apps/api/openapi/spec/common/Credits.yaml @@ -0,0 +1,17 @@ +type: object +description: Credit configuration and remaining balance. +properties: + remaining: + type: + - integer + - "null" + format: int64 + minimum: 0 + maximum: 9223372036854775807 + description: Number of credits remaining (null for unlimited). + example: 1000 + refill: + "$ref": "./CreditsRefill.yaml" +required: + - remaining +additionalProperties: false \ No newline at end of file diff --git a/go/apps/api/openapi/spec/common/CreditsRefill.yaml b/go/apps/api/openapi/spec/common/CreditsRefill.yaml new file mode 100644 index 0000000000..d89f3097e7 --- /dev/null +++ b/go/apps/api/openapi/spec/common/CreditsRefill.yaml @@ -0,0 +1,25 @@ +type: object +description: Configuration for automatic credit refill behavior. +properties: + interval: + "$ref": "./CreditInterval.yaml" + amount: + type: integer + format: int64 + minimum: 1 + maximum: 9223372036854775807 + description: Number of credits to add during each refill cycle. + example: 1000 + refillDay: + type: integer + minimum: 1 + maximum: 31 + description: | + Day of the month for monthly refills (1-31). + Only required when interval is 'monthly'. + For days beyond the month's length, refill occurs on the last day of the month. + example: 15 +required: + - interval + - amount +additionalProperties: false \ No newline at end of file diff --git a/go/apps/api/openapi/spec/common/Identity.yaml b/go/apps/api/openapi/spec/common/Identity.yaml index 8527d1f116..4357c93453 100644 --- a/go/apps/api/openapi/spec/common/Identity.yaml +++ b/go/apps/api/openapi/spec/common/Identity.yaml @@ -15,6 +15,8 @@ properties: description: Identity ratelimits items: "$ref": "./RatelimitResponse.yaml" + credits: + "$ref": "./Credits.yaml" required: - externalId - id diff --git a/go/apps/api/openapi/spec/common/KeyResponseData.yaml b/go/apps/api/openapi/spec/common/KeyResponseData.yaml index ed9ddb0739..5b3dadb15e 100644 --- a/go/apps/api/openapi/spec/common/KeyResponseData.yaml +++ b/go/apps/api/openapi/spec/common/KeyResponseData.yaml @@ -68,7 +68,7 @@ properties: - editor - viewer credits: - "$ref": "./KeyCreditsData.yaml" + "$ref": "./Credits.yaml" identity: "$ref": "./Identity.yaml" plaintext: diff --git a/go/apps/api/openapi/spec/common/UpdateCredits.yaml b/go/apps/api/openapi/spec/common/UpdateCredits.yaml new file mode 100644 index 0000000000..32476d277b --- /dev/null +++ b/go/apps/api/openapi/spec/common/UpdateCredits.yaml @@ -0,0 +1,21 @@ +type: + - object + - "null" +description: | + Update credit configuration. + Omitting this field preserves existing credits, while setting to null removes credit limits entirely. + + Use this for adjusting usage quotas when users change subscription plans or purchase additional credits. +properties: + remaining: + type: + - integer + - "null" + format: int64 + minimum: 0 + maximum: 9223372036854775807 + description: Number of credits remaining (null for unlimited). + example: 1000 + refill: + "$ref": "./UpdateCreditsRefill.yaml" +additionalProperties: false \ No newline at end of file diff --git a/go/apps/api/openapi/spec/common/UpdateCreditsRefill.yaml b/go/apps/api/openapi/spec/common/UpdateCreditsRefill.yaml new file mode 100644 index 0000000000..741a1236d9 --- /dev/null +++ b/go/apps/api/openapi/spec/common/UpdateCreditsRefill.yaml @@ -0,0 +1,27 @@ +type: + - object + - "null" +description: Configuration for automatic credit refill behavior. Set to null to disable refills. +properties: + interval: + "$ref": "./CreditInterval.yaml" + amount: + type: integer + format: int64 + minimum: 1 + maximum: 9223372036854775807 + description: Number of credits to add during each refill cycle. + example: 1000 + refillDay: + type: integer + minimum: 1 + maximum: 31 + description: | + Day of the month for monthly refills (1-31). + Only required when interval is 'monthly'. + For days beyond the month's length, refill occurs on the last day of the month. + example: 15 +required: + - interval + - amount +additionalProperties: false \ No newline at end of file diff --git a/go/apps/api/openapi/spec/paths/v2/identities/createIdentity/V2IdentitiesCreateIdentityRequestBody.yaml b/go/apps/api/openapi/spec/paths/v2/identities/createIdentity/V2IdentitiesCreateIdentityRequestBody.yaml index 47945e4f38..593ae23ed8 100644 --- a/go/apps/api/openapi/spec/paths/v2/identities/createIdentity/V2IdentitiesCreateIdentityRequestBody.yaml +++ b/go/apps/api/openapi/spec/paths/v2/identities/createIdentity/V2IdentitiesCreateIdentityRequestBody.yaml @@ -45,3 +45,12 @@ properties: - Each named limit can have different thresholds and windows When verifying keys, you can specify which limits you want to use and all keys attached to this identity will share the limits, regardless of which specific key is used. + credits: + "$ref": "../../../../common/Credits.yaml" + description: | + Configure credit limits for this identity that are shared across all associated keys. + When a key belonging to this identity is verified, credits are deducted from the identity's balance rather than individual key limits. + Essential for implementing usage-based billing and quota management at the user or organization level. + + Identity credits take priority over key-level credits during verification. + If not specified, the identity has unlimited credits by default. diff --git a/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml b/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml index 54c282f0bf..ff81a35b2c 100644 --- a/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml +++ b/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml @@ -24,7 +24,7 @@ post: basic: summary: Delete identity value: - identity: user_123 + externalId: user_123 required: true responses: "200": diff --git a/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml b/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml index 9cb967a05e..11310c52ba 100644 --- a/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml +++ b/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml @@ -22,7 +22,7 @@ post: basic: summary: Get identity value: - identity: user_123 + externalId: user_123 required: true responses: "200": diff --git a/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsRequestBody.yaml b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsRequestBody.yaml new file mode 100644 index 0000000000..2c830fb504 --- /dev/null +++ b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsRequestBody.yaml @@ -0,0 +1,70 @@ +type: object +required: + - identity + - operation +properties: + identity: + type: string + minLength: 3 + description: The ID of the identity to update. Accepts either the externalId (your system-generated identifier) or the identityId (internal identifier returned by the identity service). This uniquely identifies which identity's credits will be updated across all associated keys. + example: user_123 + value: + type: + - integer + - "null" + format: int64 + minimum: 0 + maximum: 9223372036854775807 + description: | + The credit value to use with the specified operation. The meaning depends on the operation: for 'set', this becomes the new remaining credits value; for 'increment', this amount is added to current credits; for 'decrement', this amount is subtracted from current credits. + + Set to null when using 'set' operation to make the identity unlimited (removes usage restrictions entirely). When decrementing, if the result would be negative, remaining credits are automatically set to zero. Credits are consumed during successful key verification for keys associated with this identity, and when credits reach zero, verification fails with `code=INSUFFICIENT_CREDITS`. + + Required when using 'increment' or 'decrement' operations. Optional for 'set' operation (null creates unlimited usage). + example: 10000 + operation: + "$ref": "../../../../common/CreditOperation.yaml" +additionalProperties: false +examples: + planUpgrade: + summary: Upgrade user to higher credit tier + description: Increase credits when user upgrades to a higher-tier plan + value: + identity: user_premium_1234 + operation: set + value: 50000 + creditPurchase: + summary: Add purchased credits to existing balance + description: User bought additional credits to add to their current quota + value: + identity: user_5678 + operation: increment + value: 10000 + unlimitedUpgrade: + summary: Upgrade to unlimited usage plan + description: Remove credit restrictions for enterprise tier users + value: + identity: org_enterprise_9876 + operation: set + value: null + billingCycleReset: + summary: Reset monthly quota at billing cycle + description: Refresh user's monthly credit allocation + value: + identity: user_monthly_abcd + operation: set + value: 100000 + policyViolation: + summary: Reduce credits for policy violation + description: Subtract credits as penalty for terms of service violation + value: + identity: user_violation_123 + operation: decrement + value: 5000 + refundCredits: + summary: Refund unused credits + description: Remove credits when processing a partial refund + value: + identity: user_refund_789 + operation: decrement + value: 15000 diff --git a/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsResponseBody.yaml b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsResponseBody.yaml new file mode 100644 index 0000000000..d909b0fd58 --- /dev/null +++ b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/V2IdentitiesUpdateCreditsResponseBody.yaml @@ -0,0 +1,56 @@ +type: object +required: + - meta + - data +properties: + meta: + "$ref": "../../../../common/Meta.yaml" + data: + "$ref": "../../../../common/Credits.yaml" +additionalProperties: false +examples: + planUpgradeSuccess: + summary: Plan upgrade completed + description: Credits updated after user upgraded to higher tier + value: + meta: + requestId: req_upgrade_1234 + data: + remaining: 50000 + refill: + interval: monthly + amount: 50000 + refillDay: 1 + creditPurchaseSuccess: + summary: Credit purchase completed + description: Additional credits added to user's balance + value: + meta: + requestId: req_purchase_5678 + data: + remaining: 35000 + refill: + interval: monthly + amount: 25000 + refillDay: 15 + unlimitedUpgradeSuccess: + summary: Unlimited upgrade completed + description: User upgraded to unlimited usage plan + value: + meta: + requestId: req_unlimited_9876 + data: + remaining: null + refill: null + billingResetSuccess: + summary: Billing cycle reset completed + description: Monthly quota refreshed at billing cycle + value: + meta: + requestId: req_reset_abcd + data: + remaining: 100000 + refill: + interval: monthly + amount: 100000 + refillDay: 1 diff --git a/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml new file mode 100644 index 0000000000..131ea18a06 --- /dev/null +++ b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml @@ -0,0 +1,70 @@ +post: + tags: + - identities + summary: Update identity credits + description: | + Update credit quotas for an identity in response to plan changes, billing cycles, or usage purchases. + + Use this for user upgrades/downgrades, monthly quota resets, credit purchases, or promotional bonuses. Supports three operations: set, increment, or decrement credits. Set to null for unlimited usage. + + Identity credits are shared across all keys belonging to the identity and take priority over key-level credits during verification. + + **Important**: Setting unlimited credits automatically clears existing refill configurations. + + **Required Permissions** + + Your root key must have one of the following permissions: + - `identity.*.update_identity` (to update any identity) + - `identity..update_identity` (to update a specific identity) + + **Side Effects** + + Credit updates take effect immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes propagate instantly but may take up to 30 seconds to reach all edge regions. + operationId: updateIdentityCredits + x-speakeasy-name-override: updateIdentityCredits + security: + - rootKey: [] + requestBody: + required: true + content: + application/json: + schema: + "$ref": "./V2IdentitiesUpdateCreditsRequestBody.yaml" + responses: + "200": + description: | + Credits updated successfully. Response includes updated remaining credits and refill settings. + content: + application/json: + schema: + "$ref": "./V2IdentitiesUpdateCreditsResponseBody.yaml" + "400": + description: Bad request + content: + application/json: + schema: + "$ref": "../../../../error/BadRequestErrorResponse.yaml" + "401": + description: Unauthorized + content: + application/json: + schema: + "$ref": "../../../../error/UnauthorizedErrorResponse.yaml" + "403": + description: Forbidden + content: + application/json: + schema: + "$ref": "../../../../error/ForbiddenErrorResponse.yaml" + "404": + description: Not found + content: + application/json: + schema: + "$ref": "../../../../error/NotFoundErrorResponse.yaml" + "500": + description: Internal server error + content: + application/json: + schema: + "$ref": "../../../../error/InternalServerErrorResponse.yaml" diff --git a/go/apps/api/openapi/spec/paths/v2/identities/updateIdentity/V2IdentitiesUpdateIdentityRequestBody.yaml b/go/apps/api/openapi/spec/paths/v2/identities/updateIdentity/V2IdentitiesUpdateIdentityRequestBody.yaml index cc533dc830..862954c9a8 100644 --- a/go/apps/api/openapi/spec/paths/v2/identities/updateIdentity/V2IdentitiesUpdateIdentityRequestBody.yaml +++ b/go/apps/api/openapi/spec/paths/v2/identities/updateIdentity/V2IdentitiesUpdateIdentityRequestBody.yaml @@ -33,6 +33,8 @@ properties: limit: 1000 duration: 3600000 autoApply: true + credits: + "$ref": "../../../../common/UpdateCredits.yaml" additionalProperties: false required: - identity diff --git a/go/apps/api/openapi/spec/paths/v2/keys/createKey/V2KeysCreateKeyRequestBody.yaml b/go/apps/api/openapi/spec/paths/v2/keys/createKey/V2KeysCreateKeyRequestBody.yaml index 09d89085a4..989fcbe3c8 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/createKey/V2KeysCreateKeyRequestBody.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/createKey/V2KeysCreateKeyRequestBody.yaml @@ -118,7 +118,7 @@ properties: Essential for trial periods, temporary access, and security compliance requiring key rotation. example: 1704067200000 credits: - "$ref": "../../../../common/KeyCreditsData.yaml" + "$ref": "../../../../common/Credits.yaml" description: | Controls usage-based limits through credit consumption with optional automatic refills. Unlike rate limits which control frequency, credits control total usage with global consistency. diff --git a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsRequestBody.yaml b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsRequestBody.yaml index f63c614209..73cf40b62b 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsRequestBody.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsRequestBody.yaml @@ -26,14 +26,7 @@ properties: Required when using 'increment' or 'decrement' operations. Optional for 'set' operation (null creates unlimited usage). example: 1000 operation: - type: string - enum: - - set - - increment - - decrement - description: | - Defines how to modify the key's remaining credits. Use 'set' to replace current credits with a specific value or unlimited usage, 'increment' to add credits for plan upgrades or credit purchases, and 'decrement' to reduce credits for refunds or policy violations. - example: set + "$ref": "../../../../common/CreditOperation.yaml" additionalProperties: false examples: planUpgrade: diff --git a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsResponseBody.yaml b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsResponseBody.yaml index df8f7b2c67..6f3e42b704 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsResponseBody.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/V2KeysUpdateCreditsResponseBody.yaml @@ -6,7 +6,7 @@ properties: meta: "$ref": "../../../../common/Meta.yaml" data: - "$ref": "../../../../common/KeyCreditsData.yaml" + "$ref": "../../../../common/Credits.yaml" additionalProperties: false examples: planUpgradeSuccess: diff --git a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml index 855b20940b..e7edfeab23 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml @@ -18,8 +18,8 @@ post: **Side Effects** Credit updates remove the key from cache immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes take effect instantly but may take up to 30 seconds to propagate to all edge regions. - operationId: updateCredits - x-speakeasy-name-override: updateCredits + operationId: updateKeyCredits + x-speakeasy-name-override: updateKeyCredits security: - rootKey: [] requestBody: diff --git a/go/apps/api/openapi/spec/paths/v2/keys/updateKey/V2KeysUpdateKeyRequestBody.yaml b/go/apps/api/openapi/spec/paths/v2/keys/updateKey/V2KeysUpdateKeyRequestBody.yaml index 7058e39fed..a5b0b4c4a9 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/updateKey/V2KeysUpdateKeyRequestBody.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/updateKey/V2KeysUpdateKeyRequestBody.yaml @@ -77,7 +77,7 @@ properties: Active sessions continue until their next verification attempt after expiry. example: 1704067200000 credits: - "$ref": "./UpdateKeyCreditsData.yaml" + "$ref": "../../../../common/UpdateCredits.yaml" description: | Controls usage-based limits for this key through credit consumption. Omitting this field preserves current credit settings, while setting null enables unlimited usage. From d901b6dc8aea4e4ed4f1230a71e6567fee32396c Mon Sep 17 00:00:00 2001 From: Flo Date: Tue, 28 Oct 2025 16:13:07 +0100 Subject: [PATCH 2/6] fix: delete unused files --- .../openapi/spec/common/KeyCreditsData.yaml | 17 ---------- .../openapi/spec/common/KeyCreditsRefill.yaml | 30 ----------------- .../keys/updateKey/UpdateKeyCreditsData.yaml | 17 ---------- .../updateKey/UpdateKeyCreditsRefill.yaml | 32 ------------------- 4 files changed, 96 deletions(-) delete mode 100644 go/apps/api/openapi/spec/common/KeyCreditsData.yaml delete mode 100644 go/apps/api/openapi/spec/common/KeyCreditsRefill.yaml delete mode 100644 go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsData.yaml delete mode 100644 go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsRefill.yaml diff --git a/go/apps/api/openapi/spec/common/KeyCreditsData.yaml b/go/apps/api/openapi/spec/common/KeyCreditsData.yaml deleted file mode 100644 index f26eab18e2..0000000000 --- a/go/apps/api/openapi/spec/common/KeyCreditsData.yaml +++ /dev/null @@ -1,17 +0,0 @@ -type: object -description: Credit configuration and remaining balance for this key. -properties: - remaining: - type: - - integer - - "null" - format: int64 - minimum: 0 - maximum: 9223372036854775807 - description: Number of credits remaining (null for unlimited). - example: 1000 - refill: - "$ref": "./KeyCreditsRefill.yaml" -required: - - remaining -additionalProperties: false diff --git a/go/apps/api/openapi/spec/common/KeyCreditsRefill.yaml b/go/apps/api/openapi/spec/common/KeyCreditsRefill.yaml deleted file mode 100644 index 2170cdf55a..0000000000 --- a/go/apps/api/openapi/spec/common/KeyCreditsRefill.yaml +++ /dev/null @@ -1,30 +0,0 @@ -type: object -description: Configuration for automatic credit refill behavior. -properties: - interval: - type: string - enum: - - daily - - monthly - description: How often credits are automatically refilled. - example: daily - amount: - type: integer - format: int64 - minimum: 1 - maximum: 9223372036854775807 - description: Number of credits to add during each refill cycle. - example: 1000 - refillDay: - type: integer - minimum: 1 - maximum: 31 - description: | - Day of the month for monthly refills (1-31). - Only required when interval is 'monthly'. - For days beyond the month's length, refill occurs on the last day of the month. - example: 15 -required: - - interval - - amount -additionalProperties: false diff --git a/go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsData.yaml b/go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsData.yaml deleted file mode 100644 index e9aacb7d14..0000000000 --- a/go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsData.yaml +++ /dev/null @@ -1,17 +0,0 @@ -type: - - object - - null -description: Credit configuration and remaining balance for this key. -properties: - remaining: - type: - - integer - - "null" - format: int64 - minimum: 0 - maximum: 9223372036854775807 - description: Number of credits remaining (null for unlimited). This also clears the refilling schedule. - example: 1000 - refill: - "$ref": "./UpdateKeyCreditsRefill.yaml" -additionalProperties: false diff --git a/go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsRefill.yaml b/go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsRefill.yaml deleted file mode 100644 index b3dd9f92ca..0000000000 --- a/go/apps/api/openapi/spec/paths/v2/keys/updateKey/UpdateKeyCreditsRefill.yaml +++ /dev/null @@ -1,32 +0,0 @@ -type: - - object - - null -description: Configuration for automatic credit refill behavior. -properties: - interval: - type: string - enum: - - daily - - monthly - description: How often credits are automatically refilled. - example: daily - amount: - type: integer - format: int64 - minimum: 1 - maximum: 9223372036854775807 - description: Number of credits to add during each refill cycle. - example: 1000 - refillDay: - type: integer - minimum: 1 - maximum: 31 - description: | - Day of the month for monthly refills (1-31). - Only required when interval is 'monthly'. - For days beyond the month's length, refill occurs on the last day of the month. - example: 15 -required: - - interval - - amount -additionalProperties: false From 95526d9544c78286b34d67c1c65c3cc5fc1a1c05 Mon Sep 17 00:00:00 2001 From: Flo Date: Wed, 29 Oct 2025 17:34:43 +0100 Subject: [PATCH 3/6] fix: expose seperate identity struct --- go/apps/api/openapi/gen.go | 19 +++++++++++++-- go/apps/api/openapi/openapi-generated.yaml | 23 ++++++++++++++++++- .../V2KeysVerifyKeyResponseData.yaml | 2 +- .../v2/keys/verifyKey/VerifyKeyIdentity.yaml | 20 ++++++++++++++++ 4 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 go/apps/api/openapi/spec/paths/v2/keys/verifyKey/VerifyKeyIdentity.yaml diff --git a/go/apps/api/openapi/gen.go b/go/apps/api/openapi/gen.go index 7ed9c82c62..4de7a6ca3b 100644 --- a/go/apps/api/openapi/gen.go +++ b/go/apps/api/openapi/gen.go @@ -1501,8 +1501,8 @@ type V2KeysVerifyKeyResponseData struct { // Expires Unix timestamp (in milliseconds) when the key will expire. // If null or not present, the key has no expiration. You can use this to // warn users about upcoming expirations or to understand the validity period. - Expires *int64 `json:"expires,omitempty"` - Identity *Identity `json:"identity,omitempty"` + Expires *int64 `json:"expires,omitempty"` + Identity *VerifyKeyIdentity `json:"identity,omitempty"` // KeyId The unique identifier of the verified key in Unkey's system. // Use this ID for operations like updating or revoking the key. This field @@ -2077,6 +2077,21 @@ type ValidationError struct { Message string `json:"message"` } +// VerifyKeyIdentity defines model for VerifyKeyIdentity. +type VerifyKeyIdentity struct { + // ExternalId External identity ID + ExternalId string `json:"externalId"` + + // Id Identity ID + Id string `json:"id"` + + // Meta Identity metadata + Meta *map[string]interface{} `json:"meta,omitempty"` + + // Ratelimits Identity ratelimits + Ratelimits *[]RatelimitResponse `json:"ratelimits,omitempty"` +} + // VerifyKeyRatelimitData defines model for VerifyKeyRatelimitData. type VerifyKeyRatelimitData struct { // AutoApply Whether this rate limit should be automatically applied when verifying keys. diff --git a/go/apps/api/openapi/openapi-generated.yaml b/go/apps/api/openapi/openapi-generated.yaml index d8756f5044..5d3affdf44 100644 --- a/go/apps/api/openapi/openapi-generated.yaml +++ b/go/apps/api/openapi/openapi-generated.yaml @@ -2945,7 +2945,7 @@ components: of permissions that grant access to specific functionality. Only returned when permissions were checked during verification. identity: - "$ref": "#/components/schemas/Identity" + "$ref": "#/components/schemas/VerifyKeyIdentity" description: | Information about the identity associated with this key. Identities allow multiple keys to share resources (like rate limits) and represent @@ -2958,6 +2958,27 @@ components: required: - valid - code + VerifyKeyIdentity: + type: object + properties: + id: + type: string + description: Identity ID + externalId: + type: string + description: External identity ID + meta: + type: object + additionalProperties: true + description: Identity metadata + ratelimits: + type: array + description: Identity ratelimits + items: + "$ref": "#/components/schemas/RatelimitResponse" + required: + - externalId + - id VerifyKeyRatelimitData: type: object properties: diff --git a/go/apps/api/openapi/spec/paths/v2/keys/verifyKey/V2KeysVerifyKeyResponseData.yaml b/go/apps/api/openapi/spec/paths/v2/keys/verifyKey/V2KeysVerifyKeyResponseData.yaml index 64c3ce29fd..ce4e6bfb31 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/verifyKey/V2KeysVerifyKeyResponseData.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/verifyKey/V2KeysVerifyKeyResponseData.yaml @@ -86,7 +86,7 @@ properties: of permissions that grant access to specific functionality. Only returned when permissions were checked during verification. identity: - "$ref": "../../../../common/Identity.yaml" + "$ref": "./VerifyKeyIdentity.yaml" description: | Information about the identity associated with this key. Identities allow multiple keys to share resources (like rate limits) and represent diff --git a/go/apps/api/openapi/spec/paths/v2/keys/verifyKey/VerifyKeyIdentity.yaml b/go/apps/api/openapi/spec/paths/v2/keys/verifyKey/VerifyKeyIdentity.yaml new file mode 100644 index 0000000000..e220483e40 --- /dev/null +++ b/go/apps/api/openapi/spec/paths/v2/keys/verifyKey/VerifyKeyIdentity.yaml @@ -0,0 +1,20 @@ +type: object +properties: + id: + type: string + description: Identity ID + externalId: + type: string + description: External identity ID + meta: + type: object + additionalProperties: true + description: Identity metadata + ratelimits: + type: array + description: Identity ratelimits + items: + "$ref": "../../../../common/RatelimitResponse.yaml" +required: + - externalId + - id From 912e03db1944fccea42c3545d3583c73fd578898 Mon Sep 17 00:00:00 2001 From: Flo Date: Wed, 29 Oct 2025 19:03:59 +0100 Subject: [PATCH 4/6] fix: undo docs change --- go/apps/api/openapi/openapi-generated.yaml | 2 +- .../openapi/spec/paths/v2/identities/deleteIdentity/index.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go/apps/api/openapi/openapi-generated.yaml b/go/apps/api/openapi/openapi-generated.yaml index 5d3affdf44..ae0ade6dbd 100644 --- a/go/apps/api/openapi/openapi-generated.yaml +++ b/go/apps/api/openapi/openapi-generated.yaml @@ -3878,7 +3878,7 @@ paths: basic: summary: Delete identity value: - externalId: user_123 + identity: user_123 schema: $ref: '#/components/schemas/V2IdentitiesDeleteIdentityRequestBody' required: true diff --git a/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml b/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml index ff81a35b2c..54c282f0bf 100644 --- a/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml +++ b/go/apps/api/openapi/spec/paths/v2/identities/deleteIdentity/index.yaml @@ -24,7 +24,7 @@ post: basic: summary: Delete identity value: - externalId: user_123 + identity: user_123 required: true responses: "200": From b7c600bcc8ae75a5e4c9485e4c71580d0fdd0778 Mon Sep 17 00:00:00 2001 From: Flo Date: Mon, 3 Nov 2025 13:07:46 +0100 Subject: [PATCH 5/6] fix: spec naming --- go/apps/api/openapi/gen.go | 8 ++++---- go/apps/api/openapi/openapi-generated.yaml | 10 +++++----- .../spec/paths/v2/identities/getIdentity/index.yaml | 2 +- .../spec/paths/v2/identities/updateCredits/index.yaml | 4 ++-- .../spec/paths/v2/keys/updateCredits/index.yaml | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go/apps/api/openapi/gen.go b/go/apps/api/openapi/gen.go index 4de7a6ca3b..ad5978f845 100644 --- a/go/apps/api/openapi/gen.go +++ b/go/apps/api/openapi/gen.go @@ -2156,8 +2156,8 @@ type IdentitiesGetIdentityJSONRequestBody = V2IdentitiesGetIdentityRequestBody // IdentitiesListIdentitiesJSONRequestBody defines body for IdentitiesListIdentities for application/json ContentType. type IdentitiesListIdentitiesJSONRequestBody = V2IdentitiesListIdentitiesRequestBody -// UpdateIdentityCreditsJSONRequestBody defines body for UpdateIdentityCredits for application/json ContentType. -type UpdateIdentityCreditsJSONRequestBody = V2IdentitiesUpdateCreditsRequestBody +// IdentitiesUpdateCreditsJSONRequestBody defines body for IdentitiesUpdateCredits for application/json ContentType. +type IdentitiesUpdateCreditsJSONRequestBody = V2IdentitiesUpdateCreditsRequestBody // V2IdentitiesUpdateIdentityJSONRequestBody defines body for V2IdentitiesUpdateIdentity for application/json ContentType. type V2IdentitiesUpdateIdentityJSONRequestBody = V2IdentitiesUpdateIdentityRequestBody @@ -2192,8 +2192,8 @@ type SetPermissionsJSONRequestBody = V2KeysSetPermissionsRequestBody // SetRolesJSONRequestBody defines body for SetRoles for application/json ContentType. type SetRolesJSONRequestBody = V2KeysSetRolesRequestBody -// UpdateKeyCreditsJSONRequestBody defines body for UpdateKeyCredits for application/json ContentType. -type UpdateKeyCreditsJSONRequestBody = V2KeysUpdateCreditsRequestBody +// UpdateCreditsJSONRequestBody defines body for UpdateCredits for application/json ContentType. +type UpdateCreditsJSONRequestBody = V2KeysUpdateCreditsRequestBody // UpdateKeyJSONRequestBody defines body for UpdateKey for application/json ContentType. type UpdateKeyJSONRequestBody = V2KeysUpdateKeyRequestBody diff --git a/go/apps/api/openapi/openapi-generated.yaml b/go/apps/api/openapi/openapi-generated.yaml index ae0ade6dbd..c060290616 100644 --- a/go/apps/api/openapi/openapi-generated.yaml +++ b/go/apps/api/openapi/openapi-generated.yaml @@ -3964,7 +3964,7 @@ paths: basic: summary: Get identity value: - externalId: user_123 + identity: user_123 schema: $ref: '#/components/schemas/V2IdentitiesGetIdentityRequestBody' required: true @@ -4174,7 +4174,7 @@ paths: **Side Effects** Credit updates take effect immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes propagate instantly but may take up to 30 seconds to reach all edge regions. - operationId: updateIdentityCredits + operationId: identities.updateCredits requestBody: content: application/json: @@ -4224,7 +4224,7 @@ paths: summary: Update identity credits tags: - identities - x-speakeasy-name-override: updateIdentityCredits + x-speakeasy-name-override: updateCredits /v2/identities.updateIdentity: post: description: | @@ -5029,7 +5029,7 @@ paths: **Side Effects** Credit updates remove the key from cache immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes take effect instantly but may take up to 30 seconds to propagate to all edge regions. - operationId: updateKeyCredits + operationId: updateCredits requestBody: content: application/json: @@ -5079,7 +5079,7 @@ paths: summary: Update key credits tags: - keys - x-speakeasy-name-override: updateKeyCredits + x-speakeasy-name-override: updateCredits /v2/keys.updateKey: post: description: | diff --git a/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml b/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml index 11310c52ba..9cb967a05e 100644 --- a/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml +++ b/go/apps/api/openapi/spec/paths/v2/identities/getIdentity/index.yaml @@ -22,7 +22,7 @@ post: basic: summary: Get identity value: - externalId: user_123 + identity: user_123 required: true responses: "200": diff --git a/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml index 131ea18a06..bd033ba309 100644 --- a/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml +++ b/go/apps/api/openapi/spec/paths/v2/identities/updateCredits/index.yaml @@ -20,8 +20,8 @@ post: **Side Effects** Credit updates take effect immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes propagate instantly but may take up to 30 seconds to reach all edge regions. - operationId: updateIdentityCredits - x-speakeasy-name-override: updateIdentityCredits + operationId: identities.updateCredits + x-speakeasy-name-override: updateCredits security: - rootKey: [] requestBody: diff --git a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml index e7edfeab23..855b20940b 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/updateCredits/index.yaml @@ -18,8 +18,8 @@ post: **Side Effects** Credit updates remove the key from cache immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes take effect instantly but may take up to 30 seconds to propagate to all edge regions. - operationId: updateKeyCredits - x-speakeasy-name-override: updateKeyCredits + operationId: updateCredits + x-speakeasy-name-override: updateCredits security: - rootKey: [] requestBody: From 36d3b2ba86a98ba147c800e7d6da00cdf6bdc257 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:14:18 +0000 Subject: [PATCH 6/6] [autofix.ci] apply automated fixes --- apps/docs/docs.json | 45 +++++++++++---------------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/apps/docs/docs.json b/apps/docs/docs.json index ed595cb096..0f1c806bd8 100644 --- a/apps/docs/docs.json +++ b/apps/docs/docs.json @@ -79,9 +79,7 @@ }, { "group": "Identities", - "pages": [ - "quickstart/identities/shared-ratelimits" - ] + "pages": ["quickstart/identities/shared-ratelimits"] } ] }, @@ -115,10 +113,7 @@ { "group": "Identities", "icon": "fingerprint", - "pages": [ - "concepts/identities/overview", - "concepts/identities/ratelimits" - ] + "pages": ["concepts/identities/overview", "concepts/identities/ratelimits"] } ] }, @@ -135,9 +130,7 @@ "pages": [ { "group": "Ratelimiting", - "pages": [ - "apis/features/ratelimiting/overview" - ] + "pages": ["apis/features/ratelimiting/overview"] }, "apis/features/temp-keys", "apis/features/remaining", @@ -172,10 +165,7 @@ { "group": "Audit logs", "icon": "scroll", - "pages": [ - "audit-log/introduction", - "audit-log/types" - ] + "pages": ["audit-log/introduction", "audit-log/types"] }, { "group": "Analytics", @@ -197,10 +187,7 @@ { "group": "Migrating API Keys", "icon": "plane", - "pages": [ - "migrations/introduction", - "migrations/keys" - ] + "pages": ["migrations/introduction", "migrations/keys"] } ] }, @@ -282,9 +269,7 @@ }, { "group": "Too Many Requests", - "pages": [ - "errors/user/too_many_requests/query_quota_exceeded" - ] + "pages": ["errors/user/too_many_requests/query_quota_exceeded"] }, { "group": "Unprocessable Entity", @@ -390,15 +375,11 @@ }, { "group": "Go", - "pages": [ - "libraries/go/api" - ] + "pages": ["libraries/go/api"] }, { "group": "Python", - "pages": [ - "libraries/py/api" - ] + "pages": ["libraries/py/api"] } ] }, @@ -423,15 +404,11 @@ }, { "group": "Nuxt", - "pages": [ - "libraries/nuxt/overview" - ] + "pages": ["libraries/nuxt/overview"] }, { "group": "Rust", - "pages": [ - "libraries/rs/overview" - ] + "pages": ["libraries/rs/overview"] }, { "group": "Springboot", @@ -474,4 +451,4 @@ "codeblocks": "system" }, "theme": "maple" -} \ No newline at end of file +}