openapi: 3.1.0
info:
  title: Custom Social Profile API
  description: |
    Custom Social Profile lets enterprises connect a proprietary messaging channel to Hootsuite Inbox. Agents receive customer messages and reply from Inbox while your system remains the channel runtime.

    ## Integration model

    The API documents two **provider APIs** — the **Integrator API** (implemented by you) and the **Hootsuite API** (implemented by Hootsuite). Both are secured with **HMAC** (`X-Hootsuite-Signature`) on every request. One shared secret is provisioned per Custom Social Profile integration. The sender signs the raw request body; the receiver verifies the signature before processing.

    Ownership is **contact-scoped** — there is no `conversation` object in the public contract. The integrator-native `contact.id` is the canonical identifier for routing, ownership, and messaging.

    ## Configure your integration

    1. In Inbox admin settings, create the Custom Social Profile channel and note the **shared secret** and **Hootsuite webhook delivery URL** shown on the social profile settings page (`https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}`).
    2. Provide Hootsuite with your **integrator base URL**. Hootsuite appends:
       - `/inbox/v1/custom-social-profile/messages` — Hootsuite calls this path to send an outbound message.
       - `/inbox/v1/custom-social-profile/events` — Hootsuite → integrator webhook events (`OWNERSHIP_TAKEN`, `OWNERSHIP_RELEASED`).
    3. Store credentials securely. Rotate the shared secret through your Hootsuite contact if it is compromised.

    ## Contact identity

    - `contact.id` is your integrator-native identifier.
    - `primaryIdentifier` and `secondaryIdentifier` are optional on `INBOUND_MESSAGE_RECEIVED` and `OUTBOUND_MESSAGE_SENT`. A message stream may start with either event; both use the same `contact` object.
    - When identifiers are not provided, Hootsuite may display a generated human-readable alias until non-empty values are sent.
    - Non-empty values on later message events update the contact (last apply wins), so identifiers can change mid-thread. Omission, empty, and null do not clear existing values.

    ## Contact attributes

    On `INBOUND_MESSAGE_RECEIVED` and `OUTBOUND_MESSAGE_SENT` only, you may include optional `contact.attributes`: a map of org contact-attribute **aliases** to string values.

    - Keys must match org attribute definition aliases (**case-sensitive** exact match).
    - A known alias creates or updates the value; unknown aliases are ignored.
    - Updates are a **partial merge** onto the contact.
    - An empty string (`""`) clears a known alias.
    - Do **not** send `attributes` on ownership events or on Hootsuite → integrator events.

    ## Topics

    On `INBOUND_MESSAGE_RECEIVED` and `OUTBOUND_MESSAGE_SENT` only, you may include optional `topics`: an array of org topic **names** (strings).

    - Names must match org-defined topics (**case-sensitive** exact match).
    - Known topics are **added** to the conversation associated with the contact; unknown names are ignored.
    - Updates are **additive** — each event adds topics; omitting `topics` leaves existing topics unchanged; an empty array (`[]`) is a no-op.
    - Re-applying a topic already on the conversation is a no-op.
    - Duplicate names within the same request are deduplicated. Leading and trailing whitespace is trimmed; empty or whitespace-only entries are rejected with `400`.
    - Topics apply even when the integrator holds external ownership.
    - Do **not** send `topics` on ownership events.

    ## Outbound message flow

    1. Hootsuite calls your **send outbound message** REST command at `POST /inbox/v1/custom-social-profile/messages`.
    2. Your service returns `message.id` immediately in the `2xx` response (integrator-generated).
    3. Hootsuite adds the outbound message to the agent conversation using that ID.

    An `OUTBOUND_MESSAGE_SENT` webhook with the same `message.id` is **optional** after this path — not required, and not wrong if you send it. The main use of [`OUTBOUND_MESSAGE_SENT`](/api-reference/inbox-custom-social-profile/csp-outbound-message-sent/) is outbound messages sent on your channel **outside** Inbox, so Hootsuite can record them.

    ## Keeping ownership

    When your system holds contact-scoped ownership, the conversation is **hidden** from Inbox human agents and virtual agents. External ownership lasts **one day** by default from the last successful `OWNERSHIP_TAKEN`.

    If you need to keep owning longer, send `OWNERSHIP_TAKEN` again before that window ends — each take renews the duration. You can also take ownership **mid-thread** after messages have already been exchanged.

    If external ownership is removed (including when that window ends without renewal), the conversation becomes **visible** to human agents again and Hootsuite treats the contact as **not externally owned** (Hootsuite or an agent can own it).

    ## Ownership flows

    The safe pattern is to take ownership before your automation messages the contact, so Inbox agents and VAs do not see the thread while you own it. See [Integrator › Webhooks](/api-reference/inbox-custom-social-profile/csp-integrator-webhooks/) and [Hootsuite › Webhooks](/api-reference/inbox-custom-social-profile/csp-hootsuite-webhooks/) for payload details.

    ### Flow 1 — Own, message, hand back to a human

    Take ownership, exchange messages while hidden from Inbox agents/VAs, then release **without** `finishedBy` so a human can continue in Hootsuite.

    ```mermaid
    sequenceDiagram
      participant Integrator
      participant Hootsuite
      participant Agent as Inbox agent
      Integrator->>Hootsuite: OWNERSHIP_TAKEN
      Note over Hootsuite: Conversation hidden from agents/VAs
      Integrator->>Hootsuite: INBOUND_MESSAGE_RECEIVED / OUTBOUND_MESSAGE_SENT
      Integrator->>Hootsuite: OWNERSHIP_RELEASED (no finishedBy)
      Note over Hootsuite: Visible for human handling
      Agent->>Hootsuite: Continues conversation
    ```

    1. Send `OWNERSHIP_TAKEN` for `contact.id` (before messaging, or mid-thread).
    2. While you own the contact, send message events as needed (`INBOUND_MESSAGE_RECEIVED`, `OUTBOUND_MESSAGE_SENT`, and/or handle Hootsuite `POST …/messages`). The conversation stays hidden from Inbox agents and VAs.
    3. Send `OWNERSHIP_RELEASED` **without** `finishedBy` to hand ownership back. The conversation becomes visible for a human agent in Hootsuite.

    ### Flow 2 — Own, then finish and resolve

    Same ownership start as Flow 1, but release **with** `finishedBy` so Hootsuite resolves the conversation into the resolved queue.

    ```mermaid
    sequenceDiagram
      participant Integrator
      participant Hootsuite
      Integrator->>Hootsuite: OWNERSHIP_TAKEN
      Note over Hootsuite: Conversation hidden from agents/VAs
      Integrator->>Hootsuite: Message events while owned
      Integrator->>Hootsuite: OWNERSHIP_RELEASED + finishedBy BOT or HUMAN
      Note over Hootsuite: Conversation resolved (resolved queue)
    ```

    1. Send `OWNERSHIP_TAKEN` (and message while owned, as in Flow 1).
    2. When the interaction is complete, send `OWNERSHIP_RELEASED` with `finishedBy.type`:
       - `BOT` — your automation finished the contact (typical integrator-bot path).
       - `HUMAN` — a human in **your** system (HITL) finished the contact; you are attributing the resolve reason as human.
    3. Hootsuite **resolves** the conversation; it appears in the **resolved** queue.

    ### Flow 3 — Inbox ownership sync (Hootsuite → integrator)

    When Inbox takes or releases ownership of a contact, Hootsuite POSTs the matching event to your integrator. Treat these as **authoritative state sync** for contact-scoped ownership on the Hootsuite side.

    ```mermaid
    sequenceDiagram
      participant Hootsuite
      participant Integrator
      Hootsuite->>Integrator: OWNERSHIP_TAKEN
      Note over Integrator: Clear local external-ownership assumption
      Hootsuite->>Integrator: OWNERSHIP_RELEASED
      Note over Integrator: Sync local ownership state
    ```

    1. Inbox takes ownership of the contact — Hootsuite POSTs `OWNERSHIP_TAKEN` with `contact.id`. Clear any local assumption that your integrator still holds external ownership for that contact.
    2. Inbox releases ownership of the contact — Hootsuite POSTs `OWNERSHIP_RELEASED` with `contact.id`. Update your local ownership state accordingly.

    `OWNERSHIP_TAKEN` and `OWNERSHIP_RELEASED` use the **same type strings** in both directions. Discriminate by who POSTs and which URL receives the request.

    ## Webhook delivery

    ### Integrator → Hootsuite

    POST integrator-fired events to the Hootsuite delivery URL shown on your Custom Social Profile settings page:

    ```
    https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}
    ```

    Replace `{socialProfileId}` with the profile ID from channel settings. The profile ID appears **only in the URL** — it is not included in event payloads.

    ### Hootsuite → Integrator

    Hootsuite delivers events to your registered integrator base URL with the path suffix `/inbox/v1/custom-social-profile/events`:

    ```
    {integratorBaseUrl}/inbox/v1/custom-social-profile/events
    ```

    Route by the `type` field in the request body. Supported types are `OWNERSHIP_TAKEN` and `OWNERSHIP_RELEASED` (shared webhook envelope plus `data.contact.id` only).

    Return `200` for unknown future `type` values you do not yet handle. Respond with `400` for malformed payloads, `401` when signature verification fails, and `5xx` for temporary processing failures — Hootsuite retries `5xx` with exponential backoff.

    ## HMAC authentication

    Every Custom Social Profile request — integrator-fired webhooks, Hootsuite REST commands, and Hootsuite-fired webhooks — includes an `X-Hootsuite-Signature` header.

    The signature is an `HMAC-SHA256` digest of the **raw request body** using the integration shared secret. Both the secret and the signature are hexadecimal strings. Convert the secret from hex to binary before computing the HMAC.

    Example request (integrator-fired event):

    ```shell
    curl -X POST https://webhooks.hootsuite.com/custom/webhook/{socialProfileId} \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'X-Hootsuite-Signature: e6f93239a06e46ae9654fc9ad2fb4e1cc4eb213830a0d94e711570c047e43c57' \
      -d '{
            "type": "INBOUND_MESSAGE_RECEIVED",
            "version": 1,
            "timestamp": "2026-07-13T09:43:26.635984618Z",
            "idempotencyKey": "6ebc6a78-d9e9-48be-b172-51eda40b7af8",
            "data": {
              "contact": { "id": "cust-9f3a2b1c", "primaryIdentifier": "Jane Customer" },
              "message": { "id": "msg-1", "text": "Hello", "timestamp": "2026-07-13T09:43:26.635984618Z" }
            }
          }'
    ```

    Node.js verification example:

    ```javascript
    const crypto = require("crypto");
    const secret = "..."; // integration shared secret — do not share
    const expectedSignature = request.headers["x-hootsuite-signature"];
    const actualSignature = crypto
      .createHmac("sha256", Buffer.from(secret, "hex"))
      .update(request.rawBody, "utf-8")
      .digest("hex");
    if (actualSignature !== expectedSignature) {
      throw new Error("X-Hootsuite-Signature verification failed");
    }
    ```

    Calculate the signature from the body **before** JSON deserialization. Whitespace in the body is significant.

    To mitigate replay attacks, verify that `timestamp` in webhook envelopes is no older than five minutes.
  version: v1
  contact:
    email: dev.support@hootsuite.com
  license:
    name: Hootsuite Developer Terms and API License Agreement
    url: https://hootsuite.com/legal/dev-api-terms
