---
title: "Set an entity's custom field values"
type: reference
method: POST
path: /rest-api/additional-fields/{entityType}/{entityId}.do
tag: "Categories"
---

# Set an entity's custom field values

`POST https://YOUR-NETWORK-DOMAIN/rest-api/additional-fields/{entityType}/{entityId}.do`

Sets custom (additional) field values on the entity, as saving the console's Basic Info card does. The JSON body maps a field to its new value; a field is named by its id or by its name, for example {"7": "Q3 push", "cost_center": "EU-42"}. Only the fields sent change. A value is free text of at most 255 characters; an empty string clears it. A field that does not exist, or belongs to another entity type, refuses the whole request and nothing is saved. Needs update rights on the entity: the advertiser's share for an advertiser, campaign or banner, the site's share for a site, zone or placement. Answers with the entity's values after the save, in the shape of the GET.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `entityType` | string | yes | `CAMPAIGN` | Entity type the fields belong to |
| `entityId` | integer | yes | `2001` | Id of the advertiser, campaign, banner, site, zone or placement |

## Body

A JSON body. An example, built from the field definitions:

```json
{}
```

## Responses

- `200` — Saved; 'fields' lists {id, name, title, value} for each field of the entity type
- `400` — Empty body, an unknown field, a field of another entity type, or a value longer than 255 characters
- `401` — Authentication error
- `403` — No update rights on the entity
- `404` — The entity does not exist or is deleted

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/additional-fields/CAMPAIGN/2001.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "cost_center": "EU-42"
}'
```

Source: https://epom.com/ad-server/docs/api/categories/post-additional-fields