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

# Create an event destination



## OpenAPI

````yaml https://api.prets.io/v1/openapi.json post /v1/events/destinations
openapi: 3.1.0
info:
  title: Prets API
  version: 1.0.0
servers:
  - url: https://api.prets.app
security:
  - bearerAuth: []
paths:
  /v1/events/destinations:
    post:
      summary: Create an event destination
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEventDestinationRequest'
      responses:
        '201':
          description: >-
            Event destination created. `bearerSecret` is returned cleartext
            exactly once.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEventDestinationResponse'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden — missing `org:events:manage` permission
        '409':
          description: Conflict — organization already has an event destination
      security:
        - bearerAuth: []
components:
  schemas:
    CreateEventDestinationRequest:
      type: object
      properties:
        destinationId:
          type: string
          pattern: ^whk_[0-9A-HJKMNP-TV-Z]{26}$
          description: Optional client-supplied id. Server-generated when omitted.
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: Human-readable label for this destination within the organization.
          example: Production
        url:
          type: string
          maxLength: 2048
          pattern: ^((%[0-9A-Fa-f]{2}|[-()_.!~*';/?:@&=+$,A-Za-z0-9])+)([).!';/?:,])?$
          description: >-
            Public HTTPS endpoint that will receive event deliveries. Plain HTTP
            is rejected.
          example: https://example.com/prets/events
      required:
        - name
        - url
      x-stability: experimental
    CreateEventDestinationResponse:
      type: object
      properties:
        destinationId:
          type: string
          pattern: ^whk_[0-9A-HJKMNP-TV-Z]{26}$
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: Human-readable label for this destination within the organization.
          example: Production
        url:
          type: string
          maxLength: 2048
          pattern: ^((%[0-9A-Fa-f]{2}|[-()_.!~*';/?:@&=+$,A-Za-z0-9])+)([).!';/?:,])?$
          description: >-
            Public HTTPS endpoint that will receive event deliveries. Plain HTTP
            is rejected.
          example: https://example.com/prets/events
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        bearerSecret:
          type: string
          pattern: ^whsec_[A-Za-z0-9_-]{43}$
          description: >-
            Bearer secret returned cleartext exactly once when minted. Sent on
            every delivery as `Authorization: Bearer {secret}`. Cannot be
            retrieved later.
          example: whsec_3XvK2nQ8mB7pR1sT4uW6yZ0aE5gH9jLcV2bN1xM4qP8
      required:
        - destinationId
        - name
        - url
        - createdAt
        - updatedAt
        - bearerSecret
      x-stability: experimental
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````