Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/lib/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function resolveAuthHeaders(
headers[scheme.name] = AUTH_SAMPLE_VALUE
continue
}
if (scheme.type === 'http' && scheme.scheme === 'bearer') {
if (scheme.type === 'oauth2' || (scheme.type === 'http' && scheme.scheme === 'bearer')) {
headers.Authorization = `Bearer ${AUTH_SAMPLE_VALUE}`
continue
}
Expand Down
34 changes: 30 additions & 4 deletions apps/docs/openapi-v2-billing.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
"x-sim-operation": "billing.status.read",
"x-oauth-scope": "api:read",
"tags": ["Billing"],
"security": [
{
"apiKey": []
},
{
"oauthBearer": ["api:read"]
}
],
"parameters": [
{
"name": "workspaceId",
Expand Down Expand Up @@ -111,6 +119,14 @@
"x-sim-operation": "billing.logs.list",
"x-oauth-scope": "api:read",
"tags": ["Billing"],
"security": [
{
"apiKey": []
},
{
"oauthBearer": ["api:read"]
}
],
"parameters": [
{
"name": "source",
Expand Down Expand Up @@ -263,10 +279,20 @@
"description": "Your Sim API key, personal or workspace-scoped. Generate one under Settings, then API Keys. Operations that reject workspace keys say so in their own description."
},
"oauthBearer": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "OAuth 2.0 access token",
"description": "A Sim OAuth access token obtained by a registered client through the authorization-code flow. Each operation declares its required scope: api:read permits reads and searches; api:write also permits changes and execution and implies api:read. Scope requirements follow the application operation, independent of HTTP method or workspace role."
"type": "oauth2",
"description": "A Sim OAuth access token obtained by a registered client through the authorization-code flow with PKCE (S256), sent as `Authorization: Bearer`. Each operation declares the scope it requires: api:read permits reads and searches; api:write also permits changes and execution and implies api:read. Scope requirements follow the application operation, independent of HTTP method or workspace role.",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://www.sim.ai/api/auth/oauth2/authorize",
"tokenUrl": "https://www.sim.ai/api/auth/oauth2/token",
"refreshUrl": "https://www.sim.ai/api/auth/oauth2/token",
"scopes": {
"api:read": "Read your workspaces, workflows, files, tables, and logs",
"api:write": "Read, create, change, run, and delete resources in your workspaces",
"offline_access": "Stay signed in without asking again"
}
}
}
}
},
"headers": {
Expand Down
Loading
Loading