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

# Update webhook target

> Update a webhook target for the organization. Any provided field replaces its current value; omitted fields are left unchanged. Pass `repo_ids: null` to clear the repo filter and make the target org-wide.

<Note>**Required scope:** `admin`</Note>


## OpenAPI

````yaml /openapi.json patch /{org}/webhook-targets/{webhookTargetId}
openapi: 3.1.0
info:
  title: Depot API
  description: Depot HTTP API v1
  version: 1.0.0
servers:
  - url: https://api.mesa.dev/v1
security:
  - apiKey: []
paths:
  /{org}/webhook-targets/{webhookTargetId}:
    patch:
      tags:
        - Webhook Target
      summary: Update webhook target
      description: >-
        Update a webhook target for the organization. Any provided field
        replaces its current value; omitted fields are left unchanged. Pass
        `repo_ids: null` to clear the repo filter and make the target org-wide.
      operationId: updateWebhookTarget
      parameters:
        - in: path
          name: org
          schema:
            type: string
            minLength: 1
          required: true
        - in: path
          name: webhookTargetId
          schema:
            type: string
            minLength: 1
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  anyOf:
                    - type: string
                      minLength: 1
                      maxLength: 256
                    - type: 'null'
                url:
                  type: string
                  format: uri
                events:
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - repo.created
                      - repo.updated
                      - repo.deleted
                      - bookmark.created
                      - bookmark.deleted
                      - bookmark.moved
                      - bookmark.merged
                      - change.created
                      - change.evolved
                      - push
                      - sync.queued
                      - sync.in_progress
                      - sync.completed
                      - sync.failed
                repo_ids:
                  anyOf:
                    - minItems: 1
                      type: array
                      items:
                        type: string
                        minLength: 1
                    - type: 'null'
      responses:
        '200':
          description: Webhook target updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    anyOf:
                      - type: string
                      - type: 'null'
                  url:
                    type: string
                  events:
                    type: array
                    items:
                      type: string
                      enum:
                        - repo.created
                        - repo.updated
                        - repo.deleted
                        - bookmark.created
                        - bookmark.deleted
                        - bookmark.moved
                        - bookmark.merged
                        - change.created
                        - change.evolved
                        - push
                        - sync.queued
                        - sync.in_progress
                        - sync.completed
                        - sync.failed
                  repo_ids:
                    anyOf:
                      - type: array
                        items:
                          type: string
                      - type: 'null'
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                required:
                  - id
                  - name
                  - url
                  - events
                  - repo_ids
                  - created_at
                  - updated_at
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '406':
          description: Not acceptable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key

````