tags:
  - name: csp_integrator_webhooks
    x-displayName: Integrator › Webhooks
    description: |
      You send events to Hootsuite with an HTTP POST to:

      `https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}`

      Sign each request with `X-Hootsuite-Signature`. See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

      ### Events

      - [`INBOUND_MESSAGE_RECEIVED`](/api-reference/inbox-custom-social-profile/csp-inbound-message-received/) — inbound message from a contact (optional `contact.attributes`, `topics`)
      - [`OUTBOUND_MESSAGE_SENT`](/api-reference/inbox-custom-social-profile/csp-outbound-message-sent/) — outbound on your channel outside Inbox (main use); optional after send-outbound-message with the same `message.id` (optional `contact.attributes`, `topics`)
      - [`OWNERSHIP_TAKEN`](/api-reference/inbox-custom-social-profile/csp-ownership-taken/) — your side takes contact-scoped ownership
      - [`OWNERSHIP_RELEASED`](/api-reference/inbox-custom-social-profile/csp-ownership-released/) — your side releases ownership (optional `finishedBy`)

      ### Common fields

      All events share the same envelope:

      - `type` — event discriminant (`INBOUND_MESSAGE_RECEIVED`, `OUTBOUND_MESSAGE_SENT`, `OWNERSHIP_TAKEN`, `OWNERSHIP_RELEASED`). New types may be added; do not fail on unknown values when acting as a generic receiver.
      - `version` — payload version; currently always `1`
      - `timestamp` — when the event was sent (ISO-8601); reject stale events (for example older than five minutes) to mitigate replay
      - `idempotencyKey` — unique per event; retries reuse the same key so Hootsuite can deduplicate (`409` if already processed)
      - `data` — event-specific payload (see each operation)

      ### Requirements

      Respond with `200` when the event is accepted. Use `400` for malformed payloads, `401` for signature failures, and `503` for a temporary processing failure (retry with the same `idempotencyKey`).
  - name: csp_integrator_rest_api
    x-displayName: Integrator › REST API
    description: |
      Endpoints you implement on your registered integrator base URL. Hootsuite sends an HTTP POST to them. Verify `X-Hootsuite-Signature` on every request. See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

      - [Send outbound message](/api-reference/inbox-custom-social-profile/csp-send-outbound-message/) — Hootsuite calls this endpoint when a message is sent in Inbox
      - [Receive Hootsuite events](/api-reference/inbox-custom-social-profile/csp-receive-hootsuite-events/) — Hootsuite POSTs ownership sync events (`OWNERSHIP_TAKEN`, `OWNERSHIP_RELEASED`)
  - name: csp_hootsuite_webhooks
    x-displayName: Hootsuite › Webhooks
    description: |
      Hootsuite delivers events to your registered integrator base URL at:

      `{integratorBaseUrl}/inbox/v1/custom-social-profile/events`

      Sign each request with `X-Hootsuite-Signature`. See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

      ### Events

      - [`OWNERSHIP_TAKEN`](/api-reference/inbox-custom-social-profile/csp-hootsuite-ownership-taken/) — Inbox takes contact-scoped ownership (authoritative state sync)
      - [`OWNERSHIP_RELEASED`](/api-reference/inbox-custom-social-profile/csp-hootsuite-ownership-released/) — Inbox releases contact-scoped ownership (`finishedBy` is not included)

      Route by the `type` field. Return `200` for unknown future types so delivery is not retried.
