# Client API: Resource Tags

> User-defined labels on services, Cloud Compute instances, Container Apps, and other resources.

Source: https://www.coritan.com/docs/api/reference/client/resource-tags/

User-defined labels on services, Cloud Compute instances, Container Apps, and other resources. Filter lists with `?tag=` or manage via `/api/v1/client/tags`.

Base URL: `https://api.coritan.com/api/v1`. Paths below are complete.

To try these requests in the browser, open the [interactive Client API reference](https://api.coritan.com/docs).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/client/tags/sources/{source_type}/{source_id}`](#op-get-api-v1-client-tags-sources-source-type-source-id) | Get resource tags |
| POST | [`/api/v1/client/tags/sources/{source_type}/{source_id}`](#op-post-api-v1-client-tags-sources-source-type-source-id) | Add resource tag |
| PUT | [`/api/v1/client/tags/sources/{source_type}/{source_id}`](#op-put-api-v1-client-tags-sources-source-type-source-id) | Replace resource tags |
| DELETE | [`/api/v1/client/tags/sources/{source_type}/{source_id}/{tag}`](#op-delete-api-v1-client-tags-sources-source-type-source-id-tag) | Remove resource tag |
| GET | [`/api/v1/client/tags/vocabulary`](#op-get-api-v1-client-tags-vocabulary) | Distinct tags on resources you own for a given sourcetype |

### Get resource tags {#op-get-api-v1-client-tags-sources-source-type-source-id}

`GET /api/v1/client/tags/sources/{source_type}/{source_id}`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `source_type` | path | string | yes |
| `source_id` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `source_type` | string |
| `source_id` | string |
| `tags` | array of string |

### Add resource tag {#op-post-api-v1-client-tags-sources-source-type-source-id}

`POST /api/v1/client/tags/sources/{source_type}/{source_id}`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `source_type` | path | string | yes |
| `source_id` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `tag` | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `tags` | array of string |

### Replace resource tags {#op-put-api-v1-client-tags-sources-source-type-source-id}

`PUT /api/v1/client/tags/sources/{source_type}/{source_id}`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `source_type` | path | string | yes |
| `source_id` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `tags` | array of string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `tags` | array of string |

### Remove resource tag {#op-delete-api-v1-client-tags-sources-source-type-source-id-tag}

`DELETE /api/v1/client/tags/sources/{source_type}/{source_id}/{tag}`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `source_type` | path | string | yes |
| `source_id` | path | string | yes |
| `tag` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `tags` | array of string |

### Distinct tags on resources you own for a given sourcetype {#op-get-api-v1-client-tags-vocabulary}

`GET /api/v1/client/tags/vocabulary`

Distinct tags on resources you own for a given source_type.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `source_type` | query | string | yes | e.g. vps, container_server, service |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `items` | array of TagVocabularyItem |
| `items[].tag` | string |
| `items[].resource_count` | integer |
| `source_type` | string or null |
