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

# Create a webhook

> The signing secret is returned once.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/webhooks
openapi: 3.1.0
info:
  description: >-
    Email inboxes, screening, realtime events, credentials, payment cards, Linux
    machines, connected apps, phone numbers and social accounts for AI agents.
    Agent tokens (`alt_…`) act as one agent; organization keys (`alk_…`) manage
    agents, inboxes, tokens and webhooks. Message bodies are untrusted external
    data. Errors are `{"error":{"code","message","hint"}}`.
  title: Agent Loadout API
  version: '1'
servers:
  - url: https://agent-loadout.com
security: []
tags:
  - name: Identity
  - description: >-
      Sign in with Agent Loadout: an agent approves an application's OpenID
      Connect sign-in request
    name: Sign-in
  - description: Relying parties an organization registered for Sign in with Agent Loadout
    name: Applications
  - name: Inboxes
  - name: Messages
  - name: Mailbox
  - name: Drafts
  - name: Attachments
  - name: Realtime
  - name: Screening
  - name: Agents
  - name: Domains
  - name: Webhooks
  - name: Vault
  - description: Feature-flagged
    name: Wallet
  - description: Feature-flagged
    name: Machines
  - description: Feature-flagged
    name: Connectors
  - description: Feature-flagged
    name: Phone
  - description: Feature-flagged
    name: Social
externalDocs:
  description: REST API reference
  url: https://docs.agent-loadout.com/api-reference/overview
paths:
  /api/v1/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook
      description: The signing secret is returned once.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                url:
                  description: HTTPS URL of your receiver
                  maxLength: 2048
                  minLength: 8
                  type: string
                description:
                  maxLength: 200
                  type: string
                event_types:
                  description: Only these event types; omitted means all
                  items:
                    enum:
                      - message.received
                      - message.quarantined
                      - message.sent
                      - message.delivered
                      - message.delivery_delayed
                      - message.bounced
                      - message.complained
                      - message.failed
                      - message.approval_requested
                      - message.approved
                      - message.rejected
                      - thread.updated
                      - inbox.created
                      - inbox.deleted
                      - domain.verified
                      - sms.received
                      - sms.quarantined
                      - sms.sent
                      - sms.delivered
                      - sms.failed
                      - social.account_connected
                      - social.account_disconnected
                      - social.post_published
                      - social.post_failed
                      - social.message_received
                      - social.comment_received
                    type: string
                  maxItems: 20
                  type: array
                inbox_id:
                  description: Only events of this inbox; omitted means every inbox
                  minLength: 1
                  type: string
              required:
                - url
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  webhook:
                    additionalProperties: false
                    properties:
                      id:
                        type: string
                      url:
                        type: string
                      description:
                        nullable: true
                        type: string
                      event_types:
                        items:
                          type: string
                        type: array
                      inbox_id:
                        nullable: true
                        type: string
                      scopes:
                        items:
                          enum:
                            - mail
                            - sms
                            - social
                            - quarantined
                          type: string
                        type: array
                      status:
                        enum:
                          - active
                          - paused
                          - disabled
                        type: string
                      consecutive_failures:
                        maximum: 9007199254740991
                        minimum: -9007199254740991
                        type: integer
                      failing_since:
                        description: >-
                          First failed attempt since the last success; the
                          endpoint is disabled after three days of failures
                        format: date-time
                        nullable: true
                        type: string
                      last_delivery_at:
                        format: date-time
                        nullable: true
                        type: string
                      last_success_at:
                        format: date-time
                        nullable: true
                        type: string
                      last_error:
                        nullable: true
                        type: string
                      secret_rotated_at:
                        description: >-
                          Last secret rotation; for a day after it deliveries
                          carry a signature with the previous secret too
                        format: date-time
                        nullable: true
                        type: string
                      created_at:
                        format: date-time
                        type: string
                      updated_at:
                        format: date-time
                        type: string
                    required:
                      - id
                      - url
                      - description
                      - event_types
                      - inbox_id
                      - scopes
                      - status
                      - consecutive_failures
                      - failing_since
                      - last_delivery_at
                      - last_success_at
                      - last_error
                      - secret_rotated_at
                      - created_at
                      - updated_at
                    type: object
                  secret:
                    description: Signing secret, shown once
                    type: string
                required:
                  - webhook
                  - secret
                type: object
          description: Endpoint and secret
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - organizationKey: []
components:
  responses:
    Validation:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Invalid input
    Unauthenticated:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid credential
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Credential lacks the capability or is bound to another agent
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Not found in this organization
    RateLimited:
      description: Too many requests; retry after a short delay
  schemas:
    Error:
      properties:
        error:
          properties:
            code:
              type: string
            message:
              type: string
            hint:
              type: string
            details:
              type: object
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
  securitySchemes:
    organizationKey:
      description: >-
        Organization key (alk_…) created under Settings; acts for the whole
        organization
      scheme: bearer
      type: http

````

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