Get organizations
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations
Example responses
200 Response
[
{
"created_at": "2019-08-24T14:15:22Z",
"default_org_member_roles": [
"string"
],
"description": "string",
"display_name": "string",
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_default": true,
"name": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » created_atstring(date-time) true » default_org_member_rolesarray false Default org member roles are unioned into every member's effective roles at request time. Changes propagate to all members on the next request. » descriptionstring false » display_namestring false » iconstring false » idstring(uuid) true » is_defaultboolean true » namestring false » updated_atstring(date-time) true
To perform this operation, you must be authenticated. Learn more .
Create organization
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/organizations \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/organizations
Body parameter
{
"description": "string",
"display_name": "string",
"icon": "string",
"name": "string"
}
Parameters
Example responses
201 Response
{
"created_at": "2019-08-24T14:15:22Z",
"default_org_member_roles": [
"string"
],
"description": "string",
"display_name": "string",
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_default": true,
"name": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get organization by ID
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"default_org_member_roles": [
"string"
],
"description": "string",
"display_name": "string",
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_default": true,
"name": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete organization
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/organizations/{organization}
Parameters
Name In Type Required Description organizationpath string true Organization 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 organization
Code samples
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PATCH /api/v2/organizations/{organization}
Body parameter
{
"default_org_member_roles": [
"string"
],
"description": "string",
"display_name": "string",
"icon": "string",
"name": "string"
}
Parameters
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"default_org_member_roles": [
"string"
],
"description": "string",
"display_name": "string",
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_default": true,
"name": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Get provisioner jobs
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisionerjobs \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/provisionerjobs
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID limitquery integer false Page limit idsquery array(uuid) false Filter results by job IDs statusquery string false Filter results by status tagsquery object false Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'}) initiatorquery string(uuid) false Filter results by initiator
Enumerated Values
Parameter Value(s) statuscanceled, canceling, failed, pending, running, succeeded, unknown
Example responses
200 Response
[
{
"available_workers": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"canceled_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"error": "string",
"error_code": "REQUIRED_TEMPLATE_VARIABLES",
"file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3",
"input": {
"error": "string",
"template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1",
"workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478"
},
"logs_overflowed": true,
"metadata": {
"template_display_name": "string",
"template_icon": "string",
"template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
"template_name": "string",
"template_version_name": "string",
"workspace_build_transition": "start",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",
"workspace_name": "string"
},
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"queue_position": 0,
"queue_size": 0,
"started_at": "2019-08-24T14:15:22Z",
"status": "pending",
"tags": {
"property1": "string",
"property2": "string"
},
"type": "template_version_import",
"worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b",
"worker_name": "string"
}
]
Responses
Response Schema
Status Code 200
Name Type Required Restrictions Description [array item]array false » available_workersarray false » canceled_atstring(date-time) false » completed_atstring(date-time) false » created_atstring(date-time) false » errorstring false » error_codecodersdk.JobErrorCode false » file_idstring(uuid) false » idstring(uuid) false » initiator_idstring(uuid) false » inputcodersdk.ProvisionerJobInput false »» errorstring false »» template_version_idstring(uuid) false »» workspace_build_idstring(uuid) false » logs_overflowedboolean false » metadatacodersdk.ProvisionerJobMetadata false »» template_display_namestring false »» template_iconstring false »» template_idstring(uuid) false »» template_namestring false »» template_version_namestring false »» workspace_build_transitioncodersdk.WorkspaceTransition false »» workspace_idstring(uuid) false »» workspace_namestring false » organization_idstring(uuid) false » queue_positioninteger false » queue_sizeinteger false » started_atstring(date-time) false » statuscodersdk.ProvisionerJobStatus false » tagsobject false »» [any property]string false » typecodersdk.ProvisionerJobType false » worker_idstring(uuid) false » worker_namestring false
Enumerated Values
Property Value(s) error_codeINSUFFICIENT_QUOTA, REQUIRED_TEMPLATE_VARIABLESworkspace_build_transitiondelete, start, stopstatuscanceled, canceling, failed, pending, running, succeededtypetemplate_version_dry_run, template_version_import, workspace_build
To perform this operation, you must be authenticated. Learn more .
Get provisioner job
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisionerjobs/{job} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/organizations/{organization}/provisionerjobs/{job}
Parameters
Name In Type Required Description organizationpath string(uuid) true Organization ID jobpath string(uuid) true Job ID
Example responses
200 Response
{
"available_workers": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"canceled_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"error": "string",
"error_code": "REQUIRED_TEMPLATE_VARIABLES",
"file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3",
"input": {
"error": "string",
"template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1",
"workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478"
},
"logs_overflowed": true,
"metadata": {
"template_display_name": "string",
"template_icon": "string",
"template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
"template_name": "string",
"template_version_name": "string",
"workspace_build_transition": "start",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",
"workspace_name": "string"
},
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"queue_position": 0,
"queue_size": 0,
"started_at": "2019-08-24T14:15:22Z",
"status": "pending",
"tags": {
"property1": "string",
"property2": "string"
},
"type": "template_version_import",
"worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b",
"worker_name": "string"
}
Responses
To perform this operation, you must be authenticated. Learn more .