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

# Create webhook

> Add a new webhook destination to monitor transfer failures. All errors resulting from transfers that do not succeed will be delivered to this webhook endpoint for monitoring or logging.



## OpenAPI

````yaml /generated/openapi-generated-2023-12-01.json post /webhooks
openapi: 3.1.0
info:
  title: Prequel Data Export
  description: Data Export API spec
  version: '2023-12-01'
servers:
  - url: https://api.prequel.co
    description: Cloud-hosted server (US)
  - url: https://eu-api.prequel.co
    description: Cloud-hosted server (EU)
  - url: https://{custom_host}/
    description: Cloud-prem or shared-cloud server
security:
  - ApiKeyAuth: []
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create webhook
      description: >-
        Add a new webhook destination to monitor transfer failures. All errors
        resulting from transfers that do not succeed will be delivered to this
        webhook endpoint for monitoring or logging.
      operationId: create-webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: >-
                https://github.com/prequel-co/datafeed/internal/shared/api/models/create-webhook-request
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    $ref: '#/components/schemas/WebhookResponse'
                    $schema: https://json-schema.org/draft/2020-12/schema
                    $id: >-
                      https://github.com/prequel-co/datafeed/internal/shared/api/models/webhook-response
                  message:
                    type: string
                type: object
                required:
                  - status
                  - data
                  - message
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateWebhookRequest:
      properties:
        webhook:
          $ref: '#/components/schemas/WebhookOptions'
      additionalProperties: false
      type: object
      required:
        - webhook
    WebhookResponse:
      properties:
        webhook:
          $ref: '#/components/schemas/Webhook'
      additionalProperties: false
      type: object
      required:
        - webhook
    WebhookOptions:
      oneOf:
        - $ref: '#/components/schemas/HttpWebhookOptions'
          title: HTTP
        - $ref: '#/components/schemas/PagerDutyWebhookOptions'
          title: PagerDuty
        - $ref: '#/components/schemas/SlackWebhookOptions'
          title: Slack
        - $ref: '#/components/schemas/DatadogWebhookOptions'
          title: Datadog
    Webhook:
      properties:
        id:
          type: string
        name:
          type: string
        vendor:
          type: string
        url:
          type: string
        api_key:
          type: string
        api_version:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        events:
          $ref: '#/components/schemas/StringArray'
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - vendor
        - url
        - api_version
        - created_at
        - updated_at
        - events
    ErrorResponse:
      properties:
        status:
          type: string
          const: error
        message:
          type: string
        data:
          type: 'null'
      type: object
      required:
        - status
        - message
    HttpWebhookOptions:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: >-
        https://github.com/prequel-co/datafeed/internal/shared/api/models/http-webhook-options
      properties:
        name:
          type: string
          description: Descriptive name for webhook.
        vendor:
          type: string
          enum:
            - generic_post
            - generic_get
          description: >-
            Webhook destination type. generic_post will deliver payload data as
            JSON
        api_version:
          type: string
          description: The API version to use when rendering events.
          default: '2023-10-15'
        events:
          items:
            type: string
            enum:
              - transfer.cancelled
              - transfer.error
              - transfer.success
              - export_source.created
              - export_source.updated
              - export_source.deleted
              - export_destination.created
              - export_destination.updated
              - export_destination.deleted
              - recipient.created
              - recipient.updated
              - recipient.deleted
              - export_magic_link.created
              - export_magic_link.deleted
          type: array
          description: The events to receive via webhook.
        url:
          type: string
          pattern: ^https?://.+$
          description: The URL to send the webhook to.
        api_key:
          type: string
          description: The API key to use when sending the webhook.
      additionalProperties: false
      type: object
      required:
        - name
        - vendor
        - url
    PagerDutyWebhookOptions:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: >-
        https://github.com/prequel-co/datafeed/internal/shared/api/models/pager-duty-webhook-options
      properties:
        name:
          type: string
          description: Descriptive name for webhook.
        vendor:
          type: string
          enum:
            - pagerduty
          description: >-
            Webhook destination type. pagerduty will POST a JSON payload data
            formatted for the enqueue endpoint of the PagerDuty V2 Events API.
        api_version:
          type: string
          description: The API version to use when rendering events.
          default: '2023-10-15'
        events:
          items:
            type: string
            enum:
              - transfer.cancelled
              - transfer.error
              - transfer.success
              - export_source.created
              - export_source.updated
              - export_source.deleted
              - export_destination.created
              - export_destination.updated
              - export_destination.deleted
              - recipient.created
              - recipient.updated
              - recipient.deleted
              - export_magic_link.created
              - export_magic_link.deleted
          type: array
          description: The events to receive via webhook.
        api_key:
          type: string
          description: >-
            Integration Key provided by PagerDuty in the Events API Overview of
            the service configured to monitor these events.
      additionalProperties: false
      type: object
      required:
        - name
        - vendor
        - api_key
    SlackWebhookOptions:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: >-
        https://github.com/prequel-co/datafeed/internal/shared/api/models/slack-webhook-options
      properties:
        name:
          type: string
          description: Descriptive name for webhook.
        vendor:
          type: string
          enum:
            - slack
          description: >-
            Webhook destination type. slack will POST a JSON payload formatted
            for Slack incoming webhooks.
        api_version:
          type: string
          description: The API version to use when rendering events.
          default: '2023-10-15'
        events:
          items:
            type: string
            enum:
              - transfer.cancelled
              - transfer.error
              - transfer.success
              - export_source.created
              - export_source.updated
              - export_source.deleted
              - export_destination.created
              - export_destination.updated
              - export_destination.deleted
              - recipient.created
              - recipient.updated
              - recipient.deleted
              - export_magic_link.created
              - export_magic_link.deleted
          type: array
          description: The events to receive via webhook.
        url:
          type: string
          pattern: ^https://hooks\.slack\.com/services/.+$
          description: >-
            Destination URL provided by Slack in the form
            'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'.
      additionalProperties: false
      type: object
      required:
        - name
        - vendor
        - url
    DatadogWebhookOptions:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: >-
        https://github.com/prequel-co/datafeed/internal/shared/api/models/datadog-webhook-options
      properties:
        name:
          type: string
          description: Descriptive name for webhook.
        vendor:
          type: string
          enum:
            - datadog
          description: >-
            Webhook destination type. datadog will POST a JSON payload data
            formatted for the Datadog v1 events endpoint.
        api_version:
          type: string
          description: The API version to use when rendering events.
          default: '2023-10-15'
        events:
          items:
            type: string
            enum:
              - transfer.cancelled
              - transfer.error
              - transfer.success
              - export_source.created
              - export_source.updated
              - export_source.deleted
              - export_destination.created
              - export_destination.updated
              - export_destination.deleted
              - recipient.created
              - recipient.updated
              - recipient.deleted
              - export_magic_link.created
              - export_magic_link.deleted
          type: array
          description: The events to receive via webhook.
        api_key:
          type: string
          description: The API key to use when sending the webhook.
      additionalProperties: false
      type: object
      required:
        - name
        - vendor
    StringArray:
      items:
        type: string
      type: array
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````