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

# Create Webhook Endpoint

> Creates a new webhook endpoint. A ping is sent immediately to validate the URL — it must respond with a `2xx` status code.

**Important:** The `secret` is only returned in this response. Store it securely.

**Prerequisite:** You must have at least one active webhook endpoint before you can create customers.




## OpenAPI

````yaml POST /webhooks
openapi: 3.1.0
info:
  title: KemyCard API
  version: '1.0'
  description: >
    KemyCard API allows you to issue virtual and physical cards, manage KYC/POA
    verification,

    create crypto wallets, virtual bank accounts, and purchase gift cards.
  contact:
    name: KemyCard API Support
    email: hi@kemycard.com
servers:
  - url: https://api.kemycard.com/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Customers
    description: Manage your customers
  - name: Card Products
    description: Browse the card product catalog
  - name: Cards
    description: Issue and manage cards
  - name: KYC
    description: Identity verification
  - name: POA
    description: Proof of address verification
  - name: Wallets
    description: Crypto wallets
  - name: Virtual Accounts
    description: Virtual bank accounts
  - name: Gift Cards
    description: Gift card catalog and purchases
  - name: Balance
    description: Operational balances and transaction history
  - name: Webhooks
    description: Webhook endpoints and delivery management
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook endpoint
      description: >
        Creates a new webhook endpoint. A ping is sent immediately to validate
        the URL — it must respond with a `2xx` status code.


        **Important:** The `secret` is only returned in this response. Store it
        securely.


        **Prerequisite:** You must have at least one active webhook endpoint
        before you can create customers.
      operationId: createWebhookEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '201':
          description: Webhook endpoint created (includes secret)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointWithSecretResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    CreateWebhookRequest:
      type: object
      required:
        - url
        - events
      properties:
        url:
          type: string
          format: uri
          description: HTTPS URL to receive webhook events. HTTP URLs are rejected.
          example: https://your-app.com/webhooks/kemycard
        events:
          type: array
          items:
            type: string
          description: List of event types to subscribe to. Use ["*"] for all events.
          example:
            - kyc.approved
            - kyc.rejected
            - card.transaction
        description:
          type: string
          nullable: true
          description: Optional label for this endpoint
          example: Production webhook
    WebhookEndpointWithSecretResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/WebhookEndpointWithSecret'
    WebhookEndpointWithSecret:
      allOf:
        - $ref: '#/components/schemas/WebhookEndpoint'
        - type: object
          properties:
            secret:
              type: string
              description: >-
                HMAC-SHA256 secret. **Only shown at creation time.** Store it
                securely.
              example: >-
                whsec_a1b2c3d4e5f6789012345678901234567890123456789012345678901234
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Missing required fields.
            details:
              type: object
              nullable: true
        meta:
          $ref: '#/components/schemas/Meta'
    WebhookEndpoint:
      type: object
      properties:
        code:
          type: string
          format: uuid
        url:
          type: string
          example: https://your-app.com/webhooks/kemycard
        events:
          type: array
          items:
            type: string
          example:
            - kyc.approved
            - kyc.rejected
            - card.transaction
        description:
          type: string
          nullable: true
        is_active:
          type: boolean
        consecutive_failures:
          type: integer
          description: Number of consecutive failed deliveries. Auto-deactivates at 100.
          example: 0
        last_success_at:
          type: string
          format: date-time
          nullable: true
        last_failure_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          nullable: true
    Meta:
      type: object
      properties:
        request_id:
          type: string
          example: a4f8e2c1b3d97056
        mode:
          type: string
          enum:
            - test
            - live
          example: test
        timestamp:
          type: string
          format: date-time
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk_test_... or sk_live_...)

````

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