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

# Create a Field Option for a Custom Field

`POST https://api.pagerduty.com/incidents/types/{type_id_or_name}/custom_fields/{field_id}/field_options`

Create a field option for a custom field.

Custom Fields (CF) are a feature which will allow customers to extend Incidents with their own custom data,
to provide additional context and support features such as customized filtering, search and analytics.
Custom Fields can be applied to different incident types.

Scoped OAuth requires: `custom_fields.write`

## Authorization

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

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `type_id_or_name` | string | yes | The ID or name of the Incident Type. |
| `field_id` | string | yes | The ID of the field. |

## 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 |
|---|---|---|---|
| `field_option` | object | yes | Details of the field option to be created. |
| `field_option.data` | object | yes |  |
| `field_option.data.data_type` | string | yes | The data type of the Field Option for the Custom Field. |
| `field_option.data.value` | string | yes | The value of the Field Option for the Custom Field. |

Example: Request Example

```json
{
  "field_option": {
    "data": {
      "data_type": "string",
      "value": "option_1"
    }
  }
}
```

## Response 201

The field option for the custom field created.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `field_option` | object | yes |  |
| `field_option.data` | one of: object |  |  |
| `field_option.data.data_type` | string | yes | (option 1) The kind of data represented by this option. Must match the Field's `data_type`. One of: `string`. |
| `field_option.data.value` | string | yes | (option 1) Max length: 100. |
| `field_option.id` | string | yes | The ID of the resource. Read-only. |
| `field_option.type` | string | yes | Read-only. One of: `field_option`. |
| `field_option.updated_at` | string (date-time) | yes | The date/time the object was last updated. Read-only. |
| `field_option.created_at` | string (date-time) | yes | The date/time the object was created at. Read-only. |

Example: Response Example

```json
{
  "field_option": {
    "id": "P123456",
    "data": {
      "data_type": "string",
      "value": "option_1"
    },
    "type": "field_option",
    "created_at": "2021-06-01T21:30:42Z",
    "updated_at": "2021-06-01T21:30:42Z"
  }
}
```

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

The requested resource was not found.

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