[Tenjin API Reference](https://api-docs.tenjin.com/llms.txt) › [Campaign Management API](https://api-docs.tenjin.com/campaign-management-api.md) › Create a callback group

- Campaign Management API OpenAPI spec: https://api-docs.tenjin.com/openapi/campaign-management-api.json

# Create a callback group

- **Method:** `POST`
- **Path:** `/v2/apps/{app_id}/integrations/{integration_id}/callback_groups`
- **Operation ID:** `post_apps_app_id_integrations_integration_id_callback_groups`
- **Tags:** Callback Groups

## Effective servers

- `https://api.tenjin.com`

## Authentication

- **Bearer**: HTTP bearer (`JWT`)

  Generate an access token on the [Access Tokens](https://dashboard.tenjin.com/dashboard/access_tokens) page of the Tenjin dashboard and send it as `Authorization: Bearer <access token>`. [API access tokens](https://tenjin.com/docs/api-access-tokens/) explains them.

## Path parameters

- **`app_id` (required)**: `string`, format: `uuid`, maxLength: `36`

  Id of the app
- **`integration_id` (required)**: `integer`

  Id of the integration: its channel id

## Request body

**Required:** `true`

**Content type:** `application/json`

schema: `post_apps_app_id_integrations_integration_id_callback_groups_Request`

- **`callback_group_template_id` (required)**: `string`, format: `uuid`, maxLength: `36`

  Id of the callback group template the group is made from
- **`active`**: `boolean`

  Whether Tenjin sends the callbacks
- **`callback_settings`**: `object`

  A value for each of the template's required_settings, for this callback group only
- **`event`**: `string`

  Name of the event that sends the callbacks
- **`event_definition_id`**: `string`, format: `uuid`, maxLength: `36`

  Id of the event that sends the callbacks. Send event_definition_id or event; event_definition_id wins when both are sent
- **`name`**: `string`

  Name of the callback group
- **`user_filter`**: `string`, possible values: `"all", "channel", "channel_and_organic", "defer_to_template"`

  Users the callbacks are sent for

**Example:**

```json
{
  "callback_group_template_id": "",
  "event_definition_id": "",
  "event": "",
  "active": true,
  "callback_settings": {},
  "name": "",
  "user_filter": "all"
}
```

## Responses

### 201 The created callback group

**Content type:** `application/json`

schema: `CallbackGroupDocument`

- **`data` (required)**: `object`, schema: `CallbackGroupResource`
  - **`attributes` (required)**: `object`
    - **`active` (required)**: `boolean`

      Whether Tenjin sends the callbacks
    - **`app_id` (required)**: `string`, format: `uuid`

      Id of the app
    - **`callback_group_template_id` (required)**: `string | null`, format: `uuid`

      Id of the callback group template the group is made from
    - **`callback_settings` (required)**: `object`

      Settings of this callback group only
    - **`event` (required)**: `string | null`

      Name of the event that sends the callbacks
    - **`event_definition_id` (required)**: `string | null`, format: `uuid`

      Id of the event that sends the callbacks
    - **`integration_id` (required)**: `integer`

      Id of the integration: its channel id
    - **`name` (required)**: `string | null`

      Name of the callback group
    - **`user_filter` (required)**: `string`, possible values: `"all", "channel", "channel_and_organic", "defer_to_template"`

      Users the callbacks are sent for
  - **`id` (required)**: `string`, format: `uuid`
  - **`type` (required)**: `string`, possible values: `"callback_group"`
- **`links` (required)**: `object`, schema: `Links`
  - **`self` (required)**: `string`, format: `uri`

    URL of this request
  - **`first`**: `string`, format: `uri`

    URL of the first page of a list
  - **`last`**: `string`, format: `uri`

    URL of the last page of a list
  - **`next`**: `string`, format: `uri`

    URL of the next page of a list
  - **`prev`**: `string`, format: `uri`

    URL of the previous page of a list
- **`meta` (required)**: `object`

  Always empty

**Example: The created callback group**

```json
{
  "data": {
    "id": "2bf128e0-78ae-4df7-9591-91f6ff412b85",
    "type": "callback_group",
    "attributes": {
      "active": true,
      "callback_group_template_id": "5af128e0-78ae-4df7-9591-91f6f8411b83",
      "event_definition_id": "402a9bc4-d6e3-4e3f-8621-52193c3c3034",
      "name": "Level 10",
      "user_filter": "channel",
      "app_id": "17ef8c1a-5729-456e-98db-ccc104bdf860",
      "integration_id": 18,
      "callback_settings": {
        "event_name": "level_10"
      },
      "event": "level_10"
    }
  },
  "links": {
    "self": "https://api.tenjin.com/v2/apps/17ef8c1a-5729-456e-98db-ccc104bdf860/integrations/18/callback_groups/2bf128e0-78ae-4df7-9591-91f6ff412b85"
  },
  "meta": {}
}
```

### 400, 401, 403, 498, 503

- `400` A param is missing or invalid, a record is not found, or the organization has no ad account for the integration
- `401` Missing or invalid credentials, or no access to the requested data
- `403` Invalid token, or the user's role does not allow the request
- `498` Expired token, or a token with an invalid signature
- `503` Read-only mode during maintenance; try again later

**Content type:** `application/json`

schema: `Error`

- **`error` (required)**: `string`

  What went wrong

**Example:**

```json
{
  "error": ""
}
```

## Schemas

- `Error` — shown above.
- `post_apps_app_id_integrations_integration_id_callback_groups_Request` — shown above.
- `CallbackGroupDocument` — shown above.
- `Links` — shown above.
- `CallbackGroupResource` — shown above.
