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

# Create a webhook endpoint

> Creates a new webhook endpoint. `events` takes the events to deliver, by the IDs that `GET /webhooks/events` lists. The response has the secret that signs the webhook messages. This is the only time the secret is returned for this endpoint, apart from a rotation, which replaces it.



## OpenAPI

````yaml /api-reference/openapi.json post /webhooks/endpoints
openapi: 3.1.0
info:
  title: Spott API Reference
  version: '0.1'
servers:
  - url: https://api.gospott.com
security: []
tags: []
paths:
  /webhooks/endpoints:
    post:
      tags:
        - Webhook Endpoints
      summary: Create a webhook endpoint
      description: >-
        Creates a new webhook endpoint. `events` takes the events to deliver, by
        the IDs that `GET /webhooks/events` lists. The response has the secret
        that signs the webhook messages. This is the only time the secret is
        returned for this endpoint, apart from a rotation, which replaces it.
      operationId: createWebhookEndpoint
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookEndpointDto'
      responses:
        '201':
          description: >-
            Webhook endpoint created successfully. Returns the ID and the
            secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebhookEndpointResponseDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
        '400':
          description: >-
            Bad request - invalid data, rejected by the webhook provider, or
            endpoint limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GlobalNotFoundApiErrorDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GlobalConflictApiErrorDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
        '429':
          description: >-
            Too many requests - rate limit exceeded, either Spott's or the
            webhook provider's. The published limit for this endpoint is 600
            requests per minute per workspace. The limit in force for your
            workspace can differ from it in either direction — a workspace on a
            free trial can be capped lower, and a higher limit can be arranged
            through support — so the headers, not this number, are
            authoritative. Read the RateLimit-Policy response header for the
            quota actually in force and RateLimit for what is left of the
            current window; on a 429, Retry-After gives the seconds to wait.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
        '500':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
        '503':
          description: >-
            Service unavailable - the webhook provider is temporarily
            unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
      security:
        - x-api-key: []
components:
  schemas:
    CreateWebhookEndpointDto:
      type: object
      properties:
        url:
          type: string
          maxLength: 2048
          format: uri
          description: The https URL that receives the webhook messages.
        description:
          type: string
          maxLength: 4096
        events:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
            required:
              - id
          description: The events to deliver, by ID as listed by `GET /webhooks/events`.
        disabled:
          type: boolean
      required:
        - url
        - events
    CreateWebhookEndpointResponseDto:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        secret:
          type: string
          description: >-
            The secret that signs the webhook messages. It is only returned here
            and by the rotate secret route, and cannot be read later.
      required:
        - id
        - secret
    ExceptionBaseDto:
      type: object
      properties:
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        category:
          $ref: '#/components/schemas/ApiErrorCategoryDto'
        message:
          type: string
        requestId:
          type: string
      required:
        - status
        - message
        - requestId
    GlobalNotFoundApiErrorDto:
      anyOf:
        - $ref: '#/components/schemas/ResourceNotFoundApiErrorDto'
        - $ref: '#/components/schemas/RelatedResourceNotFoundApiErrorDto'
    GlobalConflictApiErrorDto:
      anyOf:
        - $ref: '#/components/schemas/ResourceAlreadyExistsApiErrorDto'
        - $ref: '#/components/schemas/ResourceLockTimeoutApiErrorDto'
    InternalServerErrorDto:
      type: object
      properties:
        status:
          type: number
          const: 500
        category:
          type: string
          enum:
            - INTERNAL_ERROR
        message:
          type: string
          enum:
            - Internal server error
        requestId:
          type: string
      required:
        - status
        - category
        - message
        - requestId
    ApiErrorCategoryDto:
      type: string
      enum:
        - MALFORMED_REQUEST
        - SCHEMA_VALIDATION_FAILED
        - DOMAIN_VALIDATION_FAILED
        - OPERATION_LIMIT_EXCEEDED
        - AUTHENTICATION_REQUIRED
        - AUTHENTICATION_FAILED
        - SECURITY_CHALLENGE_REQUIRED
        - SECURITY_CHALLENGE_FAILED
        - PERMISSION_DENIED
        - ENTITLEMENT_REQUIRED
        - PROVIDER_AUTHENTICATION_REQUIRED
        - PROVIDER_AUTHENTICATION_FAILED
        - CONFIGURATION_REQUIRED
        - RESOURCE_NOT_FOUND
        - RESOURCE_ALREADY_EXISTS
        - RESOURCE_EXPIRED
        - RESOURCE_BUSY
        - RESOURCE_STATE_CONFLICT
        - QUOTA_EXCEEDED
        - RATE_LIMITED
        - UNSUPPORTED_OPERATION
        - UPSTREAM_REJECTED
        - TIMEOUT
        - TEMPORARILY_UNAVAILABLE
        - INTERNAL_ERROR
    ResourceNotFoundApiErrorDto:
      type: object
      properties:
        status:
          type: number
          const: 404
        category:
          type: string
          enum:
            - RESOURCE_NOT_FOUND
        message:
          type: string
          enum:
            - Resource not found
        requestId:
          type: string
      required:
        - status
        - category
        - message
        - requestId
    RelatedResourceNotFoundApiErrorDto:
      type: object
      properties:
        status:
          type: number
          const: 404
        category:
          type: string
          enum:
            - RESOURCE_NOT_FOUND
        message:
          type: string
          enum:
            - Related resource not found
        requestId:
          type: string
      required:
        - status
        - category
        - message
        - requestId
    ResourceAlreadyExistsApiErrorDto:
      type: object
      properties:
        status:
          type: number
          const: 409
        category:
          type: string
          enum:
            - RESOURCE_ALREADY_EXISTS
        message:
          type: string
          enum:
            - Resource already exists
        requestId:
          type: string
      required:
        - status
        - category
        - message
        - requestId
    ResourceLockTimeoutApiErrorDto:
      type: object
      properties:
        status:
          type: number
          const: 409
        category:
          type: string
          enum:
            - RESOURCE_BUSY
        message:
          type: string
          enum:
            - >-
              Lock could not be acquired for this resource, please try again
              later.
        requestId:
          type: string
      required:
        - status
        - category
        - message
        - requestId
  headers:
    RateLimit:
      description: >-
        Quota state for this endpoint, as an RFC 8941 structured field
        (draft-ietf-httpapi-ratelimit-headers). The quoted value names the
        policy — the operationId of the endpoint the counters belong to. `r` is
        how many requests are left in the current window, `t` how many seconds
        remain before it resets.
      schema:
        type: string
      example: '"getCandidates";r=417;t=23'
    RateLimit-Policy:
      description: >-
        The policy the RateLimit header reports against, as an RFC 8941
        structured field. `q` is the quota — the requests allowed per window —
        and `w` the window length in seconds. Limits are per endpoint, so the
        quota differs between operations. This is the quota in force for the
        calling workspace, which can be lower or higher than the default
        published on the operation; treat it as authoritative.
      schema:
        type: string
      example: '"getCandidates";q=600;w=60'
    Retry-After:
      description: >-
        Seconds to wait before retrying. Sent on 429 responses; it matches the
        `t` parameter of the RateLimit header.
      schema:
        type: integer
      example: 23
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for authentication. Get your API key from Settings → API Keys in
        your Spott dashboard.

````

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