paths:
  /inbox/v1/custom-social-profile/messages:
    post:
      tags:
        - csp_integrator_rest_api
      summary: Send outbound message
      operationId: cspSendOutboundMessage
      description: |
        Hootsuite calls this REST command on your integrator base URL when an agent sends a reply in Inbox.

        Return `message.id` immediately in the `2xx` response. Hootsuite records the outbound message using that identifier. That `2xx` response is sufficient confirmation — an `OUTBOUND_MESSAGE_SENT` webhook is **not** required after this path. If you do emit one, use the same `message.id`.

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for request signing requirements.
      security:
        - SharedSecret: []
      servers:
        - url: https://integrator.example.com
          description: Integrator — base URL registered at channel setup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contact
                - message
              properties:
                contact:
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      type: string
                      description: Integrator-native contact identifier.
                      example: cust-9f3a2b1c
                message:
                  type: object
                  properties:
                    text:
                      type: string
                      description: Outbound message text. Optional when `attachments` is present; at least one of `text` or `attachments` is required.
                      example: Thanks for reaching out — an agent will follow up shortly.
                    attachments:
                      type: array
                      items:
                        type: string
                        format: uri
                      description: |
                        Optional HTTPS URLs for attachments hosted by Hootsuite. At least one of `text` or `attachments` is required.
                      example:
                        - https://assets.hootsuite.com/attachments/invoice.pdf
            example:
              contact:
                id: cust-9f3a2b1c
              message:
                text: Thanks for reaching out — an agent will follow up shortly.
      responses:
        "200":
          description: Outbound message accepted; returns integrator-generated message ID.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        description: |
                          Integrator-generated message identifier returned immediately. Hootsuite adds the outbound message to the conversation using this ID. An `OUTBOUND_MESSAGE_SENT` webhook with the same `message.id` is optional after this path — not required.
                        example: msg-integrator-42f1
              example:
                message:
                  id: msg-integrator-42f1
        "400":
          description: Malformed command payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        "404":
          description: Unknown contact.id.
        5xx:
          description: Temporary failure delivering the outbound message.
  /inbox/v1/custom-social-profile/events:
    post:
      summary: Receive Hootsuite events
      description: |
        Implement this path on your registered integrator base URL. Hootsuite POSTs webhook events here.

        Event types and payload details:
        [`OWNERSHIP_TAKEN`](/api-reference/inbox-custom-social-profile/csp-hootsuite-ownership-taken/),
        [`OWNERSHIP_RELEASED`](/api-reference/inbox-custom-social-profile/csp-hootsuite-ownership-released/).
        Route by the `type` field.

        Return `200` for unknown future `type` values you do not yet handle so delivery is not retried.

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for webhook delivery URLs and HMAC authentication.
      operationId: cspReceiveHootsuiteEvents
      security:
        - SharedSecret: []
      tags:
        - csp_integrator_rest_api
      servers:
        - url: https://integrator.example.com
          description: Integrator — base URL registered at channel setup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - allOf:
                    - type: object
                      required:
                        - type
                        - version
                        - timestamp
                        - idempotencyKey
                        - data
                      properties:
                        type:
                          type: string
                          description: Event type discriminant in SCREAMING_SNAKE_CASE.
                        version:
                          type: integer
                          description: Payload version. Currently always `1`.
                          enum:
                            - 1
                          example: 1
                        timestamp:
                          type: string
                          format: date-time
                          description: ISO-8601 timestamp when the event was sent.
                          example: 2026-07-13T09:43:26.635984618Z
                        idempotencyKey:
                          type: string
                          description: |
                            Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                          example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                        data:
                          type: object
                          description: Event-specific payload.
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - OWNERSHIP_TAKEN
                        data:
                          type: object
                          required:
                            - contact
                          properties:
                            contact:
                              type: object
                              required:
                                - id
                              properties:
                                id:
                                  type: string
                                  description: Integrator-native contact identifier.
                                  example: cust-9f3a2b1c
                - allOf:
                    - type: object
                      required:
                        - type
                        - version
                        - timestamp
                        - idempotencyKey
                        - data
                      properties:
                        type:
                          type: string
                          description: Event type discriminant in SCREAMING_SNAKE_CASE.
                        version:
                          type: integer
                          description: Payload version. Currently always `1`.
                          enum:
                            - 1
                          example: 1
                        timestamp:
                          type: string
                          format: date-time
                          description: ISO-8601 timestamp when the event was sent.
                          example: 2026-07-13T09:43:26.635984618Z
                        idempotencyKey:
                          type: string
                          description: |
                            Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                          example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                        data:
                          type: object
                          description: Event-specific payload.
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - OWNERSHIP_RELEASED
                        data:
                          type: object
                          required:
                            - contact
                          properties:
                            contact:
                              type: object
                              required:
                                - id
                              properties:
                                id:
                                  type: string
                                  description: Integrator-native contact identifier.
                                  example: cust-9f3a2b1c
              discriminator:
                propertyName: type
                mapping:
                  OWNERSHIP_TAKEN: "#/components/schemas/HootsuiteOwnershipTakenEvent"
                  OWNERSHIP_RELEASED: "#/components/schemas/HootsuiteOwnershipReleasedEvent"
      responses:
        "200":
          description: Event accepted for processing (including unknown future `type` values you choose to ignore).
        "400":
          description: Malformed event payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        5xx:
          description: Temporary processing failure; Hootsuite retries with exponential backoff.
