Code samples
# Example request using curl
curl -X GET http://coder-server:8080/.well-known/oauth-authorization-server \
-H 'Accept: application/json'
GET /.well-known/oauth-authorization-server
Example responses
200 Response
{
"authorization_endpoint": "string",
"code_challenge_methods_supported": [
"S256"
],
"grant_types_supported": [
"authorization_code"
],
"issuer": "string",
"registration_endpoint": "string",
"response_types_supported": [
"code"
],
"revocation_endpoint": "string",
"scopes_supported": [
"string"
],
"token_endpoint": "string",
"token_endpoint_auth_methods_supported": [
"client_secret_basic"
]
}
Responses
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/.well-known/oauth-protected-resource \
-H 'Accept: application/json'
GET /.well-known/oauth-protected-resource
Example responses
200 Response
{
"authorization_servers": [
"string"
],
"bearer_methods_supported": [
"string"
],
"resource": "string",
"scopes_supported": [
"string"
]
}
Responses
Get agent firewall session by ID
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/agent-firewall/sessions/{id} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/agent-firewall/sessions/{id}
Parameters
Name In Type Required Description idpath string(uuid) true Agent firewall session ID
Example responses
200 Response
{
"confined_process": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"started_at": "2019-08-24T14:15:22Z",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get agent firewall session logs
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/agent-firewall/sessions/{id}/logs \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/agent-firewall/sessions/{id}/logs
Parameters
Name In Type Required Description idpath string(uuid) true Agent firewall session ID seq_afterquery integer false Inclusive lower bound on sequence number seq_beforequery integer false Exclusive upper bound on sequence number limitquery integer false Maximum number of logs to return (default 100)
Example responses
200 Response
{
"results": [
{
"allowed": true,
"captured_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"detail": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"matched_rule": "string",
"method": "string",
"proto": "string",
"sequence_number": 0,
"session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
List AI Gateway keys
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/ai-gateway/keys \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/ai-gateway/keys
Example responses
200 Response
[
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key_prefix": "string",
"last_heartbeat_at": "2019-08-24T14:15:22Z",
"name": "string"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » created_atstring(date-time) false » idstring(uuid) false » key_prefixstring false » last_heartbeat_atstring(date-time) false » namestring false
To perform this operation, you must be authenticated. Learn more .
Create AI Gateway key
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/ai-gateway/keys \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/ai-gateway/keys
Body parameter
Parameters
Example responses
201 Response
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key": "string",
"key_prefix": "string",
"name": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete AI Gateway key
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/ai-gateway/keys/{key} \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/ai-gateway/keys/{key}
Parameters
Name In Type Required Description keypath string(uuid) true Key ID
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
AI Gateway serve
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/ai-gateway/serve \
-H 'X-AI-Governance-Gateway-Key: API_KEY'
GET /api/v2/ai-gateway/serve
Responses
To perform this operation, you must be authenticated. Learn more .
Get appearance
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/appearance \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/appearance
Example responses
200 Response
{
"announcement_banners": [
{
"background_color": "string",
"enabled": true,
"message": "string"
}
],
"application_name": "string",
"docs_url": "string",
"logo_url": "string",
"service_banner": {
"background_color": "string",
"enabled": true,
"message": "string"
},
"support_links": [
{
"icon": "bug",
"location": "navbar",
"name": "string",
"target": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update appearance
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/appearance \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PUT /api/v2/appearance
Body parameter
{
"announcement_banners": [
{
"background_color": "string",
"enabled": true,
"message": "string"
}
],
"application_name": "string",
"logo_url": "string",
"service_banner": {
"background_color": "string",
"enabled": true,
"message": "string"
}
}
Parameters
Example responses
200 Response
{
"announcement_banners": [
{
"background_color": "string",
"enabled": true,
"message": "string"
}
],
"application_name": "string",
"logo_url": "string",
"service_banner": {
"background_color": "string",
"enabled": true,
"message": "string"
}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get connection logs
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/connectionlog?limit=0 \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/connectionlog
Parameters
Name In Type Required Description qquery string false Search query limitquery integer true Page limit offsetquery integer false Page offset
Example responses
200 Response
{
"connection_logs": [
{
"agent_name": "string",
"connect_time": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"ip": "string",
"organization": {
"display_name": "string",
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
},
"ssh_info": {
"connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
"disconnect_reason": "string",
"disconnect_time": "2019-08-24T14:15:22Z",
"exit_code": 0
},
"type": "ssh",
"web_info": {
"slug_or_port": "string",
"status_code": 0,
"user": {
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"has_ai_seat": true,
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"organization_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"roles": [
{
"display_name": "string",
"name": "string",
"organization_id": "string"
}
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
},
"user_agent": "string"
},
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",
"workspace_name": "string",
"workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7",
"workspace_owner_username": "string"
}
],
"count": 0,
"count_cap": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get entitlements
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/entitlements \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/entitlements
Example responses
200 Response
{
"errors": [
"string"
],
"features": {
"property1": {
"actual": 0,
"enabled": true,
"entitlement": "entitled",
"limit": 0,
"usage_period": {
"end": "2019-08-24T14:15:22Z",
"issued_at": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z"
}
},
"property2": {
"actual": 0,
"enabled": true,
"entitlement": "entitled",
"limit": 0,
"usage_period": {
"end": "2019-08-24T14:15:22Z",
"issued_at": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z"
}
}
},
"has_license": true,
"refreshed_at": "2019-08-24T14:15:22Z",
"require_telemetry": true,
"trial": true,
"warnings": [
"string"
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get groups
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/groups?organization=string&has_member=string&group_ids=string \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/groups
Parameters
Name In Type Required Description organizationquery string true Organization ID or name has_memberquery string true User ID or name group_idsquery string true Comma separated list of group IDs
Example responses
200 Response
[
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » avatar_urlstring(uri) false » display_namestring false » idstring(uuid) false » membersarray false »» avatar_urlstring(uri) false »» created_atstring(date-time) true »» emailstring(email) true »» idstring(uuid) true »» is_service_accountboolean false »» last_seen_atstring(date-time) false »» login_typecodersdk.LoginType false »» namestring false »» statuscodersdk.UserStatus false »» theme_preferencestring false Deprecated: this value should be retrieved from codersdk.UserPreferenceSettings instead. »» updated_atstring(date-time) false »» usernamestring true » namestring false » organization_display_namestring false » organization_idstring(uuid) false » organization_namestring false » quota_allowanceinteger false » sourcecodersdk.GroupSource false » total_member_countinteger false How many members are in this group. Shows the total count, even if the user is not authorized to read group member details. May be greater than len(Group.Members).
Enumerated Values
Property Value(s) login_type``, github, none, oidc, password, token statusactive, suspendedsourceoidc, user
To perform this operation, you must be authenticated. Learn more .
Get group by ID
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/groups/{group} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/groups/{group}
Parameters
Name In Type Required Description grouppath string true Group id exclude_membersquery boolean false Exclude members from the response
Example responses
200 Response
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete group by name
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/groups/{group} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/groups/{group}
Parameters
Name In Type Required Description grouppath string true Group name
Example responses
200 Response
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update group by name
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/groups/{group} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/groups/{group}
Body parameter
{
"add_users": [
"string"
],
"avatar_url": "string",
"display_name": "string",
"name": "string",
"quota_allowance": 0,
"remove_users": [
"string"
]
}
Parameters
Example responses
200 Response
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get group AI budget
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/groups/{group}/ai/budget \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/groups/{group}/ai/budget
Parameters
Name In Type Required Description grouppath string(uuid) true Group ID
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
"spend_limit_micros": 0,
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Upsert group AI budget
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/groups/{group}/ai/budget \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PUT /api/v2/groups/{group}/ai/budget
Body parameter
{
"spend_limit_micros": 0
}
Parameters
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
"spend_limit_micros": 0,
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete group AI budget
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/groups/{group}/ai/budget \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/groups/{group}/ai/budget
Parameters
Name In Type Required Description grouppath string(uuid) true Group ID
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
Get group AI spend
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/groups/{group}/ai/spend \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/groups/{group}/ai/spend
Returns the AI spend limit and aggregate spend for the group.
Parameters
Name In Type Required Description grouppath string(uuid) true Group ID
Example responses
200 Response
{
"current_spend_micros": 0,
"group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
"period_end": "2019-08-24T14:15:22Z",
"period_start": "2019-08-24T14:15:22Z",
"spend_limit_micros": 0,
"total_spend_limit_micros": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get group members by group ID
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/groups/{group}/members \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/groups/{group}/members
Parameters
Name In Type Required Description grouppath string true Group id qquery string false Member search query after_idquery string(uuid) false After ID limitquery integer false Page limit offsetquery integer false Page offset
Example responses
200 Response
{
"count": 0,
"users": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get group members AI spend
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/groups/{group}/members/ai/spend?user_ids=string \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/groups/{group}/members/ai/spend
Returns aggregate AI spend attributed to the group per requested user.
A maximum of 100 user IDs may be requested per call, and requests with more are rejected, so callers are expected to batch across multiple requests.
User IDs that are not members of the group, or that the caller has no read access to, are silently omitted.
Parameters
Name In Type Required Description grouppath string(uuid) true Group ID user_idsquery string true Comma-separated list of user IDs (maximum 100)
Example responses
200 Response
{
"members": [
{
"effective_group_id": "85e2b926-ddfb-4c66-b68e-b66e5acec6c0",
"group_budget": {
"limit_source": "user_override",
"spend_limit_micros": 0
},
"group_spend_micros": 0,
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
],
"period_end": "2019-08-24T14:15:22Z",
"period_start": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get licenses
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/licenses \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/licenses
Example responses
200 Response
[
{
"claims": {},
"id": 0,
"uploaded_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » claimsobject false Claims are the JWT claims asserted by the license. Here we use a generic string map to ensure that all data from the server is parsed verbatim, not just the fields this version of Coder understands. » idinteger false » uploaded_atstring(date-time) false » uuidstring(uuid) false
To perform this operation, you must be authenticated. Learn more .
Add new license
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/licenses \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/licenses
Body parameter
Parameters
Example responses
201 Response
{
"claims": {},
"id": 0,
"uploaded_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update license entitlements
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/licenses/refresh-entitlements \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/licenses/refresh-entitlements
Example responses
201 Response
{
"detail": "string",
"message": "string",
"validations": [
{
"detail": "string",
"field": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete license
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/licenses/{id} \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/licenses/{id}
Parameters
Name In Type Required Description idpath string(number) true License ID
Responses
Status Meaning Description Schema 200 OK OK
To perform this operation, you must be authenticated. Learn more .
Update notification template dispatch method
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/notifications/templates/{notification_template}/method \
-H 'Coder-Session-Token: API_KEY'
PUT /api/v2/notifications/templates/{notification_template}/method
Parameters
Name In Type Required Description notification_templatepath string true Notification template UUID
Responses
To perform this operation, you must be authenticated. Learn more .
Get OAuth2 applications
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/oauth2-provider/apps
Parameters
Name In Type Required Description user_idquery string false Filter by applications authorized for a user
Example responses
200 Response
[
{
"callback_url": "string",
"endpoints": {
"authorization": "string",
"device_authorization": "string",
"token": "string",
"token_revoke": "string"
},
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » callback_urlstring false » endpointscodersdk.OAuth2AppEndpoints false Endpoints are included in the app response for easier discovery. The OAuth2 spec does not have a defined place to find these (for comparison, OIDC has a '/.well-known/openid-configuration' endpoint). »» authorizationstring false »» device_authorizationstring false Device authorization is optional. »» tokenstring false »» token_revokestring false » iconstring false » idstring(uuid) false » namestring false
To perform this operation, you must be authenticated. Learn more .
Create OAuth2 application
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/oauth2-provider/apps
Body parameter
{
"callback_url": "string",
"icon": "string",
"name": "string"
}
Parameters
Example responses
200 Response
{
"callback_url": "string",
"endpoints": {
"authorization": "string",
"device_authorization": "string",
"token": "string",
"token_revoke": "string"
},
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get OAuth2 application
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/oauth2-provider/apps/{app}
Parameters
Name In Type Required Description apppath string true App ID
Example responses
200 Response
{
"callback_url": "string",
"endpoints": {
"authorization": "string",
"device_authorization": "string",
"token": "string",
"token_revoke": "string"
},
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update OAuth2 application
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PUT /api/v2/oauth2-provider/apps/{app}
Body parameter
{
"callback_url": "string",
"icon": "string",
"name": "string"
}
Parameters
Example responses
200 Response
{
"callback_url": "string",
"endpoints": {
"authorization": "string",
"device_authorization": "string",
"token": "string",
"token_revoke": "string"
},
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete OAuth2 application
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/oauth2-provider/apps/{app}
Parameters
Name In Type Required Description apppath string true App ID
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
Get OAuth2 application secrets
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/oauth2-provider/apps/{app}/secrets
Parameters
Name In Type Required Description apppath string true App ID
Example responses
200 Response
[
{
"client_secret_truncated": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"last_used_at": "string"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » client_secret_truncatedstring false » idstring(uuid) false » last_used_atstring false
To perform this operation, you must be authenticated. Learn more .
Create OAuth2 application secret
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/oauth2-provider/apps/{app}/secrets
Parameters
Name In Type Required Description apppath string true App ID
Example responses
200 Response
[
{
"client_secret_full": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » client_secret_fullstring false » idstring(uuid) false
To perform this operation, you must be authenticated. Learn more .
Delete OAuth2 application secret
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets/{secretID} \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/oauth2-provider/apps/{app}/secrets/{secretID}
Parameters
Name In Type Required Description apppath string true App ID secretIDpath string true Secret ID
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
Export organization AI spend as CSV
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/ai/spend/export \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/ai/spend/export
Returns per-user, per-group, per-model, per-provider aggregated AI spend for the organization as CSV, built from raw AI Gateway token usage.
The optional period_start and period_end query parameters bound the period and are interpreted as UTC. They must be provided together and span at most 31 days. When both are omitted, the current UTC monthly period is used.
An explicit period_start must fall within the configured AI Gateway data retention window, since older token usage is purged. The default period is narrowed to that window instead, and every row echoes the applied bounds.
Requires organization-level administrator permissions.
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID period_startquery string(date-time) false Inclusive lower bound (RFC3339) period_endquery string(date-time) false Exclusive upper bound (RFC3339)
Responses
Status Meaning Description Schema 200 OK OK
To perform this operation, you must be authenticated. Learn more .
Get groups by organization
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/groups
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Example responses
200 Response
[
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » avatar_urlstring(uri) false » display_namestring false » idstring(uuid) false » membersarray false »» avatar_urlstring(uri) false »» created_atstring(date-time) true »» emailstring(email) true »» idstring(uuid) true »» is_service_accountboolean false »» last_seen_atstring(date-time) false »» login_typecodersdk.LoginType false »» namestring false »» statuscodersdk.UserStatus false »» theme_preferencestring false Deprecated: this value should be retrieved from codersdk.UserPreferenceSettings instead. »» updated_atstring(date-time) false »» usernamestring true » namestring false » organization_display_namestring false » organization_idstring(uuid) false » organization_namestring false » quota_allowanceinteger false » sourcecodersdk.GroupSource false » total_member_countinteger false How many members are in this group. Shows the total count, even if the user is not authorized to read group member details. May be greater than len(Group.Members).
Enumerated Values
Property Value(s) login_type``, github, none, oidc, password, token statusactive, suspendedsourceoidc, user
To perform this operation, you must be authenticated. Learn more .
Create group for organization
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/groups \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/organizations/{organization}/groups
Body parameter
{
"avatar_url": "string",
"display_name": "string",
"name": "string",
"quota_allowance": 0
}
Parameters
Example responses
201 Response
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get organization groups AI spend
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/ai/spend?group_ids=string \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/groups/ai/spend
Returns AI spend limits and aggregate spend for the requested groups.
A maximum of 100 group IDs may be requested per call, and requests with more are rejected, so callers are expected to batch across multiple requests.
Unknown or unreadable group IDs are silently omitted.
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID group_idsquery string true Comma-separated list of group IDs (maximum 100)
Example responses
200 Response
{
"groups": [
{
"current_spend_micros": 0,
"group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
"spend_limit_micros": 0,
"total_spend_limit_micros": 0
}
],
"period_end": "2019-08-24T14:15:22Z",
"period_start": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get group by organization and group name
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/{groupName} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/groups/{groupName}
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID groupNamepath string true Group name
Example responses
200 Response
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get group members by organization and group name
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/{groupName}/members \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/groups/{groupName}/members
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID groupNamepath string true Group name qquery string false Member search query after_idquery string(uuid) false After ID limitquery integer false Page limit offsetquery integer false Page offset
Example responses
200 Response
{
"count": 0,
"users": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get group members AI spend by organization
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/{groupName}/members/ai/spend?user_ids=string \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/groups/{groupName}/members/ai/spend
Returns aggregate AI spend attributed to the group per requested user.
A maximum of 100 user IDs may be requested per call, and requests with more are rejected, so callers are expected to batch across multiple requests.
User IDs that are not members of the group, or that the caller has no read access to, are silently omitted.
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID groupNamepath string true Group name user_idsquery string true Comma-separated list of user IDs (maximum 100)
Example responses
200 Response
{
"members": [
{
"effective_group_id": "85e2b926-ddfb-4c66-b68e-b66e5acec6c0",
"group_budget": {
"limit_source": "user_override",
"spend_limit_micros": 0
},
"group_spend_micros": 0,
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
],
"period_end": "2019-08-24T14:15:22Z",
"period_start": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get workspace quota by user
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members/{user}/workspace-quota \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/members/{user}/workspace-quota
Parameters
Name In Type Required Description userpath string true User ID, name, or me organizationpath string(uuid) true Organization ID
Example responses
200 Response
{
"budget": 0,
"credits_consumed": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Serve provisioner daemon
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisionerdaemons/serve \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/provisionerdaemons/serve
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Responses
To perform this operation, you must be authenticated. Learn more .
List provisioner key
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisionerkeys \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/provisionerkeys
Parameters
Name In Type Required Description organizationpath string true Organization ID
Example responses
200 Response
[
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"tags": {
"property1": "string",
"property2": "string"
}
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » created_atstring(date-time) false » idstring(uuid) false » namestring false » organizationstring(uuid) false » tagscodersdk.ProvisionerKeyTags false »» [any property]string false
To perform this operation, you must be authenticated. Learn more .
Create provisioner key
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/provisionerkeys \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/organizations/{organization}/provisionerkeys
Parameters
Name In Type Required Description organizationpath string true Organization ID
Example responses
201 Response
Responses
To perform this operation, you must be authenticated. Learn more .
List provisioner key daemons
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisionerkeys/daemons \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/provisionerkeys/daemons
Parameters
Name In Type Required Description organizationpath string true Organization ID
Example responses
200 Response
[
{
"daemons": [
{
"api_version": "string",
"created_at": "2019-08-24T14:15:22Z",
"current_job": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "pending",
"template_display_name": "string",
"template_icon": "string",
"template_name": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5",
"key_name": "string",
"last_seen_at": "2019-08-24T14:15:22Z",
"name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"previous_job": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "pending",
"template_display_name": "string",
"template_icon": "string",
"template_name": "string"
},
"provisioners": [
"string"
],
"status": "offline",
"tags": {
"property1": "string",
"property2": "string"
},
"version": "string"
}
],
"key": {
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"tags": {
"property1": "string",
"property2": "string"
}
}
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » daemonsarray false »» api_versionstring false »» created_atstring(date-time) false »» current_jobcodersdk.ProvisionerDaemonJob false »»» idstring(uuid) false »»» statuscodersdk.ProvisionerJobStatus false »»» template_display_namestring false »»» template_iconstring false »»» template_namestring false »» idstring(uuid) false »» key_idstring(uuid) false »» key_namestring false Optional fields. »» last_seen_atstring(date-time) false »» namestring false »» organization_idstring(uuid) false »» previous_jobcodersdk.ProvisionerDaemonJob false »» provisionersarray false »» statuscodersdk.ProvisionerDaemonStatus false »» tagsobject false »»» [any property]string false »» versionstring false » keycodersdk.ProvisionerKey false »» created_atstring(date-time) false »» idstring(uuid) false »» namestring false »» organizationstring(uuid) false »» tagscodersdk.ProvisionerKeyTags false »»» [any property]string false
Enumerated Values
Property Value(s) statusbusy, canceled, canceling, failed, idle, offline, pending, running, succeeded
To perform this operation, you must be authenticated. Learn more .
Delete provisioner key
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/provisionerkeys/{provisionerkey} \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/organizations/{organization}/provisionerkeys/{provisionerkey}
Parameters
Name In Type Required Description organizationpath string true Organization ID provisionerkeypath string true Provisioner key name
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
Get the available organization idp sync claim fields
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/available-fields \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/settings/idpsync/available-fields
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Example responses
200 Response
Responses
Status Meaning Description Schema 200 OK OK array of string
Response Schema
To perform this operation, you must be authenticated. Learn more .
Get the organization idp sync claim field values
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/field-values?claimField=string \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/settings/idpsync/field-values
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID claimFieldquery string(string) true Claim Field
Example responses
200 Response
Responses
Status Meaning Description Schema 200 OK OK array of string
Response Schema
To perform this operation, you must be authenticated. Learn more .
Get group IdP Sync settings by organization
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/groups \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/settings/idpsync/groups
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Example responses
200 Response
{
"auto_create_missing_groups": true,
"field": "string",
"legacy_group_name_mapping": {
"property1": "string",
"property2": "string"
},
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"regex_filter": {}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update group IdP Sync settings by organization
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/groups \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}/settings/idpsync/groups
Body parameter
{
"auto_create_missing_groups": true,
"field": "string",
"legacy_group_name_mapping": {
"property1": "string",
"property2": "string"
},
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"regex_filter": {}
}
Parameters
Example responses
200 Response
{
"auto_create_missing_groups": true,
"field": "string",
"legacy_group_name_mapping": {
"property1": "string",
"property2": "string"
},
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"regex_filter": {}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update group IdP Sync config
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/groups/config \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}/settings/idpsync/groups/config
Body parameter
{
"auto_create_missing_groups": true,
"field": "string",
"regex_filter": {}
}
Parameters
Example responses
200 Response
{
"auto_create_missing_groups": true,
"field": "string",
"legacy_group_name_mapping": {
"property1": "string",
"property2": "string"
},
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"regex_filter": {}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update group IdP Sync mapping
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/groups/mapping \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}/settings/idpsync/groups/mapping
Body parameter
{
"add": [
{
"gets": "string",
"given": "string"
}
],
"remove": [
{
"gets": "string",
"given": "string"
}
]
}
Parameters
Example responses
200 Response
{
"auto_create_missing_groups": true,
"field": "string",
"legacy_group_name_mapping": {
"property1": "string",
"property2": "string"
},
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"regex_filter": {}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get role IdP Sync settings by organization
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/roles \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/settings/idpsync/roles
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update role IdP Sync settings by organization
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/roles \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}/settings/idpsync/roles
Body parameter
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID bodybody codersdk.RoleSyncSettings true New settings
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update role IdP Sync config
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/roles/config \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}/settings/idpsync/roles/config
Body parameter
Parameters
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update role IdP Sync mapping
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/roles/mapping \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}/settings/idpsync/roles/mapping
Body parameter
{
"add": [
{
"gets": "string",
"given": "string"
}
],
"remove": [
{
"gets": "string",
"given": "string"
}
]
}
Parameters
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get workspace sharing settings for organization
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/settings/workspace-sharing \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/settings/workspace-sharing
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Example responses
200 Response
{
"shareable_workspace_owners": "none",
"sharing_disabled": true,
"sharing_globally_disabled": true
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update workspace sharing settings for organization
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/workspace-sharing \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}/settings/workspace-sharing
Body parameter
{
"shareable_workspace_owners": "none",
"sharing_disabled": true
}
Parameters
Example responses
200 Response
{
"shareable_workspace_owners": "none",
"sharing_disabled": true,
"sharing_globally_disabled": true
}
Responses
To perform this operation, you must be authenticated. Learn more .
Fetch provisioner key details
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/provisionerkeys/{provisionerkey} \
-H 'Accept: application/json'
GET /api/v2/provisionerkeys/{provisionerkey}
Parameters
Name In Type Required Description provisionerkeypath string true Provisioner Key
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"organization": "452c1a86-a0af-475b-b03f-724878b0f387",
"tags": {
"property1": "string",
"property2": "string"
}
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get active replicas
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/replicas \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/replicas
Example responses
200 Response
[
{
"created_at": "2019-08-24T14:15:22Z",
"database_latency": 0,
"error": "string",
"hostname": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"region_id": 0,
"relay_address": "string"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » created_atstring(date-time) false Created at is the timestamp when the replica was first seen. » database_latencyinteger false Database latency is the latency in microseconds to the database. » errorstring false Error is the replica error. » hostnamestring false Hostname is the hostname of the replica. » idstring(uuid) false ID is the unique identifier for the replica. » region_idinteger false Region ID is the region of the replica. » relay_addressstring false Relay address is the accessible address to relay DERP connections.
To perform this operation, you must be authenticated. Learn more .
Get the available idp sync claim fields
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/settings/idpsync/available-fields \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/settings/idpsync/available-fields
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Example responses
200 Response
Responses
Status Meaning Description Schema 200 OK OK array of string
Response Schema
To perform this operation, you must be authenticated. Learn more .
Get the idp sync claim field values
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/settings/idpsync/field-values?claimField=string \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/settings/idpsync/field-values
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID claimFieldquery string(string) true Claim Field
Example responses
200 Response
Responses
Status Meaning Description Schema 200 OK OK array of string
Response Schema
To perform this operation, you must be authenticated. Learn more .
Get organization IdP Sync settings
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/settings/idpsync/organization \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/settings/idpsync/organization
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"organization_assign_default": true
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update organization IdP Sync settings
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/settings/idpsync/organization
Body parameter
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"organization_assign_default": true
}
Parameters
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"organization_assign_default": true
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update organization IdP Sync config
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization/config \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/settings/idpsync/organization/config
Body parameter
{
"assign_default": true,
"field": "string"
}
Parameters
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"organization_assign_default": true
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update organization IdP Sync mapping
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization/mapping \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/settings/idpsync/organization/mapping
Body parameter
{
"add": [
{
"gets": "string",
"given": "string"
}
],
"remove": [
{
"gets": "string",
"given": "string"
}
]
}
Parameters
Example responses
200 Response
{
"field": "string",
"mapping": {
"property1": [
"string"
],
"property2": [
"string"
]
},
"organization_assign_default": true
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get template ACLs
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/templates/{template}/acl
Parameters
Name In Type Required Description templatepath string(uuid) true Template ID
Example responses
200 Response
{
"group": [
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"role": "admin",
"source": "user",
"total_member_count": 0
}
],
"users": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"has_ai_seat": true,
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"organization_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"role": "admin",
"roles": [
{
"display_name": "string",
"name": "string",
"organization_id": "string"
}
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update template ACL
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/acl \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/templates/{template}/acl
Body parameter
{
"group_perms": {
"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
"<group_id>": "admin"
},
"user_perms": {
"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
"<user_id>": "admin"
}
}
Parameters
Name In Type Required Description templatepath string(uuid) true Template ID bodybody codersdk.UpdateTemplateACL true Update template ACL request
Example responses
200 Response
{
"detail": "string",
"message": "string",
"validations": [
{
"detail": "string",
"field": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get template available acl users/groups
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/templates/{template}/acl/available
Parameters
Name In Type Required Description templatepath string(uuid) true Template ID
Example responses
200 Response
[
{
"groups": [
{
"avatar_url": "http://example.com",
"display_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"members": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
],
"name": "string",
"organization_display_name": "string",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"organization_name": "string",
"quota_allowance": 0,
"source": "user",
"total_member_count": 0
}
],
"users": [
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
]
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » groupsarray false »» avatar_urlstring(uri) false »» display_namestring false »» idstring(uuid) false »» membersarray false »»» avatar_urlstring(uri) false »»» created_atstring(date-time) true »»» emailstring(email) true »»» idstring(uuid) true »»» is_service_accountboolean false »»» last_seen_atstring(date-time) false »»» login_typecodersdk.LoginType false »»» namestring false »»» statuscodersdk.UserStatus false »»» theme_preferencestring false Deprecated: this value should be retrieved from codersdk.UserPreferenceSettings instead. »»» updated_atstring(date-time) false »»» usernamestring true »» namestring false »» organization_display_namestring false »» organization_idstring(uuid) false »» organization_namestring false »» quota_allowanceinteger false »» sourcecodersdk.GroupSource false »» total_member_countinteger false How many members are in this group. Shows the total count, even if the user is not authorized to read group member details. May be greater than len(Group.Members). » usersarray false
Enumerated Values
Property Value(s) login_type``, github, none, oidc, password, token statusactive, suspendedsourceoidc, user
To perform this operation, you must be authenticated. Learn more .
Invalidate presets for template
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/templates/{template}/prebuilds/invalidate \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/templates/{template}/prebuilds/invalidate
Parameters
Name In Type Required Description templatepath string(uuid) true Template ID
Example responses
200 Response
{
"invalidated": [
{
"preset_name": "string",
"template_name": "string",
"template_version_name": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get user AI budget override
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/users/{user}/ai/budget/override \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/users/{user}/ai/budget/override
Parameters
Name In Type Required Description userpath string true User ID, username, or me
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
"spend_limit_micros": 0,
"updated_at": "2019-08-24T14:15:22Z",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Upsert user AI budget override
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/users/{user}/ai/budget/override \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PUT /api/v2/users/{user}/ai/budget/override
Body parameter
{
"group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
"spend_limit_micros": 0
}
Parameters
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
"spend_limit_micros": 0,
"updated_at": "2019-08-24T14:15:22Z",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete user AI budget override
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/users/{user}/ai/budget/override \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/users/{user}/ai/budget/override
Parameters
Name In Type Required Description userpath string true User ID, username, or me
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
Get user AI spend
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/users/{user}/ai/spend \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/users/{user}/ai/spend
Parameters
Name In Type Required Description userpath string true User ID, username, or me
Example responses
200 Response
{
"current_spend_micros": 0,
"effective_budget": {
"limit_source": "user_override",
"spend_limit_micros": 0
},
"effective_group_id": "85e2b926-ddfb-4c66-b68e-b66e5acec6c0",
"period_end": "2019-08-24T14:15:22Z",
"period_start": "2019-08-24T14:15:22Z",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get user quiet hours schedule
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/users/{user}/quiet-hours \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/users/{user}/quiet-hours
Parameters
Name In Type Required Description userpath string(uuid) true User ID
Example responses
200 Response
[
{
"next": "2019-08-24T14:15:22Z",
"raw_schedule": "string",
"time": "string",
"timezone": "string",
"user_can_set": true,
"user_set": true
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » nextstring(date-time) false Next is the next time that the quiet hours window will start. » raw_schedulestring false » timestring false Time is the time of day that the quiet hours window starts in the given Timezone each day. » timezonestring false raw format from the cron expression, UTC if unspecified » user_can_setboolean false User can set is true if the user is allowed to set their own quiet hours schedule. If false, the user cannot set a custom schedule and the default schedule will always be used. » user_setboolean false User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule.
To perform this operation, you must be authenticated. Learn more .
Update user quiet hours schedule
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/users/{user}/quiet-hours \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PUT /api/v2/users/{user}/quiet-hours
Body parameter
Parameters
Example responses
200 Response
[
{
"next": "2019-08-24T14:15:22Z",
"raw_schedule": "string",
"time": "string",
"timezone": "string",
"user_can_set": true,
"user_set": true
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » nextstring(date-time) false Next is the next time that the quiet hours window will start. » raw_schedulestring false » timestring false Time is the time of day that the quiet hours window starts in the given Timezone each day. » timezonestring false raw format from the cron expression, UTC if unspecified » user_can_setboolean false User can set is true if the user is allowed to set their own quiet hours schedule. If false, the user cannot set a custom schedule and the default schedule will always be used. » user_setboolean false User set is true if the user has set their own quiet hours schedule. If false, the user is using the default schedule.
To perform this operation, you must be authenticated. Learn more .
Get workspace quota by user deprecated
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/workspace-quota/{user} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/workspace-quota/{user}
Parameters
Name In Type Required Description userpath string true User ID, name, or me
Example responses
200 Response
{
"budget": 0,
"credits_consumed": 0
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get workspace proxies
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/workspaceproxies \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/workspaceproxies
Example responses
200 Response
[
{
"regions": [
{
"created_at": "2019-08-24T14:15:22Z",
"deleted": true,
"derp_enabled": true,
"derp_only": true,
"display_name": "string",
"healthy": true,
"icon_url": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"path_app_url": "string",
"status": {
"checked_at": "2019-08-24T14:15:22Z",
"report": {
"errors": [
"string"
],
"warnings": [
"string"
]
},
"status": "ok"
},
"updated_at": "2019-08-24T14:15:22Z",
"version": "string",
"wildcard_hostname": "string"
}
]
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » regionsarray false »» created_atstring(date-time) false »» deletedboolean false »» derp_enabledboolean false »» derp_onlyboolean false »» display_namestring false »» healthyboolean false »» icon_urlstring false »» idstring(uuid) false »» namestring false »» path_app_urlstring false Path app URL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com »» statuscodersdk.WorkspaceProxyStatus false Status is the latest status check of the proxy. This will be empty for deleted proxies. This value can be used to determine if a workspace proxy is healthy and ready to use. »»» checked_atstring(date-time) false »»» reportcodersdk.ProxyHealthReport false Report provides more information about the health of the workspace proxy. »»»» errorsarray false Errors are problems that prevent the workspace proxy from being healthy »»»» warningsarray false Warnings do not prevent the workspace proxy from being healthy, but should be addressed. »»» statuscodersdk.ProxyHealthStatus false »» updated_atstring(date-time) false »» versionstring false »» wildcard_hostnamestring false Wildcard hostname is the wildcard hostname for subdomain apps. E.g. .us.example.com E.g. --suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL.
Enumerated Values
Property Value(s) statusok, unhealthy, unreachable, unregistered
To perform this operation, you must be authenticated. Learn more .
Create workspace proxy
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/workspaceproxies \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/workspaceproxies
Body parameter
{
"display_name": "string",
"icon": "string",
"name": "string"
}
Parameters
Example responses
201 Response
{
"created_at": "2019-08-24T14:15:22Z",
"deleted": true,
"derp_enabled": true,
"derp_only": true,
"display_name": "string",
"healthy": true,
"icon_url": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"path_app_url": "string",
"status": {
"checked_at": "2019-08-24T14:15:22Z",
"report": {
"errors": [
"string"
],
"warnings": [
"string"
]
},
"status": "ok"
},
"updated_at": "2019-08-24T14:15:22Z",
"version": "string",
"wildcard_hostname": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get workspace proxy
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/workspaceproxies/{workspaceproxy}
Parameters
Name In Type Required Description workspaceproxypath string(uuid) true Proxy ID or name
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"deleted": true,
"derp_enabled": true,
"derp_only": true,
"display_name": "string",
"healthy": true,
"icon_url": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"path_app_url": "string",
"status": {
"checked_at": "2019-08-24T14:15:22Z",
"report": {
"errors": [
"string"
],
"warnings": [
"string"
]
},
"status": "ok"
},
"updated_at": "2019-08-24T14:15:22Z",
"version": "string",
"wildcard_hostname": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete workspace proxy
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/workspaceproxies/{workspaceproxy}
Parameters
Name In Type Required Description workspaceproxypath string(uuid) true Proxy ID or name
Example responses
200 Response
{
"detail": "string",
"message": "string",
"validations": [
{
"detail": "string",
"field": "string"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Update workspace proxy
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/workspaceproxies/{workspaceproxy}
Body parameter
{
"display_name": "string",
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"regenerate_token": true
}
Parameters
Name In Type Required Description workspaceproxypath string(uuid) true Proxy ID or name bodybody codersdk.PatchWorkspaceProxy true Update workspace proxy request
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"deleted": true,
"derp_enabled": true,
"derp_only": true,
"display_name": "string",
"healthy": true,
"icon_url": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"path_app_url": "string",
"status": {
"checked_at": "2019-08-24T14:15:22Z",
"report": {
"errors": [
"string"
],
"warnings": [
"string"
]
},
"status": "ok"
},
"updated_at": "2019-08-24T14:15:22Z",
"version": "string",
"wildcard_hostname": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get workspace external agent credentials
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/external-agent/{agent}/credentials \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/workspaces/{workspace}/external-agent/{agent}/credentials
Parameters
Name In Type Required Description workspacepath string(uuid) true Workspace ID agentpath string true Agent name
Example responses
200 Response
{
"agent_token": "string",
"command": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
OAuth2 authorization request (GET - show authorization page)
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/oauth2/authorize?client_id=string&state=string&response_type=code \
-H 'Coder-Session-Token: API_KEY'
GET /oauth2/authorize
Parameters
Name In Type Required Description client_idquery string true Client ID statequery string true A random unguessable string response_typequery string true Response type redirect_uriquery string false Redirect here after authorization scopequery string false Token scopes (currently ignored)
Enumerated Values
Parameter Value(s) response_typecode, token
Responses
Status Meaning Description Schema 200 OK Returns HTML authorization page
To perform this operation, you must be authenticated. Learn more .
OAuth2 authorization request (POST - process authorization)
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/oauth2/authorize?client_id=string&state=string&response_type=code \
-H 'Coder-Session-Token: API_KEY'
POST /oauth2/authorize
Parameters
Name In Type Required Description client_idquery string true Client ID statequery string true A random unguessable string response_typequery string true Response type redirect_uriquery string false Redirect here after authorization scopequery string false Token scopes (currently ignored)
Enumerated Values
Parameter Value(s) response_typecode, token
Responses
Status Meaning Description Schema 302 Found Returns redirect with authorization code
To perform this operation, you must be authenticated. Learn more .
Get OAuth2 client configuration (RFC 7592)
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/oauth2/clients/{client_id} \
-H 'Accept: application/json'
GET /oauth2/clients/{client_id}
Parameters
Name In Type Required Description client_idpath string true Client ID
Example responses
200 Response
{
"client_id": "string",
"client_id_issued_at": 0,
"client_name": "string",
"client_secret_expires_at": 0,
"client_uri": "string",
"contacts": [
"string"
],
"grant_types": [
"authorization_code"
],
"jwks": {},
"jwks_uri": "string",
"logo_uri": "string",
"policy_uri": "string",
"redirect_uris": [
"string"
],
"registration_access_token": "string",
"registration_client_uri": "string",
"response_types": [
"code"
],
"scope": "string",
"software_id": "string",
"software_version": "string",
"token_endpoint_auth_method": "client_secret_basic",
"tos_uri": "string"
}
Responses
Update OAuth2 client configuration (RFC 7592)
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/oauth2/clients/{client_id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
PUT /oauth2/clients/{client_id}
Body parameter
{
"client_name": "string",
"client_uri": "string",
"contacts": [
"string"
],
"grant_types": [
"authorization_code"
],
"jwks": {},
"jwks_uri": "string",
"logo_uri": "string",
"policy_uri": "string",
"redirect_uris": [
"string"
],
"response_types": [
"code"
],
"scope": "string",
"software_id": "string",
"software_statement": "string",
"software_version": "string",
"token_endpoint_auth_method": "client_secret_basic",
"tos_uri": "string"
}
Parameters
Example responses
200 Response
{
"client_id": "string",
"client_id_issued_at": 0,
"client_name": "string",
"client_secret_expires_at": 0,
"client_uri": "string",
"contacts": [
"string"
],
"grant_types": [
"authorization_code"
],
"jwks": {},
"jwks_uri": "string",
"logo_uri": "string",
"policy_uri": "string",
"redirect_uris": [
"string"
],
"registration_access_token": "string",
"registration_client_uri": "string",
"response_types": [
"code"
],
"scope": "string",
"software_id": "string",
"software_version": "string",
"token_endpoint_auth_method": "client_secret_basic",
"tos_uri": "string"
}
Responses
Delete OAuth2 client registration (RFC 7592)
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/oauth2/clients/{client_id}
DELETE /oauth2/clients/{client_id}
Parameters
Name In Type Required Description client_idpath string true Client ID
Responses
Status Meaning Description Schema 204 No Content No Content
OAuth2 dynamic client registration (RFC 7591)
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/oauth2/register \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /oauth2/register
Body parameter
{
"client_name": "string",
"client_uri": "string",
"contacts": [
"string"
],
"grant_types": [
"authorization_code"
],
"jwks": {},
"jwks_uri": "string",
"logo_uri": "string",
"policy_uri": "string",
"redirect_uris": [
"string"
],
"response_types": [
"code"
],
"scope": "string",
"software_id": "string",
"software_statement": "string",
"software_version": "string",
"token_endpoint_auth_method": "client_secret_basic",
"tos_uri": "string"
}
Parameters
Example responses
201 Response
{
"client_id": "string",
"client_id_issued_at": 0,
"client_name": "string",
"client_secret": "string",
"client_secret_expires_at": 0,
"client_uri": "string",
"contacts": [
"string"
],
"grant_types": [
"authorization_code"
],
"jwks": {},
"jwks_uri": "string",
"logo_uri": "string",
"policy_uri": "string",
"redirect_uris": [
"string"
],
"registration_access_token": "string",
"registration_client_uri": "string",
"response_types": [
"code"
],
"scope": "string",
"software_id": "string",
"software_version": "string",
"token_endpoint_auth_method": "client_secret_basic",
"tos_uri": "string"
}
Responses
Revoke OAuth2 tokens (RFC 7009)
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/oauth2/revoke \
POST /oauth2/revoke
Body parameter
client_id: string
token: string
token_type_hint: string
Parameters
Name In Type Required Description bodybody object true » client_idbody string true Client ID for authentication » tokenbody string true The token to revoke » token_type_hintbody string false Hint about token type (access_token or refresh_token)
Responses
Status Meaning Description Schema 200 OK Token successfully revoked
OAuth2 token exchange
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/oauth2/tokens \
-H 'Accept: application/json'
POST /oauth2/tokens
Body parameter
client_id: string
client_secret: string
code: string
refresh_token: string
grant_type: authorization_code
Parameters
Name In Type Required Description bodybody object false » client_idbody string false Client ID, required if grant_type=authorization_code » client_secretbody string false Client secret, required if grant_type=authorization_code » codebody string false Authorization code, required if grant_type=authorization_code » refresh_tokenbody string false Refresh token, required if grant_type=refresh_token » grant_typebody string true Grant type
Enumerated Values
Parameter Value(s) » grant_typeauthorization_code, client_credentials, implicit, password, refresh_token
Example responses
200 Response
{
"access_token": "string",
"expires_in": 0,
"expiry": "string",
"refresh_token": "string",
"token_type": "string"
}
Responses
Delete OAuth2 application tokens
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/oauth2/tokens?client_id=string \
-H 'Coder-Session-Token: API_KEY'
DELETE /oauth2/tokens
Parameters
Name In Type Required Description client_idquery string true Client ID
Responses
Status Meaning Description Schema 204 No Content No Content
To perform this operation, you must be authenticated. Learn more .
SCIM 2.0: Service Provider Config
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/scim/v2/ServiceProviderConfig
GET /scim/v2/ServiceProviderConfig
Responses
Status Meaning Description Schema 200 OK OK
SCIM 2.0: Get users
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/scim/v2/Users \
-H 'Authorizaiton: API_KEY'
GET /scim/v2/Users
Responses
Status Meaning Description Schema 200 OK OK
To perform this operation, you must be authenticated. Learn more .
SCIM 2.0: Create new user
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/scim/v2/Users \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorizaiton: API_KEY'
POST /scim/v2/Users
Body parameter
{
"active": true,
"emails": [
{
"display": "string",
"primary": true,
"type": "string",
"value": "[email protected] "
}
],
"groups": [
null
],
"id": "string",
"meta": {
"resourceType": "string"
},
"name": {
"familyName": "string",
"givenName": "string"
},
"schemas": [
"string"
],
"userName": "string"
}
Parameters
Example responses
200 Response
{
"active": true,
"emails": [
{
"display": "string",
"primary": true,
"type": "string",
"value": "[email protected] "
}
],
"groups": [
null
],
"id": "string",
"meta": {
"resourceType": "string"
},
"name": {
"familyName": "string",
"givenName": "string"
},
"schemas": [
"string"
],
"userName": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
SCIM 2.0: Get user by ID
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/scim/v2/Users/{id} \
-H 'Authorizaiton: API_KEY'
GET /scim/v2/Users/{id}
Parameters
Name In Type Required Description idpath string(uuid) true User ID
Responses
Status Meaning Description Schema 404 Not Found Not Found
To perform this operation, you must be authenticated. Learn more .
SCIM 2.0: Replace user account
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/scim/v2/Users/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/scim+json' \
-H 'Authorizaiton: API_KEY'
PUT /scim/v2/Users/{id}
Body parameter
{
"active": true,
"emails": [
{
"display": "string",
"primary": true,
"type": "string",
"value": "[email protected] "
}
],
"groups": [
null
],
"id": "string",
"meta": {
"resourceType": "string"
},
"name": {
"familyName": "string",
"givenName": "string"
},
"schemas": [
"string"
],
"userName": "string"
}
Parameters
Name In Type Required Description idpath string(uuid) true User ID bodybody legacyscim.SCIMUser true Replace user request
Example responses
200 Response
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"has_ai_seat": true,
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"organization_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"roles": [
{
"display_name": "string",
"name": "string",
"organization_id": "string"
}
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .
SCIM 2.0: Update user account
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/scim/v2/Users/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/scim+json' \
-H 'Authorizaiton: API_KEY'
PATCH /scim/v2/Users/{id}
Body parameter
{
"active": true,
"emails": [
{
"display": "string",
"primary": true,
"type": "string",
"value": "[email protected] "
}
],
"groups": [
null
],
"id": "string",
"meta": {
"resourceType": "string"
},
"name": {
"familyName": "string",
"givenName": "string"
},
"schemas": [
"string"
],
"userName": "string"
}
Parameters
Name In Type Required Description idpath string(uuid) true User ID bodybody legacyscim.SCIMUser true Update user request
Example responses
200 Response
{
"avatar_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"email": "[email protected] ",
"has_ai_seat": true,
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_service_account": true,
"last_seen_at": "2019-08-24T14:15:22Z",
"login_type": "",
"name": "string",
"organization_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"roles": [
{
"display_name": "string",
"name": "string",
"organization_id": "string"
}
],
"status": "active",
"theme_preference": "string",
"updated_at": "2019-08-24T14:15:22Z",
"username": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .