diff --git a/apps/api/src/routes/v1_analytics_getVerifications.ts b/apps/api/src/routes/v1_analytics_getVerifications.ts index 1872b322de..42dc81b6bc 100644 --- a/apps/api/src/routes/v1_analytics_getVerifications.ts +++ b/apps/api/src/routes/v1_analytics_getVerifications.ts @@ -15,7 +15,8 @@ const route = createRoute({ tags: ["analytics"], operationId: "getVerifications", summary: "Get verification analytics", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/analytics.getVerifications", security: [{ bearerAuth: [] }], @@ -510,9 +511,9 @@ STEP INTERVAL 1 MONTH`, tags: row.tags, identity: row.identityId ? { - id: row.identityId, - externalId: identitiesById[row.identityId]?.externalId, - } + id: row.identityId, + externalId: identitiesById[row.identityId]?.externalId, + } : undefined, })), ); diff --git a/apps/api/src/routes/v1_apis_createApi.ts b/apps/api/src/routes/v1_apis_createApi.ts index c99d40d6c6..7d33a54af8 100644 --- a/apps/api/src/routes/v1_apis_createApi.ts +++ b/apps/api/src/routes/v1_apis_createApi.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["apis"], operationId: "createApi", summary: "Create API namespace", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/apis.createApi", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_apis_deleteApi.ts b/apps/api/src/routes/v1_apis_deleteApi.ts index 16a59ed311..e47be2263c 100644 --- a/apps/api/src/routes/v1_apis_deleteApi.ts +++ b/apps/api/src/routes/v1_apis_deleteApi.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["apis"], operationId: "deleteApi", summary: "Delete API namespace", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/apis.deleteApi", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_apis_deleteKeys.ts b/apps/api/src/routes/v1_apis_deleteKeys.ts index db01c1b081..a1cda0a857 100644 --- a/apps/api/src/routes/v1_apis_deleteKeys.ts +++ b/apps/api/src/routes/v1_apis_deleteKeys.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["apis"], operationId: "deleteKeys", summary: "Delete API keys", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/apis.deleteKeys", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_apis_getApi.ts b/apps/api/src/routes/v1_apis_getApi.ts index 76bacb7dc8..1a02aac451 100644 --- a/apps/api/src/routes/v1_apis_getApi.ts +++ b/apps/api/src/routes/v1_apis_getApi.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["apis"], operationId: "getApi", summary: "Get API namespace", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/apis.getApi", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_apis_listKeys.ts b/apps/api/src/routes/v1_apis_listKeys.ts index 8555f69908..c3ddfa1ea6 100644 --- a/apps/api/src/routes/v1_apis_listKeys.ts +++ b/apps/api/src/routes/v1_apis_listKeys.ts @@ -14,7 +14,8 @@ const route = createRoute({ tags: ["apis"], operationId: "listKeys", summary: "List API keys", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/apis.listKeys", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_identities_createIdentity.ts b/apps/api/src/routes/v1_identities_createIdentity.ts index 77429dc297..2198702e72 100644 --- a/apps/api/src/routes/v1_identities_createIdentity.ts +++ b/apps/api/src/routes/v1_identities_createIdentity.ts @@ -14,7 +14,8 @@ const route = createRoute({ tags: ["identities"], operationId: "createIdentity", summary: "Create identity", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/identities.createIdentity", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_identities_deleteIdentity.ts b/apps/api/src/routes/v1_identities_deleteIdentity.ts index 724345aca7..c97a1989e4 100644 --- a/apps/api/src/routes/v1_identities_deleteIdentity.ts +++ b/apps/api/src/routes/v1_identities_deleteIdentity.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["identities"], operationId: "deleteIdentity", summary: "Delete identity", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/identities.deleteIdentity", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_identities_getIdentity.ts b/apps/api/src/routes/v1_identities_getIdentity.ts index 61ed05884b..72b1c8d98d 100644 --- a/apps/api/src/routes/v1_identities_getIdentity.ts +++ b/apps/api/src/routes/v1_identities_getIdentity.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["identities"], operationId: "getIdentity", summary: "Get identity", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/identities.getIdentity", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_identities_listIdentities.ts b/apps/api/src/routes/v1_identities_listIdentities.ts index 516b45714c..84fb2f2ab8 100644 --- a/apps/api/src/routes/v1_identities_listIdentities.ts +++ b/apps/api/src/routes/v1_identities_listIdentities.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["identities"], operationId: "listIdentities", summary: "List identities", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/identities.listIdentities", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_identities_updateIdentity.ts b/apps/api/src/routes/v1_identities_updateIdentity.ts index 7aebaec281..0df75bee07 100644 --- a/apps/api/src/routes/v1_identities_updateIdentity.ts +++ b/apps/api/src/routes/v1_identities_updateIdentity.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["identities"], operationId: "updateIdentity", summary: "Update identity", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/identities.updateIdentity", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_addPermissions.ts b/apps/api/src/routes/v1_keys_addPermissions.ts index 7698d5997b..66f3cb41d0 100644 --- a/apps/api/src/routes/v1_keys_addPermissions.ts +++ b/apps/api/src/routes/v1_keys_addPermissions.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["keys"], operationId: "addPermissions", summary: "Add key permissions", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.addPermissions", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_addRoles.ts b/apps/api/src/routes/v1_keys_addRoles.ts index 6586e95e6b..a7f42222c1 100644 --- a/apps/api/src/routes/v1_keys_addRoles.ts +++ b/apps/api/src/routes/v1_keys_addRoles.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["keys"], operationId: "addRoles", summary: "Add key roles", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.addRoles", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_createKey.ts b/apps/api/src/routes/v1_keys_createKey.ts index efa777afc8..43948e3676 100644 --- a/apps/api/src/routes/v1_keys_createKey.ts +++ b/apps/api/src/routes/v1_keys_createKey.ts @@ -17,7 +17,8 @@ const route = createRoute({ tags: ["keys"], operationId: "createKey", summary: "Create API key", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post" as const, path: "/v1/keys.createKey", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_deleteKey.ts b/apps/api/src/routes/v1_keys_deleteKey.ts index 4de250d83b..6ac781a3c7 100644 --- a/apps/api/src/routes/v1_keys_deleteKey.ts +++ b/apps/api/src/routes/v1_keys_deleteKey.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["keys"], operationId: "deleteKey", summary: "Delete API key", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.deleteKey", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_getKey.ts b/apps/api/src/routes/v1_keys_getKey.ts index 08e51cf5be..08fea4f3d3 100644 --- a/apps/api/src/routes/v1_keys_getKey.ts +++ b/apps/api/src/routes/v1_keys_getKey.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["keys"], operationId: "getKey", summary: "Get API key", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/keys.getKey", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_getVerifications.ts b/apps/api/src/routes/v1_keys_getVerifications.ts index 3611fb8ff2..4141c86793 100644 --- a/apps/api/src/routes/v1_keys_getVerifications.ts +++ b/apps/api/src/routes/v1_keys_getVerifications.ts @@ -14,7 +14,8 @@ const route = createRoute({ method: "get", path: "/v1/keys.getVerifications", "x-speakeasy-name-override": "getVerifications", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", security: [{ bearerAuth: [] }], request: { query: z.object({ diff --git a/apps/api/src/routes/v1_keys_removePermissions.ts b/apps/api/src/routes/v1_keys_removePermissions.ts index 909a884dde..31d669fb05 100644 --- a/apps/api/src/routes/v1_keys_removePermissions.ts +++ b/apps/api/src/routes/v1_keys_removePermissions.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["keys"], operationId: "removePermissions", summary: "Remove key permissions", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.removePermissions", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_removeRoles.ts b/apps/api/src/routes/v1_keys_removeRoles.ts index b454fcd1ec..6a087be886 100644 --- a/apps/api/src/routes/v1_keys_removeRoles.ts +++ b/apps/api/src/routes/v1_keys_removeRoles.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["keys"], operationId: "removeRoles", summary: "Remove key roles", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.removeRoles", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_setPermissions.ts b/apps/api/src/routes/v1_keys_setPermissions.ts index 7cd01cc4ac..28147b9c5d 100644 --- a/apps/api/src/routes/v1_keys_setPermissions.ts +++ b/apps/api/src/routes/v1_keys_setPermissions.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["keys"], operationId: "setPermissions", summary: "Set key permissions", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.setPermissions", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_setRoles.ts b/apps/api/src/routes/v1_keys_setRoles.ts index 299e8d4f61..67822a6792 100644 --- a/apps/api/src/routes/v1_keys_setRoles.ts +++ b/apps/api/src/routes/v1_keys_setRoles.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["keys"], operationId: "setRoles", summary: "Set key roles", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.setRoles", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_updateKey.ts b/apps/api/src/routes/v1_keys_updateKey.ts index 5c12f4bfa9..ee148d6da7 100644 --- a/apps/api/src/routes/v1_keys_updateKey.ts +++ b/apps/api/src/routes/v1_keys_updateKey.ts @@ -17,7 +17,8 @@ const route = createRoute({ tags: ["keys"], operationId: "updateKey", summary: "Update key settings", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.updateKey", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_updateRemaining.ts b/apps/api/src/routes/v1_keys_updateRemaining.ts index 89b015a507..05de238b97 100644 --- a/apps/api/src/routes/v1_keys_updateRemaining.ts +++ b/apps/api/src/routes/v1_keys_updateRemaining.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["keys"], operationId: "updateRemaining", summary: "Update key credits", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.updateRemaining", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_keys_verifyKey.ts b/apps/api/src/routes/v1_keys_verifyKey.ts index aad8bab3eb..63f6625aea 100644 --- a/apps/api/src/routes/v1_keys_verifyKey.ts +++ b/apps/api/src/routes/v1_keys_verifyKey.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["keys"], operationId: "verifyKey", summary: "Verify API key", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.verifyKey", request: { diff --git a/apps/api/src/routes/v1_keys_whoami.ts b/apps/api/src/routes/v1_keys_whoami.ts index 17ddd5f53c..dff60eecb3 100644 --- a/apps/api/src/routes/v1_keys_whoami.ts +++ b/apps/api/src/routes/v1_keys_whoami.ts @@ -11,7 +11,8 @@ const route = createRoute({ tags: ["keys"], operationId: "whoami", summary: "Get key information", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/keys.whoami", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_liveness.ts b/apps/api/src/routes/v1_liveness.ts index a994a148fd..c7526f24da 100644 --- a/apps/api/src/routes/v1_liveness.ts +++ b/apps/api/src/routes/v1_liveness.ts @@ -7,7 +7,8 @@ const route = createRoute({ tags: ["liveness"], operationId: "v1.liveness", summary: "Health check", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/liveness", responses: { diff --git a/apps/api/src/routes/v1_migrations_createKey.ts b/apps/api/src/routes/v1_migrations_createKey.ts index 451cef5a41..9ed93ae54e 100644 --- a/apps/api/src/routes/v1_migrations_createKey.ts +++ b/apps/api/src/routes/v1_migrations_createKey.ts @@ -23,7 +23,8 @@ const route = createRoute({ tags: ["migrations"], operationId: "v1.migrations.createKeys", summary: "Migrate keys", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post" as const, path: "/v1/migrations.createKeys", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_migrations_enqueueKeys.ts b/apps/api/src/routes/v1_migrations_enqueueKeys.ts index b42e4d90b3..69f578c318 100644 --- a/apps/api/src/routes/v1_migrations_enqueueKeys.ts +++ b/apps/api/src/routes/v1_migrations_enqueueKeys.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["migrations"], operationId: "v1.migrations.enqueueKeys", summary: "Enqueue key migration", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post" as const, path: "/v1/migrations.enqueueKeys", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_createPermission.ts b/apps/api/src/routes/v1_permissions_createPermission.ts index 112724c45a..730efdf58e 100644 --- a/apps/api/src/routes/v1_permissions_createPermission.ts +++ b/apps/api/src/routes/v1_permissions_createPermission.ts @@ -16,7 +16,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "createPermission", summary: "Create permission", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/permissions.createPermission", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_createRole.ts b/apps/api/src/routes/v1_permissions_createRole.ts index cb68d727c6..1a49cdb6d1 100644 --- a/apps/api/src/routes/v1_permissions_createRole.ts +++ b/apps/api/src/routes/v1_permissions_createRole.ts @@ -15,7 +15,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "createRole", summary: "Create role", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/permissions.createRole", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_deletePermission.ts b/apps/api/src/routes/v1_permissions_deletePermission.ts index 67880bc389..b99cb21199 100644 --- a/apps/api/src/routes/v1_permissions_deletePermission.ts +++ b/apps/api/src/routes/v1_permissions_deletePermission.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "deletePermission", summary: "Delete permission", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/permissions.deletePermission", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_deleteRole.ts b/apps/api/src/routes/v1_permissions_deleteRole.ts index 97768b9494..1059bed241 100644 --- a/apps/api/src/routes/v1_permissions_deleteRole.ts +++ b/apps/api/src/routes/v1_permissions_deleteRole.ts @@ -12,7 +12,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "deleteRole", summary: "Delete role", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/permissions.deleteRole", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_getPermission.ts b/apps/api/src/routes/v1_permissions_getPermission.ts index acaf447547..8295d1c269 100644 --- a/apps/api/src/routes/v1_permissions_getPermission.ts +++ b/apps/api/src/routes/v1_permissions_getPermission.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "getPermission", summary: "Get permission", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/permissions.getPermission", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_getRole.ts b/apps/api/src/routes/v1_permissions_getRole.ts index e8b93c99a8..1a22120425 100644 --- a/apps/api/src/routes/v1_permissions_getRole.ts +++ b/apps/api/src/routes/v1_permissions_getRole.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "getRole", summary: "Get role", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/permissions.getRole", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_listPermissions.ts b/apps/api/src/routes/v1_permissions_listPermissions.ts index d8d766a0a5..f3f83460e0 100644 --- a/apps/api/src/routes/v1_permissions_listPermissions.ts +++ b/apps/api/src/routes/v1_permissions_listPermissions.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "listPermissions", summary: "List permissions", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/permissions.listPermissions", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_permissions_listRoles.ts b/apps/api/src/routes/v1_permissions_listRoles.ts index e54229085f..8540c19fae 100644 --- a/apps/api/src/routes/v1_permissions_listRoles.ts +++ b/apps/api/src/routes/v1_permissions_listRoles.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["permissions"], operationId: "listRoles", summary: "List roles", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/permissions.listRoles", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_ratelimits_deleteOverride.ts b/apps/api/src/routes/v1_ratelimits_deleteOverride.ts index 4bc5005058..c9917b5268 100644 --- a/apps/api/src/routes/v1_ratelimits_deleteOverride.ts +++ b/apps/api/src/routes/v1_ratelimits_deleteOverride.ts @@ -11,7 +11,8 @@ const route = createRoute({ tags: ["ratelimits"], operationId: "deleteOverride", summary: "Delete rate limit override", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/ratelimits.deleteOverride", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_ratelimits_getOverride.ts b/apps/api/src/routes/v1_ratelimits_getOverride.ts index 22a678303b..11b3d95190 100644 --- a/apps/api/src/routes/v1_ratelimits_getOverride.ts +++ b/apps/api/src/routes/v1_ratelimits_getOverride.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["ratelimit"], operationId: "getOverride", summary: "Get rate limit override", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/ratelimits.getOverride", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_ratelimits_limit.ts b/apps/api/src/routes/v1_ratelimits_limit.ts index 9f2cf1d0fc..6f698c83c6 100644 --- a/apps/api/src/routes/v1_ratelimits_limit.ts +++ b/apps/api/src/routes/v1_ratelimits_limit.ts @@ -15,7 +15,8 @@ const route = createRoute({ tags: ["ratelimits"], operationId: "limit", summary: "Check rate limit", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/ratelimits.limit", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_ratelimits_listOverrides.ts b/apps/api/src/routes/v1_ratelimits_listOverrides.ts index 17b5d556ae..5311187b4b 100644 --- a/apps/api/src/routes/v1_ratelimits_listOverrides.ts +++ b/apps/api/src/routes/v1_ratelimits_listOverrides.ts @@ -10,7 +10,8 @@ const route = createRoute({ tags: ["ratelimit"], operationId: "listOverrides", summary: "List rate limit overrides", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "get", path: "/v1/ratelimits.listOverrides", security: [{ bearerAuth: [] }], diff --git a/apps/api/src/routes/v1_ratelimits_setOverride.ts b/apps/api/src/routes/v1_ratelimits_setOverride.ts index 9b8056b81b..fd325b48e1 100644 --- a/apps/api/src/routes/v1_ratelimits_setOverride.ts +++ b/apps/api/src/routes/v1_ratelimits_setOverride.ts @@ -13,7 +13,8 @@ const route = createRoute({ tags: ["ratelimit"], operationId: "setOverride", summary: "Set rate limit override", - description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", + description: + "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", method: "post", path: "/v1/ratelimits.setOverride", security: [{ bearerAuth: [] }], diff --git a/go/apps/api/openapi/gen.go b/go/apps/api/openapi/gen.go index c6c057d419..f29414e91f 100644 --- a/go/apps/api/openapi/gen.go +++ b/go/apps/api/openapi/gen.go @@ -417,6 +417,33 @@ type RatelimitResponse struct { Name string `json:"name"` } +// Role defines model for Role. +type Role struct { + // Description Optional detailed explanation of what this role encompasses and what access it provides. + // Helps team members understand the role's scope, intended use cases, and security implications. + // Include information about what types of users should receive this role and what they can accomplish. + // Not visible to end users - this is for internal documentation and access control audits. + Description *string `json:"description,omitempty"` + + // Id The unique identifier for this role within Unkey's system. + // Generated automatically when the role is created and used to reference this role in API operations. + // Always begins with 'role_' followed by alphanumeric characters and underscores. + Id string `json:"id"` + + // Name The human-readable name for this role that describes its function. + // Should be descriptive enough for administrators to understand what access this role provides. + // Use clear, semantic names that reflect the job function or responsibility level. + // Names must be unique within your workspace to avoid confusion during role assignment. + Name string `json:"name"` + + // Permissions Complete list of permissions currently assigned to this role. + // Each permission grants specific access rights that will be inherited by any keys or users assigned this role. + // Use this list to understand the full scope of access provided by this role. + // Permissions can be added or removed from roles without affecting the role's identity or other properties. + // Empty array indicates a role with no permissions currently assigned. + Permissions []Permission `json:"permissions"` +} + // UnauthorizedErrorResponse Error response when authentication has failed or credentials are missing. This occurs when: // - No authentication token is provided in the request // - The provided token is invalid, expired, or malformed @@ -1904,33 +1931,6 @@ type VerifyKeyRatelimitData struct { Reset int64 `json:"reset"` } -// Role defines model for role. -type Role struct { - // Description Optional detailed explanation of what this role encompasses and what access it provides. - // Helps team members understand the role's scope, intended use cases, and security implications. - // Include information about what types of users should receive this role and what they can accomplish. - // Not visible to end users - this is for internal documentation and access control audits. - Description *string `json:"description,omitempty"` - - // Id The unique identifier for this role within Unkey's system. - // Generated automatically when the role is created and used to reference this role in API operations. - // Always begins with 'role_' followed by alphanumeric characters and underscores. - Id string `json:"id"` - - // Name The human-readable name for this role that describes its function. - // Should be descriptive enough for administrators to understand what access this role provides. - // Use clear, semantic names that reflect the job function or responsibility level. - // Names must be unique within your workspace to avoid confusion during role assignment. - Name string `json:"name"` - - // Permissions Complete list of permissions currently assigned to this role. - // Each permission grants specific access rights that will be inherited by any keys or users assigned this role. - // Use this list to understand the full scope of access provided by this role. - // Permissions can be added or removed from roles without affecting the role's identity or other properties. - // Empty array indicates a role with no permissions currently assigned. - Permissions []Permission `json:"permissions"` -} - // ChproxyMetricsJSONRequestBody defines body for ChproxyMetrics for application/json ContentType. type ChproxyMetricsJSONRequestBody = ChproxyMetricsRequestBody diff --git a/go/apps/api/openapi/openapi-generated.yaml b/go/apps/api/openapi/openapi-generated.yaml index eec2b35fb1..3f635555e8 100644 --- a/go/apps/api/openapi/openapi-generated.yaml +++ b/go/apps/api/openapi/openapi-generated.yaml @@ -2414,8 +2414,8 @@ components: - This only shows direct role assignments, not inherited or nested roles - Role permissions are not expanded in this response - use keys.getKey for full details items: - "$ref": "#/components/schemas/role" - role: + "$ref": "#/components/schemas/Role" + Role: type: object properties: id: @@ -2501,7 +2501,7 @@ components: - Role permissions are not expanded in this response - use keys.getKey for full details - Changes take effect immediately for new verifications but cached sessions may retain old permissions briefly items: - "$ref": "#/components/schemas/role" + "$ref": "#/components/schemas/Role" V2KeysSetPermissionsResponseData: type: array description: |- @@ -2535,7 +2535,7 @@ components: - Role permissions are not expanded in this response - use keys.getKey for complete details - An empty array indicates the key now has no roles assigned at all items: - "$ref": "#/components/schemas/role" + "$ref": "#/components/schemas/Role" KeysVerifyKeyCredits: type: object required: @@ -2807,7 +2807,7 @@ components: type: object properties: role: - "$ref": "#/components/schemas/role" + "$ref": "#/components/schemas/Role" required: - role additionalProperties: false @@ -2823,7 +2823,7 @@ components: maxItems: 1000 description: Array of roles with their assigned permissions. items: - "$ref": "#/components/schemas/role" + "$ref": "#/components/schemas/Role" V2RatelimitDeleteOverrideResponseData: type: object additionalProperties: false diff --git a/go/apps/api/openapi/spec/common/Identity.yaml b/go/apps/api/openapi/spec/common/Identity.yaml new file mode 100644 index 0000000000..cdf01d9d41 --- /dev/null +++ b/go/apps/api/openapi/spec/common/Identity.yaml @@ -0,0 +1,16 @@ +type: object +properties: + externalId: + type: string + description: External identity ID + meta: + type: object + description: Identity metadata + ratelimits: + type: array + items: + "$ref": "./RatelimitResponse.yaml" + description: Identity ratelimits +required: + - externalId + - ratelimits diff --git a/go/apps/api/openapi/spec/common/KeyCreditsRefill.yaml b/go/apps/api/openapi/spec/common/KeyCreditsRefill.yaml new file mode 100644 index 0000000000..2170cdf55a --- /dev/null +++ b/go/apps/api/openapi/spec/common/KeyCreditsRefill.yaml @@ -0,0 +1,30 @@ +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/common/Meta.yaml b/go/apps/api/openapi/spec/common/Meta.yaml new file mode 100644 index 0000000000..c3b46a9cdc --- /dev/null +++ b/go/apps/api/openapi/spec/common/Meta.yaml @@ -0,0 +1,18 @@ +type: object +required: + - requestId +properties: + requestId: + description: + A unique id for this request. Always include this ID when contacting + support about a specific API request. This identifier allows Unkey's support + team to trace the exact request through logs and diagnostic systems to + provide faster assistance. + example: req_123 + type: string +additionalProperties: false +description: + 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. diff --git a/go/apps/api/openapi/spec/common/Pagination.yaml b/go/apps/api/openapi/spec/common/Pagination.yaml new file mode 100644 index 0000000000..d6e82dd5c4 --- /dev/null +++ b/go/apps/api/openapi/spec/common/Pagination.yaml @@ -0,0 +1,24 @@ +type: object +properties: + cursor: + type: string + minLength: 1 + maxLength: 1024 # Reasonable upper bound for cursor tokens + description: | + Opaque pagination token for retrieving the next page of results. + Include this exact value in the cursor field of subsequent requests. + Cursors are temporary and may expire after extended periods. + example: eyJrZXkiOiJrZXlfMTIzNCIsInRzIjoxNjk5Mzc4ODAwfQ== + hasMore: + type: boolean + description: | + Indicates whether additional results exist beyond this page. + When true, use the cursor to fetch the next page. + When false, you have reached the end of the result set. + example: true +required: + - hasMore +additionalProperties: false +description: + Pagination metadata for list endpoints. Provides information necessary + to traverse through large result sets efficiently using cursor-based pagination. diff --git a/go/apps/api/openapi/spec/common/Permission.yaml b/go/apps/api/openapi/spec/common/Permission.yaml new file mode 100644 index 0000000000..e315734956 --- /dev/null +++ b/go/apps/api/openapi/spec/common/Permission.yaml @@ -0,0 +1,42 @@ +type: object +properties: + id: + type: string + minLength: 3 + maxLength: 255 + pattern: "^[a-zA-Z0-9_]+$" + description: | + The unique identifier for this permission within Unkey's system. + Generated automatically when the permission is created and used to reference this permission in API operations. + Always begins with 'perm_' followed by alphanumeric characters and underscores. + example: perm_1234567890abcdef + name: + type: string + minLength: 1 + maxLength: 512 + description: | + The human-readable name for this permission that describes its purpose. + Should be descriptive enough for developers to understand what access it grants. + Use clear, semantic names that reflect the resources or actions being permitted. + Names must be unique within your workspace to avoid confusion and conflicts. + example: "users.read" + slug: + pattern: ^[a-zA-Z0-9_:\-\.\*]+$ + type: string + minLength: 1 + maxLength: 512 + description: The URL-safe identifier when this permission was created. + example: users-read + description: + type: string + maxLength: 2048 + description: | + Optional detailed explanation of what this permission grants access to. + Helps team members understand the scope and implications of granting this permission. + Include information about what resources can be accessed and what actions can be performed. + Not visible to end users - this is for internal documentation and team clarity. + example: "Allows reading user profile information and account details" +required: + - id + - name + - slug diff --git a/go/apps/api/openapi/spec/common/RatelimitOverride.yaml b/go/apps/api/openapi/spec/common/RatelimitOverride.yaml new file mode 100644 index 0000000000..369ad8fd81 --- /dev/null +++ b/go/apps/api/openapi/spec/common/RatelimitOverride.yaml @@ -0,0 +1,60 @@ +type: object +additionalProperties: false +properties: + namespaceId: + description: The unique identifier of the rate limit namespace this override + belongs to. This links the override to a specific namespace context, ensuring + the override only applies within that namespace. + type: string + minLength: 1 + maxLength: 255 + overrideId: + description: The unique identifier of this specific rate limit override. + This ID is generated when the override is created and can be used for + management operations like updating or deleting the override. + type: string + minLength: 1 + maxLength: 255 + duration: + description: The duration in milliseconds for this override's rate limit + window. This may differ from the default duration for the namespace, allowing + custom time windows for specific entities. After this duration elapses, + the rate limit counter for affected identifiers resets to zero. + format: int64 + type: integer + minimum: 1000 + identifier: + description: |- + The identifier pattern this override applies to. This determines which entities receive the custom rate limit. + + This can be: + - An exact identifier for a specific entity + - A pattern with wildcards for matching multiple entities + + Wildcard examples: + - 'admin_*' matches any identifier starting with 'admin_' + - '*_test' matches any identifier ending with '_test' + - '*premium*' matches any identifier containing 'premium' + + More complex patterns can combine multiple wildcards. Detailed documentation on pattern matching rules is available at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules + type: string + minLength: 1 + maxLength: 255 + limit: + description: |- + The maximum number of requests allowed for entities matching this override. This replaces the default limit for the namespace when applied. + + Common use cases: + - Higher limits for premium customers + - Reduced limits for abusive or suspicious entities + - Zero limit to completely block specific patterns + - Custom tier-based limits for different customer segments + format: int64 + type: integer + minimum: 0 +required: + - namespaceId + - overrideId + - duration + - identifier + - limit diff --git a/go/apps/api/openapi/spec/common/RatelimitRequest.yaml b/go/apps/api/openapi/spec/common/RatelimitRequest.yaml new file mode 100644 index 0000000000..aa9ebb85d7 --- /dev/null +++ b/go/apps/api/openapi/spec/common/RatelimitRequest.yaml @@ -0,0 +1,55 @@ +type: object +required: + - name + - limit + - duration + - autoApply +properties: + name: + description: |- + The name of this rate limit. This name is used to identify which limit to check during key verification. + + Best practices for limit names: + - Use descriptive, semantic names like 'api_requests', 'heavy_operations', or 'downloads' + - Be consistent with naming conventions across your application + - Create separate limits for different resource types or operation costs + - Consider using namespaced names for better organization (e.g., 'files.downloads', 'compute.training') + + You will reference this exact name when verifying keys to check against this specific limit. + type: string + example: api + minLength: 3 + maxLength: 128 + limit: + description: |- + The maximum number of operations allowed within the specified time window. + + When this limit is reached, verification requests will fail with `code=RATE_LIMITED` until the window resets. The limit should reflect: + - Your infrastructure capacity and scaling limitations + - Fair usage expectations for your service + - Different tier levels for various user types + - The relative cost of the operations being limited + + Higher values allow more frequent access but may impact service performance. + type: integer + format: int64 + minimum: 1 + duration: + description: |- + The duration for each ratelimit window in milliseconds. + + This controls how long the rate limit counter accumulates before resetting. Common values include: + - 1000 (1 second): For strict per-second limits on high-frequency operations + - 60000 (1 minute): For moderate API usage control + - 3600000 (1 hour): For less frequent but costly operations + - 86400000 (24 hours): For daily quotas + + Shorter windows provide more frequent resets but may allow large burst usage. Longer windows provide more consistent usage patterns but take longer to reset after limit exhaustion. + type: integer + format: int64 + minimum: 1000 + autoApply: + description: |- + Whether this ratelimit should be automatically applied when verifying a key. + type: boolean + default: false diff --git a/go/apps/api/openapi/spec/common/RatelimitResponse.yaml b/go/apps/api/openapi/spec/common/RatelimitResponse.yaml new file mode 100644 index 0000000000..bbf2e5ac87 --- /dev/null +++ b/go/apps/api/openapi/spec/common/RatelimitResponse.yaml @@ -0,0 +1,41 @@ +type: object +properties: + id: + type: string + minLength: 8 + maxLength: 255 + pattern: "^rl_[a-zA-Z0-9_]+$" + description: Unique identifier for this rate limit configuration. + example: rl_1234567890abcdef + name: + type: string + minLength: 1 + maxLength: 128 + pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$" + description: Human-readable name for this rate limit. + example: api_requests + limit: + type: integer + format: int64 + minimum: 1 + maximum: 1000000 + description: Maximum requests allowed within the time window. + example: 1000 + duration: + type: integer + format: int64 + minimum: 1000 + maximum: 2592000000 + description: Rate limit window duration in milliseconds. + example: 3600000 + autoApply: + type: boolean + description: Whether this rate limit was automatically applied when verifying the key. + example: true +required: + - id + - name + - limit + - duration + - autoApply +additionalProperties: false diff --git a/go/apps/api/openapi/spec/common/Role.yaml b/go/apps/api/openapi/spec/common/Role.yaml new file mode 100644 index 0000000000..b096c075ae --- /dev/null +++ b/go/apps/api/openapi/spec/common/Role.yaml @@ -0,0 +1,41 @@ +type: object +properties: + id: + type: string + description: | + The unique identifier for this role within Unkey's system. + Generated automatically when the role is created and used to reference this role in API operations. + Always begins with 'role_' followed by alphanumeric characters and underscores. + example: role_1234567890abcdef + name: + type: string + description: | + The human-readable name for this role that describes its function. + Should be descriptive enough for administrators to understand what access this role provides. + Use clear, semantic names that reflect the job function or responsibility level. + Names must be unique within your workspace to avoid confusion during role assignment. + example: "support.readonly" + description: + type: string + description: | + Optional detailed explanation of what this role encompasses and what access it provides. + Helps team members understand the role's scope, intended use cases, and security implications. + Include information about what types of users should receive this role and what they can accomplish. + Not visible to end users - this is for internal documentation and access control audits. + example: "Provides read-only access for customer support representatives to view user accounts and support tickets" + permissions: + type: array + items: + "$ref": "./Permission.yaml" + maxItems: 100 + description: | + Complete list of permissions currently assigned to this role. + Each permission grants specific access rights that will be inherited by any keys or users assigned this role. + Use this list to understand the full scope of access provided by this role. + Permissions can be added or removed from roles without affecting the role's identity or other properties. + Empty array indicates a role with no permissions currently assigned. +required: + - id + - name + - permissions +additionalProperties: false diff --git a/go/apps/api/openapi/spec/error/BadRequestErrorDetails.yaml b/go/apps/api/openapi/spec/error/BadRequestErrorDetails.yaml new file mode 100644 index 0000000000..65430a4da5 --- /dev/null +++ b/go/apps/api/openapi/spec/error/BadRequestErrorDetails.yaml @@ -0,0 +1,19 @@ +allOf: + - $ref: "./BaseError.yaml" + - type: object + properties: + errors: + description: List of individual validation errors that occurred in the + request. Each error provides specific details about what failed validation, + where the error occurred in the request, and suggestions for fixing + it. This granular information helps developers quickly identify and + resolve multiple issues in a single request without having to make repeated + API calls. + items: + $ref: "./ValidationError.yaml" + type: array + required: + - errors +description: Extended error details specifically for bad request (400) errors. + This builds on the BaseError structure by adding an array of individual validation + errors, making it easy to identify and fix multiple issues at once. diff --git a/go/apps/api/openapi/spec/error/BadRequestErrorResponse.yaml b/go/apps/api/openapi/spec/error/BadRequestErrorResponse.yaml new file mode 100644 index 0000000000..6242e91783 --- /dev/null +++ b/go/apps/api/openapi/spec/error/BadRequestErrorResponse.yaml @@ -0,0 +1,16 @@ +type: object +required: + - meta + - error +properties: + meta: + $ref: "../common/Meta.yaml" + error: + $ref: "./BadRequestErrorDetails.yaml" +description: Error response for invalid requests that cannot be processed due + to client-side errors. This typically occurs when request parameters are missing, + malformed, or fail validation rules. The response includes detailed information + about the specific errors in the request, including the location of each error + and suggestions for fixing it. When receiving this error, check the 'errors' + array in the response for specific validation issues that need to be addressed + before retrying. diff --git a/go/apps/api/openapi/spec/error/BaseError.yaml b/go/apps/api/openapi/spec/error/BaseError.yaml new file mode 100644 index 0000000000..ab464f3268 --- /dev/null +++ b/go/apps/api/openapi/spec/error/BaseError.yaml @@ -0,0 +1,40 @@ +properties: + detail: + description: A human-readable explanation specific to this occurrence of + the problem. This provides detailed information about what went wrong + and potential remediation steps. The message is intended to be helpful + for developers troubleshooting the issue. + example: Property foo is required but is missing. + type: string + status: + description: HTTP status code that corresponds to this error. This will + match the status code in the HTTP response. Common codes include `400` (Bad + Request), `401` (Unauthorized), `403` (Forbidden), `404` (Not Found), `409` (Conflict), + and `500` (Internal Server Error). + example: 404 + format: int + type: integer + title: + description: + A short, human-readable summary of the problem type. This remains + constant from occurrence to occurrence of the same problem and should be + used for programmatic handling. + example: Not Found + type: string + type: + description: A URI reference that identifies the problem type. This provides + a stable identifier for the error that can be used for documentation lookups + and programmatic error handling. When followed, this URI should provide human-readable + documentation for the problem type. + example: https://unkey.com/docs/errors/unkey/resource/not_found + type: string +required: + - title + - detail + - status + - type +type: object +additionalProperties: false +description: Base error structure following Problem Details for HTTP APIs (RFC + 7807). This provides a standardized way to carry machine-readable details of + errors in HTTP response content. diff --git a/go/apps/api/openapi/spec/error/ConflictErrorResponse.yaml b/go/apps/api/openapi/spec/error/ConflictErrorResponse.yaml new file mode 100644 index 0000000000..df70620217 --- /dev/null +++ b/go/apps/api/openapi/spec/error/ConflictErrorResponse.yaml @@ -0,0 +1,16 @@ +type: object +required: + - meta + - error +properties: + meta: + $ref: "../common/Meta.yaml" + error: + $ref: "./BaseError.yaml" +description: |- + Error response when the request conflicts with the current state of the resource. This occurs when: + - Attempting to create a resource that already exists + - Modifying a resource that has been changed by another operation + - Violating unique constraints or business rules + + To resolve this error, check the current state of the resource and adjust your request accordingly. diff --git a/go/apps/api/openapi/spec/error/ForbiddenErrorResponse.yaml b/go/apps/api/openapi/spec/error/ForbiddenErrorResponse.yaml new file mode 100644 index 0000000000..9154d4fd18 --- /dev/null +++ b/go/apps/api/openapi/spec/error/ForbiddenErrorResponse.yaml @@ -0,0 +1,16 @@ +type: object +required: + - meta + - error +properties: + meta: + $ref: "../common/Meta.yaml" + error: + $ref: "./BaseError.yaml" +description: |- + Error response when the provided credentials are valid but lack sufficient permissions for the requested operation. This occurs when: + - The root key doesn't have the required permissions for this endpoint + - The operation requires elevated privileges that the current key lacks + - Access to the requested resource is restricted based on workspace settings + + To resolve this error, ensure your root key has the necessary permissions or contact your workspace administrator. diff --git a/go/apps/api/openapi/spec/error/InternalServerErrorResponse.yaml b/go/apps/api/openapi/spec/error/InternalServerErrorResponse.yaml new file mode 100644 index 0000000000..fdb52766e9 --- /dev/null +++ b/go/apps/api/openapi/spec/error/InternalServerErrorResponse.yaml @@ -0,0 +1,16 @@ +type: object +required: + - meta + - error +properties: + meta: + $ref: "../common/Meta.yaml" + error: + $ref: "./BaseError.yaml" +description: |- + Error response when an unexpected error occurs on the server. This indicates a problem with Unkey's systems rather than your request. + + When you encounter this error: + - The request ID in the response can help Unkey support investigate the issue + - The error is likely temporary and retrying may succeed + - If the error persists, contact Unkey support with the request ID diff --git a/go/apps/api/openapi/spec/error/NotFoundErrorResponse.yaml b/go/apps/api/openapi/spec/error/NotFoundErrorResponse.yaml new file mode 100644 index 0000000000..e73b122b04 --- /dev/null +++ b/go/apps/api/openapi/spec/error/NotFoundErrorResponse.yaml @@ -0,0 +1,16 @@ +type: object +required: + - meta + - error +properties: + meta: + $ref: "../common/Meta.yaml" + error: + $ref: "./BaseError.yaml" +description: |- + Error response when the requested resource cannot be found. This occurs when: + - The specified resource ID doesn't exist in your workspace + - The resource has been deleted or moved + - The resource exists but is not accessible with current permissions + + To resolve this error, verify the resource ID is correct and that you have access to it. diff --git a/go/apps/api/openapi/spec/error/UnauthorizedErrorResponse.yaml b/go/apps/api/openapi/spec/error/UnauthorizedErrorResponse.yaml new file mode 100644 index 0000000000..ee646cfed1 --- /dev/null +++ b/go/apps/api/openapi/spec/error/UnauthorizedErrorResponse.yaml @@ -0,0 +1,16 @@ +type: object +required: + - meta + - error +properties: + meta: + $ref: "../common/Meta.yaml" + error: + $ref: "./BaseError.yaml" +description: |- + Error response when authentication has failed or credentials are missing. This occurs when: + - No authentication token is provided in the request + - The provided token is invalid, expired, or malformed + - The token format doesn't match expected patterns + + To resolve this error, ensure you're including a valid root key in the Authorization header. diff --git a/go/apps/api/openapi/spec/error/ValidationError.yaml b/go/apps/api/openapi/spec/error/ValidationError.yaml new file mode 100644 index 0000000000..fd80ca20cf --- /dev/null +++ b/go/apps/api/openapi/spec/error/ValidationError.yaml @@ -0,0 +1,34 @@ +additionalProperties: false +properties: + location: + description: |- + JSON path indicating exactly where in the request the error occurred. This helps pinpoint the problematic field or parameter. Examples include: + - 'body.name' (field in request body) + - 'body.items[3].tags' (nested array element) + - 'path.apiId' (path parameter) + - 'query.limit' (query parameter) + Use this location to identify exactly which part of your request needs correction. + type: string + example: body.permissions[0].name + message: + description: Detailed error message explaining what validation rule was + violated. This provides specific information about why the field or parameter + was rejected, such as format errors, invalid values, or constraint violations. + type: string + example: Must be at least 3 characters long + fix: + description: A human-readable suggestion describing how to fix the error. + This provides practical guidance on what changes would satisfy the validation + requirements. Not all validation errors include fix suggestions, but when + present, they offer specific remediation advice. + type: string + example: Ensure the name uses only alphanumeric characters, underscores, + and hyphens +required: + - location + - message +type: object +description: + Individual validation error details. Each validation error provides + precise information about what failed, where it failed, and how to fix it, + enabling efficient error resolution. \ No newline at end of file diff --git a/go/apps/api/openapi/spec/paths/v2/keys/addRoles/V2KeysAddRolesResponseData.yaml b/go/apps/api/openapi/spec/paths/v2/keys/addRoles/V2KeysAddRolesResponseData.yaml index 69376d4153..ccac591ddd 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/addRoles/V2KeysAddRolesResponseData.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/addRoles/V2KeysAddRolesResponseData.yaml @@ -13,4 +13,4 @@ description: |- - This only shows direct role assignments, not inherited or nested roles - Role permissions are not expanded in this response - use keys.getKey for full details items: - "$ref": "../../../../common/role.yaml" + "$ref": "../../../../common/Role.yaml" diff --git a/go/apps/api/openapi/spec/paths/v2/keys/removeRoles/V2KeysRemoveRolesResponseData.yaml b/go/apps/api/openapi/spec/paths/v2/keys/removeRoles/V2KeysRemoveRolesResponseData.yaml index 71f11c2aa6..75d5b94ec8 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/removeRoles/V2KeysRemoveRolesResponseData.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/removeRoles/V2KeysRemoveRolesResponseData.yaml @@ -14,4 +14,4 @@ description: |- - Role permissions are not expanded in this response - use keys.getKey for full details - Changes take effect immediately for new verifications but cached sessions may retain old permissions briefly items: - "$ref": "../../../../common/role.yaml" + "$ref": "../../../../common/Role.yaml" diff --git a/go/apps/api/openapi/spec/paths/v2/keys/setRoles/V2KeysSetRolesResponseData.yaml b/go/apps/api/openapi/spec/paths/v2/keys/setRoles/V2KeysSetRolesResponseData.yaml index 27454ac54f..b758b4c3ec 100644 --- a/go/apps/api/openapi/spec/paths/v2/keys/setRoles/V2KeysSetRolesResponseData.yaml +++ b/go/apps/api/openapi/spec/paths/v2/keys/setRoles/V2KeysSetRolesResponseData.yaml @@ -14,4 +14,4 @@ description: |- - Role permissions are not expanded in this response - use keys.getKey for complete details - An empty array indicates the key now has no roles assigned at all items: - "$ref": "../../../../common/role.yaml" + "$ref": "../../../../common/Role.yaml" diff --git a/go/apps/api/openapi/spec/paths/v2/permissions/getRole/V2PermissionsGetRoleResponseData.yaml b/go/apps/api/openapi/spec/paths/v2/permissions/getRole/V2PermissionsGetRoleResponseData.yaml index b67f1238f7..7d6c268a18 100644 --- a/go/apps/api/openapi/spec/paths/v2/permissions/getRole/V2PermissionsGetRoleResponseData.yaml +++ b/go/apps/api/openapi/spec/paths/v2/permissions/getRole/V2PermissionsGetRoleResponseData.yaml @@ -1,7 +1,7 @@ type: object properties: role: - "$ref": "../../../../common/role.yaml" + "$ref": "../../../../common/Role.yaml" required: - role additionalProperties: false diff --git a/go/apps/api/openapi/spec/paths/v2/permissions/listRoles/V2PermissionsListRolesResponseData.yaml b/go/apps/api/openapi/spec/paths/v2/permissions/listRoles/V2PermissionsListRolesResponseData.yaml index e0c4bf1f5a..31fb8044ea 100644 --- a/go/apps/api/openapi/spec/paths/v2/permissions/listRoles/V2PermissionsListRolesResponseData.yaml +++ b/go/apps/api/openapi/spec/paths/v2/permissions/listRoles/V2PermissionsListRolesResponseData.yaml @@ -2,4 +2,4 @@ type: array maxItems: 1000 description: Array of roles with their assigned permissions. items: - "$ref": "../../../../common/role.yaml" + "$ref": "../../../../common/Role.yaml"