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

# Update Custom Field Values

`PUT https://api.pagerduty.com/services/{id}/custom_fields/values`

Set custom field values for a service.

Scoped OAuth requires: `services.write`

## Authorization

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

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of the resource. |

## 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 |
|---|---|---|---|
| `custom_fields` | array of one of: object \| object | yes |  |
| `custom_fields[].id` | string | yes | (Value by Field ID) The ID of the resource. |
| `custom_fields[].value` | one of: object \| object \| object \| object \| object \| object | yes | (Value by Field ID) |
| `custom_fields[].value.value` | boolean \| null |  | (Boolean) |
| `custom_fields[].value.value` | string \| null (date-time) |  | (Datetime) |
| `custom_fields[].value.value` | number \| null |  | (Float) |
| `custom_fields[].value.value` | integer \| null |  | (Integer) |
| `custom_fields[].value.value` | one of: string \| null \| array \| null |  | (String) |
| `custom_fields[].value.value` | string \| null (uri) |  | (Url) Max length: 200. |
| `custom_fields[].name` | string | yes | (Value by Field Name) The name of the field. May include ASCII characters, specifically lowercase letters, digits, and underescores. The `name` for a Field must be unique and cannot be changed once created. Max length: 50. |
| `custom_fields[].value` | one of: object \| object \| object \| object \| object \| object | yes | (Value by Field Name) |
| `custom_fields[].value.value` | boolean \| null |  | (Boolean) |
| `custom_fields[].value.value` | string \| null (date-time) |  | (Datetime) |
| `custom_fields[].value.value` | number \| null |  | (Float) |
| `custom_fields[].value.value` | integer \| null |  | (Integer) |
| `custom_fields[].value.value` | one of: string \| null \| array \| null |  | (String) |
| `custom_fields[].value.value` | string \| null (uri) |  | (Url) Max length: 200. |

Example: Request Example

```json
{
  "custom_fields": [
    {
      "id": "PT4KHEE",
      "value": "production"
    }
  ]
}
```

Example: Request Example

```json
{
  "custom_fields": [
    {
      "name": "environment",
      "value": "production"
    }
  ]
}
```

Example: Request Example

```json
{
  "custom_fields": [
    {
      "id": "PT4KHEE",
      "value": [
        "production",
        "staging"
      ]
    }
  ]
}
```

## Response 201

The custom field values were updated.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `custom_fields` | array of object | yes |  |
| `custom_fields[].data_type` | string |  | The kind of data the custom field is allowed to contain. One of: `boolean`, `integer`, `float`, `string`, `datetime`, `url`. |
| `custom_fields[].description` | string \| null |  | A description of the data this field contains. Max length: 1000. |
| `custom_fields[].display_name` | string |  | The human-readable name of the field. This must be unique across an account. Max length: 50. |
| `custom_fields[].field_type` | string |  | The type of data this field contains. In combination with the `data_type` field. One of: `single_value`, `single_value_fixed`, `multi_value`, `multi_value_fixed`. |
| `custom_fields[].id` | string |  | The ID of the resource. |
| `custom_fields[].name` | string |  | The name of the field. May include ASCII characters, specifically lowercase letters, digits, and underescores. The `name` for a Field must be unique and cannot be changed once created. Max length: 50. |
| `custom_fields[].type` | string |  | Determines the type of the reference. One of: `field_value`. |
| `custom_fields[].value` | one of: object \| object \| object \| object \| object \| object |  |  |
| `custom_fields[].value.value` | boolean \| null |  | (Boolean) |
| `custom_fields[].value.value` | number \| null |  | (Float) |
| `custom_fields[].value.value` | integer \| null |  | (Integer) |
| `custom_fields[].value.value` | one of: string \| null \| array \| null |  | (String) |
| `custom_fields[].value.value` | string \| null (date-time) |  | (Datetime) |
| `custom_fields[].value.value` | string \| null (uri) |  | (Url) Max length: 200. |

Example: Response Example

```json
{
  "custom_fields": [
    {
      "data_type": "string",
      "description": "environment where service instance runs",
      "display_name": "Runtime Environment",
      "field_type": "single_value_fixed",
      "id": "PT4KHEE",
      "name": "environment",
      "type": "field_value",
      "value": "production"
    }
  ]
}
```

Example: Response Example

```json
{
  "custom_fields": [
    {
      "data_type": "string",
      "description": "environment where service instance runs",
      "display_name": "Runtime Environment",
      "field_type": "multi_value_fixed",
      "id": "PT4KHEE",
      "name": "environment",
      "type": "field_value",
      "value": [
        "production",
        "staging"
      ]
    }
  ]
}
```

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