webhooks:
  csp-inbound-message-received:
    post:
      summary: INBOUND_MESSAGE_RECEIVED
      description: |
        ### INBOUND_MESSAGE_RECEIVED

        Send when a contact messages your proprietary channel. `contact` uses the shared contact object (`id` required; `primaryIdentifier` and `secondaryIdentifier` optional). Optional `contact.attributes` and `topics` may be included — see [Contact attributes](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) and [Topics](/api-reference/inbox-custom-social-profile/custom-social-profile-api/).

        Send this event with an HTTP POST to:

        `https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}`

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

        ### When to send

        - Fire once per inbound contact message.
      operationId: cspInboundMessageReceived
      security:
        - SharedSecret: []
      tags:
        - csp_integrator_webhooks
      servers:
        - url: https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}
          description: Hootsuite — integrator → Hootsuite event delivery URL
          variables:
            socialProfileId:
              default: "{socialProfileId}"
              description: Custom Social Profile ID from channel settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  required:
                    - type
                    - version
                    - timestamp
                    - idempotencyKey
                    - data
                  properties:
                    type:
                      type: string
                      description: Event type discriminant in SCREAMING_SNAKE_CASE.
                    version:
                      type: integer
                      description: Payload version. Currently always `1`.
                      enum:
                        - 1
                      example: 1
                    timestamp:
                      type: string
                      format: date-time
                      description: ISO-8601 timestamp when the event was sent.
                      example: 2026-07-13T09:43:26.635984618Z
                    idempotencyKey:
                      type: string
                      description: |
                        Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                      example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                    data:
                      type: object
                      description: Event-specific payload.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - INBOUND_MESSAGE_RECEIVED
                    data:
                      type: object
                      required:
                        - contact
                        - message
                      properties:
                        contact:
                          type: object
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: |
                                Integrator-native contact identifier. This field is the canonical contact key for the integration.
                              example: cust-9f3a2b1c
                            primaryIdentifier:
                              type: string
                              description: |
                                Optional human-readable primary label for the contact. May be sent on
                                `INBOUND_MESSAGE_RECEIVED` or `OUTBOUND_MESSAGE_SENT`. When omitted,
                                empty, or null, Hootsuite does not clear an existing value and may
                                display a generated human-readable alias until a non-empty value is
                                provided. A later non-empty value on either message event replaces the
                                previous one (last apply wins).
                              example: Jane Customer
                            secondaryIdentifier:
                              type: string
                              description: |
                                Optional secondary label such as a phone number or email. Same optionality
                                and last-apply-wins rules as `primaryIdentifier`. Omission, empty, and
                                null do not clear an existing value.
                              example: "+14155550123"
                            attributes:
                              type: object
                              additionalProperties:
                                type: string
                              description: |
                                Optional map of org contact-attribute aliases to values. Present only on
                                `INBOUND_MESSAGE_RECEIVED` and `OUTBOUND_MESSAGE_SENT` (not on ownership events).

                                Keys must match org attribute definition aliases (case-sensitive exact match).
                                Known aliases create or update the value; unknown aliases are ignored.
                                Values are merged partially onto the contact. An empty string clears
                                a known alias.
                              example:
                                loyalty_tier: gold
                                account_number: AC-10042
                        message:
                          type: object
                          required:
                            - id
                            - timestamp
                          properties:
                            id:
                              type: string
                              description: Integrator-generated message identifier.
                              example: msg-7c4e91a0
                            text:
                              type: string
                              description: Message text. Optional when `attachments` is present; at least one of `text` or `attachments` is required.
                              example: Hello, I need help with my order.
                            timestamp:
                              type: string
                              format: date-time
                              description: ISO-8601 timestamp when the message was created.
                              example: 2026-07-13T09:43:26.635984618Z
                            attachments:
                              type: array
                              items:
                                type: string
                                format: uri
                              description: |
                                Optional HTTPS URLs for attachments, hosted by the sender. At least one of `text` or `attachments` is required.
                              example:
                                - https://cdn.example.com/receipt.pdf
                        topics:
                          type: array
                          items:
                            type: string
                            minLength: 1
                          description: |
                            Optional list of org topic names to apply to the conversation associated with
                            the contact. Present only on `INBOUND_MESSAGE_RECEIVED` and
                            `OUTBOUND_MESSAGE_SENT` (not on ownership events).

                            Names must match org-defined topics (case-sensitive exact match). Known
                            topics are added to the conversation; unknown names are ignored. Updates are
                            additive — each event adds topics; omitting `topics` leaves existing topics
                            unchanged; an empty array is a no-op. Re-applying a topic already on the
                            conversation is a no-op. Duplicate names within the same request are
                            deduplicated. Leading and trailing whitespace is trimmed; empty or
                            whitespace-only strings are rejected with `400`. Applied even when the
                            integrator holds external ownership.
                          example:
                            - Billing
                            - Order status
            examples:
              inboundMessageReceived:
                summary: INBOUND_MESSAGE_RECEIVED
                value:
                  type: INBOUND_MESSAGE_RECEIVED
                  version: 1
                  timestamp: 2026-07-13T09:43:26.635984618Z
                  idempotencyKey: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                  data:
                    contact:
                      id: cust-9f3a2b1c
                      primaryIdentifier: Jane Customer
                      secondaryIdentifier: "+14155550123"
                    message:
                      id: msg-in-001
                      text: I need help with my order
                      timestamp: 2026-07-13T09:43:26.635984618Z
              inboundMessageReceivedWithAttributesAndTopics:
                summary: INBOUND_MESSAGE_RECEIVED (with contact.attributes and topics)
                value:
                  type: INBOUND_MESSAGE_RECEIVED
                  version: 1
                  timestamp: 2026-07-13T09:43:26.635984618Z
                  idempotencyKey: e5f6a7b8-c9d0-1234-ef01-345678901234
                  data:
                    contact:
                      id: cust-9f3a2b1c
                      primaryIdentifier: Jane Customer
                      secondaryIdentifier: "+14155550123"
                      attributes:
                        loyalty_tier: gold
                        account_number: AC-10042
                    topics:
                      - Billing
                      - Order status
                    message:
                      id: msg-in-002
                      text: I need help with my order
                      timestamp: 2026-07-13T09:43:26.635984618Z
      responses:
        "200":
          description: Event accepted for processing.
        "400":
          description: Malformed event payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        "409":
          description: Duplicate `idempotencyKey` already processed.
        "503":
          description: Temporary processing failure; retry with the same `idempotencyKey`.
  csp-outbound-message-sent:
    post:
      summary: OUTBOUND_MESSAGE_SENT
      description: |
        ### OUTBOUND_MESSAGE_SENT

        **Main use:** send this event when an outbound message is sent on your proprietary channel **outside** Inbox (for example by your integrator or channel itself). Hootsuite processes the event so the outbound message is recorded on the contact’s conversation.

        After [send outbound message](/api-reference/inbox-custom-social-profile/csp-send-outbound-message/), this event is **optional**. A `2xx` response with `message.id` is enough for Inbox-originated sends. If you also emit `OUTBOUND_MESSAGE_SENT`, use the same `message.id` — that is allowed, not required.

        `contact` is the same shared object as inbound — optional identifiers may be included so a stream can start with outbound, and so labels can be updated mid-thread (last apply wins; omission / empty / null do not clear). Optional `contact.attributes` and `topics` may be included — see [Contact attributes](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) and [Topics](/api-reference/inbox-custom-social-profile/custom-social-profile-api/).

        Send this event with an HTTP POST to:

        `https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}`

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

        ### When to send

        - Fire once per outbound message that originated on your side (not via Inbox) — this is the primary reason for the event.
        - Optionally after Inbox send-outbound-message, with the same `message.id` you returned in the REST response.
        - Ownership is not required to send this event.
        - `contact.id` may be new — a contact that has never sent inbound is allowed.

        ### Sequencing (outside Inbox)

        1. Your channel or integrator sends an outbound message to a contact.
        2. You send `OUTBOUND_MESSAGE_SENT` with a `message.id` you choose for that message.
        3. Hootsuite accepts the event and records the outbound message on the contact’s conversation.
      operationId: cspOutboundMessageSent
      security:
        - SharedSecret: []
      tags:
        - csp_integrator_webhooks
      servers:
        - url: https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}
          description: Hootsuite — integrator → Hootsuite event delivery URL
          variables:
            socialProfileId:
              default: "{socialProfileId}"
              description: Custom Social Profile ID from channel settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  required:
                    - type
                    - version
                    - timestamp
                    - idempotencyKey
                    - data
                  properties:
                    type:
                      type: string
                      description: Event type discriminant in SCREAMING_SNAKE_CASE.
                    version:
                      type: integer
                      description: Payload version. Currently always `1`.
                      enum:
                        - 1
                      example: 1
                    timestamp:
                      type: string
                      format: date-time
                      description: ISO-8601 timestamp when the event was sent.
                      example: 2026-07-13T09:43:26.635984618Z
                    idempotencyKey:
                      type: string
                      description: |
                        Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                      example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                    data:
                      type: object
                      description: Event-specific payload.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - OUTBOUND_MESSAGE_SENT
                    data:
                      type: object
                      required:
                        - contact
                        - message
                      properties:
                        contact:
                          type: object
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: |
                                Integrator-native contact identifier. This field is the canonical contact key for the integration.
                              example: cust-9f3a2b1c
                            primaryIdentifier:
                              type: string
                              description: |
                                Optional human-readable primary label for the contact. May be sent on
                                `INBOUND_MESSAGE_RECEIVED` or `OUTBOUND_MESSAGE_SENT`. When omitted,
                                empty, or null, Hootsuite does not clear an existing value and may
                                display a generated human-readable alias until a non-empty value is
                                provided. A later non-empty value on either message event replaces the
                                previous one (last apply wins).
                              example: Jane Customer
                            secondaryIdentifier:
                              type: string
                              description: |
                                Optional secondary label such as a phone number or email. Same optionality
                                and last-apply-wins rules as `primaryIdentifier`. Omission, empty, and
                                null do not clear an existing value.
                              example: "+14155550123"
                            attributes:
                              type: object
                              additionalProperties:
                                type: string
                              description: |
                                Optional map of org contact-attribute aliases to values. Present only on
                                `INBOUND_MESSAGE_RECEIVED` and `OUTBOUND_MESSAGE_SENT` (not on ownership events).

                                Keys must match org attribute definition aliases (case-sensitive exact match).
                                Known aliases create or update the value; unknown aliases are ignored.
                                Values are merged partially onto the contact. An empty string clears
                                a known alias.
                              example:
                                loyalty_tier: gold
                                account_number: AC-10042
                        message:
                          description: |
                            Outbound message details. For channel-originated outbound, choose a unique `message.id`. If you also emit this event after send-outbound-message, use the same `message.id` you returned in the REST `2xx` response.
                          type: object
                          required:
                            - id
                            - timestamp
                          properties:
                            id:
                              type: string
                              description: Integrator-generated message identifier.
                              example: msg-7c4e91a0
                            text:
                              type: string
                              description: Message text. Optional when `attachments` is present; at least one of `text` or `attachments` is required.
                              example: Hello, I need help with my order.
                            timestamp:
                              type: string
                              format: date-time
                              description: ISO-8601 timestamp when the message was created.
                              example: 2026-07-13T09:43:26.635984618Z
                            attachments:
                              type: array
                              items:
                                type: string
                                format: uri
                              description: |
                                Optional HTTPS URLs for attachments, hosted by the sender. At least one of `text` or `attachments` is required.
                              example:
                                - https://cdn.example.com/receipt.pdf
                        topics:
                          type: array
                          items:
                            type: string
                            minLength: 1
                          description: |
                            Optional list of org topic names to apply to the conversation associated with
                            the contact. Present only on `INBOUND_MESSAGE_RECEIVED` and
                            `OUTBOUND_MESSAGE_SENT` (not on ownership events).

                            Names must match org-defined topics (case-sensitive exact match). Known
                            topics are added to the conversation; unknown names are ignored. Updates are
                            additive — each event adds topics; omitting `topics` leaves existing topics
                            unchanged; an empty array is a no-op. Re-applying a topic already on the
                            conversation is a no-op. Duplicate names within the same request are
                            deduplicated. Leading and trailing whitespace is trimmed; empty or
                            whitespace-only strings are rejected with `400`. Applied even when the
                            integrator holds external ownership.
                          example:
                            - Billing
                            - Order status
            examples:
              outboundMessageSent:
                summary: OUTBOUND_MESSAGE_SENT
                value:
                  type: OUTBOUND_MESSAGE_SENT
                  version: 1
                  timestamp: 2026-07-13T09:44:10.000000000Z
                  idempotencyKey: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  data:
                    contact:
                      id: cust-9f3a2b1c
                      primaryIdentifier: Jane Customer
                      secondaryIdentifier: "+14155550123"
                    message:
                      id: msg-integrator-42f1
                      text: Your order is on the way.
                      timestamp: 2026-07-13T09:44:10.000000000Z
              outboundMessageSentWithAttributesAndTopics:
                summary: OUTBOUND_MESSAGE_SENT (with contact.attributes and topics)
                value:
                  type: OUTBOUND_MESSAGE_SENT
                  version: 1
                  timestamp: 2026-07-13T09:44:10.000000000Z
                  idempotencyKey: f6a7b8c9-d0e1-2345-f012-456789012345
                  data:
                    contact:
                      id: cust-9f3a2b1c
                      attributes:
                        loyalty_tier: gold
                    topics:
                      - Shipping
                    message:
                      id: msg-integrator-42f1
                      text: Your order is on the way.
                      timestamp: 2026-07-13T09:44:10.000000000Z
      responses:
        "200":
          description: Event accepted for processing.
        "400":
          description: Malformed event payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        "409":
          description: Duplicate `idempotencyKey` already processed.
        "503":
          description: Temporary processing failure; retry with the same `idempotencyKey`.
  csp-ownership-taken:
    post:
      summary: OWNERSHIP_TAKEN
      description: |
        ### OWNERSHIP_TAKEN

        Send when your system takes contact-scoped ownership (for example, an automated handler claims the contact). See [Ownership flows](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) in the Introduction.

        Send this event with an HTTP POST to:

        `https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}`

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

        ### Sequencing

        - When your side is done holding ownership, send [`OWNERSHIP_RELEASED`](/api-reference/inbox-custom-social-profile/csp-ownership-released/).
      operationId: cspOwnershipTaken
      security:
        - SharedSecret: []
      tags:
        - csp_integrator_webhooks
      servers:
        - url: https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}
          description: Hootsuite — integrator → Hootsuite event delivery URL
          variables:
            socialProfileId:
              default: "{socialProfileId}"
              description: Custom Social Profile ID from channel settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  required:
                    - type
                    - version
                    - timestamp
                    - idempotencyKey
                    - data
                  properties:
                    type:
                      type: string
                      description: Event type discriminant in SCREAMING_SNAKE_CASE.
                    version:
                      type: integer
                      description: Payload version. Currently always `1`.
                      enum:
                        - 1
                      example: 1
                    timestamp:
                      type: string
                      format: date-time
                      description: ISO-8601 timestamp when the event was sent.
                      example: 2026-07-13T09:43:26.635984618Z
                    idempotencyKey:
                      type: string
                      description: |
                        Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                      example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                    data:
                      type: object
                      description: Event-specific payload.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - OWNERSHIP_TAKEN
                    data:
                      type: object
                      required:
                        - contact
                      properties:
                        contact:
                          type: object
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Integrator-native contact identifier.
                              example: cust-9f3a2b1c
            example:
              type: OWNERSHIP_TAKEN
              version: 1
              timestamp: 2026-07-13T09:45:00.000000000Z
              idempotencyKey: b2c3d4e5-f6a7-8901-bcde-f12345678901
              data:
                contact:
                  id: cust-9f3a2b1c
      responses:
        "200":
          description: Event accepted for processing.
        "400":
          description: Malformed event payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        "409":
          description: Duplicate `idempotencyKey` already processed.
        "503":
          description: Temporary processing failure; retry with the same `idempotencyKey`.
  csp-ownership-released:
    post:
      summary: OWNERSHIP_RELEASED
      description: |
        ### OWNERSHIP_RELEASED

        Send when your system releases contact-scoped ownership. Omit `finishedBy` for ownership handback only (Flow 1). Include `finishedBy` with `type` `HUMAN` or `BOT` when the interaction is complete and you want Hootsuite to resolve the conversation (Flow 2). See [Ownership flows](/api-reference/inbox-custom-social-profile/custom-social-profile-api/).

        Send this event with an HTTP POST to:

        `https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}`

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

        ### When to send

        - **Ownership handback only:** omit `data.finishedBy`. Use this when you are releasing ownership without declaring the interaction complete (Flow 1).
        - **Interaction finished:** include `data.finishedBy` with `type` `HUMAN` or `BOT` when the interaction is complete and you want Hootsuite to resolve the conversation (Flow 2).
      operationId: cspOwnershipReleased
      security:
        - SharedSecret: []
      tags:
        - csp_integrator_webhooks
      servers:
        - url: https://webhooks.hootsuite.com/custom/webhook/{socialProfileId}
          description: Hootsuite — integrator → Hootsuite event delivery URL
          variables:
            socialProfileId:
              default: "{socialProfileId}"
              description: Custom Social Profile ID from channel settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  required:
                    - type
                    - version
                    - timestamp
                    - idempotencyKey
                    - data
                  properties:
                    type:
                      type: string
                      description: Event type discriminant in SCREAMING_SNAKE_CASE.
                    version:
                      type: integer
                      description: Payload version. Currently always `1`.
                      enum:
                        - 1
                      example: 1
                    timestamp:
                      type: string
                      format: date-time
                      description: ISO-8601 timestamp when the event was sent.
                      example: 2026-07-13T09:43:26.635984618Z
                    idempotencyKey:
                      type: string
                      description: |
                        Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                      example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                    data:
                      type: object
                      description: Event-specific payload.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - OWNERSHIP_RELEASED
                    data:
                      type: object
                      required:
                        - contact
                      properties:
                        contact:
                          type: object
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Integrator-native contact identifier.
                              example: cust-9f3a2b1c
                        finishedBy:
                          type: object
                          description: |
                            When present, signals that the integrator considers the contact interaction finished, with attribution for who completed it. Omit for ownership handback only.
                          required:
                            - type
                          properties:
                            type:
                              type: string
                              enum:
                                - HUMAN
                                - BOT
                              description: Whether a human agent or automated handler completed the interaction.
                              example: HUMAN
            examples:
              ownershipHandback:
                summary: Ownership handback (no finishedBy)
                value:
                  type: OWNERSHIP_RELEASED
                  version: 1
                  timestamp: 2026-07-13T09:46:00.000000000Z
                  idempotencyKey: c3d4e5f6-a7b8-9012-cdef-123456789012
                  data:
                    contact:
                      id: cust-9f3a2b1c
              finishedByBot:
                summary: Conversation finished by bot
                value:
                  type: OWNERSHIP_RELEASED
                  version: 1
                  timestamp: 2026-07-13T09:47:00.000000000Z
                  idempotencyKey: d4e5f6a7-b8c9-0123-def0-234567890123
                  data:
                    contact:
                      id: cust-9f3a2b1c
                    finishedBy:
                      type: BOT
      responses:
        "200":
          description: Event accepted for processing.
        "400":
          description: Malformed event payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        "409":
          description: Duplicate `idempotencyKey` already processed.
        "503":
          description: Temporary processing failure; retry with the same `idempotencyKey`.
  csp-hootsuite-ownership-taken:
    post:
      summary: OWNERSHIP_TAKEN
      description: |
        ### OWNERSHIP_TAKEN

        Hootsuite sends this event when Inbox takes contact-scoped ownership of a contact. Treat it as **authoritative state sync** for ownership on the Hootsuite side — clear any local assumption that your integrator still holds external ownership for that `contact.id`. See [Flow 3 — Inbox ownership sync](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) in the Introduction.

        Hootsuite delivers this event with an HTTP POST to:

        `{integratorBaseUrl}/inbox/v1/custom-social-profile/events`

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

        `OWNERSHIP_TAKEN` uses the **same type string** as integrator → Hootsuite ownership events. Discriminate direction by who POSTs and which URL receives the request.

        ### Payload

        Shared webhook envelope plus `data.contact.id` only. Do not send `attributes` or `topics`.

        Verify `X-Hootsuite-Signature` before processing.
      operationId: cspHootsuiteOwnershipTaken
      security:
        - SharedSecret: []
      tags:
        - csp_hootsuite_webhooks
      servers:
        - url: https://integrator.example.com/inbox/v1/custom-social-profile/events
          description: Integrator — Hootsuite → integrator event delivery URL (base URL + prescribed path)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  required:
                    - type
                    - version
                    - timestamp
                    - idempotencyKey
                    - data
                  properties:
                    type:
                      type: string
                      description: Event type discriminant in SCREAMING_SNAKE_CASE.
                    version:
                      type: integer
                      description: Payload version. Currently always `1`.
                      enum:
                        - 1
                      example: 1
                    timestamp:
                      type: string
                      format: date-time
                      description: ISO-8601 timestamp when the event was sent.
                      example: 2026-07-13T09:43:26.635984618Z
                    idempotencyKey:
                      type: string
                      description: |
                        Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                      example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                    data:
                      type: object
                      description: Event-specific payload.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - OWNERSHIP_TAKEN
                    data:
                      type: object
                      required:
                        - contact
                      properties:
                        contact:
                          type: object
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Integrator-native contact identifier.
                              example: cust-9f3a2b1c
            example:
              type: OWNERSHIP_TAKEN
              version: 1
              timestamp: 2026-07-13T09:55:00.000000000Z
              idempotencyKey: a7b8c9d0-e1f2-3456-7890-abcdef123456
              data:
                contact:
                  id: cust-9f3a2b1c
      responses:
        "200":
          description: Event accepted for processing.
        "400":
          description: Malformed event payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        5xx:
          description: Temporary processing failure; Hootsuite retries with exponential backoff.
  csp-hootsuite-ownership-released:
    post:
      summary: OWNERSHIP_RELEASED
      description: |
        ### OWNERSHIP_RELEASED

        Hootsuite sends this event when Inbox releases contact-scoped ownership of a contact. Treat it as **authoritative state sync** for ownership on the Hootsuite side — update your local ownership state accordingly. See [Flow 3 — Inbox ownership sync](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) in the Introduction.

        Hootsuite delivers this event with an HTTP POST to:

        `{integratorBaseUrl}/inbox/v1/custom-social-profile/events`

        See [Introduction](/api-reference/inbox-custom-social-profile/custom-social-profile-api/) for HMAC details.

        `OWNERSHIP_RELEASED` uses the **same type string** as integrator → Hootsuite ownership events. Discriminate direction by who POSTs and which URL receives the request.

        ### Payload

        Shared webhook envelope plus `data.contact.id` only. Hootsuite → integrator `OWNERSHIP_RELEASED` does **not** include `finishedBy` (that field applies only on integrator → Hootsuite releases). Do not send `attributes` or `topics`.

        Verify `X-Hootsuite-Signature` before processing.
      operationId: cspHootsuiteOwnershipReleased
      security:
        - SharedSecret: []
      tags:
        - csp_hootsuite_webhooks
      servers:
        - url: https://integrator.example.com/inbox/v1/custom-social-profile/events
          description: Integrator — Hootsuite → integrator event delivery URL (base URL + prescribed path)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  required:
                    - type
                    - version
                    - timestamp
                    - idempotencyKey
                    - data
                  properties:
                    type:
                      type: string
                      description: Event type discriminant in SCREAMING_SNAKE_CASE.
                    version:
                      type: integer
                      description: Payload version. Currently always `1`.
                      enum:
                        - 1
                      example: 1
                    timestamp:
                      type: string
                      format: date-time
                      description: ISO-8601 timestamp when the event was sent.
                      example: 2026-07-13T09:43:26.635984618Z
                    idempotencyKey:
                      type: string
                      description: |
                        Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
                      example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
                    data:
                      type: object
                      description: Event-specific payload.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - OWNERSHIP_RELEASED
                    data:
                      type: object
                      required:
                        - contact
                      properties:
                        contact:
                          type: object
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Integrator-native contact identifier.
                              example: cust-9f3a2b1c
            example:
              type: OWNERSHIP_RELEASED
              version: 1
              timestamp: 2026-07-13T10:00:00.000000000Z
              idempotencyKey: d4e5f6a7-b8c9-0123-def0-234567890123
              data:
                contact:
                  id: cust-9f3a2b1c
      responses:
        "200":
          description: Event accepted for processing.
        "400":
          description: Malformed event payload.
        "401":
          description: X-Hootsuite-Signature verification failed.
        5xx:
          description: Temporary processing failure; Hootsuite retries with exponential backoff.
