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

# Create a webhook

> Create a new webhook.



## OpenAPI

````yaml https://api.engine.usesophic.com/openapi.json post /webhooks
openapi: 3.1.0
info:
  title: Sophic Engine API
  version: 0.1.0
servers:
  - url: https://api.engine.usesophic.com/
security: []
paths:
  /webhooks:
    post:
      summary: Create a webhook
      description: Create a new webhook.
      operationId: create_webhook_webhooks_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookWithSecret'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateWebhookRequest:
      properties:
        url:
          type: string
          title: Url
          description: >-
            The URL of the webhook. Note that the URL must use HTTPS and must
            not be an IP address.
          examples:
            - https://example.com/webhook
        description:
          title: Description
          description: Optional description of what the webhook is used for.
          x-remove-null-from-type-union: true
          type: string
      type: object
      required:
        - url
      title: CreateWebhookRequest
    WebhookWithSecret:
      properties:
        id:
          type: string
          title: Id
          description: Unique resource identifier.
        url:
          type: string
          title: Url
          description: The URL of the webhook.
        is_active:
          type: boolean
          title: Is Active
          description: Whether the webhook is active.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of what the webhook is used for.
        secret:
          type: string
          title: Secret
          description: >-
            The signing secret for this webhook. **This is only exposed once at
            creation so please store it securely.**
        created_at:
          type: string
          format: date-time
          title: Created At
          description: >-
            The timestamp (in
            [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html)
            format) of when the resource was created.
        modified_at:
          type: string
          format: date-time
          title: Modified At
          description: >-
            The timestamp (in
            [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html)
            format) of when the resource was last modified.
      type: object
      required:
        - created_at
        - modified_at
        - id
        - url
        - is_active
        - description
        - secret
      title: WebhookWithSecret
    Error:
      properties:
        detail:
          type: string
          title: Detail
          description: A human-readable description of the error.
        code:
          type: string
          title: Code
          description: A machine-readable error code.
        docs:
          title: Docs
          description: A URL to documentation about this error code.
          x-remove-null-from-type-union: true
          type: string
        context:
          title: Context
          description: An optional object for adding extra context to the error.
          x-remove-null-from-type-union: true
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
          type: object
        params:
          title: Params
          description: An optional list of params that failed validation.
          x-remove-null-from-type-union: true
          items:
            $ref: '#/components/schemas/InvalidParam'
          type: array
      type: object
      required:
        - detail
        - code
      title: Error
    InvalidParam:
      properties:
        path:
          items:
            anyOf:
              - type: integer
              - type: string
          type: array
          title: Path
          description: Path to the field name (or index if a list) that errored.
        detail:
          type: string
          title: Detail
          description: Human-readable detail for error.
        code:
          type: string
          title: Code
          description: A machine-readable error code.
      type: object
      required:
        - path
        - detail
        - code
      title: InvalidParam
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````