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

# Create a Webhook endpoint

> Registers an endpoint and returns its signing secret once. Requires `webhooks:write`.



## OpenAPI

````yaml /openapi/heyrafiki.openapi.yaml post /webhook_endpoints
openapi: 3.1.0
info:
  title: Heyrafiki API
  version: 1.0.0
  description: Build Care, Cover and Payment workflows on Heyrafiki.
  contact:
    name: Heyrafiki
    url: https://heyrafiki.space
    email: developers@heyrafiki.space
  license:
    name: All rights reserved
    identifier: LicenseRef-Heyrafiki-Proprietary
servers:
  - url: https://api.heyrafiki.space/v1
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /webhook_endpoints:
    post:
      summary: Create a Webhook endpoint
      description: >-
        Registers an endpoint and returns its signing secret once. Requires
        `webhooks:write`.
      operationId: createWebhookEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEndpointInput'
      responses:
        '201':
          description: The Webhook endpoint was created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointWithSecret'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    WebhookEndpointInput:
      type: object
      additionalProperties: false
      required:
        - url
        - events
      properties:
        url:
          type: string
          format: uri
          maxLength: 2048
        events:
          type: array
          minItems: 1
          maxItems: 16
          items:
            type: string
            enum:
              - sandbox.ping
              - claim.submitted
              - claim.information_requested
              - claim.resubmitted
              - claim.approved
              - claim.partially_approved
              - claim.denied
              - claim.settled
              - remittance.reconciled
    WebhookEndpointWithSecret:
      type: object
      additionalProperties: false
      required:
        - id
        - object
        - url
        - events
        - status
        - created_at
        - disabled_at
        - signing_secret
      properties:
        id:
          type: string
          maxLength: 100
          pattern: ^whe_[A-Za-z0-9_-]+$
        object:
          type: string
          const: webhook_endpoint
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - active
            - disabled
        created_at:
          type: string
          format: date-time
        disabled_at:
          type:
            - string
            - 'null'
          format: date-time
        signing_secret:
          type: string
          readOnly: true
    ErrorEnvelope:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
            - docs
          properties:
            code:
              type: string
            message:
              type: string
            docs:
              type: string
              format: uri
  responses:
    BadRequest:
      description: The request failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: The API key is missing or invalid.
      headers:
        WWW-Authenticate:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: The API key does not permit this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unprocessable:
      description: The request is valid but cannot be completed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    TooManyRequests:
      description: The project exceeded its request limit.
      headers:
        Retry-After:
          description: Seconds until another request should be attempted.
          schema:
            type: integer
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ServiceUnavailable:
      description: The service is temporarily unavailable.
      headers:
        Retry-After:
          schema:
            type: integer
            example: 5
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  headers:
    RateLimitLimit:
      description: Maximum requests allowed in the current minute.
      schema:
        type: integer
    RateLimitRemaining:
      description: Requests remaining in the current minute.
      schema:
        type: integer
    RateLimitReset:
      description: Unix timestamp when the current limit resets.
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A sandbox or production secret key.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: An alternative for clients that cannot set Authorization.

````