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

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

# Update an app

- **Method:** `PATCH`
- **Path:** `/v2/apps/{id}`
- **Operation ID:** `patch_apps_id`
- **Tags:** Apps

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

- **`id` (required)**: `string`, format: `uuid`

  Id of the app

## Request body

**Required:** `false`

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

schema: `patch_apps_id_Request`

- **`amazon_shared_secret`**: `string`

  Amazon Appstore shared key, used to validate in-app purchases
- **`destination_url`**: `string`

  Download URL of an `android_other` app
- **`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 resets it to the default
- **`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 resets it to the default
- **`facebook_referrer_decryption_key`**: `string`, minLength: `64`, maxLength: `64`

  Meta install referrer decryption key, 64 characters, used to decrypt Meta attribution data of an Android app
- **`ios_shared_secret`**: `string`

  App Store shared secret, used to track subscription revenue
- **`match_strings`**: `string`, maxLength: `255`

  Comma-separated strings that match campaigns to the app
- **`name`**: `string`, maxLength: `255`

  Name of the app
- **`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 resets it to the default
- **`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 resets it to the default
- **`protocol`**: `string`, maxLength: `255`

  URL scheme of the app, used for Meta deep links
- **`public_key`**: `string`

  Google Play public key, used to validate in-app purchases

**Example:**

```json
{
  "name": "",
  "public_key": "",
  "ios_shared_secret": "",
  "amazon_shared_secret": "",
  "match_strings": "",
  "protocol": "",
  "facebook_referrer_decryption_key": "",
  "destination_url": "",
  "deterministic_click_attribution_window": "1d",
  "deterministic_impression_attribution_window": "1d",
  "probabilistic_click_attribution_window": "1d",
  "probabilistic_impression_attribution_window": "1d"
}
```

## Responses

### 200 The updated app

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

schema: `AppDocument`

- **`data` (required)**: `object`, schema: `AppResource`
  - **`attributes` (required)**: `object`
    - **`amazon_shared_secret` (required)**: `string | null`

      Amazon Appstore shared key, used to validate in-app purchases
    - **`bundle_id` (required)**: `string | null`

      Bundle id of the app in its store
    - **`created_at` (required)**: `string | null`, format: `date-time`

      When the app was added to Tenjin
    - **`deterministic_click_attribution_window` (required)**: `string`

      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`
    - **`deterministic_impression_attribution_window` (required)**: `string`

      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`
    - **`developer_name` (required)**: `string | null`

      Name of the app developer
    - **`facebook_referrer_decryption_key` (required)**: `string | null`

      Meta install referrer decryption key, used to decrypt Meta attribution data of an Android app
    - **`ios_shared_secret` (required)**: `string | null`

      App Store shared secret, used to track subscription revenue
    - **`match_strings` (required)**: `array of string`

      Strings that match campaigns to the app
    - **`name` (required)**: `string | null`

      Name of the app
    - **`platform` (required)**: `string | null`, possible values: `"amazon", "android", "android_other", "ios", "windows", "unspecified", null`

      Platform of the app
    - **`price` (required)**: `integer | null`, minimum: `0`

      Price of the app in its store
    - **`probabilistic_click_attribution_window` (required)**: `string`

      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`
    - **`probabilistic_impression_attribution_window` (required)**: `string`

      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`
    - **`protocol` (required)**: `string | null`

      URL scheme of the app, used for Meta deep links
    - **`public_key` (required)**: `string | null`

      Google Play public key, used to validate in-app purchases
    - **`rating` (required)**: `string | null`, pattern: `^\d\.\d$`

      Rating of the app in its store: a decimal number as a string
    - **`released_on` (required)**: `string | null`, format: `date`

      Release date of the app in its store
    - **`sending_events` (required)**: `boolean`

      Whether Tenjin has received events of the app
    - **`store_id` (required)**: `string | null`

      Id of the app in its store
  - **`id` (required)**: `string`, format: `uuid`
  - **`type` (required)**: `string`, possible values: `"app"`
- **`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 app**

```json
{
  "data": {
    "id": "17ef8c1a-5729-456e-98db-ccc104bdf860",
    "type": "app",
    "attributes": {
      "name": "This is an app",
      "bundle_id": "com.this.IsAnApp",
      "platform": "ios",
      "public_key": null,
      "ios_shared_secret": null,
      "store_id": "655745678",
      "released_on": "2013-09-09",
      "rating": "4.5",
      "price": 0,
      "developer_name": "Tenjin",
      "match_strings": [],
      "protocol": null,
      "facebook_referrer_decryption_key": null,
      "created_at": "2019-07-21T21:50:20.591Z",
      "sending_events": true,
      "amazon_shared_secret": null,
      "deterministic_click_attribution_window": "1d",
      "deterministic_impression_attribution_window": "1d",
      "probabilistic_click_attribution_window": "1d",
      "probabilistic_impression_attribution_window": "1d"
    }
  },
  "links": {
    "self": "https://api.tenjin.com/v2/apps/17ef8c1a-5729-456e-98db-ccc104bdf860"
  },
  "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, 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.
- `AppDocument` — shown above.
- `patch_apps_id_Request` — shown above.
- `Links` — shown above.
- `AppResource` — shown above.
