> ## 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.

# 웹훅 생성 (v3)

> 비어 있지 않고 중복이 없는 subscribedEvents 목록으로 웹훅을 등록합니다. 지원 값은 event-types에서 조회하세요. 테스트 키는 isTest=true로 강제되며 false를 명시하면 AUTH_FORBIDDEN입니다. 등록 응답에 서명 secret이 포함됩니다. 안전하게 보관하세요. 상세 조회에서도 확인할 수 있습니다.

```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 ko/api-reference/openapi.yaml POST /api/v3/orders/webhooks
openapi: 3.0.0
info:
  title: ContentCare API
  version: 2.0.0
  description: >
    ContentCare API는 디지털 콘텐츠 보호를 위한 네 가지 핵심 서비스를 제공합니다:

    - **Anti-AI**: 이미지를 AI 학습으로부터 보호

    - **Watermark Embed**: 이미지에 보이지 않는 디지털 워터마크 삽입

    - **Watermark Extract**: 이미지에서 워터마크 추출 및 검증

    - **AI Detection**: 이미지가 AI로 생성되었는지 감지

    - **테스트 API 키**: `sk_test_` 접두사의 키는 동일한 Bearer 인증을 사용하며, 실제 처리 서비스나 크레딧 사용
    없이 주문 흐름을 검증할 수 있습니다. 테스트 업로드는 파일 내용을 폐기하고 결과 파일을 만들지 않습니다
  contact:
    name: ContentCare 지원
    email: support@contentcare.ai
  license:
    name: Proprietary
    url: https://docs.contentcare.ai/legal/terms
servers:
  - url: https://api.bizmori.com
    description: 프로덕션
security: []
tags:
  - name: Anti-AI
    description: AI 학습 방지 이미지 보호 주문
  - name: Watermark Embed
    description: 워터마크 삽입 주문
  - name: Watermark Extract
    description: 워터마크 추출 주문
  - name: AI Detection
    description: AI 생성 이미지 감지 주문
  - name: Orders
    description: 주문 조회 및 관리
  - name: Webhooks
    description: 웹훅 설정 및 이벤트
  - name: Reports
    description: 워터마크 추출·AI Detection 주문의 PDF 분석 보고서
paths:
  /api/v3/orders/webhooks:
    post:
      tags:
        - Webhooks
      summary: 웹훅 생성 (v3)
      description: >-
        비어 있지 않고 중복이 없는 subscribedEvents 목록으로 웹훅을 등록합니다. 지원 값은 event-types에서
        조회하세요. 테스트 키는 isTest=true로 강제되며 false를 명시하면 AUTH_FORBIDDEN입니다. 등록 응답에 서명
        secret이 포함됩니다. 안전하게 보관하세요. 상세 조회에서도 확인할 수 있습니다.
      operationId: createWebhookV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookV3CreateRequest'
      responses:
        '200':
          description: 성공
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebhookV3Endpoint'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: 같은 계정의 정규화 URL 중복
      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: 필수이며 비어 있거나 중복된 이벤트는 허용하지 않습니다.
    WebhookV3Endpoint:
      type: object
      properties:
        webhookId:
          type: integer
        name:
          type: string
        url:
          type: string
          format: uri
        secret:
          type: string
          description: 등록·상세 조회에만 포함됩니다.
        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: 웹훅 이름 (식별용)
        url:
          type: string
          format: uri
          description: 웹훅 엔드포인트 URL
          example: https://example.com/webhook
        isTest:
          type: boolean
          description: >-
            엔드포인트 모드. 테스트 API 키에서는 생략하거나 true를 사용하며 false는 AUTH_FORBIDDEN을
            반환합니다. live API 키는 두 모드를 선택할 수 있습니다.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 에러 코드
  responses:
    Unauthorized:
      description: 인증 실패
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        외부 클라이언트 접근을 위한 Bearer API 키. 일반 키는 `sk_` 접두사를 사용하고, 테스트 키는 `sk_test_`
        접두사로 모의 응답을 사용해 실제 처리나 크레딧 사용 없이 주문 흐름을 검증합니다.

````

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