openapi: 3.0.3
info:
  title: Selligent Delivery Cloud - Webhooks API
  version: 1.0.0
  description: "# SDC Webhooks\r\n\r\nBy providing a fully documented API reference, we want to enable everyone to maximize the usage of the Selligent\r\nPlatform for automating & exchange data.\r\n\r\nThe Selligent API is organized around the REST protocol with the use of HTTP verbs and a RESTful endpoint structure. The\r\nAPI provides resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses\r\nstandard HTTP response codes, authentication, and verbs. We strive to make the endpoints so self-explanatory and\r\ninformative as possible, by providing clear validation, error and success responses.\r\n\r\nThe API style is inspired by the [Microsoft API guidelines](https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md).\r\n\r\n# REST API\r\n\r\nThe SDC Webhooks endpoints are segmented.\r\n\r\n## Base URL\r\n\r\n```\r\nhttps://<customername>.sdc.slgnt.eu/api\r\n```\r\n\r\nExample: `https://<customername>.sdc.slgnt.eu/api/webhooks/v1/admin/subscriptions/`\r\n\r\n**Definition**\r\n\r\n1. **Application Env name**: refers to a unique subdomain per environment. In the example the production environment \"sdc-prod\".\r\n2. **Module**: refers to a unique subdomain per product/application module. For this API reference the module is SMC (\r\n   Selligent).\r\n3. **slgnt.eu/slgnt.us**: refers to the geographical area for which the customer instance is active.\r\n\r\n   **Europe**: `https://<customername>.sdc.slgnt.eu/api`\r\n\r\n4. **Touchpoint**: refers to the grouped entrypoint for the user to interact/interface with the application. For this\r\n   API reference the touchpoint is the API.\r\n5. **Component/Channel**: refers to the channels (email/mobile/sms) or towards a specific component (like messages,\r\n   reporting, …). In the example the channel is \"push\".\r\n\r\n## URI parts\r\n\r\n```\r\nhttps://baseUrl/chapter/versioning/entity(_type)/{identifier}/operation|result\r\n```\r\n\r\nExamples:\r\n\r\n```bash\r\n- webhooks          https://<customername>.sdc.slgnt.eu/api/webhooks/v1/events/send\r\n```\r\n\r\n**Definition**\r\n\r\n0. _Part 0_: **Base URL** - The base url is a reference to the customer domain.\r\n1. _Part 1_: **Webhooks** - Refers to the SDC Webhooks.\r\n1. _Part 2_: **Version number** - major numbering only - example: `v2`. In case no version number is part, it refers to\r\n   the initial API version.\r\n1. _Part 3_: **Entity(\\_type)** - Refers to entity or entity type. This is depends on the chapter, if it is needed or\r\n   not.\r\n1. _Part 4_: **Identifier** - Refers to the unique identifier for a specific entity.\r\n1. _Part 5_: **Operation|Result** - Refers to additional operations or specific sub-entities of the parent entity. This\r\n   is depends on the chapter, if it is needed or not. Examples: lists > fields / journeys > send\r\n\r\n## Authentication\r\n\r\nThe Selligent Delivery Cloud API uses the Oauth2.0 authorisation protocol, through bearer JSON Web Tokens (JWT), to authenticate requests.\r\nSelligent will provide you with a dedicated client ID and secret to authorize using OAuth.\r\n\r\nWith each API call, you will need to set request headers including your access key to authenticate yourself.\r\n\r\nThe client ID and secret carry significant privileges. Please ensure to keep them 100% secure.\r\nDo not share your Oauth client ID and Oauth client secret in publicly accessible areas such as versioning systems (GitHub, Bitbucket,... ) or client-side code.\r\n\r\n<!-- ReDoc-Inject: <security-definitions> -->\r\n\r\n## Errors\r\n\r\nSelligent uses the conventional HTTP response codes to indicate successful or failed API requests.\r\n\r\nCodes in the `2xx` range indicate success.\r\n\r\nCodes in the `4xx` range indicate an input related error or validation restrictions.\r\n\r\nCodes in the `5xx` range indicate an error with Selligent servers.\r\n\r\n| HTTP Status Codes          | Description                                                                        |\r\n| -------------------------- | ---------------------------------------------------------------------------------- |\r\n| 200 - OK                   | We found the request resource                                                      |\r\n| 201 - Created              | The resource is successfully created                                               |\r\n| 204 - No Content           | The requested resources is empty                                                   |\r\n| 400 - Bad Request          | There was an error with the request. The body of the response will have more info. |\r\n| 401 - Unauthorized         | The access key was incorrect                                                       |\r\n| 404 - Not found            | The resources cannot be found                                                      |\r\n| 405 - Method Not Allowed   | The method is not allowed                                                          |\r\n| 408 - Request Timeout      | The request is taking too long to respond                                          |\r\n| 409 - Conflict             | Something is conflicting the request                                               |\r\n| 422 - Unprocessable Entity | The resource couldn't be created                                                   |\r\n| 429 - Too Many Requests    | Too many requests hit the API too quickly                                          |\r\n| 5xx - Server errors        | Something went wrong on our end. Please try again                                  |\r\n\r\n### 400/422 - Bad / Validation request - WIP\r\n\r\nIn the case of a validation of bad request error, the body of the response includes a JSON formatted response that tells\r\nyou exactly what's wrong.\r\n\r\n#### Attributes - current - WIP\r\n\r\n| Attribute              | Type    | Description                                                                                                        |\r\n| ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------ |\r\n| `title`                | String  | One of a server-defined set of error codes.                                                                        |\r\n| `status`               | Integer | An integer that represents the error type.                                                                         |\r\n| `traceId`              | String  | A reference ID to trace log within the SMC platform. This can be relevant for reporting to the support team.       |\r\n| `errors[]`             | Array   | An array of details about specific errors that led to this reported error.                                         |\r\n| `errors[] key`         | Integer | For some errors that could be handled programmatically, a short string indicating the error code reported.         |\r\n| `errors[] array value` | String  | A human-readable description of the error. You can use this to let the user know what they can do about the error. |\r\n\r\n```json\r\n{\r\n  \"type\": \"https://tools.ietf.org/html/rfc7231#section-6.5.1\",\r\n  \"title\": \"One or more validation errors occurred.\",\r\n  \"status\": 400,\r\n  \"traceId\": \"00-03f4894fecc1ae4498599fb8d5d16b5e-9d0a2aab93c57d41-00\",\r\n  \"errors\": {\r\n    \"Name\": [\"The Name field is required.\"],\r\n    \"ApiName\": [\"The ApiName field is required.\"]\r\n  }\r\n}\r\n```\r\n\r\n#### Attributes - proposal - WIP\r\n\r\n| Attribute          | Type    | Description                                                                                                        |\r\n| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------ |\r\n| `code`             | Integer | An integer that represents the error type.                                                                         |\r\n| `message`          | String  | A human readable error message.                                                                                    |\r\n| `traceId`          | String  | A reference ID to trace log within the SMC platform. This can be relevant for reporting to the support team.       |\r\n| `target`           | String  | The target in your request related to the error.                                                                   |\r\n| `details[]`        | Array   | An array of details about specific errors that led to this reported error.                                         |\r\n| `errors[].code`    | Integer | A short string indicating the error code reported, for some errors that could be handled programmatically.         |\r\n| `errors[].message` | String  | A human-readable description of the error. You can use this to let the user know what they can do about the error. |\r\n| `errors[].target`  | String  | The target in your request related to the error if the error is specific.                                          |\r\n\r\n```json\r\n{\r\n  \"error\": {\r\n    \"code\": \"BadArgument\",\r\n    \"message\": \"Multiple errors in ContactInfo data\",\r\n    \"target\": \"ContactInfo\",\r\n    \"details\": [\r\n      {\r\n        \"code\": \"NullValue\",\r\n        \"target\": \"PhoneNumber\",\r\n        \"message\": \"Phone number must not be null\"\r\n      },\r\n      {\r\n        \"code\": \"NullValue\",\r\n        \"target\": \"LastName\",\r\n        \"message\": \"Last name must not be null\"\r\n      },\r\n      {\r\n        \"code\": \"MalformedValue\",\r\n        \"target\": \"Address\",\r\n        \"message\": \"Address is not valid\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n<!--## 5xx - Server errors-->\r\n\r\n# OpenAPI specification\r\n\r\nWe provide the API specification in the format of OpenApi files which can be found in the openapi/ directory:\r\n\r\n- OpenAPI 3.0 - JSON format\r\n  - <a href=\"https://getstarted.slgnt.io/engage/api/sdc-webhooks/openapi/sdc-webhooks-rest-v1.openapi.json\" target=\"_blank\">\r\n    sdc-webhooks-rest-v1.openapi.json</a>\r\n- OpenAPI 3.0 - YAML format\r\n  - <a href=\"https://getstarted.slgnt.io/engage/api/sdc-webhooks/openapi/sdc-webhooks-rest-v1.openapi.yaml\" target=\"_blank\">\r\n    sdc-webhooks-rest-v1.openapi.yaml</a>\r\n\r\n# Developer documentation\r\n\r\nThe Selligent API can provide very powerful manner for integrating, exchanging data and automating tasks. To facilitate\r\nwith the usage of the API, we have created a number of guides in our development webhooks.\r\n\r\nOur getting started guide will demonstrate for a number of basic use cases. It will refer to this API reference us to\r\nhighlight the implementation and refer to other information resources in Selligent that will be helpful for many other\r\nuse cases too.\r\n\r\n[Click here to visit our developer webhooks](https://getstarted.slgnt.io/engage/).\r\n\r\n# Postman collection\r\n\r\nTo get you up and running and provide a hands-on experience, we provide an up-to-date Postman collection of the SDC Webhooks API V1.\r\n\r\n\r\n\r\nImport the Postman collection through any of the methods specified below.\r\n\r\n\r\n- Use the link: <a href=\"https://getstarted.slgnt.io/engage/api/sdc-webhooks/postman/sdc-webhooks-rest-v1.postman.json\" target=\"_blank\">https://getstarted.slgnt.io/engage/api/sdc-webhooks/postman/sdc-webhooks-rest-v1.postman.json</a> via \"Import\" > \"Link\"\r\n- Download the file <a href=\"https://getstarted.slgnt.io/engage/api/sdc-webhooks/postman/sdc-webhooks-rest-v1.postman.json\" target=\"_blank\">sdc-webhooks-rest-v1.postman.json</a> and import the file via \"Import\" > \"File\"\r\n- Download the file <a href=\"https://getstarted.slgnt.io/engage/api/sdc-webhooks/postman/sdc-webhooks-rest-v1.postman.json\" target=\"_blank\">sdc-webhooks-rest-v1.postman.json</a> and copy the contents and paste in the \"Import\" > Paste \"Raw Text\" section.\r\n\r\nThis collection takes advantage of Postman variables and environments to store/access your Selligent Oauth Client key/secret and base\r\nURL.\r\n"
  contact:
    name: Team Selligent
    url: https://getstarted.slgnt.io/engage/
    email: info@zetaglobal.com
  license:
    name: All Rights Reserved
    url: https://zetaglobal.com/
  x-logo:
    url: ../../assets/logo/zeta_logoLandscape_1Color_WHITE.png
    backgroundColor: '#1677FF'
