# Enterprise

## Get appearance

### Code samples

```shell
# 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 /appearance`

### Example responses

> 200 Response

```json
{
	"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",
			"name": "string",
			"target": "string"
		}
	]
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                      |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.AppearanceConfig](/docs/@v2.17.3/reference/api/schemas/#codersdkappearanceconfig) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update appearance

### Code samples

```shell
# 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 /appearance`

> Body parameter

```json
{
	"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

| Name   | In   | Type                                                                                                    | Required | Description               |
| ------ | ---- | ------------------------------------------------------------------------------------------------------- | -------- | ------------------------- |
| `body` | body | [codersdk.UpdateAppearanceConfig](/docs/@v2.17.3/reference/api/schemas/#codersdkupdateappearanceconfig) | true     | Update appearance request |

### Example responses

> 200 Response

```json
{
	"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

| Status | Meaning                                                 | Description | Schema                                                                                                  |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.UpdateAppearanceConfig](/docs/@v2.17.3/reference/api/schemas/#codersdkupdateappearanceconfig) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get entitlements

### Code samples

```shell
# 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 /entitlements`

### Example responses

> 200 Response

```json
{
	"errors": ["string"],
	"features": {
		"property1": {
			"actual": 0,
			"enabled": true,
			"entitlement": "entitled",
			"limit": 0
		},
		"property2": {
			"actual": 0,
			"enabled": true,
			"entitlement": "entitled",
			"limit": 0
		}
	},
	"has_license": true,
	"refreshed_at": "2019-08-24T14:15:22Z",
	"require_telemetry": true,
	"trial": true,
	"warnings": ["string"]
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                              |
| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Entitlements](/docs/@v2.17.3/reference/api/schemas/#codersdkentitlements) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get groups

### Code samples

```shell
# 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 /groups`

### Parameters

| Name           | In    | Type   | Required | Description                       |
| -------------- | ----- | ------ | -------- | --------------------------------- |
| `organization` | query | string | true     | Organization ID or name           |
| `has_member`   | query | string | true     | User ID or name                   |
| `group_ids`    | query | string | true     | Comma separated list of group IDs |

### Example responses

> 200 Response

```json
[
	{
		"avatar_url": "string",
		"display_name": "string",
		"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
		"members": [
			{
				"avatar_url": "http://example.com",
				"created_at": "2019-08-24T14:15:22Z",
				"email": "user@example.com",
				"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
				"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

| Status | Meaning                                                 | Description | Schema                                                                         |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.Group](/docs/@v2.17.3/reference/api/schemas/#codersdkgroup) |

<h3 id="get-groups-responseschema">Response Schema</h3>

Status Code **200**

| Name                          | Type                                                                              | Required | Restrictions | Description                                                                                                                                                           |
| ----------------------------- | --------------------------------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]`                | array                                                                             | false    |              |                                                                                                                                                                       |
| `» avatar_url`                | string                                                                            | false    |              |                                                                                                                                                                       |
| `» display_name`              | string                                                                            | false    |              |                                                                                                                                                                       |
| `» id`                        | string(uuid)                                                                      | false    |              |                                                                                                                                                                       |
| `» members`                   | array                                                                             | false    |              |                                                                                                                                                                       |
| `»» avatar_url`               | string(uri)                                                                       | false    |              |                                                                                                                                                                       |
| `»» created_at`               | string(date-time)                                                                 | true     |              |                                                                                                                                                                       |
| `»» email`                    | string(email)                                                                     | true     |              |                                                                                                                                                                       |
| `»» id`                       | string(uuid)                                                                      | true     |              |                                                                                                                                                                       |
| `»» last_seen_at`             | string(date-time)                                                                 | false    |              |                                                                                                                                                                       |
| `»» login_type`               | [codersdk.LoginType](/docs/@v2.17.3/reference/api/schemas/#codersdklogintype)     | false    |              |                                                                                                                                                                       |
| `»» name`                     | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» status`                   | [codersdk.UserStatus](/docs/@v2.17.3/reference/api/schemas/#codersdkuserstatus)   | false    |              |                                                                                                                                                                       |
| `»» theme_preference`         | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» updated_at`               | string(date-time)                                                                 | false    |              |                                                                                                                                                                       |
| `»» username`                 | string                                                                            | true     |              |                                                                                                                                                                       |
| `» name`                      | string                                                                            | false    |              |                                                                                                                                                                       |
| `» organization_display_name` | string                                                                            | false    |              |                                                                                                                                                                       |
| `» organization_id`           | string(uuid)                                                                      | false    |              |                                                                                                                                                                       |
| `» organization_name`         | string                                                                            | false    |              |                                                                                                                                                                       |
| `» quota_allowance`           | integer                                                                           | false    |              |                                                                                                                                                                       |
| `» source`                    | [codersdk.GroupSource](/docs/@v2.17.3/reference/api/schemas/#codersdkgroupsource) | false    |              |                                                                                                                                                                       |
| `» total_member_count`        | integer                                                                           | 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       |
| ------------ | ----------- |
| `login_type` | \`\`        |
| `login_type` | `password`  |
| `login_type` | `github`    |
| `login_type` | `oidc`      |
| `login_type` | `token`     |
| `login_type` | `none`      |
| `status`     | `active`    |
| `status`     | `suspended` |
| `source`     | `user`      |
| `source`     | `oidc`      |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get group by ID

### Code samples

```shell
# 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 /groups/{group}`

### Parameters

| Name    | In   | Type   | Required | Description |
| ------- | ---- | ------ | -------- | ----------- |
| `group` | path | string | true     | Group id    |

### Example responses

> 200 Response

```json
{
	"avatar_url": "string",
	"display_name": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"members": [
		{
			"avatar_url": "http://example.com",
			"created_at": "2019-08-24T14:15:22Z",
			"email": "user@example.com",
			"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
			"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

| Status | Meaning                                                 | Description | Schema                                                                |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Group](/docs/@v2.17.3/reference/api/schemas/#codersdkgroup) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Delete group by name

### Code samples

```shell
# 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 /groups/{group}`

### Parameters

| Name    | In   | Type   | Required | Description |
| ------- | ---- | ------ | -------- | ----------- |
| `group` | path | string | true     | Group name  |

### Example responses

> 200 Response

```json
{
	"avatar_url": "string",
	"display_name": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"members": [
		{
			"avatar_url": "http://example.com",
			"created_at": "2019-08-24T14:15:22Z",
			"email": "user@example.com",
			"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
			"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

| Status | Meaning                                                 | Description | Schema                                                                |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Group](/docs/@v2.17.3/reference/api/schemas/#codersdkgroup) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update group by name

### Code samples

```shell
# 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 /groups/{group}`

> Body parameter

```json
{
	"add_users": ["string"],
	"avatar_url": "string",
	"display_name": "string",
	"name": "string",
	"quota_allowance": 0,
	"remove_users": ["string"]
}
```

### Parameters

| Name    | In   | Type                                                                                          | Required | Description         |
| ------- | ---- | --------------------------------------------------------------------------------------------- | -------- | ------------------- |
| `group` | path | string                                                                                        | true     | Group name          |
| `body`  | body | [codersdk.PatchGroupRequest](/docs/@v2.17.3/reference/api/schemas/#codersdkpatchgrouprequest) | true     | Patch group request |

### Example responses

> 200 Response

```json
{
	"avatar_url": "string",
	"display_name": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"members": [
		{
			"avatar_url": "http://example.com",
			"created_at": "2019-08-24T14:15:22Z",
			"email": "user@example.com",
			"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
			"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

| Status | Meaning                                                 | Description | Schema                                                                |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Group](/docs/@v2.17.3/reference/api/schemas/#codersdkgroup) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get JFrog XRay scan by workspace agent ID.

### Code samples

```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/integrations/jfrog/xray-scan?workspace_id=string&agent_id=string \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'
```

`GET /integrations/jfrog/xray-scan`

### Parameters

| Name           | In    | Type   | Required | Description  |
| -------------- | ----- | ------ | -------- | ------------ |
| `workspace_id` | query | string | true     | Workspace ID |
| `agent_id`     | query | string | true     | Agent ID     |

### Example responses

> 200 Response

```json
{
	"agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
	"critical": 0,
	"high": 0,
	"medium": 0,
	"results_url": "string",
	"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.JFrogXrayScan](/docs/@v2.17.3/reference/api/schemas/#codersdkjfrogxrayscan) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Post JFrog XRay scan by workspace agent ID.

### Code samples

```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/integrations/jfrog/xray-scan \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'
```

`POST /integrations/jfrog/xray-scan`

> Body parameter

```json
{
	"agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
	"critical": 0,
	"high": 0,
	"medium": 0,
	"results_url": "string",
	"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
}
```

### Parameters

| Name   | In   | Type                                                                                  | Required | Description                  |
| ------ | ---- | ------------------------------------------------------------------------------------- | -------- | ---------------------------- |
| `body` | body | [codersdk.JFrogXrayScan](/docs/@v2.17.3/reference/api/schemas/#codersdkjfrogxrayscan) | true     | Post JFrog XRay scan request |

### Example responses

> 200 Response

```json
{
	"detail": "string",
	"message": "string",
	"validations": [
		{
			"detail": "string",
			"field": "string"
		}
	]
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                      |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Response](/docs/@v2.17.3/reference/api/schemas/#codersdkresponse) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get licenses

### Code samples

```shell
# 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 /licenses`

### Example responses

> 200 Response

```json
[
	{
		"claims": {},
		"id": 0,
		"uploaded_at": "2019-08-24T14:15:22Z",
		"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
	}
]
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                             |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.License](/docs/@v2.17.3/reference/api/schemas/#codersdklicense) |

<h3 id="get-licenses-responseschema">Response Schema</h3>

Status Code **200**

| Name            | Type              | Required | Restrictions | Description                                                                                                                                                                                            |
| --------------- | ----------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `[array item]`  | array             | false    |              |                                                                                                                                                                                                        |
| `» claims`      | object            | 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. |
| `» id`          | integer           | false    |              |                                                                                                                                                                                                        |
| `» uploaded_at` | string(date-time) | false    |              |                                                                                                                                                                                                        |
| `» uuid`        | string(uuid)      | false    |              |                                                                                                                                                                                                        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Delete license

### Code samples

```shell
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/licenses/{id} \
  -H 'Coder-Session-Token: API_KEY'
```

`DELETE /licenses/{id}`

### Parameters

| Name | In   | Type           | Required | Description |
| ---- | ---- | -------------- | -------- | ----------- |
| `id` | path | string(number) | true     | License ID  |

### Responses

| Status | Meaning                                                 | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update notification template dispatch method

### Code samples

```shell
# 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 /notifications/templates/{notification_template}/method`

### Parameters

| Name                    | In   | Type   | Required | Description                |
| ----------------------- | ---- | ------ | -------- | -------------------------- |
| `notification_template` | path | string | true     | Notification template UUID |

### Responses

| Status | Meaning                                                         | Description  | Schema |
| ------ | --------------------------------------------------------------- | ------------ | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)         | Success      |        |
| 304    | [Not Modified](https://tools.ietf.org/html/rfc7232#section-4.1) | Not modified |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get OAuth2 applications.

### Code samples

```shell
# 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 /oauth2-provider/apps`

### Parameters

| Name      | In    | Type   | Required | Description                                  |
| --------- | ----- | ------ | -------- | -------------------------------------------- |
| `user_id` | query | string | false    | Filter by applications authorized for a user |

### Example responses

> 200 Response

```json
[
	{
		"callback_url": "string",
		"endpoints": {
			"authorization": "string",
			"device_authorization": "string",
			"token": "string"
		},
		"icon": "string",
		"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
		"name": "string"
	}
]
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                                 |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.OAuth2ProviderApp](/docs/@v2.17.3/reference/api/schemas/#codersdkoauth2providerapp) |

<h3 id="get-oauth2-applications.-responseschema">Response Schema</h3>

Status Code **200**

| Name                      | Type                                                                                            | Required | Restrictions | Description                                                                                                                                                                                             |
| ------------------------- | ----------------------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]`            | array                                                                                           | false    |              |                                                                                                                                                                                                         |
| `» callback_url`          | string                                                                                          | false    |              |                                                                                                                                                                                                         |
| `» endpoints`             | [codersdk.OAuth2AppEndpoints](/docs/@v2.17.3/reference/api/schemas/#codersdkoauth2appendpoints) | 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). |
| `»» authorization`        | string                                                                                          | false    |              |                                                                                                                                                                                                         |
| `»» device_authorization` | string                                                                                          | false    |              | Device authorization is optional.                                                                                                                                                                       |
| `»» token`                | string                                                                                          | false    |              |                                                                                                                                                                                                         |
| `» icon`                  | string                                                                                          | false    |              |                                                                                                                                                                                                         |
| `» id`                    | string(uuid)                                                                                    | false    |              |                                                                                                                                                                                                         |
| `» name`                  | string                                                                                          | false    |              |                                                                                                                                                                                                         |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Create OAuth2 application.

### Code samples

```shell
# 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 /oauth2-provider/apps`

> Body parameter

```json
{
	"callback_url": "string",
	"icon": "string",
	"name": "string"
}
```

### Parameters

| Name   | In   | Type                                                                                                                | Required | Description                       |
| ------ | ---- | ------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------- |
| `body` | body | [codersdk.PostOAuth2ProviderAppRequest](/docs/@v2.17.3/reference/api/schemas/#codersdkpostoauth2providerapprequest) | true     | The OAuth2 application to create. |

### Example responses

> 200 Response

```json
{
	"callback_url": "string",
	"endpoints": {
		"authorization": "string",
		"device_authorization": "string",
		"token": "string"
	},
	"icon": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"name": "string"
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                        |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.OAuth2ProviderApp](/docs/@v2.17.3/reference/api/schemas/#codersdkoauth2providerapp) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get OAuth2 application.

### Code samples

```shell
# 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 /oauth2-provider/apps/{app}`

### Parameters

| Name  | In   | Type   | Required | Description |
| ----- | ---- | ------ | -------- | ----------- |
| `app` | path | string | true     | App ID      |

### Example responses

> 200 Response

```json
{
	"callback_url": "string",
	"endpoints": {
		"authorization": "string",
		"device_authorization": "string",
		"token": "string"
	},
	"icon": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"name": "string"
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                        |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.OAuth2ProviderApp](/docs/@v2.17.3/reference/api/schemas/#codersdkoauth2providerapp) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update OAuth2 application.

### Code samples

```shell
# 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 /oauth2-provider/apps/{app}`

> Body parameter

```json
{
	"callback_url": "string",
	"icon": "string",
	"name": "string"
}
```

### Parameters

| Name   | In   | Type                                                                                                              | Required | Description                   |
| ------ | ---- | ----------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------- |
| `app`  | path | string                                                                                                            | true     | App ID                        |
| `body` | body | [codersdk.PutOAuth2ProviderAppRequest](/docs/@v2.17.3/reference/api/schemas/#codersdkputoauth2providerapprequest) | true     | Update an OAuth2 application. |

### Example responses

> 200 Response

```json
{
	"callback_url": "string",
	"endpoints": {
		"authorization": "string",
		"device_authorization": "string",
		"token": "string"
	},
	"icon": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"name": "string"
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                        |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.OAuth2ProviderApp](/docs/@v2.17.3/reference/api/schemas/#codersdkoauth2providerapp) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Delete OAuth2 application.

### Code samples

```shell
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \
  -H 'Coder-Session-Token: API_KEY'
```

`DELETE /oauth2-provider/apps/{app}`

### Parameters

| Name  | In   | Type   | Required | Description |
| ----- | ---- | ------ | -------- | ----------- |
| `app` | path | string | true     | App ID      |

### Responses

| Status | Meaning                                                         | Description | Schema |
| ------ | --------------------------------------------------------------- | ----------- | ------ |
| 204    | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content  |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get OAuth2 application secrets.

### Code samples

```shell
# 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 /oauth2-provider/apps/{app}/secrets`

### Parameters

| Name  | In   | Type   | Required | Description |
| ----- | ---- | ------ | -------- | ----------- |
| `app` | path | string | true     | App ID      |

### Example responses

> 200 Response

```json
[
	{
		"client_secret_truncated": "string",
		"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
		"last_used_at": "string"
	}
]
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                                             |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.OAuth2ProviderAppSecret](/docs/@v2.17.3/reference/api/schemas/#codersdkoauth2providerappsecret) |

<h3 id="get-oauth2-application-secrets.-responseschema">Response Schema</h3>

Status Code **200**

| Name                        | Type         | Required | Restrictions | Description |
| --------------------------- | ------------ | -------- | ------------ | ----------- |
| `[array item]`              | array        | false    |              |             |
| `» client_secret_truncated` | string       | false    |              |             |
| `» id`                      | string(uuid) | false    |              |             |
| `» last_used_at`            | string       | false    |              |             |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Create OAuth2 application secret.

### Code samples

```shell
# 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 /oauth2-provider/apps/{app}/secrets`

### Parameters

| Name  | In   | Type   | Required | Description |
| ----- | ---- | ------ | -------- | ----------- |
| `app` | path | string | true     | App ID      |

### Example responses

> 200 Response

```json
[
	{
		"client_secret_full": "string",
		"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
	}
]
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                                                     |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.OAuth2ProviderAppSecretFull](/docs/@v2.17.3/reference/api/schemas/#codersdkoauth2providerappsecretfull) |

<h3 id="create-oauth2-application-secret.-responseschema">Response Schema</h3>

Status Code **200**

| Name                   | Type         | Required | Restrictions | Description |
| ---------------------- | ------------ | -------- | ------------ | ----------- |
| `[array item]`         | array        | false    |              |             |
| `» client_secret_full` | string       | false    |              |             |
| `» id`                 | string(uuid) | false    |              |             |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Delete OAuth2 application secret.

### Code samples

```shell
# 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 /oauth2-provider/apps/{app}/secrets/{secretID}`

### Parameters

| Name       | In   | Type   | Required | Description |
| ---------- | ---- | ------ | -------- | ----------- |
| `app`      | path | string | true     | App ID      |
| `secretID` | path | string | true     | Secret ID   |

### Responses

| Status | Meaning                                                         | Description | Schema |
| ------ | --------------------------------------------------------------- | ----------- | ------ |
| 204    | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content  |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## OAuth2 authorization request.

### Code samples

```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/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_id`     | query | string | true     | Client ID                         |
| `state`         | query | string | true     | A random unguessable string       |
| `response_type` | query | string | true     | Response type                     |
| `redirect_uri`  | query | string | false    | Redirect here after authorization |
| `scope`         | query | string | false    | Token scopes (currently ignored)  |

#### Enumerated Values

| Parameter       | Value  |
| --------------- | ------ |
| `response_type` | `code` |

### Responses

| Status | Meaning                                                    | Description | Schema |
| ------ | ---------------------------------------------------------- | ----------- | ------ |
| 302    | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Found       |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## OAuth2 token exchange.

### Code samples

```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/oauth2/tokens \
  -H 'Accept: application/json'
```

`POST /oauth2/tokens`

> Body parameter

```yaml
client_id: string
client_secret: string
code: string
refresh_token: string
grant_type: authorization_code
```

### Parameters

| Name              | In   | Type   | Required | Description                                                     |
| ----------------- | ---- | ------ | -------- | --------------------------------------------------------------- |
| `body`            | body | object | false    |                                                                 |
| `» client_id`     | body | string | false    | Client ID, required if grant\_type=authorization\_code          |
| `» client_secret` | body | string | false    | Client secret, required if grant\_type=authorization\_code      |
| `» code`          | body | string | false    | Authorization code, required if grant\_type=authorization\_code |
| `» refresh_token` | body | string | false    | Refresh token, required if grant\_type=refresh\_token           |
| `» grant_type`    | body | string | true     | Grant type                                                      |

#### Enumerated Values

| Parameter      | Value                |
| -------------- | -------------------- |
| `» grant_type` | `authorization_code` |
| `» grant_type` | `refresh_token`      |

### Example responses

> 200 Response

```json
{
	"access_token": "string",
	"expires_in": 0,
	"expiry": "string",
	"refresh_token": "string",
	"token_type": "string"
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                            |
| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [oauth2.Token](/docs/@v2.17.3/reference/api/schemas/#oauth2token) |

## Delete OAuth2 application tokens.

### Code samples

```shell
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/oauth2/tokens?client_id=string \
  -H 'Coder-Session-Token: API_KEY'
```

`DELETE /oauth2/tokens`

### Parameters

| Name        | In    | Type   | Required | Description |
| ----------- | ----- | ------ | -------- | ----------- |
| `client_id` | query | string | true     | Client ID   |

### Responses

| Status | Meaning                                                         | Description | Schema |
| ------ | --------------------------------------------------------------- | ----------- | ------ |
| 204    | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content  |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get groups by organization

### Code samples

```shell
# 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 /organizations/{organization}/groups`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |

### Example responses

> 200 Response

```json
[
	{
		"avatar_url": "string",
		"display_name": "string",
		"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
		"members": [
			{
				"avatar_url": "http://example.com",
				"created_at": "2019-08-24T14:15:22Z",
				"email": "user@example.com",
				"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
				"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

| Status | Meaning                                                 | Description | Schema                                                                         |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.Group](/docs/@v2.17.3/reference/api/schemas/#codersdkgroup) |

<h3 id="get-groups-by-organization-responseschema">Response Schema</h3>

Status Code **200**

| Name                          | Type                                                                              | Required | Restrictions | Description                                                                                                                                                           |
| ----------------------------- | --------------------------------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]`                | array                                                                             | false    |              |                                                                                                                                                                       |
| `» avatar_url`                | string                                                                            | false    |              |                                                                                                                                                                       |
| `» display_name`              | string                                                                            | false    |              |                                                                                                                                                                       |
| `» id`                        | string(uuid)                                                                      | false    |              |                                                                                                                                                                       |
| `» members`                   | array                                                                             | false    |              |                                                                                                                                                                       |
| `»» avatar_url`               | string(uri)                                                                       | false    |              |                                                                                                                                                                       |
| `»» created_at`               | string(date-time)                                                                 | true     |              |                                                                                                                                                                       |
| `»» email`                    | string(email)                                                                     | true     |              |                                                                                                                                                                       |
| `»» id`                       | string(uuid)                                                                      | true     |              |                                                                                                                                                                       |
| `»» last_seen_at`             | string(date-time)                                                                 | false    |              |                                                                                                                                                                       |
| `»» login_type`               | [codersdk.LoginType](/docs/@v2.17.3/reference/api/schemas/#codersdklogintype)     | false    |              |                                                                                                                                                                       |
| `»» name`                     | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» status`                   | [codersdk.UserStatus](/docs/@v2.17.3/reference/api/schemas/#codersdkuserstatus)   | false    |              |                                                                                                                                                                       |
| `»» theme_preference`         | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» updated_at`               | string(date-time)                                                                 | false    |              |                                                                                                                                                                       |
| `»» username`                 | string                                                                            | true     |              |                                                                                                                                                                       |
| `» name`                      | string                                                                            | false    |              |                                                                                                                                                                       |
| `» organization_display_name` | string                                                                            | false    |              |                                                                                                                                                                       |
| `» organization_id`           | string(uuid)                                                                      | false    |              |                                                                                                                                                                       |
| `» organization_name`         | string                                                                            | false    |              |                                                                                                                                                                       |
| `» quota_allowance`           | integer                                                                           | false    |              |                                                                                                                                                                       |
| `» source`                    | [codersdk.GroupSource](/docs/@v2.17.3/reference/api/schemas/#codersdkgroupsource) | false    |              |                                                                                                                                                                       |
| `» total_member_count`        | integer                                                                           | 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       |
| ------------ | ----------- |
| `login_type` | \`\`        |
| `login_type` | `password`  |
| `login_type` | `github`    |
| `login_type` | `oidc`      |
| `login_type` | `token`     |
| `login_type` | `none`      |
| `status`     | `active`    |
| `status`     | `suspended` |
| `source`     | `user`      |
| `source`     | `oidc`      |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Create group for organization

### Code samples

```shell
# 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 /organizations/{organization}/groups`

> Body parameter

```json
{
	"avatar_url": "string",
	"display_name": "string",
	"name": "string",
	"quota_allowance": 0
}
```

### Parameters

| Name           | In   | Type                                                                                            | Required | Description          |
| -------------- | ---- | ----------------------------------------------------------------------------------------------- | -------- | -------------------- |
| `organization` | path | string                                                                                          | true     | Organization ID      |
| `body`         | body | [codersdk.CreateGroupRequest](/docs/@v2.17.3/reference/api/schemas/#codersdkcreategrouprequest) | true     | Create group request |

### Example responses

> 201 Response

```json
{
	"avatar_url": "string",
	"display_name": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"members": [
		{
			"avatar_url": "http://example.com",
			"created_at": "2019-08-24T14:15:22Z",
			"email": "user@example.com",
			"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
			"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

| Status | Meaning                                                      | Description | Schema                                                                |
| ------ | ------------------------------------------------------------ | ----------- | --------------------------------------------------------------------- |
| 201    | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created     | [codersdk.Group](/docs/@v2.17.3/reference/api/schemas/#codersdkgroup) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get group by organization and group name

### Code samples

```shell
# 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 /organizations/{organization}/groups/{groupName}`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |
| `groupName`    | path | string       | true     | Group name      |

### Example responses

> 200 Response

```json
{
	"avatar_url": "string",
	"display_name": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"members": [
		{
			"avatar_url": "http://example.com",
			"created_at": "2019-08-24T14:15:22Z",
			"email": "user@example.com",
			"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
			"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

| Status | Meaning                                                 | Description | Schema                                                                |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Group](/docs/@v2.17.3/reference/api/schemas/#codersdkgroup) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get workspace quota by user

### Code samples

```shell
# 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 /organizations/{organization}/members/{user}/workspace-quota`

### Parameters

| Name           | In   | Type         | Required | Description          |
| -------------- | ---- | ------------ | -------- | -------------------- |
| `user`         | path | string       | true     | User ID, name, or me |
| `organization` | path | string(uuid) | true     | Organization ID      |

### Example responses

> 200 Response

```json
{
	"budget": 0,
	"credits_consumed": 0
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                  |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.WorkspaceQuota](/docs/@v2.17.3/reference/api/schemas/#codersdkworkspacequota) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get provisioner daemons

### Code samples

```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisionerdaemons \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'
```

`GET /organizations/{organization}/provisionerdaemons`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |

### Example responses

> 200 Response

```json
[
	{
		"api_version": "string",
		"created_at": "2019-08-24T14:15:22Z",
		"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
		"key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5",
		"last_seen_at": "2019-08-24T14:15:22Z",
		"name": "string",
		"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
		"provisioners": ["string"],
		"tags": {
			"property1": "string",
			"property2": "string"
		},
		"version": "string"
	}
]
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                                 |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.ProvisionerDaemon](/docs/@v2.17.3/reference/api/schemas/#codersdkprovisionerdaemon) |

<h3 id="get-provisioner-daemons-responseschema">Response Schema</h3>

Status Code **200**

| Name                | Type              | Required | Restrictions | Description |
| ------------------- | ----------------- | -------- | ------------ | ----------- |
| `[array item]`      | array             | false    |              |             |
| `» api_version`     | string            | false    |              |             |
| `» created_at`      | string(date-time) | false    |              |             |
| `» id`              | string(uuid)      | false    |              |             |
| `» key_id`          | string(uuid)      | false    |              |             |
| `» last_seen_at`    | string(date-time) | false    |              |             |
| `» name`            | string            | false    |              |             |
| `» organization_id` | string(uuid)      | false    |              |             |
| `» provisioners`    | array             | false    |              |             |
| `» tags`            | object            | false    |              |             |
| `»» [any property]` | string            | false    |              |             |
| `» version`         | string            | false    |              |             |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Serve provisioner daemon

### Code samples

```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisionerdaemons/serve \
  -H 'Coder-Session-Token: API_KEY'
```

`GET /organizations/{organization}/provisionerdaemons/serve`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |

### Responses

| Status | Meaning                                                                  | Description         | Schema |
| ------ | ------------------------------------------------------------------------ | ------------------- | ------ |
| 101    | [Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) | Switching Protocols |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## List provisioner key

### Code samples

```shell
# 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 /organizations/{organization}/provisionerkeys`

### Parameters

| Name           | In   | Type   | Required | Description     |
| -------------- | ---- | ------ | -------- | --------------- |
| `organization` | path | string | true     | Organization ID |

### Example responses

> 200 Response

```json
[
	{
		"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

| Status | Meaning                                                 | Description | Schema                                                                                           |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.ProvisionerKey](/docs/@v2.17.3/reference/api/schemas/#codersdkprovisionerkey) |

<h3 id="list-provisioner-key-responseschema">Response Schema</h3>

Status Code **200**

| Name                | Type                                                                                            | Required | Restrictions | Description |
| ------------------- | ----------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- |
| `[array item]`      | array                                                                                           | false    |              |             |
| `» created_at`      | string(date-time)                                                                               | false    |              |             |
| `» id`              | string(uuid)                                                                                    | false    |              |             |
| `» name`            | string                                                                                          | false    |              |             |
| `» organization`    | string(uuid)                                                                                    | false    |              |             |
| `» tags`            | [codersdk.ProvisionerKeyTags](/docs/@v2.17.3/reference/api/schemas/#codersdkprovisionerkeytags) | false    |              |             |
| `»» [any property]` | string                                                                                          | false    |              |             |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Create provisioner key

### Code samples

```shell
# 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 /organizations/{organization}/provisionerkeys`

### Parameters

| Name           | In   | Type   | Required | Description     |
| -------------- | ---- | ------ | -------- | --------------- |
| `organization` | path | string | true     | Organization ID |

### Example responses

> 201 Response

```json
{
	"key": "string"
}
```

### Responses

| Status | Meaning                                                      | Description | Schema                                                                                                              |
| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------- |
| 201    | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created     | [codersdk.CreateProvisionerKeyResponse](/docs/@v2.17.3/reference/api/schemas/#codersdkcreateprovisionerkeyresponse) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## List provisioner key daemons

### Code samples

```shell
# 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 /organizations/{organization}/provisionerkeys/daemons`

### Parameters

| Name           | In   | Type   | Required | Description     |
| -------------- | ---- | ------ | -------- | --------------- |
| `organization` | path | string | true     | Organization ID |

### Example responses

> 200 Response

```json
[
	{
		"daemons": [
			{
				"api_version": "string",
				"created_at": "2019-08-24T14:15:22Z",
				"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
				"key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5",
				"last_seen_at": "2019-08-24T14:15:22Z",
				"name": "string",
				"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
				"provisioners": ["string"],
				"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

| Status | Meaning                                                 | Description | Schema                                                                                                         |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.ProvisionerKeyDaemons](/docs/@v2.17.3/reference/api/schemas/#codersdkprovisionerkeydaemons) |

<h3 id="list-provisioner-key-daemons-responseschema">Response Schema</h3>

Status Code **200**

| Name                 | Type                                                                                            | Required | Restrictions | Description |
| -------------------- | ----------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- |
| `[array item]`       | array                                                                                           | false    |              |             |
| `» daemons`          | array                                                                                           | false    |              |             |
| `»» api_version`     | string                                                                                          | false    |              |             |
| `»» created_at`      | string(date-time)                                                                               | false    |              |             |
| `»» id`              | string(uuid)                                                                                    | false    |              |             |
| `»» key_id`          | string(uuid)                                                                                    | false    |              |             |
| `»» last_seen_at`    | string(date-time)                                                                               | false    |              |             |
| `»» name`            | string                                                                                          | false    |              |             |
| `»» organization_id` | string(uuid)                                                                                    | false    |              |             |
| `»» provisioners`    | array                                                                                           | false    |              |             |
| `»» tags`            | object                                                                                          | false    |              |             |
| `»»» [any property]` | string                                                                                          | false    |              |             |
| `»» version`         | string                                                                                          | false    |              |             |
| `» key`              | [codersdk.ProvisionerKey](/docs/@v2.17.3/reference/api/schemas/#codersdkprovisionerkey)         | false    |              |             |
| `»» created_at`      | string(date-time)                                                                               | false    |              |             |
| `»» id`              | string(uuid)                                                                                    | false    |              |             |
| `»» name`            | string                                                                                          | false    |              |             |
| `»» organization`    | string(uuid)                                                                                    | false    |              |             |
| `»» tags`            | [codersdk.ProvisionerKeyTags](/docs/@v2.17.3/reference/api/schemas/#codersdkprovisionerkeytags) | false    |              |             |
| `»»» [any property]` | string                                                                                          | false    |              |             |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Delete provisioner key

### Code samples

```shell
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/provisionerkeys/{provisionerkey} \
  -H 'Coder-Session-Token: API_KEY'
```

`DELETE /organizations/{organization}/provisionerkeys/{provisionerkey}`

### Parameters

| Name             | In   | Type   | Required | Description          |
| ---------------- | ---- | ------ | -------- | -------------------- |
| `organization`   | path | string | true     | Organization ID      |
| `provisionerkey` | path | string | true     | Provisioner key name |

### Responses

| Status | Meaning                                                         | Description | Schema |
| ------ | --------------------------------------------------------------- | ----------- | ------ |
| 204    | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content  |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get group IdP Sync settings by organization

### Code samples

```shell
# 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 /organizations/{organization}/settings/idpsync/groups`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |

### Example responses

> 200 Response

```json
{
	"auto_create_missing_groups": true,
	"field": "string",
	"legacy_group_name_mapping": {
		"property1": "string",
		"property2": "string"
	},
	"mapping": {
		"property1": ["string"],
		"property2": ["string"]
	},
	"regex_filter": {}
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                        |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.GroupSyncSettings](/docs/@v2.17.3/reference/api/schemas/#codersdkgroupsyncsettings) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update group IdP Sync settings by organization

### Code samples

```shell
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/groups \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'
```

`PATCH /organizations/{organization}/settings/idpsync/groups`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |

### Example responses

> 200 Response

```json
{
	"auto_create_missing_groups": true,
	"field": "string",
	"legacy_group_name_mapping": {
		"property1": "string",
		"property2": "string"
	},
	"mapping": {
		"property1": ["string"],
		"property2": ["string"]
	},
	"regex_filter": {}
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                        |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.GroupSyncSettings](/docs/@v2.17.3/reference/api/schemas/#codersdkgroupsyncsettings) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get role IdP Sync settings by organization

### Code samples

```shell
# 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 /organizations/{organization}/settings/idpsync/roles`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |

### Example responses

> 200 Response

```json
{
	"field": "string",
	"mapping": {
		"property1": ["string"],
		"property2": ["string"]
	}
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                      |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.RoleSyncSettings](/docs/@v2.17.3/reference/api/schemas/#codersdkrolesyncsettings) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update role IdP Sync settings by organization

### Code samples

```shell
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/roles \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'
```

`PATCH /organizations/{organization}/settings/idpsync/roles`

### Parameters

| Name           | In   | Type         | Required | Description     |
| -------------- | ---- | ------------ | -------- | --------------- |
| `organization` | path | string(uuid) | true     | Organization ID |

### Example responses

> 200 Response

```json
{
	"field": "string",
	"mapping": {
		"property1": ["string"],
		"property2": ["string"]
	}
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                      |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.RoleSyncSettings](/docs/@v2.17.3/reference/api/schemas/#codersdkrolesyncsettings) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get active replicas

### Code samples

```shell
# 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 /replicas`

### Example responses

> 200 Response

```json
[
	{
		"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

| Status | Meaning                                                 | Description | Schema                                                                             |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.Replica](/docs/@v2.17.3/reference/api/schemas/#codersdkreplica) |

<h3 id="get-active-replicas-responseschema">Response Schema</h3>

Status Code **200**

| Name                 | Type              | Required | Restrictions | Description                                                        |
| -------------------- | ----------------- | -------- | ------------ | ------------------------------------------------------------------ |
| `[array item]`       | array             | false    |              |                                                                    |
| `» created_at`       | string(date-time) | false    |              | Created at is the timestamp when the replica was first seen.       |
| `» database_latency` | integer           | false    |              | Database latency is the latency in microseconds to the database.   |
| `» error`            | string            | false    |              | Error is the replica error.                                        |
| `» hostname`         | string            | false    |              | Hostname is the hostname of the replica.                           |
| `» id`               | string(uuid)      | false    |              | ID is the unique identifier for the replica.                       |
| `» region_id`        | integer           | false    |              | Region ID is the region of the replica.                            |
| `» relay_address`    | string            | false    |              | Relay address is the accessible address to relay DERP connections. |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## SCIM 2.0: Service Provider Config

### Code samples

```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/scim/v2/ServiceProviderConfig

```

`GET /scim/v2/ServiceProviderConfig`

### Responses

| Status | Meaning                                                 | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          |        |

## SCIM 2.0: Get users

### Code samples

```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/scim/v2/Users \
  -H 'Authorizaiton: API_KEY'
```

`GET /scim/v2/Users`

### Responses

| Status | Meaning                                                 | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## SCIM 2.0: Create new user

### Code samples

```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/scim/v2/Users \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorizaiton: API_KEY'
```

`POST /scim/v2/Users`

> Body parameter

```json
{
	"active": true,
	"emails": [
		{
			"display": "string",
			"primary": true,
			"type": "string",
			"value": "user@example.com"
		}
	],
	"groups": [null],
	"id": "string",
	"meta": {
		"resourceType": "string"
	},
	"name": {
		"familyName": "string",
		"givenName": "string"
	},
	"schemas": ["string"],
	"userName": "string"
}
```

### Parameters

| Name   | In   | Type                                                                    | Required | Description |
| ------ | ---- | ----------------------------------------------------------------------- | -------- | ----------- |
| `body` | body | [coderd.SCIMUser](/docs/@v2.17.3/reference/api/schemas/#coderdscimuser) | true     | New user    |

### Example responses

> 200 Response

```json
{
	"active": true,
	"emails": [
		{
			"display": "string",
			"primary": true,
			"type": "string",
			"value": "user@example.com"
		}
	],
	"groups": [null],
	"id": "string",
	"meta": {
		"resourceType": "string"
	},
	"name": {
		"familyName": "string",
		"givenName": "string"
	},
	"schemas": ["string"],
	"userName": "string"
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                  |
| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [coderd.SCIMUser](/docs/@v2.17.3/reference/api/schemas/#coderdscimuser) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## SCIM 2.0: Get user by ID

### Code samples

```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/scim/v2/Users/{id} \
  -H 'Authorizaiton: API_KEY'
```

`GET /scim/v2/Users/{id}`

### Parameters

| Name | In   | Type         | Required | Description |
| ---- | ---- | ------------ | -------- | ----------- |
| `id` | path | string(uuid) | true     | User ID     |

### Responses

| Status | Meaning                                                        | Description | Schema |
| ------ | -------------------------------------------------------------- | ----------- | ------ |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found   |        |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## SCIM 2.0: Update user account

### Code samples

```shell
# Example request using curl
curl -X PATCH http://coder-server:8080/api/v2/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

```json
{
	"active": true,
	"emails": [
		{
			"display": "string",
			"primary": true,
			"type": "string",
			"value": "user@example.com"
		}
	],
	"groups": [null],
	"id": "string",
	"meta": {
		"resourceType": "string"
	},
	"name": {
		"familyName": "string",
		"givenName": "string"
	},
	"schemas": ["string"],
	"userName": "string"
}
```

### Parameters

| Name   | In   | Type                                                                    | Required | Description         |
| ------ | ---- | ----------------------------------------------------------------------- | -------- | ------------------- |
| `id`   | path | string(uuid)                                                            | true     | User ID             |
| `body` | body | [coderd.SCIMUser](/docs/@v2.17.3/reference/api/schemas/#coderdscimuser) | true     | Update user request |

### Example responses

> 200 Response

```json
{
	"avatar_url": "http://example.com",
	"created_at": "2019-08-24T14:15:22Z",
	"email": "user@example.com",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"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

| Status | Meaning                                                 | Description | Schema                                                              |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.User](/docs/@v2.17.3/reference/api/schemas/#codersdkuser) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get template ACLs

### Code samples

```shell
# 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 /templates/{template}/acl`

### Parameters

| Name       | In   | Type         | Required | Description |
| ---------- | ---- | ------------ | -------- | ----------- |
| `template` | path | string(uuid) | true     | Template ID |

### Example responses

> 200 Response

```json
[
	{
		"avatar_url": "http://example.com",
		"created_at": "2019-08-24T14:15:22Z",
		"email": "user@example.com",
		"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
		"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

| Status | Meaning                                                 | Description | Schema                                                                                       |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.TemplateUser](/docs/@v2.17.3/reference/api/schemas/#codersdktemplateuser) |

<h3 id="get-template-acls-responseschema">Response Schema</h3>

Status Code **200**

| Name                 | Type                                                                                | Required | Restrictions | Description |
| -------------------- | ----------------------------------------------------------------------------------- | -------- | ------------ | ----------- |
| `[array item]`       | array                                                                               | false    |              |             |
| `» avatar_url`       | string(uri)                                                                         | false    |              |             |
| `» created_at`       | string(date-time)                                                                   | true     |              |             |
| `» email`            | string(email)                                                                       | true     |              |             |
| `» id`               | string(uuid)                                                                        | true     |              |             |
| `» last_seen_at`     | string(date-time)                                                                   | false    |              |             |
| `» login_type`       | [codersdk.LoginType](/docs/@v2.17.3/reference/api/schemas/#codersdklogintype)       | false    |              |             |
| `» name`             | string                                                                              | false    |              |             |
| `» organization_ids` | array                                                                               | false    |              |             |
| `» role`             | [codersdk.TemplateRole](/docs/@v2.17.3/reference/api/schemas/#codersdktemplaterole) | false    |              |             |
| `» roles`            | array                                                                               | false    |              |             |
| `»» display_name`    | string                                                                              | false    |              |             |
| `»» name`            | string                                                                              | false    |              |             |
| `»» organization_id` | string                                                                              | false    |              |             |
| `» status`           | [codersdk.UserStatus](/docs/@v2.17.3/reference/api/schemas/#codersdkuserstatus)     | false    |              |             |
| `» theme_preference` | string                                                                              | false    |              |             |
| `» updated_at`       | string(date-time)                                                                   | false    |              |             |
| `» username`         | string                                                                              | true     |              |             |

#### Enumerated Values

| Property     | Value       |
| ------------ | ----------- |
| `login_type` | \`\`        |
| `login_type` | `password`  |
| `login_type` | `github`    |
| `login_type` | `oidc`      |
| `login_type` | `token`     |
| `login_type` | `none`      |
| `role`       | `admin`     |
| `role`       | `use`       |
| `status`     | `active`    |
| `status`     | `suspended` |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update template ACL

### Code samples

```shell
# 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 /templates/{template}/acl`

> Body parameter

```json
{
	"group_perms": {
		"8bd26b20-f3e8-48be-a903-46bb920cf671": "use",
		"<user_id>>": "admin"
	},
	"user_perms": {
		"4df59e74-c027-470b-ab4d-cbba8963a5e9": "use",
		"<group_id>": "admin"
	}
}
```

### Parameters

| Name       | In   | Type                                                                                          | Required | Description             |
| ---------- | ---- | --------------------------------------------------------------------------------------------- | -------- | ----------------------- |
| `template` | path | string(uuid)                                                                                  | true     | Template ID             |
| `body`     | body | [codersdk.UpdateTemplateACL](/docs/@v2.17.3/reference/api/schemas/#codersdkupdatetemplateacl) | true     | Update template request |

### Example responses

> 200 Response

```json
{
	"detail": "string",
	"message": "string",
	"validations": [
		{
			"detail": "string",
			"field": "string"
		}
	]
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                      |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Response](/docs/@v2.17.3/reference/api/schemas/#codersdkresponse) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get template available acl users/groups

### Code samples

```shell
# 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 /templates/{template}/acl/available`

### Parameters

| Name       | In   | Type         | Required | Description |
| ---------- | ---- | ------------ | -------- | ----------- |
| `template` | path | string(uuid) | true     | Template ID |

### Example responses

> 200 Response

```json
[
	{
		"groups": [
			{
				"avatar_url": "string",
				"display_name": "string",
				"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
				"members": [
					{
						"avatar_url": "http://example.com",
						"created_at": "2019-08-24T14:15:22Z",
						"email": "user@example.com",
						"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
						"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": "user@example.com",
				"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
				"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

| Status | Meaning                                                 | Description | Schema                                                                                       |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.ACLAvailable](/docs/@v2.17.3/reference/api/schemas/#codersdkaclavailable) |

<h3 id="get-template-available-acl-users/groups-responseschema">Response Schema</h3>

Status Code **200**

| Name                           | Type                                                                              | Required | Restrictions | Description                                                                                                                                                           |
| ------------------------------ | --------------------------------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]`                 | array                                                                             | false    |              |                                                                                                                                                                       |
| `» groups`                     | array                                                                             | false    |              |                                                                                                                                                                       |
| `»» avatar_url`                | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» display_name`              | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» id`                        | string(uuid)                                                                      | false    |              |                                                                                                                                                                       |
| `»» members`                   | array                                                                             | false    |              |                                                                                                                                                                       |
| `»»» avatar_url`               | string(uri)                                                                       | false    |              |                                                                                                                                                                       |
| `»»» created_at`               | string(date-time)                                                                 | true     |              |                                                                                                                                                                       |
| `»»» email`                    | string(email)                                                                     | true     |              |                                                                                                                                                                       |
| `»»» id`                       | string(uuid)                                                                      | true     |              |                                                                                                                                                                       |
| `»»» last_seen_at`             | string(date-time)                                                                 | false    |              |                                                                                                                                                                       |
| `»»» login_type`               | [codersdk.LoginType](/docs/@v2.17.3/reference/api/schemas/#codersdklogintype)     | false    |              |                                                                                                                                                                       |
| `»»» name`                     | string                                                                            | false    |              |                                                                                                                                                                       |
| `»»» status`                   | [codersdk.UserStatus](/docs/@v2.17.3/reference/api/schemas/#codersdkuserstatus)   | false    |              |                                                                                                                                                                       |
| `»»» theme_preference`         | string                                                                            | false    |              |                                                                                                                                                                       |
| `»»» updated_at`               | string(date-time)                                                                 | false    |              |                                                                                                                                                                       |
| `»»» username`                 | string                                                                            | true     |              |                                                                                                                                                                       |
| `»» name`                      | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» organization_display_name` | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» organization_id`           | string(uuid)                                                                      | false    |              |                                                                                                                                                                       |
| `»» organization_name`         | string                                                                            | false    |              |                                                                                                                                                                       |
| `»» quota_allowance`           | integer                                                                           | false    |              |                                                                                                                                                                       |
| `»» source`                    | [codersdk.GroupSource](/docs/@v2.17.3/reference/api/schemas/#codersdkgroupsource) | false    |              |                                                                                                                                                                       |
| `»» total_member_count`        | integer                                                                           | 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)`. |
| `» users`                      | array                                                                             | false    |              |                                                                                                                                                                       |

#### Enumerated Values

| Property     | Value       |
| ------------ | ----------- |
| `login_type` | \`\`        |
| `login_type` | `password`  |
| `login_type` | `github`    |
| `login_type` | `oidc`      |
| `login_type` | `token`     |
| `login_type` | `none`      |
| `status`     | `active`    |
| `status`     | `suspended` |
| `source`     | `user`      |
| `source`     | `oidc`      |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get user quiet hours schedule

### Code samples

```shell
# 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 /users/{user}/quiet-hours`

### Parameters

| Name   | In   | Type         | Required | Description |
| ------ | ---- | ------------ | -------- | ----------- |
| `user` | path | string(uuid) | true     | User ID     |

### Example responses

> 200 Response

```json
[
	{
		"next": "2019-08-24T14:15:22Z",
		"raw_schedule": "string",
		"time": "string",
		"timezone": "string",
		"user_can_set": true,
		"user_set": true
	}
]
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                                                           |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.UserQuietHoursScheduleResponse](/docs/@v2.17.3/reference/api/schemas/#codersdkuserquiethoursscheduleresponse) |

<h3 id="get-user-quiet-hours-schedule-responseschema">Response Schema</h3>

Status Code **200**

| Name             | Type              | Required | Restrictions | Description                                                                                                                                                                      |
| ---------------- | ----------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]`   | array             | false    |              |                                                                                                                                                                                  |
| `» next`         | string(date-time) | false    |              | Next is the next time that the quiet hours window will start.                                                                                                                    |
| `» raw_schedule` | string            | false    |              |                                                                                                                                                                                  |
| `» time`         | string            | false    |              | Time is the time of day that the quiet hours window starts in the given Timezone each day.                                                                                       |
| `» timezone`     | string            | false    |              | raw format from the cron expression, UTC if unspecified                                                                                                                          |
| `» user_can_set` | boolean           | 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_set`     | boolean           | 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](/docs/@v2.17.3/reference/api/authentication/).

## Update user quiet hours schedule

### Code samples

```shell
# 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 /users/{user}/quiet-hours`

> Body parameter

```json
{
	"schedule": "string"
}
```

### Parameters

| Name   | In   | Type                                                                                                                              | Required | Description             |
| ------ | ---- | --------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------- |
| `user` | path | string(uuid)                                                                                                                      | true     | User ID                 |
| `body` | body | [codersdk.UpdateUserQuietHoursScheduleRequest](/docs/@v2.17.3/reference/api/schemas/#codersdkupdateuserquiethoursschedulerequest) | true     | Update schedule request |

### Example responses

> 200 Response

```json
[
	{
		"next": "2019-08-24T14:15:22Z",
		"raw_schedule": "string",
		"time": "string",
		"timezone": "string",
		"user_can_set": true,
		"user_set": true
	}
]
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                                                           |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.UserQuietHoursScheduleResponse](/docs/@v2.17.3/reference/api/schemas/#codersdkuserquiethoursscheduleresponse) |

<h3 id="update-user-quiet-hours-schedule-responseschema">Response Schema</h3>

Status Code **200**

| Name             | Type              | Required | Restrictions | Description                                                                                                                                                                      |
| ---------------- | ----------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[array item]`   | array             | false    |              |                                                                                                                                                                                  |
| `» next`         | string(date-time) | false    |              | Next is the next time that the quiet hours window will start.                                                                                                                    |
| `» raw_schedule` | string            | false    |              |                                                                                                                                                                                  |
| `» time`         | string            | false    |              | Time is the time of day that the quiet hours window starts in the given Timezone each day.                                                                                       |
| `» timezone`     | string            | false    |              | raw format from the cron expression, UTC if unspecified                                                                                                                          |
| `» user_can_set` | boolean           | 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_set`     | boolean           | 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](/docs/@v2.17.3/reference/api/authentication/).

## Get workspace quota by user deprecated

### Code samples

```shell
# 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 /workspace-quota/{user}`

### Parameters

| Name   | In   | Type   | Required | Description          |
| ------ | ---- | ------ | -------- | -------------------- |
| `user` | path | string | true     | User ID, name, or me |

### Example responses

> 200 Response

```json
{
	"budget": 0,
	"credits_consumed": 0
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                                  |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.WorkspaceQuota](/docs/@v2.17.3/reference/api/schemas/#codersdkworkspacequota) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get workspace proxies

### Code samples

```shell
# 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 /workspaceproxies`

### Example responses

> 200 Response

```json
[
	{
		"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

| Status | Meaning                                                 | Description | Schema                                                                                                                                              |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | array of [codersdk.RegionsResponse-codersdk\_WorkspaceProxy](/docs/@v2.17.3/reference/api/schemas/#codersdkregionsresponse-codersdk_workspaceproxy) |

<h3 id="get-workspace-proxies-responseschema">Response Schema</h3>

Status Code **200**

| Name                   | Type                                                                                                | Required | Restrictions | Description                                                                                                                                                                          |
| ---------------------- | --------------------------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `[array item]`         | array                                                                                               | false    |              |                                                                                                                                                                                      |
| `» regions`            | array                                                                                               | false    |              |                                                                                                                                                                                      |
| `»» created_at`        | string(date-time)                                                                                   | false    |              |                                                                                                                                                                                      |
| `»» deleted`           | boolean                                                                                             | false    |              |                                                                                                                                                                                      |
| `»» derp_enabled`      | boolean                                                                                             | false    |              |                                                                                                                                                                                      |
| `»» derp_only`         | boolean                                                                                             | false    |              |                                                                                                                                                                                      |
| `»» display_name`      | string                                                                                              | false    |              |                                                                                                                                                                                      |
| `»» healthy`           | boolean                                                                                             | false    |              |                                                                                                                                                                                      |
| `»» icon_url`          | string                                                                                              | false    |              |                                                                                                                                                                                      |
| `»» id`                | string(uuid)                                                                                        | false    |              |                                                                                                                                                                                      |
| `»» name`              | string                                                                                              | false    |              |                                                                                                                                                                                      |
| `»» path_app_url`      | string                                                                                              | 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](https://us.example.com)                             |
| `»» status`            | [codersdk.WorkspaceProxyStatus](/docs/@v2.17.3/reference/api/schemas/#codersdkworkspaceproxystatus) | 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_at`       | string(date-time)                                                                                   | false    |              |                                                                                                                                                                                      |
| `»»» report`           | [codersdk.ProxyHealthReport](/docs/@v2.17.3/reference/api/schemas/#codersdkproxyhealthreport)       | false    |              | Report provides more information about the health of the workspace proxy.                                                                                                            |
| `»»»» errors`          | array                                                                                               | false    |              | Errors are problems that prevent the workspace proxy from being healthy                                                                                                              |
| `»»»» warnings`        | array                                                                                               | false    |              | Warnings do not prevent the workspace proxy from being healthy, but should be addressed.                                                                                             |
| `»»» status`           | [codersdk.ProxyHealthStatus](/docs/@v2.17.3/reference/api/schemas/#codersdkproxyhealthstatus)       | false    |              |                                                                                                                                                                                      |
| `»» updated_at`        | string(date-time)                                                                                   | false    |              |                                                                                                                                                                                      |
| `»» version`           | string                                                                                              | false    |              |                                                                                                                                                                                      |
| `»» wildcard_hostname` | string                                                                                              | 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          |
| -------- | -------------- |
| `status` | `ok`           |
| `status` | `unreachable`  |
| `status` | `unhealthy`    |
| `status` | `unregistered` |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Create workspace proxy

### Code samples

```shell
# 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 /workspaceproxies`

> Body parameter

```json
{
	"display_name": "string",
	"icon": "string",
	"name": "string"
}
```

### Parameters

| Name   | In   | Type                                                                                                              | Required | Description                    |
| ------ | ---- | ----------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------ |
| `body` | body | [codersdk.CreateWorkspaceProxyRequest](/docs/@v2.17.3/reference/api/schemas/#codersdkcreateworkspaceproxyrequest) | true     | Create workspace proxy request |

### Example responses

> 201 Response

```json
{
	"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

| Status | Meaning                                                      | Description | Schema                                                                                  |
| ------ | ------------------------------------------------------------ | ----------- | --------------------------------------------------------------------------------------- |
| 201    | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created     | [codersdk.WorkspaceProxy](/docs/@v2.17.3/reference/api/schemas/#codersdkworkspaceproxy) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Get workspace proxy

### Code samples

```shell
# 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 /workspaceproxies/{workspaceproxy}`

### Parameters

| Name             | In   | Type         | Required | Description      |
| ---------------- | ---- | ------------ | -------- | ---------------- |
| `workspaceproxy` | path | string(uuid) | true     | Proxy ID or name |

### Example responses

> 200 Response

```json
{
	"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

| Status | Meaning                                                 | Description | Schema                                                                                  |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.WorkspaceProxy](/docs/@v2.17.3/reference/api/schemas/#codersdkworkspaceproxy) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Delete workspace proxy

### Code samples

```shell
# 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 /workspaceproxies/{workspaceproxy}`

### Parameters

| Name             | In   | Type         | Required | Description      |
| ---------------- | ---- | ------------ | -------- | ---------------- |
| `workspaceproxy` | path | string(uuid) | true     | Proxy ID or name |

### Example responses

> 200 Response

```json
{
	"detail": "string",
	"message": "string",
	"validations": [
		{
			"detail": "string",
			"field": "string"
		}
	]
}
```

### Responses

| Status | Meaning                                                 | Description | Schema                                                                      |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.Response](/docs/@v2.17.3/reference/api/schemas/#codersdkresponse) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).

## Update workspace proxy

### Code samples

```shell
# 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 /workspaceproxies/{workspaceproxy}`

> Body parameter

```json
{
	"display_name": "string",
	"icon": "string",
	"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
	"name": "string",
	"regenerate_token": true
}
```

### Parameters

| Name             | In   | Type                                                                                              | Required | Description                    |
| ---------------- | ---- | ------------------------------------------------------------------------------------------------- | -------- | ------------------------------ |
| `workspaceproxy` | path | string(uuid)                                                                                      | true     | Proxy ID or name               |
| `body`           | body | [codersdk.PatchWorkspaceProxy](/docs/@v2.17.3/reference/api/schemas/#codersdkpatchworkspaceproxy) | true     | Update workspace proxy request |

### Example responses

> 200 Response

```json
{
	"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

| Status | Meaning                                                 | Description | Schema                                                                                  |
| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK          | [codersdk.WorkspaceProxy](/docs/@v2.17.3/reference/api/schemas/#codersdkworkspaceproxy) |

To perform this operation, you must be authenticated. [Learn more](/docs/@v2.17.3/reference/api/authentication/).
