Workspaces
Organization workspaces: members, roles, invitations and organization SSO (browser sessions only).
Organization workspaces: members, roles, invitations and organization SSO (browser sessions only).
patch/api/v1/workspace
Patch Workspace
Requires an API key.
Request bodyWorkspacePatch
| Field | Type | Default | Description |
|---|---|---|---|
| name | string | null | ||
| slug | string | null |
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X PATCH "$OSR_URL/api/v1/workspace" \
-H "Authorization: Bearer $OSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "default", "slug": "eu-health" }'{
"name": "default",
"slug": "eu-health"
}delete/api/v1/workspace
Leave Workspace
Leave the current organization (owners must hand over first).
Requires an API key.
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X DELETE "$OSR_URL/api/v1/workspace" \
-H "Authorization: Bearer $OSR_API_KEY"get/api/v1/workspace/audit
Workspace Audit
Account-lifecycle events of this workspace (sign-ins, invitations, roles, removals). Admins only.
Requires an API key.
Parameters
| Name | In | Type | Default | Description |
|---|---|---|---|---|
| limit | query | integer | 100 | |
| before | query | number | null | ||
| action | query | string | null |
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s "$OSR_URL/api/v1/workspace/audit?limit=100" \
-H "Authorization: Bearer $OSR_API_KEY"post/api/v1/workspace/invites
Invite
Requires an API key.
Request bodyInviteIn
| Field | Type | Default | Description |
|---|---|---|---|
| email(required) | string | ||
| role | string | "member" |
Responses
| 201 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X POST "$OSR_URL/api/v1/workspace/invites" \
-H "Authorization: Bearer $OSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "ada@example.com" }'{
"email": "ada@example.com"
}delete/api/v1/workspace/invites/{invite_id}
Revoke Invite
Requires an API key.
Parameters
| Name | In | Type | Default | Description |
|---|---|---|---|---|
| invite_id(required) | path | string |
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X DELETE "$OSR_URL/api/v1/workspace/invites/<invite_id>" \
-H "Authorization: Bearer $OSR_API_KEY"get/api/v1/workspace/members
Members
Requires an API key.
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s "$OSR_URL/api/v1/workspace/members" \
-H "Authorization: Bearer $OSR_API_KEY"patch/api/v1/workspace/members/{user_id}
Set Role
Requires an API key.
Parameters
| Name | In | Type | Default | Description |
|---|---|---|---|---|
| user_id(required) | path | string |
Request bodyRoleIn
| Field | Type | Default | Description |
|---|---|---|---|
| role(required) | string |
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X PATCH "$OSR_URL/api/v1/workspace/members/<user_id>" \
-H "Authorization: Bearer $OSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "role": "user" }'{
"role": "user"
}delete/api/v1/workspace/members/{user_id}
Remove Member
Requires an API key.
Parameters
| Name | In | Type | Default | Description |
|---|---|---|---|---|
| user_id(required) | path | string |
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X DELETE "$OSR_URL/api/v1/workspace/members/<user_id>" \
-H "Authorization: Bearer $OSR_API_KEY"get/api/v1/workspace/sso
Sso Get
Requires an API key.
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s "$OSR_URL/api/v1/workspace/sso" \
-H "Authorization: Bearer $OSR_API_KEY"put/api/v1/workspace/sso
Sso Put
Requires an API key.
Request bodySsoConnectionIn
| Field | Type | Default | Description |
|---|---|---|---|
| client_id(required) | string | ||
| client_secret | string | null | ||
| default_role | string | "member" | |
| domains | string[] | ||
| issuer | string | null | ||
| kind | string | "oidc" | |
| label | string | "Company SSO" | |
| scopes | string[] |
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X PUT "$OSR_URL/api/v1/workspace/sso" \
-H "Authorization: Bearer $OSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "client_id": "string" }'{
"client_id": "string"
}delete/api/v1/workspace/sso
Sso Delete
Requires an API key.
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X DELETE "$OSR_URL/api/v1/workspace/sso" \
-H "Authorization: Bearer $OSR_API_KEY"get/api/v1/workspaces
Workspaces
Requires an API key.
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s "$OSR_URL/api/v1/workspaces" \
-H "Authorization: Bearer $OSR_API_KEY"post/api/v1/workspaces
Create Workspace
Requires an API key.
Request bodyWorkspaceIn
| Field | Type | Default | Description |
|---|---|---|---|
| name(required) | string | ||
| slug | string | null |
Responses
| 201 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X POST "$OSR_URL/api/v1/workspaces" \
-H "Authorization: Bearer $OSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "default" }'{
"name": "default"
}post/api/v1/workspaces/{account_id}/switch
Switch Workspace
Requires an API key.
Parameters
| Name | In | Type | Default | Description |
|---|---|---|---|---|
| account_id(required) | path | string |
Responses
| 200 | Successful Response |
| 422 | Validation ErrorHTTPValidationError |
| 401 | Missing, invalid or revoked API key |
curl -s -X POST "$OSR_URL/api/v1/workspaces/<account_id>/switch" \
-H "Authorization: Bearer $OSR_API_KEY"Account, keys and tenants
The calling workspace: profile, usage, savings, activity log, API keys and tenants.
Sign-in and sessions
Sign-in with GitHub, Google or an organization identity provider; browser sessions; and CLI sign-in with device codes (`osr login`): the CLI requests a code, the person approves it in the browser, the CLI receives a workspace API key.