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

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

# Create an S2S callback

- **Method:** `POST`
- **Path:** `/v2/apps/{app_id}/s2s_callbacks`
- **Operation ID:** `post_apps_app_id_s2s_callbacks`
- **Tags:** S2S Callbacks

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

## Request body

**Required:** `false`

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

schema: `post_apps_app_id_s2s_callbacks_Request`

- **`action`**: `string`, possible values: `"ping", "ping_on_first", "notify_on_reengagement"`

  `ping` to notify on every event; `ping_on_first` to notify on install and `notify_on_reengagement` on reengagement, both for the open event only
- **`active`**: `boolean`

  Whether Tenjin sends the callback
- **`advertising_id_filter`**: `boolean`

  Only send the callback for users with a known advertising id
- **`event`**: `string`

  Event of the app that sends the callback
- **`first_party`**: `boolean`

  Whether this is a first-party (destination belongs to the advertiser) S2S callback
- **`http_method`**: `string`, possible values: `"GET", "POST"`

  HTTP method
- **`name`**: `string`

  Name of the S2S callback
- **`url`**: `string`

  URL Tenjin calls. Macros such as `{{advertising_id}}` are filled in
- **`user_filter`**: `array of integer`

  Only send the callback for users attributed to these channels; all users when empty

**Example:**

```json
{
  "event": "",
  "name": "",
  "url": "",
  "http_method": "GET",
  "action": "ping",
  "active": true,
  "advertising_id_filter": true,
  "user_filter": [
    1
  ],
  "first_party": true
}
```

## Responses

### 201 The created S2S callback

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

schema: `S2SCallbackDocument`

- **`data` (required)**: `object`, schema: `S2SCallbackResource`
  - **`attributes` (required)**: `object`
    - **`action` (required)**: `string`, possible values: `"ping", "ping_on_first", "notify_on_reengagement"`

      `ping` to notify on every event; `ping_on_first` to notify on install and `notify_on_reengagement` on reengagement, both for the open event only
    - **`active` (required)**: `boolean`

      Whether Tenjin sends the callback
    - **`advertising_id_filter` (required)**: `boolean`

      Only send the callback for users with a known advertising id
    - **`app_id` (required)**: `string | null`, format: `uuid`

      Id of the app
    - **`created_at` (required)**: `string`, format: `date-time`

      When the callback was created
    - **`event` (required)**: `string`

      Event that sends the callback
    - **`first_party` (required)**: `boolean | null`

      Whether this is a first-party (destination belongs to the advertiser) S2S callback
    - **`http_method` (required)**: `string`, possible values: `"GET", "POST"`

      HTTP method
    - **`name` (required)**: `string`

      Name of the S2S callback
    - **`url` (required)**: `string`

      URL Tenjin calls. Macros such as `{{bundle_id}}` are filled in
    - **`user_filter` (required)**: `array of integer`

      Only send the callback for users attributed to these channels; all users when empty
  - **`id` (required)**: `string`, format: `uuid`
  - **`type` (required)**: `string`, possible values: `"s2s_callbacks"`
- **`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 S2S callback**

```json
{
  "data": {
    "id": "06daaf45-8bab-4070-848b-b198024fb927",
    "type": "s2s_callbacks",
    "attributes": {
      "app_id": "e3448393-bbf4-432e-9d4d-bdf640508b4c",
      "name": "S2S Purchase",
      "event": "purchase",
      "url": "https://fake.tenjin.com?bundle_id={{bundle_id}}",
      "http_method": "GET",
      "active": true,
      "created_at": "2024-12-18T00:01:32.473Z",
      "action": "ping",
      "advertising_id_filter": true,
      "user_filter": [
        1,
        3,
        5
      ],
      "first_party": false
    }
  },
  "links": {
    "self": "https://api.tenjin.com/v2/apps/e3448393-bbf4-432e-9d4d-bdf640508b4c/s2s_callbacks/06daaf45-8bab-4070-848b-b198024fb927"
  },
  "meta": {}
}
```

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

- `400` A param is missing or invalid, a record is not found, or the request cannot be served
- `401` Missing or invalid credentials, or no access to the requested data
- `403` Invalid token, the user's role does not allow the request, or the organization has no access to S2S callbacks
- `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_s2s_callbacks_Request` — shown above.
- `S2SCallbackDocument` — shown above.
- `Links` — shown above.
- `S2SCallbackResource` — shown above.
