---
title: Dictionary item
summary: >-
  A Dictionary Item is a single key-value pair that makes up an entry in a
  Dictionary. Dictionary Items can be added, removed and modified without
  activating a new version of the associated service.
url: >-
  https://www.fastly.com/documentation/reference/api/dictionaries/dictionary-item
---

A Dictionary Item is a single key-value pair that makes up an entry in a Dictionary. Dictionary Items can be added, removed and modified without activating a new version of the associated service.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `item_key` | string | Item key, maximum 256 characters. |
| `item_value` | string | Item value, maximum 8000 characters. |
| `items` | array |  |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `deleted_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `dictionary_id` | string | Alphanumeric string identifying a Dictionary. (Read-only) |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |

## API endpoints

### List items in a dictionary

**GET** `/service/{service_id}/dictionary/{dictionary_id}/items`

List of DictionaryItems given service and dictionary ID.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `dictionary_id` | string | path | Yes | Alphanumeric string identifying a Dictionary. |
| `direction` | string | query | No | Direction in which to sort results. |
| `page` | integer | query | No | Current page. |
| `per_page` | integer | query | No | Number of records per page. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `sort` | string | query | No | Field on which to sort. |

### Update multiple entries in a dictionary

**PATCH** `/service/{service_id}/dictionary/{dictionary_id}/items`

Update multiple items in the same dictionary. For faster updates to your service, group your changes into large batches. The maximum batch size is 1000 items. <a href="https://support.fastly.com/">Contact support</a> to discuss raising this limit.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `dictionary_id` | string | path | Yes | Alphanumeric string identifying a Dictionary. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Get an item from a dictionary

**GET** `/service/{service_id}/dictionary/{dictionary_id}/item/{dictionary_item_key}`

Retrieve a single DictionaryItem given service, dictionary ID and item key.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `dictionary_id` | string | path | Yes | Alphanumeric string identifying a Dictionary. |
| `dictionary_item_key` | string | path | Yes | Item key, maximum 256 characters. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Insert or update an entry in a dictionary

**PUT** `/service/{service_id}/dictionary/{dictionary_id}/item/{dictionary_item_key}`

Upsert DictionaryItem given service, dictionary ID, item key, and item value.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `dictionary_id` | string | path | Yes | Alphanumeric string identifying a Dictionary. |
| `dictionary_item_key` | string | path | Yes | Item key, maximum 256 characters. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Delete an item from a dictionary

**DELETE** `/service/{service_id}/dictionary/{dictionary_id}/item/{dictionary_item_key}`

Delete DictionaryItem given service, dictionary ID, and item key.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `dictionary_id` | string | path | Yes | Alphanumeric string identifying a Dictionary. |
| `dictionary_item_key` | string | path | Yes | Item key, maximum 256 characters. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Update an entry in a dictionary

**PATCH** `/service/{service_id}/dictionary/{dictionary_id}/item/{dictionary_item_key}`

Update DictionaryItem given service, dictionary ID, item key, and item value.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `dictionary_id` | string | path | Yes | Alphanumeric string identifying a Dictionary. |
| `dictionary_item_key` | string | path | Yes | Item key, maximum 256 characters. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |

### Create an entry in a dictionary

**POST** `/service/{service_id}/dictionary/{dictionary_id}/item`

Create DictionaryItem given service, dictionary ID, item key, and item value.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `dictionary_id` | string | path | Yes | Alphanumeric string identifying a Dictionary. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
