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

# Set webhook URL for a channel

> Register a webhook URL that will receive events (message:created, review:responded) for the given channel. Replaces any previously configured webhook.



## OpenAPI

````yaml /openapi.json post /api/v1/agents/setWebhook
openapi: 3.0.0
info:
  title: Placet API
  description: Chat-based agent inbox for AI-human interaction
  version: 0.1.0
  contact: {}
servers:
  - url: http://localhost:3001
    description: Local development
security: []
tags: []
paths:
  /api/v1/agents/setWebhook:
    post:
      tags:
        - Agents
      summary: Set webhook URL for a channel
      description: >-
        Register a webhook URL that will receive events (message:created,
        review:responded) for the given channel. Replaces any previously
        configured webhook.
      operationId: AgentsAgentController_setWebhook
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetWebhookDto'
      responses:
        '200':
          description: Webhook configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api-key: []
components:
  schemas:
    SetWebhookDto:
      type: object
      properties:
        url:
          type: string
          format: uri
        channelId:
          type: string
          minLength: 1
        headers:
          type: object
          additionalProperties:
            type: string
        auth:
          $ref: '#/components/schemas/SetWebhookDtoAuth'
      required:
        - url
        - channelId
    AgentResponse:
      type: object
      properties:
        id:
          type: string
          example: clxyz456
        name:
          type: string
          example: My Agent
        description:
          type: string
          example: A helpful assistant
        avatarUrl:
          type: string
          example: https://example.com/avatar.png
        webhookUrl:
          type: string
          example: https://example.com/webhook
        lastActiveAt:
          type: string
          example: '2025-01-01T12:00:00.000Z'
        createdAt:
          type: string
          example: '2025-01-01T00:00:00.000Z'
      required:
        - id
        - name
        - createdAt
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Validation failed
        errors:
          description: Zod validation errors (only on 400)
          type: array
          items:
            $ref: '#/components/schemas/ZodValidationError'
      required:
        - statusCode
        - message
    SetWebhookDtoAuth:
      type: object
      properties:
        username:
          type: string
        password:
          type: string
      required:
        - username
        - password
    ZodValidationError:
      type: object
      properties:
        code:
          type: string
          example: invalid_type
        message:
          type: string
          example: Expected string, received number
        path:
          example:
            - email
          type: array
          items:
            type: string
      required:
        - code
        - message
        - path
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Placet API key (hp_...)

````