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

# List template fields

`GET https://api.pagerduty.com/templates/fields`

Get a list of fields that can be used on the account templates.

Scoped OAuth requires: `templates.read`

## 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`. |

## Response 200

An array of template fields.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `fields` | array of object | yes |  |
| `fields[].data_type` | string |  | The kind of data the template field is allowed to contain. One of: `boolean`, `integer`, `float`, `string`, `datetime`, `url`. |
| `fields[].default_value` | string \| null |  | The default value of the template field. |
| `fields[].description` | string \| null |  | A short description of the template field. |
| `fields[].domain_name` | object |  |  |
| `fields[].domain_name.order` | integer |  |  |
| `fields[].domain_name.summary` | string |  |  |
| `fields[].keyword` | string \| null |  |  |
| `fields[].summary` | string |  | A short summary of the template field. |
| `fields[].type` | string |  | The type of template field. One of: `standard_field`, `custom_field`. |
| `fields[].examples` |  |  |  |

Example: Response Example

```json
{
  "fields": [
    {
      "data_type": "datetime",
      "default_value": null,
      "description": "The time the incident was created.",
      "domain": {
        "order": 1,
        "summary": "Incident"
      },
      "example": "2023-11-22T07:12:50Z",
      "keyword": null,
      "summary": "incident.created_at",
      "type": "standard_field"
    },
    {
      "data_type": "string",
      "default_value": null,
      "description": "The name of the escalation policy attached to the service that the incident is on",
      "domain": {
        "order": 1,
        "summary": "Incident"
      },
      "example": "Another Escalation Policy",
      "keyword": "name",
      "summary": "incident.escalation_policy.summary",
      "type": "standard_field"
    },
    {
      "data_type": "string",
      "default_value": "default value",
      "description": "An account defined custom field",
      "domain": {
        "order": 1,
        "summary": "Incident"
      },
      "example": null,
      "keyword": null,
      "summary": "incident.custom_field",
      "type": "custom_field"
    }
  ]
}
```

## 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 402

Account does not have the abilities to perform the action. Please review the response for the required abilities.
You can also use the [Abilities API](#resource_Abilities) to determine what features are available to your account.

### `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 500

Internal Server Error the PagerDuty server experienced an error.

### `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).
