---
title: "Create a new action"
type: reference
method: POST
path: /rest-api/action/create.do
tag: "Actions"
---

# Create a new action

`POST https://YOUR-NETWORK-DOMAIN/rest-api/action/create.do`

Creates a new conversion action owned by the authenticated user. Conversion actions represent advertiser-defined events (e.g., purchase, sign-up, app install) that are tracked after ad interactions. All parameters are optional -- omitted fields use system defaults. If 'campaignId' is provided, the response includes the campaign's pixelKey (derived from advertiser ID + campaign ID + action ID); otherwise pixelKey is omitted. The newly created action is returned in the response JSON and logged to the action log. Requires authentication.

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `name` | string | yes | `Purchase` | Display name for the new action (e.g., 'Purchase', 'Sign Up', 'App Install'), up to 64 characters. |
| `clickToConversionTimeFrame` | integer | no | `7` | Click-to-conversion attribution window duration, 0 to 255 units. For example, 7 with DAY means conversions within 7 days of a click are attributed. |
| `clickToConversionTimeFramePeriodType` | string | no | `DAY` | Time unit for clickToConversionTimeFrame. Allowed values: SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR. |
| `viewToConversionTimeFrame` | integer | no | `1` | View-to-conversion attribution window duration, 0 to 255 units. For example, 1 with DAY means conversions within 1 day of an impression are attributed. |
| `viewToConversionTimeFramePeriodType` | string | no | `DAY` | Time unit for viewToConversionTimeFrame. Allowed values: SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR. |
| `applyAttributionWindowToServerToServer` | boolean | no | `true` | Whether the attribution window is also applied to server-to-server conversions. Server-to-server postbacks carry no impression or click identity of their own, so this is off for actions created before the option existed and on for new ones. Omit to keep the current value. |
| `rejectDuplicateConversions` | boolean | no | `false` | Whether a repeat of the same event on one click is thrown away. Off by default: repeats count. Applies to both server-to-server postbacks and the cookie pixel. A tracking-event action repeats by definition and is exempt regardless. |
| `defaultAttributionType` | string | no | `POST_CLICK` | Attribution type applied to a conversion that arrives with no attribution of its own — the last resort, below the action's tracking event, the partner's att= parameter and the classification carried by the tracking token. Allowed values: UNSPECIFIED, POST_CLICK, POST_VIEW (or integer IDs 0, 1, 2). Omit to keep the current value. |
| `campaignId` | integer | no | `2001` | Optional campaign ID. When provided, the response includes the computed pixelKey for this campaign context. |

## Responses

- `200` — Newly created action object with id, key, name, conversion time frames, and optionally a campaign-specific pixelKey
- `400` — Bad request — wrong parameter types
- `401` — Authentication error
- `403` — Not enough permissions

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/action/create.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'name=Purchase' \
  --data-urlencode 'campaignId=2001' \
  --data-urlencode 'clickToConversionTimeFrame=7' \
  --data-urlencode 'clickToConversionTimeFramePeriodType=DAY' \
  --data-urlencode 'viewToConversionTimeFrame=1'
```

Source: https://epom.com/ad-server/docs/api/actions/post-action-create