# Update an app

Updates a particular app as specified by the App ID. Note that this is a PATCH operation, so any specified field values will replace existing values. Therefore, if you'd like to add additional configurations to an existing Conversation API app, ensure that you include existing values AND new values in the call. For example, if you'd like to add new channel_credentials, you can get your existing Conversation API app, extract the existing channel_credentials list, append your new configuration to that list, and include the updated channel_credentials list in this update call.

Endpoint: PATCH /v1/projects/{project_id}/apps/{app_id}
Version: 1.0
Security: Basic, oAuth2

## Path parameters:

  - `project_id` (string, required)
    The unique ID of the project. You can find this on the Sinch Dashboard.

  - `app_id` (string, required)
    The unique ID of the app. You can find this on the Sinch Dashboard.

## Query parameters:

  - `update_mask` (array)
    The set of field mask paths.

## Request fields (application/json):

  - `channel_credentials` (array) — one of:
    An array of channel credentials. The order of the credentials defines the app channel priority.
    - Static Bearer Authentication:
      - `static_bearer` (object)
        This object is required for channels which use a bearer-type of credential for authentication.
      - `static_bearer.claimed_identity` (string, required)
        The claimed identity for the channel.
      - `static_bearer.token` (string, required)
        The static bearer token for the channel.
    - Static Token Authentication:
      - `static_token` (object)
        This object is required for channels which use a static token credential for authentication.
      - `static_token.token` (string, required)
        The static token for the channel.
    - MMS:
      - `mms_credentials` (object)
        If you are including the MMS channel in the channel_identifier property, you must include this object.
      - `mms_credentials.account_id` (string, required)
        MMS Account ID.
      - `mms_credentials.api_key` (string, required)
        MMS API Key.
      - `mms_credentials.basic_auth` (object)
        It consists of a username and a password.
      - `mms_credentials.basic_auth.password` (string, required)
        Basic auth password.
      - `mms_credentials.basic_auth.username` (string, required)
        Basic auth username.
    - KakaoTalk:
      - `kakaotalk_credentials` (object)
        If you are including the KakaoTalk channel in the channel_identifier property, you must include this object.
      - `kakaotalk_credentials.kakaotalk_plus_friend_id` (string, required)
        KakaoTalk Business Channel ID.
      - `kakaotalk_credentials.kakaotalk_sender_key` (string, required)
        KakaoTalk Sender Key.
    - Telegram:
      - `telegram_credentials` (object)
        If you are including the Telegram Bot channel in the channel_identifier property, you must include this object.
      - `telegram_credentials.token` (string, required)
        The token for the Telegram bot to which you are connecting.
        Example: "{{TELEGRAM_BOT_TOKEN}}"
    - LINE:
      - `line_credentials` (object)
        If the channel property is set to LINE for this entry of the channel_credentials array, you must include either the line_credentials object or the line_enterprise_credentials object in the entry as well.
      - `line_credentials.token` (string, required)
        The token for the LINE channel to which you are connecting.
        Example: "{{LINE_TOKEN}}"
      - `line_credentials.secret` (string, required)
        The secret for the LINE channel to which you are connecting.
        Example: "{{LINE_SECRET}}"
      - `line_credentials.is_default` (boolean)
        When an app contains multiple LINE or LINE Enterprise credentials, one of the credentials needs to be defined as the default. Setting this property to true marks the corresponding credentials as the default credentials.
    - LINE Enterprise:
      - `line_enterprise_credentials` (object) — one of:
        If the channel property is set to LINE for this entry of the channel_credentials array, you must include either the line_credentials object or the line_enterprise_credentials object in the entry as well.
        - LINE Credentials Japan:
          - `line_japan` (object)
          - `line_japan.token` (string, required)
            The token for the LINE channel to which you are connecting.
            Example: "{{LINE_TOKEN}}"
          - `line_japan.secret` (string, required)
            The secret for the LINE channel to which you are connecting.
            Example: "{{LINE_SECRET}}"
          - `is_default` (boolean)
            When an app contains multiple LINE or LINE Enterprise credentials, one of the credentials needs to be defined as the default. Setting this property to true marks the corresponding credentials as the default credentials.
        - LINE Credentials Thailand:
          - `line_thailand` (object)
          - `line_thailand.token` (string, required)
            The token for the LINE channel to which you are connecting.
            Example: "{{LINE_TOKEN}}"
          - `line_thailand.secret` (string, required)
            The secret for the LINE channel to which you are connecting.
            Example: "{{LINE_SECRET}}"
          - `is_default` (boolean)
            When an app contains multiple LINE or LINE Enterprise credentials, one of the credentials needs to be defined as the default. Setting this property to true marks the corresponding credentials as the default credentials.
    - WeChat:
      - `wechat_credentials` (object)
        If you are including the WeChat channel in the channel_identifier property, you must include this object.
      - `wechat_credentials.app_id` (string, required)
        The AppID(Developer ID) for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_APPID}}"
      - `wechat_credentials.app_secret` (string, required)
        The AppSecret(Developer Password) for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_APPSECRET}}"
      - `wechat_credentials.token` (string, required)
        The Token for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_TOKEN}}"
      - `wechat_credentials.aes_key` (string, required)
        The Encoding AES Key for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_AESKEY}}"
    - Instagram:
      - `instagram_credentials` (object)
        If you are including the INSTAGRAM channel in the channel_identifier property, you must include this object.
      - `instagram_credentials.token` (string, required)
        The static token.
      - `instagram_credentials.business_account_id` (string)
        Required if using the Sinch Facebook App.
    - Apple Business Chat:
      - `applebc_credentials` (object)
        If you are including the AppleBC channel in the channel_identifier property, you must include this object.
      - `applebc_credentials.business_chat_account_id` (string, required)
        The ID that identifies a Business Chat Account (BCA).
      - `applebc_credentials.merchant_id` (string)
        Merchant ID, required if our client wants to use Apple Pay.
      - `applebc_credentials.apple_pay_certificate_reference` (string)
        Certificate reference, required if our client wants to use Apple Pay.
      - `applebc_credentials.apple_pay_certificate_password` (string)
        Certificate password, required if our client wants to use Apple Pay.
    - KakaoTalkChat:
      - `kakaotalkchat_credentials` (object)
        If you are including the KakaoTalkChat channel in the channel_identifier property, you must include this object.
      - `kakaotalkchat_credentials.kakaotalk_plus_friend_id` (string, required)
        Kakaotalk Plus friend ID.
      - `kakaotalkchat_credentials.api_key` (string)
        InfoBank API KEY.

  - `channel_credentials.callback_secret` (string)
    The secret used to verify the channel callbacks
