> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Register webhook

> Registers a webhook for the Client ID provided in the request.

One Client ID can register up to three webhooks for every `action`. The `license` webhooks will be enabled automatically when the application is installed on the license.

For `bot` webhooks, you need to create a bot, register webhooks, and then call Set Routing Status.

**Required scopes:** <Tooltip tip="Token scopes are assigned to an access token, not to an application (Client ID). We recommend authorizing with a Personal Access Token (PAT) that has the webhooks.configuration:rw scope.">`webhooks.configuration:rw`</Tooltip>


## OpenAPI

````yaml /api/configuration/v3.5/openapi.json post /action/register_webhook
openapi: 3.1.0
info:
  title: Configuration API
  version: v3.5
servers:
  - url: https://api.livechatinc.com/v3.5/configuration
security:
  - PersonalAccessToken: []
  - OAuth2BearerToken: []
paths:
  /action/register_webhook:
    post:
      tags:
        - Webhooks
      summary: Register webhook
      description: >-
        Registers a webhook for the Client ID provided in the request.


        One Client ID can register up to three webhooks for every `action`. The
        `license` webhooks will be enabled automatically when the application is
        installed on the license.


        For `bot` webhooks, you need to create a bot, register webhooks, and
        then call Set Routing Status.
      operationId: register-webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterWebhookRequest'
            example:
              url: http://myservice.com/webhooks
              description: Test webhook
              action: chat_deactivated
              secret_key: laudla991lamda0pnoaa0
              owner_client_id: asXdesldiAJSq9padj
              type: license
      responses:
        '200':
          description: Webhook registered successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterWebhookResponse'
              example:
                id: pqi8oasdjahuakndw9nsad9na
components:
  schemas:
    RegisterWebhookRequest:
      type: object
      required:
        - action
        - secret_key
        - url
        - owner_client_id
        - type
      properties:
        action:
          type: string
          description: >-
            The action that triggers sending a webhook. Possible values include
            `incoming_chat`, `chat_deactivated`, `chat_access_updated`,
            `chat_transferred`, `user_added_to_chat`, `user_removed_from_chat`,
            `incoming_event`, `event_deleted`, `event_updated`,
            `incoming_rich_message_postback`, `chat_properties_updated`,
            `chat_properties_deleted`, `thread_properties_updated`,
            `thread_properties_deleted`, `event_properties_updated`,
            `event_properties_deleted`, `thread_tagged`, `thread_untagged`,
            `routing_status_set`, `customer_session_fields_updated`,
            `events_marked_as_seen`, `group_created`, `group_updated`,
            `group_deleted`, `agent_created`, `agent_updated`, `agent_deleted`,
            `agent_suspended`, `agent_unsuspended`, `agent_approved`,
            `bot_created`, `bot_updated`, `bot_deleted`,
            `auto_accesses_updated`, `tag_created`, `tag_deleted`,
            `tag_updated`, `thread_summary_set`.
        secret_key:
          type: string
          description: The secret key sent in webhooks to verify the source of a webhook.
        url:
          type: string
          description: The destination URL for the webhook.
          maxLength: 500
        additional_data:
          type: array
          items:
            type: string
          description: >-
            Additional data arriving with the webhook. Possible values:
            `chat_properties`, `chat_presence_user_ids` (all actions except for
            `agent_status_changed`, `agent_deleted`).
        description:
          type: string
          description: The webhook description.
        filters:
          $ref: '#/components/schemas/WebhookFilters'
        owner_client_id:
          type: string
          description: >-
            The Client ID that will own the webhook. Must be owned by your
            organization.
        type:
          type: string
          enum:
            - bot
            - license
          description: The webhook type.
    RegisterWebhookResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the registered webhook.
    WebhookFilters:
      type: object
      properties:
        author_type:
          $ref: '#/components/schemas/WebhookFiltersAuthorType'
        only_my_chats:
          type: boolean
          description: >-
            If set to `true`: triggers webhooks only for chats with the property
            `source.client_id` set to my `client_id`.
        chat_presence:
          $ref: '#/components/schemas/WebhookChatPresenceFilter'
        source_type:
          type: array
          items:
            type: string
          description: >-
            An array of source types. If the source which triggered the webhook
            matches the filter, the webhook will be sent.


            - `my_client` — client ID of your app.

            - `other_clients` — client IDs other than your app's.

            - `system` — no client ID.
      description: The filters to check if a webhook should be triggered.
    WebhookFiltersAuthorType:
      type: string
      enum:
        - customer
        - agent
      description: >-
        The author type filter. Allowed only for the `incoming_event` and
        `event_updated` actions.
    WebhookChatPresenceFilter:
      type: object
      properties:
        user_ids:
          $ref: '#/components/schemas/WebhookChatPresenceUserIds'
        my_bots:
          type: boolean
          description: >-
            If set to `true`: if any bot owned by `owner_client_id` is in the
            chat, the webhook will be triggered.
      description: >-
        The filters to check if a webhook should be triggered based on user's
        presence in the chat.
    WebhookChatPresenceUserIds:
      type: object
      properties:
        values:
          type: array
          items:
            type: string
          description: >-
            An array of user IDs. If any specified user is in the chat, the
            webhook will be triggered.
        exclude_values:
          type: array
          items:
            type: string
          description: >-
            An array of user IDs. If any specified user is in the chat, the
            webhook will not be triggered.
      description: >-
        Only one filter (`values` or `exclude_values`) is allowed. Supports
        every user type (agent, customer).
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: basic
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
    OAuth2BearerToken:
      type: http
      scheme: bearer
      description: Authenticate using an OAuth 2.0 Bearer token.
      x-example: us-south1:MQraNrGCsoJvtxD7KNJQB1kM3d5

````