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

# Register a webhook endpoint

> Registers an HTTPS URL (port 443 or 8443) to receive events. The
response contains the signing `secret` (`whsec_…`). **It is shown only
once.** Live and test endpoints are separate: an endpoint created with
a test key receives only test events.




## OpenAPI

````yaml /openapi.yaml post /webhook_endpoints
openapi: 3.1.0
info:
  title: Relettr API
  version: '1'
  summary: Translate manhwa chapters (Korean comics) into lettered English.
  description: |
    The Relettr public REST API, version 1.

    Every request is authenticated with an API key sent as a bearer token
    (`rl_live_…` or `rl_test_…`). Credits are integers; 100 credits = $1.

    Within v1 only additive changes are made: new endpoints, new optional
    fields, new event types and new enum values. Ignore unknown fields, and
    treat an unknown chapter `status` as non-terminal.
  contact:
    name: Relettr support
    email: support@relettr.com
servers:
  - url: https://api.relettr.com/v1
    description: Production (live and test keys)
security:
  - bearer: []
tags:
  - name: Chapters
    description: Create, upload, quote, start, poll and download a chapter.
  - name: Regions and review
    description: >-
      Read and edit the translated text, re-render, and resolve failed-mask
      zones.
  - name: Series
    description: Series hold the binding glossary and the context shared between chapters.
  - name: Glossary
    description: Glossary entries of a series.
  - name: Webhooks
    description: Registered webhook endpoints.
  - name: Events
    description: The events that are delivered to webhooks, as a list you can page through.
  - name: Credits
    description: Balance, usage, ledger and price estimates.
  - name: Status
    description: Service status. No authentication.
  - name: Test helpers
    description: Endpoints that exist only for `rl_test_` keys.
paths:
  /webhook_endpoints:
    post:
      tags:
        - Webhooks
      summary: Register a webhook endpoint
      description: |
        Registers an HTTPS URL (port 443 or 8443) to receive events. The
        response contains the signing `secret` (`whsec_…`). **It is shown only
        once.** Live and test endpoints are separate: an endpoint created with
        a test key receives only test events.
      operationId: createWebhookEndpoint
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                events:
                  type: array
                  description: |
                    Event types to send. Defaults to every type except
                    `chapter.step_completed`, which is opt-in.
                  items:
                    $ref: '#/components/schemas/EventType'
                description:
                  type: string
                  maxLength: 200
      responses:
        '201':
          description: The endpoint, including its secret.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/WebhookEndpoint'
                  - type: object
                    properties:
                      secret:
                        type: string
                        examples:
                          - whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        A unique key for this request (a UUIDv4 is recommended). See
        Idempotency.
      schema:
        type: string
        maxLength: 255
  schemas:
    EventType:
      type: string
      enum:
        - chapter.ready
        - chapter.queued
        - chapter.processing
        - chapter.step_completed
        - chapter.needs_review
        - chapter.succeeded
        - chapter.failed
        - chapter.canceled
        - chapter.expired
        - chapter.deleted
        - balance.low
        - api_key.spend_limit_reached
        - ping
    WebhookEndpoint:
      type: object
      properties:
        id:
          type: string
          examples:
            - we_4mN8pQ2rS3tU4vW5xY6zA7
        object:
          const: webhook_endpoint
        livemode:
          type: boolean
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventType'
        enabled:
          type: boolean
        description:
          type:
            - string
            - 'null'
        api_version:
          const: v1
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          additionalProperties: true
          description: |
            Some codes add fields: `required` and `available` (402),
            `scope`, `limit` and `used_this_month` (spend limits), `limit` and
            `active` (concurrency), `estimated_wait_s` (503), `status` and
            `allowed_from` (invalid_state), `missing_indexes`
            (upload_incomplete).
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - authentication
                - permission
                - not_found
                - conflict
                - payment_required
                - rate_limited
                - capacity
                - api_error
            code:
              type: string
              examples:
                - parameter_invalid
            message:
              type: string
            param:
              type: string
              examples:
                - files[3].content_type
            doc_url:
              type: string
              format: uri
            request_id:
              type: string
  responses:
    BadRequest:
      description: '`parameter_invalid`, `parameter_missing` or `json_invalid`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: '`api_key_missing`, `api_key_invalid` or `api_key_revoked`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        `scope_missing`, `test_key_live_object`, `live_key_test_object` or
        `account_suspended`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: '`rate_limited` or `concurrency_limit`.'
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: |
        An API key: `rl_live_…` for real work, `rl_test_…` for test mode.
        Create keys on the site. Never put a key in browser code.

````

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