for channels which support callback verification.
The callback verification is not needed for Sinch-managed
channels because the callbacks are not leaving
Sinch internal networks.
Max length is 256 characters.
Note: leaving channel_callback_secret empty for channels with
callback verification will disable the verification.

  - `channel_credentials.channel` (string)
    The identifier of the channel you want to include. Must be one of the enum values.
    Enum: "WHATSAPP", "RCS", "SMS", "MESSENGER", "VIBERBM", "MMS", "INSTAGRAM", "TELEGRAM", "KAKAOTALK", "KAKAOTALKCHAT", "LINE", "WECHAT", "APPLEBC"

  - `channel_credentials.credential_ordinal_number` (integer)
    The ordinal number of the credential. This field is used when the application supports multiple credential integrations per channel. Currently, this is only applicable to the LINE channel. For other channels, this value will always be set to 0. In the case in which there are multiple credential integrations per channel on a single app, this field must have a unique value for each multi-credential channel entry.

  - `conversation_metadata_report_view` (string)
    NONE - Omit metadata.
FULL - Include all metadata assigned to the conversation.
    Enum: "NONE", "FULL"

  - `display_name` (string)
    The display name for the app.
    Example: "Sinch Conversation API Demo App 001"

  - `retention_policy` (object)
    The retention policy configured for the app. For more information about retention policies, see [Retention Policy](https://developers.sinch.com/docs/conversation/keyconcepts/#retention-policy).

  - `retention_policy.retention_type` (string)
    Enum: "MESSAGE_EXPIRE_POLICY", "CONVERSATION_EXPIRE_POLICY", "PERSIST_RETENTION_POLICY"

  - `retention_policy.ttl_days` (integer)
    Optional. The days before a message or conversation is eligible for deletion.
Default value is 180. The ttl_days value has no effect when retention_type
is PERSIST_RETENTION_POLICY. The valid values for this field are [1 - 3650].
Note that retention cleanup job runs once every twenty-four hours
which can lead to delay i.e., messages and conversations are not deleted on
the minute they become eligible for deletion.

  - `dispatch_retention_policy` (object)
    The retention policy configured for messages in [Dispatch Mode](https://developers.sinch.com/docs/conversation/processing-modes/). Currently only MESSAGE_EXPIRE_POLICY is available. For more information about retention policies, see [Retention Policy](https://developers.sinch.com/docs/conversation/keyconcepts/#retention-policy).

  - `dispatch_retention_policy.retention_type` (string)
    Enum: "MESSAGE_EXPIRE_POLICY"

  - `dispatch_retention_policy.ttl_days` (integer)
    Optional. The days before a message is eligible for deletion. The valid range is [0 - 7]. In the case of a 0 day TTL, messages aren't stored at all.
Note the retention cleanup job runs once every twenty-four hours, so messages are not deleted on the minute they become eligible for deletion.

  - `processing_mode` (string)
    Whether or not Conversation API should store contacts and conversations for the app. For more information, see [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/).
    Enum: "CONVERSATION", "DISPATCH"

  - `smart_conversation` (object)
    This object is required for apps that subscribe to Smart Conversations features.

  - `smart_conversation.enabled` (boolean)
    Set to true to allow messages processed by this app to be analyzed by Smart Conversations.

  - `callback_settings` (object)
    This object contains additional settings related to callback processing.

  - `callback_settings.secret_for_overridden_callback_urls` (string)
    Optional. Secret can be used to sign contents of delivery receipts for a message that was sent with the default callback URL overridden (using the [callback_url field](https://developers.sinch.com/docs/conversation/api-reference/conversation/tag/Messages/#tag/Messages/operation/Messages_SendMessage!path=callback_url&t=request)). You can then use the secret to verify the signature.

  - `message_retry_settings` (object)
    This object contains settings related to message retry mechanism.

  - `message_retry_settings.retry_duration` (integer)
    The maximum duration, in seconds, during which the system will retry sending a message in the event of a temporary processing failure. Time is counted after the first message processing failure. At least one retry is guaranteed. Subsequent retry instances are randomized with exponential backoff. If the next retry timestamp exceeds the configured time, one final retry will be performed on the cut-off time. The valid values for this field are [30 - 3600].

  - `delivery_report_based_fallback` (object)
    This object contains additional settings related to [delivery report based fallback](https://developers.sinch.com/docs/conversation/keyconcepts/#delivery-report-base-message-fallback). Note that this is paid functionality.

  - `delivery_report_based_fallback.enabled` (boolean)
    Optional. A flag specifying whether this app has enabled fallback message delivery upon no positive delivery report. This feature is applicable only to messages which are sent to a recipient with more than one channel identity. Identities must be defined on channels which support at least the 'DELIVERED' message state. Please note that this functionality requires payment.

  - `delivery_report_based_fallback.delivery_report_waiting_time` (integer)
    Optional. The time, in seconds, after which a message without a positive delivery report will fallback to the next channel.

## Response 200 fields (application/json):

  - `channel_credentials` (array) — one of:
    - Static Bearer Authentication:
      - `static_bearer` (object)
        This object is required for channels which use a bearer-type of credential for authentication.
      - `static_bearer.claimed_identity` (string, required)
        The claimed identity for the channel.
      - `static_bearer.token` (string, required)
        The static bearer token for the channel.
    - Static Token Authentication:
      - `static_token` (object)
        This object is required for channels which use a static token credential for authentication.
      - `static_token.token` (string, required)
        The static token for the channel.
    - MMS:
      - `mms_credentials` (object)
        If you are including the MMS channel in the channel_identifier property, you must include this object.
      - `mms_credentials.account_id` (string, required)
        MMS Account ID.
      - `mms_credentials.api_key` (string, required)
        MMS API Key.
      - `mms_credentials.basic_auth` (object)
        It consists of a username and a password.
      - `mms_credentials.basic_auth.password` (string, required)
        Basic auth password.
      - `mms_credentials.basic_auth.username` (string, required)
        Basic auth username.
    - KakaoTalk:
      - `kakaotalk_credentials` (object)
        If you are including the KakaoTalk channel in the channel_identifier property, you must include this object.
      - `kakaotalk_credentials.kakaotalk_plus_friend_id` (string, required)
        KakaoTalk Business Channel ID.
      - `kakaotalk_credentials.kakaotalk_sender_key` (string, required)
        KakaoTalk Sender Key.
    - Telegram:
      - `telegram_credentials` (object)
        If you are including the Telegram Bot channel in the channel_identifier property, you must include this object.
      - `telegram_credentials.token` (string, required)
        The token for the Telegram bot to which you are connecting.
        Example: "{{TELEGRAM_BOT_TOKEN}}"
    - LINE:
      - `line_credentials` (object)
        If the channel property is set to LINE for this entry of the channel_credentials array, you must include either the line_credentials object or the line_enterprise_credentials object in the entry as well.
      - `line_credentials.token` (string, required)
        The token for the LINE channel to which you are connecting.
        Example: "{{LINE_TOKEN}}"
      - `line_credentials.secret` (string, required)
        The secret for the LINE channel to which you are connecting.
        Example: "{{LINE_SECRET}}"
      - `line_credentials.is_default` (boolean)
        When an app contains multiple LINE or LINE Enterprise credentials, one of the credentials needs to be defined as the default. Setting this property to true marks the corresponding credentials as the default credentials.
    - LINE Enterprise:
      - `line_enterprise_credentials` (object) — one of:
        If the channel property is set to LINE for this entry of the channel_credentials array, you must include either the line_credentials object or the line_enterprise_credentials object in the entry as well.
        - LINE Credentials Japan:
          - `line_japan` (object)
          - `line_japan.token` (string, required)
            The token for the LINE channel to which you are connecting.
            Example: "{{LINE_TOKEN}}"
          - `line_japan.secret` (string, required)
            The secret for the LINE channel to which you are connecting.
            Example: "{{LINE_SECRET}}"
          - `is_default` (boolean)
            When an app contains multiple LINE or LINE Enterprise credentials, one of the credentials needs to be defined as the default. Setting this property to true marks the corresponding credentials as the default credentials.
        - LINE Credentials Thailand:
          - `line_thailand` (object)
          - `line_thailand.token` (string, required)
            The token for the LINE channel to which you are connecting.
            Example: "{{LINE_TOKEN}}"
          - `line_thailand.secret` (string, required)
            The secret for the LINE channel to which you are connecting.
            Example: "{{LINE_SECRET}}"
          - `is_default` (boolean)
            When an app contains multiple LINE or LINE Enterprise credentials, one of the credentials needs to be defined as the default. Setting this property to true marks the corresponding credentials as the default credentials.
    - WeChat:
      - `wechat_credentials` (object)
        If you are including the WeChat channel in the channel_identifier property, you must include this object.
      - `wechat_credentials.app_id` (string, required)
        The AppID(Developer ID) for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_APPID}}"
      - `wechat_credentials.app_secret` (string, required)
        The AppSecret(Developer Password) for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_APPSECRET}}"
      - `wechat_credentials.token` (string, required)
        The Token for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_TOKEN}}"
      - `wechat_credentials.aes_key` (string, required)
        The Encoding AES Key for the WeChat channel to which you are connecting.
        Example: "{{WECHAT_AESKEY}}"
    - Instagram:
      - `instagram_credentials` (object)
        If you are including the INSTAGRAM channel in the channel_identifier property, you must include this object.
      - `instagram_credentials.token` (string, required)
        The static token.
      - `instagram_credentials.business_account_id` (string)
        Required if using the Sinch Facebook App.
    - Apple Business Chat:
      - `applebc_credentials` (object)
        If you are including the AppleBC channel in the channel_identifier property, you must include this object.
      - `applebc_credentials.business_chat_account_id` (string, required)
        The ID that identifies a Business Chat Account (BCA).
      - `applebc_credentials.merchant_id` (string)
        Merchant ID, required if our client wants to use Apple Pay.
      - `applebc_credentials.apple_pay_certificate_reference` (string)
        Certificate reference, required if our client wants to use Apple Pay.
      - `applebc_credentials.apple_pay_certificate_password` (string)
        Certificate password, required if our client wants to use Apple Pay.
    - KakaoTalkChat:
      - `kakaotalkchat_credentials` (object)
        If you are including the KakaoTalkChat channel in the channel_identifier property, you must include this object.
      - `kakaotalkchat_credentials.kakaotalk_plus_friend_id` (string, required)
        Kakaotalk Plus friend ID.
      - `kakaotalkchat_credentials.api_key` (string)
        InfoBank API KEY.

  - `conversation_metadata_report_view` (string)
    NONE - Omit metadata.
