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

# Create webhook (v3)

> Register a webhook with a non-empty, unique `subscribedEvents` list. Get supported values from the event-types endpoint. A test API key forces `isTest=true`; explicitly setting false returns AUTH_FORBIDDEN. The response includes the signing secret. Store it securely; detail lookup also returns it.

```bash cURL theme={null}
curl -X POST "$CONTENTCARE_API_BASE_URL/api/v3/orders/webhooks" \
  -H "Authorization: Bearer $CONTENTCARE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"ContentCare webhook","url":"https://your-server.com/webhook","subscribedEvents":["order.watermarkEmbed.completed","order.watermarkEmbed.failed"]}'
```

```javascript Node.js theme={null}
const response = await fetch(`${process.env.CONTENTCARE_API_BASE_URL}/api/v3/orders/webhooks`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CONTENTCARE_API_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "ContentCare webhook",
    url: "https://your-server.com/webhook",
    subscribedEvents: ["order.watermarkEmbed.completed", "order.watermarkEmbed.failed"],
  }),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const webhook = await response.json(); // signing secret: webhook.data.secret
```

```python Python theme={null}
import os
import requests

response = requests.post(
    f"{os.environ['CONTENTCARE_API_BASE_URL']}/api/v3/orders/webhooks",
    headers={"Authorization": f"Bearer {os.environ['CONTENTCARE_API_TOKEN']}"},
    json={
        "name": "ContentCare webhook",
        "url": "https://your-server.com/webhook",
        "subscribedEvents": ["order.watermarkEmbed.completed", "order.watermarkEmbed.failed"],
    },
    timeout=30,
)
response.raise_for_status()
webhook = response.json()  # signing secret: webhook["data"]["secret"]
```


## OpenAPI

````yaml api-reference/openapi.yaml POST /api/v3/orders/webhooks
openapi: 3.0.0
info:
  title: ContentCare API
  version: 2.0.0
  description: >
    ContentCare API provides four core services for digital content protection:

    - **Anti-AI**: Protect images from AI training

    - **Watermark Embed**: Embed invisible digital watermarks into images

    - **Watermark Extract**: Extract and verify watermarks from images

    - **AI Detection**: Detect whether an image is AI-generated

    - **Test API keys**: Keys with the `sk_test_` prefix use the same Bearer
    authentication and support order-lifecycle testing with mock responses
    without running processing services or consuming credits; test uploads
    discard file contents and do not create result files
  contact:
    name: ContentCare Support
    email: support@contentcare.ai
  license:
    name: Proprietary
    url: https://docs.contentcare.ai/legal/terms
servers:
  - url: https://api.bizmori.com
    description: Production
security: []
tags:
  - name: Anti-AI
    description: Anti-AI image protection orders
  - name: Watermark Embed
    description: Watermark embedding orders
  - name: Watermark Extract
    description: Watermark extraction orders
  - name: AI Detection
    description: AI-generated image detection orders
  - name: Orders
    description: Order query and management
  - name: Webhooks
    description: Webhook configuration and events
  - name: Reports
    description: PDF analysis reports for watermark extract and AI Detection orders
paths:
  /api/v3/orders/webhooks:
    post:
      tags:
        - Webhooks
      summary: Create webhook (v3)
      description: >-
        Register a webhook with a non-empty, unique `subscribedEvents` list. Get
        supported values from the event-types endpoint. A test API key forces
        `isTest=true`; explicitly setting false returns AUTH_FORBIDDEN. The
        response includes the signing secret. Store it securely; detail lookup
        also returns it.
      operationId: createWebhookV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookV3CreateRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebhookV3Endpoint'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: The normalized URL already exists for this account
      security:
        - BearerAuth: []
components:
  schemas:
    WebhookV3CreateRequest:
      allOf:
        - $ref: '#/components/schemas/WebhookCreateRequest'
        - type: object
          required:
            - subscribedEvents
          properties:
            subscribedEvents:
              type: array
              minItems: 1
              uniqueItems: true
              items:
                type: string
                enum:
                  - order.antiAi.completed
                  - order.antiAi.failed
                  - order.watermarkEmbed.completed
                  - order.watermarkEmbed.failed
                  - order.watermarkExtract.completed
                  - order.watermarkExtract.failed
                  - order.aiDetection.completed
                  - order.aiDetection.failed
              description: Required, non-empty unique event types
    WebhookV3Endpoint:
      type: object
      properties:
        webhookId:
          type: integer
        name:
          type: string
        url:
          type: string
          format: uri
        secret:
          type: string
          description: Included only on create and detail lookup
        isTest:
          type: boolean
        isActive:
          type: boolean
        subscribedEvents:
          type: array
          items:
            type: string
        lastSentAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    WebhookCreateRequest:
      type: object
      required:
        - url
      properties:
        name:
          type: string
          maxLength: 100
          description: Webhook name (for identification)
        url:
          type: string
          format: uri
          description: Webhook endpoint URL
          example: https://example.com/webhook
        isTest:
          type: boolean
          description: >-
            Endpoint mode. For a test API key, omit this field or use true;
            false returns AUTH_FORBIDDEN. Live API keys may choose either mode.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer API key for external client access. Live keys use the `sk_`
        prefix; test keys use the `sk_test_` prefix and support order-lifecycle
        testing with mock responses without processing or credit usage.

````

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