servers:
  - url: https://arkanis.sdc.slgnt.eu/dev/api
    description: SDC Webhooks DEV API endpoint (EU region)
paths:
  /webhooks/v1/admin/subscriptions:
    parameters:
      - $ref: '#/components/parameters/OAuth2'
      - $ref: '#/components/parameters/ApplicationJson'
    get:
      operationId: get-webhook-subscriptions
      summary: Get all webhook subscriptions
      responses:
        '200':
          description: Webhook subscriptions are found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebhookSubscriptionResponseModel'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server Error
      tags:
        - Webhook Subscriptions
      x-testing: true
    post:
      operationId: post-webhook-subscription
      summary: Create a new webhook subscription
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionCreateModel'
      responses:
        '201':
          description: The webhook subscription got created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionResponseModel'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: >-
            The webhook subscription could not be created. For more details see
            the returned output.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server Error
      tags:
        - Webhook Subscriptions
      x-testing: true
    put:
      operationId: put-webhook-subscriptions
      summary: Update webhook subscriptions on tenant level
      description: Updates the webhook subscription configurations.
      requestBody:
        description: The configuration for a webhook subscription.
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/WebhookSubscriptionDeprecatedModel'
            examples:
              sample-webhooksubscriptions-update:
                $ref: '#/components/examples/sample-webhook-subscriptions-update'
      responses:
        '204':
          description: The webhook subscriptions are updated.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: >-
            The webhook subscriptions are not updated. For more details see the
            returned output.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: Unprocessable entity.
        '500':
          description: Server Error
      deprecated: true
      tags:
        - Webhook Subscriptions
      x-testing: false
    delete:
      operationId: delete-webhook-subscriptions
      summary: Delete all webhook subscriptions for a tenant.
      description: Removes webhook subscription configurations for the tenant.
      responses:
        '204':
          description: The webhook subscriptions were deleted on tenant level.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: No subscription was found that could be deleted on tenant level.
        '500':
          description: Server Error
      deprecated: true
      tags:
        - Webhook Subscriptions
      x-testing: false
  /webhooks/v1/admin/subscriptions/{subscriptionId}:
    parameters:
      - $ref: '#/components/parameters/OAuth2'
      - $ref: '#/components/parameters/ApplicationJson'
      - $ref: '#/components/parameters/subscriptionId'
    get:
      operationId: get-webhook-subscription-id
      summary: Get webhook subscription by id
      responses:
        '200':
          description: Webhook subscription is found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionSaveModel'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server Error
      tags:
        - Webhook Subscriptions
      x-testing: true
    put:
      operationId: put-webhook-subscription-id
      summary: Update webhook subscription by id
      description: Update the webhook subscription by id
      requestBody:
        description: The webhook subscription.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscriptionSaveModel'
      responses:
        '204':
          description: The webhook subscriptions are updated.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: >-
            The webhook subscriptions are not updated. For more details see the
            returned output.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: Unprocessable entity.
        '500':
          description: Server Error
      tags:
        - Webhook Subscriptions
      x-testing: true
    delete:
      operationId: delete-webhook-subscription-id
      summary: Delete webhook subscription by id
      description: Removes the webhook subscription
      responses:
        '204':
          description: The webhook subscription is deleted.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: The webhook subscription with provided id could not be found.
        '500':
          description: Server Error
      tags:
        - Webhook Subscriptions
      x-testing: true
  /webhooks/v1/admin/deadletters:
    parameters:
      - $ref: '#/components/parameters/OAuth2'
      - $ref: '#/components/parameters/ApplicationJson'
      - $ref: '#/components/parameters/Iterator'
      - $ref: '#/components/parameters/Limit'
    get:
      operationId: get-webhook-deadletters-paginated
      summary: Get paginated webhook dead letters metadata
      responses:
        '200':
          description: Webhook dead letters within the current iterator and limit.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebhookDeadLetterPagedResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server Error
      tags:
        - Webhook Dead Letters
      x-testing: false
  /webhooks/v1/admin/deadletters/{subscriptionId}:
    parameters:
      - $ref: '#/components/parameters/OAuth2'
      - $ref: '#/components/parameters/ApplicationJson'
      - $ref: '#/components/parameters/subscriptionId'
    post:
      operationId: post-reschedule-deadletters
      summary: Reschedule dead letters
      description: >
        The reschedule endpoint triggers an action that will put all the dead
        letters between the specified lower and upper bound dates back on the
        sending queue.


        ⚠️ Important note: This action should be used sparingly and there is no
        guarantee about how quick the dead letters will end up on the sending
        queue again.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RescheduleRequestModel'
      responses:
        '204':
          description: Reschedule request accepted
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Subscription ID is not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server Error
      tags:
        - Webhook Dead Letters
      x-testing: false
  /webhooks/v1/admin/deadletters/{subscriptionId}/{deadLetterId}:
    parameters:
      - $ref: '#/components/parameters/OAuth2'
      - $ref: '#/components/parameters/ApplicationJson'
      - $ref: '#/components/parameters/subscriptionId'
      - $ref: '#/components/parameters/deadLetterId'
    get:
      operationId: get-deadletter-by-id
      summary: Get webhook deadletter by id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDeadLetterResponseModel'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server Error
      tags:
        - Webhook Dead Letters
      x-testing: false
    delete:
      operationId: delete-deadletter-by-id
      summary: Delete webhook deadletter by id
      responses:
        '204':
          description: Deadletter is removed.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Deadletter cannot be be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server Error
      tags:
        - Webhook Dead Letters
      x-testing: false
