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

# Create Webhook



## OpenAPI

````yaml /api_docs/openapi.yaml post /v1/server/webhooks
openapi: 3.0.3
info:
  title: PlayCamp SDK API
  description: >
    PlayCamp SDK API - Game analytics and creator campaign integration API


    ## Required Integration APIs (Server API)

    3 APIs that must be integrated for campaign operation:

    - `POST /v1/server/sponsors` - User boosts a creator

    - `POST /v1/server/coupons/validate` - Validate coupon code

    - `POST /v1/server/payments` - Register in-game payment


    ## Authentication

    - **Client API**: `Authorization: Bearer {CLIENT_KEY_ID}:{CLIENT_SECRET}`

    - **Server API**: `Authorization: Bearer {SERVER_KEY_ID}:{SERVER_SECRET}`


    ## Servers

    - **Live**: https://sdk-api.playcamp.io (Production data)

    - **Sandbox**: https://sandbox-sdk-api.playcamp.io (Test data)


    ## Key Types

    - **Client Key**: For game client (read-only - campaign, creator queries)

    - **Server Key**: For game server (read/write - coupon redemption, payment
    registration, etc.)


    ## Test Mode (isTest)

    Before campaign launch, use `isTest: true` parameter to test API
    integration.

    - Request parameter validation is performed identically to production

    - Returns mock data without recording to actual DB

    - Verify integration in Sandbox environment before campaign launch, then
    remove `isTest` parameter for actual campaign
  version: 1.1.0
  contact:
    name: PlayCamp Support
servers:
  - url: https://sdk-api.playcamp.io
    description: Live Server
  - url: https://sandbox-sdk-api.playcamp.io
    description: Sandbox Server
  - url: http://localhost:3001
    description: Local Live Server
  - url: http://localhost:3003
    description: Local Sandbox Server
security: []
tags:
  - name: Health
    description: Server health check
  - name: Client Campaign
    description: Campaign queries (Client API)
  - name: Client Creator
    description: Creator queries (Client API)
  - name: Client Coupon
    description: Coupon validation (Client API)
  - name: Client Sponsor
    description: Boost status queries — Sponsor API (Client API)
  - name: Server Campaign
    description: Campaign queries (Server API)
  - name: Server Creator
    description: Creator queries (Server API)
  - name: Server Coupon
    description: Coupon management (Server API)
  - name: Server Sponsor
    description: Boost management — Sponsor API (Server API)
  - name: Server Payment
    description: Payment management (Server API)
  - name: Server Playtime
    description: Playtime session management (Server API)
  - name: Server Webhook
    description: Webhook management (Server API)
  - name: Server Webview
    description: WebView management (Server API)
paths:
  /v1/server/webhooks:
    post:
      tags:
        - Server Webhook
      summary: Create Webhook
      operationId: serverCreateWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - eventType
                - url
              properties:
                eventType:
                  type: string
                  enum:
                    - coupon.redeemed
                    - payment.created
                    - payment.bulk_created
                    - sponsor.created
                    - sponsor.ended
                  description: |
                    Webhook event types:
                    - `coupon.redeemed`: Coupon redeemed
                    - `payment.created`: Payment created
                    - `sponsor.created`: Boost created (Sponsor)
                url:
                  type: string
                  format: uri
                  description: Webhook receiver URL
                retryCount:
                  type: integer
                  default: 3
                  minimum: 0
                  maximum: 10
                  description: Retry count on failure
                timeoutMs:
                  type: integer
                  default: 5000
                  minimum: 1000
                  maximum: 30000
                  description: Timeout (milliseconds)
      responses:
        '201':
          description: Success (secret is only returned in this response)
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/WebhookWithSecret'
      security:
        - ServerAuth: []
components:
  schemas:
    WebhookWithSecret:
      type: object
      description: Webhook creation response (includes secret)
      allOf:
        - $ref: '#/components/schemas/Webhook'
        - type: object
          properties:
            secret:
              type: string
              description: >-
                Secret for webhook signature verification (only returned on
                creation, not retrievable afterwards)
    Webhook:
      type: object
      description: Webhook configuration (secret is only returned on creation)
      properties:
        id:
          type: integer
        eventType:
          type: string
          enum:
            - coupon.redeemed
            - payment.created
            - payment.bulk_created
            - sponsor.created
            - sponsor.ended
        url:
          type: string
          format: uri
        isActive:
          type: boolean
        retryCount:
          type: integer
        timeoutMs:
          type: integer
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    ServerAuth:
      type: http
      scheme: bearer
      description: 'Server API Key (format: {keyId}:{secret})'

````