components:
  securitySchemes:
    SharedSecret:
      type: apiKey
      in: header
      name: X-Hootsuite-Signature
  schemas:
    HootsuiteOwnershipTakenEvent:
      allOf:
        - type: object
          required:
            - type
            - version
            - timestamp
            - idempotencyKey
            - data
          properties:
            type:
              type: string
              description: Event type discriminant in SCREAMING_SNAKE_CASE.
            version:
              type: integer
              description: Payload version. Currently always `1`.
              enum:
                - 1
              example: 1
            timestamp:
              type: string
              format: date-time
              description: ISO-8601 timestamp when the event was sent.
              example: 2026-07-13T09:43:26.635984618Z
            idempotencyKey:
              type: string
              description: |
                Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
              example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
            data:
              type: object
              description: Event-specific payload.
        - type: object
          properties:
            type:
              type: string
              enum:
                - OWNERSHIP_TAKEN
            data:
              type: object
              required:
                - contact
              properties:
                contact:
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      type: string
                      description: Integrator-native contact identifier.
                      example: cust-9f3a2b1c
    HootsuiteOwnershipReleasedEvent:
      allOf:
        - type: object
          required:
            - type
            - version
            - timestamp
            - idempotencyKey
            - data
          properties:
            type:
              type: string
              description: Event type discriminant in SCREAMING_SNAKE_CASE.
            version:
              type: integer
              description: Payload version. Currently always `1`.
              enum:
                - 1
              example: 1
            timestamp:
              type: string
              format: date-time
              description: ISO-8601 timestamp when the event was sent.
              example: 2026-07-13T09:43:26.635984618Z
            idempotencyKey:
              type: string
              description: |
                Uniquely identifies each event. When delivery fails or times out, the sender retries with the same key so the receiver can process the event at most once.
              example: 6ebc6a78-d9e9-48be-b172-51eda40b7af8
            data:
              type: object
              description: Event-specific payload.
        - type: object
          properties:
            type:
              type: string
              enum:
                - OWNERSHIP_RELEASED
            data:
              type: object
              required:
                - contact
              properties:
                contact:
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      type: string
                      description: Integrator-native contact identifier.
                      example: cust-9f3a2b1c