components:
  parameters:
    ApplicationJson:
      in: header
      name: Content-Type
      required: true
      schema:
        type: string
        example: application/json
        default: application/json
      description: Define the file type and format for the request object.
    Iterator:
      name: iterator
      in: query
      schema:
        type: string
        example: >-
          7274bb1d2f5006a248bf129943a1441ab923dee75e475c8e43a1441ab923dee75e475c8e441ab9
        nullable: true
      description: An iterator to use when for querying additional results.
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        format: int32
        example: 100
        default: 10
      description: Limits the amount of items returned in 1 call.
    OAuth2:
      in: header
      name: Authorization
      required: false
      schema:
        type: string
        example: Bearer {{oauth_access_token}}
        default: Bearer {{oauth_access_token}}
      description: Oauth2 token to authorize requests.
    deadLetterId:
      name: deadLetterId
      in: path
      required: true
      schema:
        type: string
        example: 93fd896a-3821-494d-ba05-4baec32a7ef9
      description: >-
        A unique identifier that gets generated once we store the event as a
        dead letter.

        The GET endpoint which exposes the metadata of dead letters returns this
        ID,

        which can then be used to further retrieve the entire event and also
        delete it.
    subscriptionId:
      name: subscriptionId
      in: path
      required: true
      schema:
        type: string
        example: 93fd896a-3821-494d-ba05-4baec32a7ef9
      description: >-
        The unique identifier of the subscription. Dead letters always belong to
        a webhook subscription.
  schemas:
    WebhookFilters:
      description: |-
        Only events that match the filter get forwarded to the target url.
          The filters support using wildcards ('*') at the start, end or both.
          Wildcards must come before or after the '.' character of the filter part.

          Examples: 'sdc.\*', '\*.failed', '\*.email.\*', 'sdc.deliveries.email.sent'
      type: array
      items:
        type: string
      example:
        - sdc.*
        - '*.failed'
        - '*.email.*'
        - sdc.deliveries.email.sent
      nullable: true
    WebhookAdvancedFilter:
      type: object
      properties:
        key:
          description: >-
            The path to the property on which we want to filter.

            Each property leading to desired one has to be separated by a '.'.

            The path cannot contain any whitespace and cannot begin/end by a
            '.'.

            If the property does not exist in the payload of the specified
            webhook(s) the data will be filtered out.

            No validation is added on the property being valid or not.

            There is a limit of maximum 10 property filters to specify.


            Examples: 'data.account_id', 'data.recipient'
          type: string
        operator:
          description: >-
            The operator used to match the event value and the desired value.

            If you use an operator that filters numbers, then the value
            specified has to be a parsable float or integer.
          type: string
          enum:
            - equals
            - stringContains
            - stringStartsWith
            - stringEndsWith
            - numberGreaterThan
            - numberGreaterThanOrEquals
            - numberLess
            - numberLessThanOrEquals
        value:
          description: |-
            The value used by the operator to see if the event value matches.

            Example: 'gmail.com'
          type: string
      maxItems: 10
      required:
        - key
        - operator
        - value
    WebhookAdvancedFilters:
      description: >-
        Only events that match the all of the advanced filters get forwarded to
        the target url.
          The filters support all the end properties of the event.
          You have to respect the structure of the event you want to filter.
          If you try to put a filter on a property that doesn't exists or that is not an end property, the webhook won't be sent.

          Examples: 'data.recipient stringEndsWith gmail.com', 'data.account_id equals d6862df2-59c2-4fbc-b248-d1374967dafd'
      type: array
      items:
        $ref: '#/components/schemas/WebhookAdvancedFilter'
      example:
        - key: data.recipient
          operator: stringEndsWith
          value: gmail.com
      maxItems: 10
      nullable: true
    WebhookHeader:
      description: |-
        Custom headers that add additional information to the HTTP request.
        For example this can be used to add basic authentication/authorization.
        The following headers are restricted and can't be overridden or used:
        - Content-Type
        - Content-Length
        - Connection
        - Host
        - Cache-Control
      type: object
      properties:
        name:
          type: string
          example: Authorization
          minLength: 1
        value:
          type: string
          example: Basic TG9uZyBsaXZlIGRvZ2Uh
          minLength: 1
      additionalProperties: false
      required:
        - name
        - value
    WebhookHeaders:
      description: |-
        Custom headers that add additional information to the HTTP request.
        For example this can be used to add basic authentication/authorization.
        The following headers are restricted and can't be overridden or used:
        - Content-Type
        - Content-Length
        - Connection
        - Host
        - Cache-Control
      type: array
      items:
        $ref: '#/components/schemas/WebhookHeader'
      example:
        - name: Authorization
          value: Basic TG9uZyBsaXZlIGRvZ2Uh
        - name: X-Value
          value: Extra header
      nullable: true
    WebhookSubscriptionResponseModel:
      type: object
      properties:
        id:
          type: string
          example: 494d-93fd896a-3821-ba05-4baec32a7ef9
        filters:
          $ref: '#/components/schemas/WebhookFilters'
        advanced_filters:
          $ref: '#/components/schemas/WebhookAdvancedFilters'
        target_url:
          type: string
          example: https://example.com/customer-endpoint
        headers:
          $ref: '#/components/schemas/WebhookHeaders'
    ProblemDetails:
      type: object
      properties:
        type:
          description: >-
            A URI reference [RFC3986] that identifies the problem type.  This
            specification encourages that, when dereferenced, it provide
            human-readable documentation for the problem type (e.g., using HTML
            [W3C.REC-html5-20141028]).  When this member is not present, its
            value is assumed to be "about:blank".
          type: string
          example: https://tools.ietf.org/html/rfc7231#section-6.5.4
          nullable: true
        title:
          description: >-
            A short, human-readable summary of the problem type. It SHOULD NOT
            change from occurrence to occurrence of the problem, except for
            purposes of localization(e.g., using proactive content negotiation;
            see[RFC7231], Section 3.4).
          type: string
          example: Not Found
          nullable: true
        status:
          description: >-
            The HTTP status code([RFC7231], Section 6) generated by the origin
            server for this occurrence of the problem.
          type: integer
          format: int32
          example: 404
          nullable: true
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          type: string
          example: Resource does not exist.
          nullable: true
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.It may or may not yield further information if dereferenced.
          type: string
          example: TODO
          nullable: true
    WebhookSubscriptionDeprecatedModel:
      type: object
      properties:
        filters:
          $ref: '#/components/schemas/WebhookFilters'
        advanced_filters:
          $ref: '#/components/schemas/WebhookAdvancedFilters'
        target_url:
          type: string
          minLength: 1
        headers:
          $ref: '#/components/schemas/WebhookHeaders'
        id:
          type: string
          nullable: true
      additionalProperties: false
      required:
        - filters
        - target_url
    WebhookSubscriptionCreateModel:
      type: object
      properties:
        filters:
          $ref: '#/components/schemas/WebhookFilters'
        advanced_filters:
          $ref: '#/components/schemas/WebhookAdvancedFilters'
        target_url:
          type: string
          example: https://example.com/customer-endpoint
          minLength: 1
        headers:
          $ref: '#/components/schemas/WebhookHeaders'
      additionalProperties: false
      required:
        - filters
        - target_url
    WebhookSubscriptionSaveModel:
      type: object
      properties:
        id:
          type: string
          example: 494d-93fd896a-3821-ba05-4baec32a7ef9
          minLength: 1
        filters:
          $ref: '#/components/schemas/WebhookFilters'
        advanced_filters:
          $ref: '#/components/schemas/WebhookAdvancedFilters'
        target_url:
          type: string
          example: https://example.com/customer-endpoint
          minLength: 1
        headers:
          $ref: '#/components/schemas/WebhookHeaders'
      additionalProperties: false
      required:
        - filters
        - id
        - target_url
    WebhookDeadLetterPageResponseModel:
      type: object
      properties:
        id:
          type: string
          example: 93fd896a-3821-494d-ba05-4baec32a7ef9
        subscription_id:
          type: string
          example: 3821-93fd896a-494d-ba05-4baec32a7ef9
        event_type:
          type: string
          example: sdc.deliveries.email.failed
        target_url:
          type: string
          example: https://www.example.com/sdc
        created:
          type: string
          format: date-time
          example: '2024-06-24T12:00:00Z'
        response_code:
          type: integer
          format: int32
          example: 500
        response:
          type: string
          example: Server Error
        retry_count:
          type: integer
          format: int32
          example: 5
      additionalProperties: false
    WebhookDeadLetterPagedResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WebhookDeadLetterPageResponseModel'
        iterator:
          description: An iterator to use when for querying additional results.
          type: string
          example: >-
            7274bb1d2f5006a248bf129943a1441ab923dee75e475c8e43a1441ab923dee75e475c8e441ab9
          nullable: true
        previousIterator:
          description: The current iterator used for querying.
          type: string
          example: >-
            2009e6a248bf129943a1441ab923dee75e475c8e7274bb1d2f5006a248bf129943a1441ab923dee75e475c8e
          nullable: true
      additionalProperties: false
    RescheduleRequestModel:
      type: object
      properties:
        from:
          description: The lower bound of the time range to query.
          type: string
          format: date-time
          example: '2024-06-20T12:00:00Z'
        until:
          description: The upper bound of the time range to query.
          type: string
          format: date-time
          example: '2024-06-24T12:00:00Z'
      additionalProperties: false
    CloudEventsJson:
      type: object
      properties:
        id:
          description: >-
            CloudEvents 'id' attribute. Identifies the event. The ID is unique
            within the scope of the producer.
          type: string
          example: f0e01063-efaa-4023-8199-278d4e4285ae
        tenant:
          description: >-
            The Selligent tenant reference, which is a combination of the region
            (EU/US) and the Saasname, formatted like `REGION.SAASNAME`.
          type: string
          example: EU.ENGAGE
          nullable: false
        source:
          description: the context in which this event has happend.
          type: string
          format: uri
          example: /sdc/mailer
        type:
          description: >-
            CloudEvents 'type' attribute. Type of occurrence which has happened.
            Often this attribute is used for routing, observability, policy
            enforcement, etc.
          type: string
          example: sdc.deliveries.email.sent
        subject:
          description: >-
            A description / additional info for the event in the context of the
            specified source.
          type: string
          example: 674d25d7319b4549a88cefdda049989e_92233793802426
          nullable: true
        time:
          description: Timestamp of when the event happened. Expressed in UTC.
          type: string
          format: date-time
          example: '2018-04-05T17:31:00.000Z'
          nullable: true
        specversion:
          description: >-
            The version of the CloudEvents specification which the event uses.
            For more information see <a
            href="https://cloudevents.io/">cloudEvents</a>
          type: string
          default: '1.0'
        dataschema:
          description: Represents a URI for the schema to which the data adheres to.
          type: string
          format: uri
          nullable: false
        datacontenttype:
          description: Content type of the 'data' field provided by the event.
          type: string
          default: application/json
          nullable: false
        data:
          description: CloudEvent 'data' content. The event payload.
          type: object
          properties:
            account_id:
              description: The unique identifier of the account.
              type: string
              example: 3822afb319684af18b9664ee327b7c44
            tenant_id:
              description: The unique identifier of the tenant.
              type: string
              example: EU.ENGAGE
            sender_domain:
              description: The domain that is used to send the message.
              type: string
              example: example.com
            route:
              description: >-
                The origin (sender IP) and the destination (smtp server) used to
                transmit the email.
              type: object
              properties:
                destination:
                  description: >-
                    The identified target destination server for the message. It
                    is either indicated by a cluster reference or by a domain.
                  type: object
                  properties:
                    cluster_id:
                      description: The unique identifier of the domain cluster.
                      type: string
                      example: 357d2587006d4938a0cc1a9866d731b1
                    domain_name:
                      description: The mail domain used for sending.
                      type: string
                      example: '#ZETAGLOBAL.COM'
                  required:
                    - domainName
                    - clusterId
                local_ip_port:
                  description: >-
                    The NAT-ed port used for sending to (instead of port 25) to
                    identify the IP which the firewall must select.
                  type: integer
                  example: 5025
              required:
                - localIpPort
                - destination
            outcome:
              description: The response from the SMTP server (for analysis of bounces).
              type: string
              example: 250 Ok
            recipient:
              description: The target recipient of the message.
              type: string
              example: sdc.example@slgnt.eu
            context:
              description: Extra context for the email, used for reporting.
              type: object
              properties:
                tags:
                  description: A set of client defined strings that are used for reporting.
                  type: array
                  items:
                    type: string
                  example:
                    - transactional
                    - DE
                metadata:
                  description: Additional metadata for the message.
                  type: string
                  example: TEST=true
                profile:
                  description: A way to uniquely identify the recipient of the message.
                  type: string
                  example: user@userlist
            drop_time_milliseconds:
              description: >-
                The time how long it took to deliver the message to the mail
                server.
              type: number
              example: 40.0872
            external_reference:
              description: >-
                This is the external_reference provided by the client in the
                payload of the message.
              type: string
              example: 674d25d7319b4549a88cefdda049989e_92233793802426
            timestamp:
              description: The time the event happened, expressed in UTC.
              type: string
              example: '2022-03-16T12:56:00.1260605'
    WebhookDeadLetterResponseModel:
      type: object
      properties:
        id:
          type: string
          example: 93fd896a-3821-494d-ba05-4baec32a7ef9
        subscription_id:
          type: string
          example: 494d-93fd896a-3821-ba05-4baec32a7ef9
        event_type:
          type: string
          example: sdc.deliveries.email.failed
        target_url:
          type: string
          example: https://www.example.com/sdc
        created:
          type: string
          format: date-time
          example: '2024-06-24T12:00:00Z'
        response_code:
          type: integer
          format: int32
          example: 500
        response:
          type: string
          example: Server Error
          nullable: true
        response_body:
          type: string
          example: |
            {
              "type": "https://httpstatuses.io/401",
              "title": "Unauthorized",
              "status": 401
            }
          nullable: true
        retry_count:
          type: integer
          format: int32
          example: 5
        body:
          type: string
          $ref: '#/components/schemas/CloudEventsJson'
      additionalProperties: false
  examples:
    sample-webhook-subscriptions-update:
      value:
        - filters:
            - smc.*
          target_url: https://www.example.com/smc
        - filters:
            - sdc.*
          target_url: https://www.example.com/sdc
          headers:
            - name: Authorization
              value: Basic TG9uZyBsaXZlIGRvZ2Uh
          advanced_filters:
            - key: data.recipient
              operator: stringEndsWith
              value: gmail.com
tags:
  - name: Webhook Subscriptions
    x-displayName: Webhook Subscriptions
    description: <span class="tag eap">Early Access</span>
  - name: Webhook Dead Letters
    x-displayName: Webhook Dead Letters
    description: >
      In message queueing a dead letter queue is a service implementation to
      store messages that the messaging system cannot or should not deliver,
      dead letters. 

      Although implementation-specific, messages can be routed to the DLQ for
      the following reasons:


      - The webhook is sent to a URL that does not exist.

      - The webhook could not be accepted or processed by the receiving server.

      - The webhook has been retried the maximum amount of times.

      - The webhook exceeds the size limit.

      - The webhook expires because it reached the TTL (time to live)

      - The webhook is rejected by another API exchange.


      Routing these webhooks to a dead letter queue enables analysis of common
      fault patterns and potential software problems.

      For more information see: https://en.wikipedia.org/wiki/Dead_letter_queue
x-tagGroups:
  - name: Configuration Management
    tags:
      - Webhook Subscriptions
      - Webhook Dead Letters
