> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Create a tag

`POST https://api.pagerduty.com/tags`

Create a Tag.

A Tag is applied to Escalation Policies, Teams or Users and can be used to filter them.

For more information see the [API Concepts Document](https://docs.pagerduty.com/developer/api-concepts#tags)

Scoped OAuth requires: `tags.write`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Request body (`application/json`)

| Field | Type | Required | Description |
|---|---|---|---|
| `tag` | object | yes |  |
| `tag.id` | string |  | Read-only. |
| `tag.summary` | string \| null |  | A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier. Read-only. |
| `tag.type` | string | yes | The type of object being created. One of: `tag`. Default: `tag`. |
| `tag.self` | string \| null (url) |  | the API show URL at which the object is accessible. Read-only. |
| `tag.html_url` | string \| null (url) |  | a URL at which the entity is uniquely displayed in the Web app. Read-only. |
| `tag.label` | string | yes | The label of the tag. Max length: 191. |

Example: Request Example

```json
{
  "tag": {
    "type": "tag",
    "label": "Batman"
  }
}
```

## Response 201

The tag that was created.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `tag` | object | yes | Same fields as `tag` above. |

Example: Response Example

```json
{
  "tag": {
    "type": "tag",
    "summary": "Batman",
    "self": "https://api.pagerduty.com/tags/P5IYCNZ",
    "label": "Batman",
    "id": "P5IYCNZ",
    "html_url": null
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