FULL - Include all metadata assigned to the conversation.
    Enum: same as `conversation_metadata_report_view` (2 values)

  - `display_name` (string)
    The display name for the app.
    Example: "Sinch Conversation API Demo App 001"

  - `id` (string)
    The ID of the app. You can find this on the [Sinch Dashboard](https://dashboard.sinch.com/convapi/apps).
    Example: "{APP_ID}"

  - `rate_limits` (object)

  - `rate_limits.inbound` (integer)
    The number of inbound messages/events we process per second,
from underlying channels to the app.  The default rate limit is 25.

  - `rate_limits.outbound` (integer)
    The number of messages/events we process per second, from the
app to the underlying channels. Note that underlying channels may have other
rate limits.  The default rate limit is 25.

  - `rate_limits.webhooks` (integer)
    The rate limit of callbacks sent to the webhooks registered
for the app. Note that if you have multiple webhooks with shared triggers,
multiple callbacks will be sent out for each triggering event. The default rate limit is 25.

  - `retention_policy` (object)
    The retention policy configured for the app. For more information about retention policies, see [Retention Policy](https://developers.sinch.com/docs/conversation/keyconcepts/#retention-policy).

  - `dispatch_retention_policy` (object)
    The retention policy configured for messages in [Dispatch Mode](https://developers.sinch.com/docs/conversation/processing-modes/). Currently only MESSAGE_EXPIRE_POLICY is available. For more information about retention policies, see [Retention Policy](https://developers.sinch.com/docs/conversation/keyconcepts/#retention-policy).

  - `processing_mode` (string)
    Whether or not Conversation API should store contacts and conversations for the app. For more information, see [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/).
    Enum: same as `processing_mode` (2 values)

  - `smart_conversation` (object)
    This object is required for apps that subscribe to Smart Conversations features.

  - `queue_stats` (object)

  - `queue_stats.outbound_size` (integer)
    The current size of the App's MT queue.

  - `queue_stats.outbound_limit` (integer)
    The limit of the App's MT queue. The default limit is 500000 messages.

  - `callback_settings` (object)
    This object contains additional settings related to callback processing.

  - `delivery_report_based_fallback` (object)
    This object contains additional settings related to [delivery report based fallback](https://developers.sinch.com/docs/conversation/keyconcepts/#delivery-report-base-message-fallback). Note that this is paid functionality.

  - `message_retry_settings` (object)
    This object contains settings related to message retry mechanism.

## Response 400 fields (application/json):

  - `error` (object)

  - `error.code` (integer)

  - `error.details` (array)

  - `error.details.type_url` (string)

  - `error.details.value` (string)

  - `error.message` (string)

  - `error.status` (string)


