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

# Create a Webhook

> Create a new webhook for a specific app.



## OpenAPI

````yaml post /apps/{app_id}/webhooks
openapi: 3.0.0
info:
  version: 1.0.0
  title: API
servers: []
security: []
paths:
  /apps/{app_id}/webhooks:
    post:
      summary: Create a Webhook
      description: Create a new webhook for a specific app.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the app
          name: app_id
          in: path
      requestBody:
        description: The webhook to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateWebhookSchema'
      responses:
        '200':
          description: The created webhook.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSchema'
components:
  schemas:
    CreateWebhookSchema:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: URL to which the webhook will send POST requests
          example: https://example.com/webhook
        events:
          type: array
          items:
            type: string
            enum:
              - record.created
              - record.running
              - record.completed
              - record.failed
            description: Type of the webhook event
            example: record.created
          description: List of events that trigger the webhook
          example:
            - record.created
            - record.completed
      required:
        - url
        - events
      description: Data to create a new webhook
    WebhookSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the webhook
        url:
          type: string
          format: uri
          description: URL to which the webhook will send POST requests
          example: https://example.com/webhook
        created_at:
          type: string
          nullable: true
          description: Timestamp when the webhook was created
          format: date
        updated_at:
          type: string
          nullable: true
          description: Timestamp when the webhook was last updated
          format: date
        events:
          type: array
          items:
            type: string
            enum:
              - record.created
              - record.running
              - record.completed
              - record.failed
            description: Type of the webhook event
            example: record.created
          description: List of events that trigger the webhook
          example:
            - record.created
            - record.completed
      required:
        - id
        - url
        - created_at
        - updated_at
        - events
      description: Detailed information about a webhook

````