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

# Register a hook



## OpenAPI

````yaml /api/openapi.yaml post /hooks
openapi: 3.1.0
info:
  title: Antigen API
  version: v1
  description: >-
    Use the Antigen API to manage targets, runs, vulnerabilities, evidence,
    reports, hooks, assets, and integrations.
servers:
  - url: https://api.antigen.sh/v1
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
  - SessionCookie: []
tags:
  - name: Authentication
  - name: API keys
  - name: Models
  - name: Agents
  - name: Targets
  - name: Runs
  - name: Vulnerabilities
  - name: Evidence
  - name: Reports
  - name: Hooks
  - name: Asset Map
  - name: Integrations
paths:
  /hooks:
    post:
      tags:
        - Hooks
      summary: Register a hook
      operationId: createHook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHookRequest'
      responses:
        '201':
          description: Hook registered. Store the signing secret now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedHook'
components:
  schemas:
    CreateHookRequest:
      type: object
      required:
        - event
        - url
      properties:
        event:
          type: string
          enum:
            - vulnerability.status_changed
            - vulnerability.assignee_changed
        url:
          type: string
          format: uri
        filter:
          $ref: '#/components/schemas/HookFilter'
        secret:
          type: string
    CreatedHook:
      allOf:
        - $ref: '#/components/schemas/Hook'
        - type: object
          required:
            - secret
          properties:
            secret:
              type: string
              description: Store this value now.
    HookFilter:
      type: object
      properties:
        from_status:
          $ref: '#/components/schemas/VulnerabilityStatus'
        to_status:
          $ref: '#/components/schemas/VulnerabilityStatus'
        severity:
          type: array
          items:
            $ref: '#/components/schemas/Severity'
    Hook:
      type: object
      required:
        - id
        - event
        - url
        - filter
        - created_at
      properties:
        id:
          type: string
          format: uuid
        event:
          type: string
          enum:
            - vulnerability.status_changed
            - vulnerability.assignee_changed
        url:
          type: string
          format: uri
        filter:
          $ref: '#/components/schemas/HookFilter'
        created_at:
          $ref: '#/components/schemas/Timestamp'
    VulnerabilityStatus:
      type: string
      enum:
        - open
        - in_progress
        - remediated
        - verified
        - accepted_risk
    Severity:
      type: string
      enum:
        - critical
        - high
        - medium
        - low
    Timestamp:
      type: string
      format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key from the Antigen dashboard.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: access token
      description: Better Auth access token.
    SessionCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Better Auth browser session cookie.

````