2026-08-11 11:22:55 -04:00
---
# Code generated by make gen. DO NOT EDIT.
title : Organizations
---
<!-- DO NOT EDIT | GENERATED CONTENT -->
2023-01-11 12:16:09 +01:00
2024-07-18 12:28:36 -10:00
## Get organizations
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2024-07-18 12:28:36 -10:00
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
2026-05-05 02:54:03 +05:00
`GET /api/v2/organizations`
2024-07-18 12:28:36 -10:00
### Example responses
> 200 Response
```json
[
2025-01-03 18:12:59 +05:00
{
"created_at" : "2019-08-24T14:15:22Z" ,
2026-06-05 14:33:13 -05:00
"default_org_member_roles" : [
"string"
],
2025-01-03 18:12:59 +05:00
"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"
}
2024-07-18 12:28:36 -10:00
]
```
### Responses
| Status | Meaning | Description | Schema |
2025-01-03 18:12:59 +05:00
|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------|
2024-07-18 12:28:36 -10:00
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | array of [codersdk.Organization ](schemas.md#codersdkorganization ) |
<h3 id="get-organizations-responseschema">Response Schema</h3>
Status Code **200**
2026-06-05 14:33:13 -05:00
| Name | Type | Required | Restrictions | Description |
|------------------------------|-------------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `[array item]` | array | false | | |
| `» created_at` | string(date-time) | true | | |
| `» default_org_member_roles` | array | 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. |
| `» description` | string | false | | |
| `» display_name` | string | false | | |
| `» icon` | string | false | | |
| `» id` | string(uuid) | true | | |
| `» is_default` | boolean | true | | |
| `» name` | string | false | | |
| `» updated_at` | string(date-time) | true | | |
2024-07-18 12:28:36 -10:00
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2023-08-22 09:26:43 -05:00
2023-01-11 12:16:09 +01:00
## Create organization
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2023-01-11 12:16:09 +01:00
# 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'
```
2026-05-05 02:54:03 +05:00
`POST /api/v2/organizations`
2023-01-11 12:16:09 +01:00
> Body parameter
```json
{
2025-01-03 18:12:59 +05:00
"description" : "string" ,
"display_name" : "string" ,
"icon" : "string" ,
"name" : "string"
2023-01-11 12:16:09 +01:00
}
```
### Parameters
| Name | In | Type | Required | Description |
2025-01-03 18:12:59 +05:00
|--------|------|------------------------------------------------------------------------------------|----------|-----------------------------|
2023-01-11 12:16:09 +01:00
| `body` | body | [codersdk.CreateOrganizationRequest ](schemas.md#codersdkcreateorganizationrequest ) | true | Create organization request |
### Example responses
> 201 Response
```json
{
2025-01-03 18:12:59 +05:00
"created_at" : "2019-08-24T14:15:22Z" ,
2026-06-05 14:33:13 -05:00
"default_org_member_roles" : [
"string"
],
2025-01-03 18:12:59 +05:00
"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"
2023-01-11 12:16:09 +01:00
}
```
### Responses
| Status | Meaning | Description | Schema |
2025-01-03 18:12:59 +05:00
|--------|--------------------------------------------------------------|-------------|----------------------------------------------------------|
2023-01-11 12:16:09 +01:00
| 201 | [Created ](https://tools.ietf.org/html/rfc7231#section-6.3.2 ) | Created | [codersdk.Organization ](schemas.md#codersdkorganization ) |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
## Get organization by ID
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2023-01-11 12:16:09 +01:00
# 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'
```
2026-05-05 02:54:03 +05:00
`GET /api/v2/organizations/{organization}`
2023-01-11 12:16:09 +01:00
### Parameters
| Name | In | Type | Required | Description |
2025-01-03 18:12:59 +05:00
|----------------|------|--------------|----------|-----------------|
2023-01-11 12:16:09 +01:00
| `organization` | path | string(uuid) | true | Organization ID |
### Example responses
> 200 Response
```json
{
2025-01-03 18:12:59 +05:00
"created_at" : "2019-08-24T14:15:22Z" ,
2026-06-05 14:33:13 -05:00
"default_org_member_roles" : [
"string"
],
2025-01-03 18:12:59 +05:00
"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"
2023-01-11 12:16:09 +01:00
}
```
### Responses
| Status | Meaning | Description | Schema |
2025-01-03 18:12:59 +05:00
|--------|---------------------------------------------------------|-------------|----------------------------------------------------------|
2023-01-11 12:16:09 +01:00
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [codersdk.Organization ](schemas.md#codersdkorganization ) |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2024-05-21 12:46:31 -06:00
## Delete organization
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2024-05-21 12:46:31 -06:00
# 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'
```
2026-05-05 02:54:03 +05:00
`DELETE /api/v2/organizations/{organization}`
2024-05-21 12:46:31 -06:00
### Parameters
| Name | In | Type | Required | Description |
2025-01-03 18:12:59 +05:00
|----------------|------|--------|----------|-------------------------|
2024-05-21 12:46:31 -06:00
| `organization` | path | string | true | Organization ID or name |
### Example responses
> 200 Response
```json
{
2025-01-03 18:12:59 +05:00
"detail" : "string" ,
"message" : "string" ,
"validations" : [
{
"detail" : "string" ,
"field" : "string"
}
]
2024-05-21 12:46:31 -06:00
}
```
### Responses
| Status | Meaning | Description | Schema |
2025-01-03 18:12:59 +05:00
|--------|---------------------------------------------------------|-------------|--------------------------------------------------|
2024-05-21 12:46:31 -06:00
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [codersdk.Response ](schemas.md#codersdkresponse ) |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
## Update organization
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2024-05-21 12:46:31 -06:00
# 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'
```
2026-05-05 02:54:03 +05:00
`PATCH /api/v2/organizations/{organization}`
2024-05-21 12:46:31 -06:00
> Body parameter
```json
{
2026-06-05 14:33:13 -05:00
"default_org_member_roles" : [
"string"
],
2025-01-03 18:12:59 +05:00
"description" : "string" ,
"display_name" : "string" ,
"icon" : "string" ,
"name" : "string"
2024-05-21 12:46:31 -06:00
}
```
### Parameters
| Name | In | Type | Required | Description |
2025-01-03 18:12:59 +05:00
|----------------|------|------------------------------------------------------------------------------------|----------|----------------------------|
2024-05-21 12:46:31 -06:00
| `organization` | path | string | true | Organization ID or name |
| `body` | body | [codersdk.UpdateOrganizationRequest ](schemas.md#codersdkupdateorganizationrequest ) | true | Patch organization request |
### Example responses
> 200 Response
```json
{
2025-01-03 18:12:59 +05:00
"created_at" : "2019-08-24T14:15:22Z" ,
2026-06-05 14:33:13 -05:00
"default_org_member_roles" : [
"string"
],
2025-01-03 18:12:59 +05:00
"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"
2024-05-21 12:46:31 -06:00
}
```
### Responses
| Status | Meaning | Description | Schema |
2025-01-03 18:12:59 +05:00
|--------|---------------------------------------------------------|-------------|----------------------------------------------------------|
2024-05-21 12:46:31 -06:00
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [codersdk.Organization ](schemas.md#codersdkorganization ) |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2025-01-20 11:18:53 +02:00
## Get provisioner jobs
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2025-01-20 11:18:53 +02:00
# 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'
```
2026-05-05 02:54:03 +05:00
`GET /api/v2/organizations/{organization}/provisionerjobs`
2025-01-20 11:18:53 +02:00
### Parameters
2026-07-14 13:39:58 -04:00
| Name | In | Type | Required | Description |
|----------------|-------|--------------|----------|--------------------------------------------------------------------------------------|
| `organization` | path | string(uuid) | true | Organization ID |
| `limit` | query | integer | false | Page limit |
| `ids` | query | array(uuid) | false | Filter results by job IDs |
| `status` | query | string | false | Filter results by status |
2026-08-31 11:36:43 -04:00
| `tags` | query | string | false | Provisioner tags to filter by (JSON of the form `{'tag1':'value1','tag2':'value2'}` ) |
2026-07-14 13:39:58 -04:00
| `initiator` | query | string(uuid) | false | Filter results by initiator |
2025-01-20 11:18:53 +02:00
#### Enumerated Values
2025-12-22 16:19:25 +01:00
| Parameter | Value(s) |
|-----------|---------------------------------------------------------------------------------|
| `status` | `canceled` , `canceling` , `failed` , `pending` , `running` , `succeeded` , `unknown` |
2025-01-20 11:18:53 +02:00
### Example responses
> 200 Response
```json
[
{
"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" ,
2025-10-06 10:56:43 +02:00
"initiator_id" : "06588898-9a84-4b35-ba8f-f9cbd64946f3" ,
2025-01-20 11:18:53 +02:00
"input" : {
"error" : "string" ,
"template_version_id" : "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1" ,
"workspace_build_id" : "badaf2eb-96c5-4050-9f1d-db2d39ca5478"
},
2025-07-30 19:09:53 -05:00
"logs_overflowed" : true ,
2025-02-06 16:19:20 +02:00
"metadata" : {
"template_display_name" : "string" ,
2025-02-10 10:00:34 -03:00
"template_icon" : "string" ,
2025-02-06 16:19:20 +02:00
"template_id" : "c6d67e98-83ea-49f0-8812-e4abae2b68bc" ,
"template_name" : "string" ,
"template_version_name" : "string" ,
2026-04-10 09:50:11 -05:00
"workspace_build_transition" : "start" ,
2025-02-06 16:19:20 +02:00
"workspace_id" : "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" ,
"workspace_name" : "string"
},
2025-01-20 11:18:53 +02:00
"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" ,
2025-05-19 16:05:39 +01:00
"worker_id" : "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" ,
"worker_name" : "string"
2025-01-20 11:18:53 +02:00
}
]
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------|
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | array of [codersdk.ProvisionerJob ](schemas.md#codersdkprovisionerjob ) |
<h3 id="get-provisioner-jobs-responseschema">Response Schema</h3>
Status Code **200**
2026-04-10 09:50:11 -05:00
| Name | Type | Required | Restrictions | Description |
|---------------------------------|------------------------------------------------------------------------------|----------|--------------|-------------|
| `[array item]` | array | false | | |
| `» available_workers` | array | false | | |
| `» canceled_at` | string(date-time) | false | | |
| `» completed_at` | string(date-time) | false | | |
| `» created_at` | string(date-time) | false | | |
| `» error` | string | false | | |
| `» error_code` | [codersdk.JobErrorCode ](schemas.md#codersdkjoberrorcode ) | false | | |
| `» file_id` | string(uuid) | false | | |
| `» id` | string(uuid) | false | | |
| `» initiator_id` | string(uuid) | false | | |
| `» input` | [codersdk.ProvisionerJobInput ](schemas.md#codersdkprovisionerjobinput ) | false | | |
| `»» error` | string | false | | |
| `»» template_version_id` | string(uuid) | false | | |
| `»» workspace_build_id` | string(uuid) | false | | |
| `» logs_overflowed` | boolean | false | | |
| `» metadata` | [codersdk.ProvisionerJobMetadata ](schemas.md#codersdkprovisionerjobmetadata ) | false | | |
| `»» template_display_name` | string | false | | |
| `»» template_icon` | string | false | | |
| `»» template_id` | string(uuid) | false | | |
| `»» template_name` | string | false | | |
| `»» template_version_name` | string | false | | |
| `»» workspace_build_transition` | [codersdk.WorkspaceTransition ](schemas.md#codersdkworkspacetransition ) | false | | |
| `»» workspace_id` | string(uuid) | false | | |
| `»» workspace_name` | string | false | | |
| `» organization_id` | string(uuid) | false | | |
| `» queue_position` | integer | false | | |
| `» queue_size` | integer | false | | |
| `» started_at` | string(date-time) | false | | |
| `» status` | [codersdk.ProvisionerJobStatus ](schemas.md#codersdkprovisionerjobstatus ) | false | | |
| `» tags` | object | false | | |
| `»» [any property]` | string | false | | |
| `» type` | [codersdk.ProvisionerJobType ](schemas.md#codersdkprovisionerjobtype ) | false | | |
| `» worker_id` | string(uuid) | false | | |
| `» worker_name` | string | false | | |
2025-01-20 11:18:53 +02:00
#### Enumerated Values
2026-04-10 09:50:11 -05:00
| Property | Value(s) |
|------------------------------|--------------------------------------------------------------------------|
2026-05-07 15:01:58 +10:00
| `error_code` | `INSUFFICIENT_QUOTA` , `REQUIRED_TEMPLATE_VARIABLES` |
2026-04-10 09:50:11 -05:00
| `workspace_build_transition` | `delete` , `start` , `stop` |
| `status` | `canceled` , `canceling` , `failed` , `pending` , `running` , `succeeded` |
| `type` | `template_version_dry_run` , `template_version_import` , `workspace_build` |
2025-01-20 11:18:53 +02:00
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).
2025-01-27 18:26:56 +02:00
## Get provisioner job
### Code samples
2026-07-15 14:07:09 -04:00
```sh
2025-01-27 18:26:56 +02:00
# 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'
```
2026-05-05 02:54:03 +05:00
`GET /api/v2/organizations/{organization}/provisionerjobs/{job}`
2025-01-27 18:26:56 +02:00
### Parameters
| Name | In | Type | Required | Description |
|----------------|------|--------------|----------|-----------------|
| `organization` | path | string(uuid) | true | Organization ID |
| `job` | path | string(uuid) | true | Job ID |
### Example responses
> 200 Response
```json
{
"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" ,
2025-10-06 10:56:43 +02:00
"initiator_id" : "06588898-9a84-4b35-ba8f-f9cbd64946f3" ,
2025-01-27 18:26:56 +02:00
"input" : {
"error" : "string" ,
"template_version_id" : "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1" ,
"workspace_build_id" : "badaf2eb-96c5-4050-9f1d-db2d39ca5478"
},
2025-07-30 19:09:53 -05:00
"logs_overflowed" : true ,
2025-02-06 16:19:20 +02:00
"metadata" : {
"template_display_name" : "string" ,
2025-02-10 10:00:34 -03:00
"template_icon" : "string" ,
2025-02-06 16:19:20 +02:00
"template_id" : "c6d67e98-83ea-49f0-8812-e4abae2b68bc" ,
"template_name" : "string" ,
"template_version_name" : "string" ,
2026-04-10 09:50:11 -05:00
"workspace_build_transition" : "start" ,
2025-02-06 16:19:20 +02:00
"workspace_id" : "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" ,
"workspace_name" : "string"
},
2025-01-27 18:26:56 +02:00
"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" ,
2025-05-19 16:05:39 +01:00
"worker_id" : "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" ,
"worker_name" : "string"
2025-01-27 18:26:56 +02:00
}
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------|
| 200 | [OK ](https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [codersdk.ProvisionerJob ](schemas.md#codersdkprovisionerjob ) |
To perform this operation, you must be authenticated. [Learn more ](authentication.md ).