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

# Create webhook subscription

> Create a new webhook subscription. The signing secret is returned only once.



## OpenAPI

````yaml /public_openapi.json post /api/public/v1/webhooks
openapi: 3.0.3
info:
  title: ColdSend Public API
  description: >-
    Programmatic access to ColdSend for managing cold email campaigns and sender
    accounts.
  version: 1.0.0
  contact:
    name: ColdSend Support
    email: support@coldsend.pro
    url: https://coldsend.pro
servers:
  - url: https://api.coldsend.pro
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/public/v1/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create webhook subscription
      description: >-
        Create a new webhook subscription. The signing secret is returned only
        once.
      operationId: create_webhook_api_public_v1_webhooks_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCreateRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WebhookCreateRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        target_url:
          type: string
          maxLength: 2048
          title: Target Url
        event_types:
          items:
            type: string
          type: array
          minItems: 1
          title: Event Types
        campaign_id:
          type: string
          format: uuid
          nullable: true
          title: Campaign Id
        event_categories:
          items:
            type: string
          type: array
          nullable: true
          title: Event Categories
      type: object
      required:
        - name
        - target_url
        - event_types
      title: WebhookCreateRequest
      description: Request to create a webhook subscription.
    WebhookCreateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        target_url:
          type: string
          title: Target Url
        workspace_id:
          type: string
          format: uuid
          title: Workspace Id
        event_types:
          items:
            type: string
          type: array
          title: Event Types
        event_categories:
          items:
            type: string
          type: array
          nullable: true
          title: Event Categories
        campaign_id:
          type: string
          format: uuid
          nullable: true
          title: Campaign Id
        active:
          type: boolean
          title: Active
        secret:
          type: string
          title: Secret
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - name
        - target_url
        - workspace_id
        - event_types
        - active
        - secret
        - created_at
      title: WebhookCreateResponse
      description: Response after creating a webhook (includes secret shown once).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key with format cs_live_xxx

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.