[Tenjin API Reference](https://api-docs.tenjin.com/llms.txt) › [Campaign Management API](https://api-docs.tenjin.com/campaign-management-api.md) › Update attribution settings

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

# Update attribution settings

- **Method:** `PATCH`
- **Path:** `/v2/apps/{app_id}/integrations/{integration_id}/attribution_settings`
- **Operation ID:** `patch_apps_app_id_integrations_integration_id_attribution_settings`
- **Tags:** Attribution Settings

## 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:** `false`

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

schema: `patch_apps_app_id_integrations_integration_id_attribution_settings_Request`

- **`deterministic_click_attribution_window`**: `string | null`

  Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `30d`. A whole number of days is returned in days, so `24h` comes back as `1d`. Null uses the app's window
- **`deterministic_impression_attribution_window`**: `string | null`

  Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `30d`. A whole number of days is returned in days, so `24h` comes back as `1d`. Null uses the app's window
- **`probabilistic_click_attribution_window`**: `string | null`

  Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `3d`. A whole number of days is returned in days, so `24h` comes back as `1d`. Null uses the app's window
- **`probabilistic_impression_attribution_window`**: `string | null`

  Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `3d`. A whole number of days is returned in days, so `24h` comes back as `1d`. Null uses the app's window

**Example:**

```json
{
  "deterministic_click_attribution_window": "1d",
  "deterministic_impression_attribution_window": "1d",
  "probabilistic_click_attribution_window": "1d",
  "probabilistic_impression_attribution_window": "1d"
}
```

## Responses

### 200 The updated attribution settings

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

schema: `AttributionSettingsDocument`

- **`data` (required)**: `object`, schema: `AttributionSettingsResource`
  - **`attributes` (required)**: `object`
    - **`app_id` (required)**: `string`, format: `uuid`

      Id of the app
    - **`deterministic_click_attribution_window` (required)**: `string | null`

      Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `30d`. A whole number of days is returned in days, so `24h` comes back as `1d`; null when the app's window applies
    - **`deterministic_impression_attribution_window` (required)**: `string | null`

      Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `30d`. A whole number of days is returned in days, so `24h` comes back as `1d`; null when the app's window applies
    - **`integration_id` (required)**: `integer`

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

      Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `3d`. A whole number of days is returned in days, so `24h` comes back as `1d`; null when the app's window applies
    - **`probabilistic_impression_attribution_window` (required)**: `string | null`

      Duration literal: `0`, whole hours `1h` to `24h`, or whole days `1d` to `3d`. A whole number of days is returned in days, so `24h` comes back as `1d`; null when the app's window applies
  - **`id` (required)**: `string`, format: `uuid`
  - **`type` (required)**: `string`, possible values: `"attribution_setting"`
- **`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 updated attribution settings**

```json
{
  "data": {
    "id": "61bf5df0-73c5-4c04-a1f4-fae9aff839c1",
    "type": "attribution_setting",
    "attributes": {
      "app_id": "e5766ace-4f13-4912-91df-e404d8f8a021",
      "integration_id": 900002,
      "deterministic_click_attribution_window": "2d",
      "deterministic_impression_attribution_window": "6h",
      "probabilistic_click_attribution_window": null,
      "probabilistic_impression_attribution_window": null
    }
  },
  "links": {
    "self": "https://api.tenjin.com/v2/apps/e5766ace-4f13-4912-91df-e404d8f8a021/integrations/900002/attribution_settings"
  },
  "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.
- `AttributionSettingsDocument` — shown above.
- `patch_apps_app_id_integrations_integration_id_attribution_settings_Request` — shown above.
- `Links` — shown above.
- `AttributionSettingsResource` — shown above.
