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

# Create an event destination

> Creates a new event destination (e.g. a webhook endpoint) to receive platform events.



## OpenAPI

````yaml /api-reference/v2.json post /event-destinations
openapi: 3.1.1
info:
  title: Deck API
  version: 2.0.0
servers:
  - url: https://api.deck.co/v2
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Agents
  - name: Components
  - name: Credentials
  - name: Event Destinations
  - name: Events
  - name: Sessions
  - name: Sources
  - name: Storage
  - name: Task Runs
  - name: Tasks
  - name: Test
paths:
  /event-destinations:
    post:
      tags:
        - Event Destinations
      summary: Create an event destination
      description: >-
        Creates a new event destination (e.g. a webhook endpoint) to receive
        platform events.
      operationId: createEventDestination
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEventDestinationRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/CreateEventDestinationRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CreateEventDestinationRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/EventDestinationResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/EventDestinationResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/EventDestinationResponse'
        '400':
          description: Bad request — validation error or malformed input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not found — the requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict — the request is valid but cannot be completed in the
            current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable content — the request body is understood but contains
            invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateEventDestinationRequest:
      required:
        - name
      type: object
      properties:
        name:
          type: string
          description: Display name for the event destination.
        type:
          type: string
          enum:
            - webhook
            - aws_sqs
            - aws_kinesis
            - aws_s3
            - aws_eventbridge
            - gcp_pubsub
            - rabbitmq
            - azure_servicebus
            - hookdeck
          description: >-
            Destination type. Defaults to `webhook` if omitted. Send the
            matching configuration object under a property whose name equals
            this value (for example, when `type` is `aws_sqs`, include an
            `aws_sqs` object).
        events:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Event types to subscribe to (for example `task_run.completed`,
            `credential.verified`). Use `["*"]` to subscribe to all event types;
            `*` cannot be combined with specific types, and the list must not be
            empty.
        webhook:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              description: Absolute `https` or `http` URL that receives event deliveries.
            secret:
              type: string
              description: >-
                Signing secret used to verify webhook signatures. Write-only;
                never returned.
          description: >-
            Configuration for a `webhook` destination. Provide this object under
            the `webhook` property when `type` is `webhook`.
        aws_sqs:
          type: object
          required:
            - queue_url
          properties:
            queue_url:
              type: string
              description: URL of the destination Amazon SQS queue.
            key:
              type: string
              description: 'AWS access key ID. Accepted alias: `access_key`. Write-only.'
            secret:
              type: string
              description: 'AWS secret access key. Accepted alias: `secret_key`. Write-only.'
          description: >-
            Configuration for a `aws_sqs` destination. Provide this object under
            the `aws_sqs` property when `type` is `aws_sqs`.
        aws_kinesis:
          type: object
          required:
            - stream_name
            - region
          properties:
            stream_name:
              type: string
              description: Name of the Amazon Kinesis stream.
            region:
              type: string
              description: AWS region of the stream.
            key:
              type: string
              description: 'AWS access key ID. Accepted alias: `access_key`. Write-only.'
            secret:
              type: string
              description: 'AWS secret access key. Accepted alias: `secret_key`. Write-only.'
          description: >-
            Configuration for a `aws_kinesis` destination. Provide this object
            under the `aws_kinesis` property when `type` is `aws_kinesis`.
        aws_s3:
          type: object
          required:
            - bucket
            - region
          properties:
            bucket:
              type: string
              description: Name of the destination Amazon S3 bucket.
            region:
              type: string
              description: AWS region of the bucket.
            key:
              type: string
              description: 'AWS access key ID. Accepted alias: `access_key`. Write-only.'
            secret:
              type: string
              description: 'AWS secret access key. Accepted alias: `secret_key`. Write-only.'
          description: >-
            Configuration for a `aws_s3` destination. Provide this object under
            the `aws_s3` property when `type` is `aws_s3`.
        aws_eventbridge:
          type: object
          required:
            - event_bus_name
            - region
          properties:
            event_bus_name:
              type: string
              description: Name of the Amazon EventBridge event bus.
            region:
              type: string
              description: AWS region of the event bus.
            access_key_id:
              type: string
              description: AWS access key ID. Write-only.
            secret_access_key:
              type: string
              description: AWS secret access key. Write-only.
          description: >-
            Configuration for a `aws_eventbridge` destination. Provide this
            object under the `aws_eventbridge` property when `type` is
            `aws_eventbridge`.
        gcp_pubsub:
          type: object
          required:
            - project_id
            - topic
          properties:
            project_id:
              type: string
              description: Google Cloud project ID.
            topic:
              type: string
              description: 'Pub/Sub topic name. Accepted alias: `topic_name`.'
            service_account_json:
              type: string
              description: >-
                Service account credentials JSON. Accepted alias:
                `credentials_json`. Write-only.
          description: >-
            Configuration for a `gcp_pubsub` destination. Provide this object
            under the `gcp_pubsub` property when `type` is `gcp_pubsub`.
        rabbitmq:
          type: object
          required:
            - exchange
            - server_url
          properties:
            exchange:
              type: string
              description: Name of the RabbitMQ exchange.
            server_url:
              type: string
              description: >-
                RabbitMQ host as `host[:port]` (for example `rabbitmq:5672`).
                You may instead pass a full AMQP URL with embedded credentials;
                Deck extracts the host, username, and password from it.
            username:
              type: string
              description: >-
                RabbitMQ username (or embed it in the AMQP `server_url`).
                Write-only.
            password:
              type: string
              description: >-
                RabbitMQ password (or embed it in the AMQP `server_url`).
                Write-only.
          description: >-
            Configuration for a `rabbitmq` destination. Provide this object
            under the `rabbitmq` property when `type` is `rabbitmq`.
        azure_servicebus:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              description: >-
                Name of the Service Bus queue or topic. Accepted alias:
                `queue_name`.
            connection_string:
              type: string
              description: Azure Service Bus connection string. Write-only.
          description: >-
            Configuration for a `azure_servicebus` destination. Provide this
            object under the `azure_servicebus` property when `type` is
            `azure_servicebus`.
        hookdeck:
          type: object
          properties:
            token:
              type: string
              description: 'Hookdeck API key. Accepted alias: `api_key`. Write-only.'
          description: >-
            Configuration for a `hookdeck` destination. Provide this object
            under the `hookdeck` property when `type` is `hookdeck`.
      description: >-
        Request body for creating a new event destination. Provide `name`,
        `type`, `events`, and exactly one type-specific configuration object
        whose property name matches `type` (for example `{"type": "webhook",
        "webhook": {"url": "..."}}`).
    EventDestinationResponse:
      required:
        - id
        - object
        - name
        - status
        - type
        - events
        - created_at
        - updated_at
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the event destination, prefixed with `evtd_`.
        object:
          type: string
          description: Always `event_destination`.
        name:
          type: string
          description: Display name for the event destination.
        status:
          type: string
          description: 'Destination status: `pending_verification`, `active`, or `inactive`.'
        type:
          type: string
          enum:
            - webhook
            - aws_sqs
            - aws_kinesis
            - aws_s3
            - aws_eventbridge
            - gcp_pubsub
            - rabbitmq
            - azure_servicebus
            - hookdeck
          description: >-
            Destination type. The endpoint configuration is returned under a
            property whose name equals this value (for example, a `webhook`
            destination returns a `webhook` object).
        events:
          type: array
          items:
            type: string
          description: Event types this destination is subscribed to.
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the resource was created.
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the resource was last updated.
        request_id:
          type:
            - 'null'
            - string
          description: >-
            Unique identifier for the API request. Include this when contacting
            support.
        webhook:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              description: Absolute `https` or `http` URL that receives event deliveries.
          description: >-
            Configuration returned for a `webhook` destination (credentials are
            never returned).
        aws_sqs:
          type: object
          required:
            - queue_url
          properties:
            queue_url:
              type: string
              description: URL of the destination Amazon SQS queue.
          description: >-
            Configuration returned for a `aws_sqs` destination (credentials are
            never returned).
        aws_kinesis:
          type: object
          required:
            - stream_name
            - region
          properties:
            stream_name:
              type: string
              description: Name of the Amazon Kinesis stream.
            region:
              type: string
              description: AWS region of the stream.
          description: >-
            Configuration returned for a `aws_kinesis` destination (credentials
            are never returned).
        aws_s3:
          type: object
          required:
            - bucket
            - region
          properties:
            bucket:
              type: string
              description: Name of the destination Amazon S3 bucket.
            region:
              type: string
              description: AWS region of the bucket.
          description: >-
            Configuration returned for a `aws_s3` destination (credentials are
            never returned).
        aws_eventbridge:
          type: object
          required:
            - event_bus_name
            - region
          properties:
            event_bus_name:
              type: string
              description: Name of the Amazon EventBridge event bus.
            region:
              type: string
              description: AWS region of the event bus.
          description: >-
            Configuration returned for a `aws_eventbridge` destination
            (credentials are never returned).
        gcp_pubsub:
          type: object
          required:
            - project_id
            - topic
          properties:
            project_id:
              type: string
              description: Google Cloud project ID.
            topic:
              type: string
              description: 'Pub/Sub topic name. Accepted alias: `topic_name`.'
          description: >-
            Configuration returned for a `gcp_pubsub` destination (credentials
            are never returned).
        rabbitmq:
          type: object
          required:
            - exchange
            - server_url
          properties:
            exchange:
              type: string
              description: Name of the RabbitMQ exchange.
            server_url:
              type: string
              description: >-
                RabbitMQ host as `host[:port]` (for example `rabbitmq:5672`).
                You may instead pass a full AMQP URL with embedded credentials;
                Deck extracts the host, username, and password from it.
          description: >-
            Configuration returned for a `rabbitmq` destination (credentials are
            never returned).
        azure_servicebus:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              description: >-
                Name of the Service Bus queue or topic. Accepted alias:
                `queue_name`.
          description: >-
            Configuration returned for a `azure_servicebus` destination
            (credentials are never returned).
        hookdeck:
          type: object
          properties: {}
          description: >-
            Configuration returned for a `hookdeck` destination (credentials are
            never returned).
      description: >-
        An event destination object representing an endpoint that receives
        platform events.
    ValidationErrorResponse:
      required:
        - errors
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
          description: RFC 9110 problem type URI.
        title:
          type:
            - 'null'
            - string
          description: Short summary of the validation failure.
        status:
          type:
            - 'null'
            - integer
          description: HTTP status code.
          format: int32
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation errors grouped by field name.
        traceId:
          type:
            - 'null'
            - string
          description: Request trace identifier.
      description: Validation error returned for malformed requests (HTTP 400).
    ErrorResponse:
      required:
        - errors
        - request_id
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TaskRunError'
          description: One or more errors that describe what went wrong.
        request_id:
          type: string
          description: Unique identifier for this request, useful for tracing.
      description: Standard error response.
    TaskRunError:
      required:
        - type
        - code
        - message
      type: object
      properties:
        type:
          type: string
          description: >-
            Error category (e.g. `source`, `auth`, `task`, `rate_limit`).
            Determines the class of failure.
        code:
          type: string
          description: Machine-readable error code. Use this for programmatic handling.
        message:
          type: string
          description: >-
            Human-readable explanation. Do not rely on this for logic — it may
            change.
        field:
          type:
            - 'null'
            - string
          description: The input field that caused the error, when applicable.
      description: Error details for a failed task run. Same structure as API-level errors.
  securitySchemes:
    BearerAuth:
      type: http
      description: Secret key (sk_live_...)
      scheme: bearer
      bearerFormat: JWT

````