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

# Update Webhook Settings

Updates the webhook URL where your partner account receives event notifications. To disable webhook delivery, send `null` as the `url` value.

<Info>
  For details on webhook payloads and HMAC validation, see the [Webhooks Guide](/docs/how-our-webhooks-work).
</Info>

***

## Use Cases

* **Set a webhook URL**: Start receiving notifications for transaction status changes and KYC events.
* **Update the URL**: Point notifications to a new server after a migration.
* **Disable webhooks**: Send `url: null` to stop receiving notifications.

***

## Error Codes

### Common Errors

| HTTP Status | Code                   | Message                            |
| ----------- | ---------------------- | ---------------------------------- |
| 401         | `UNAUTHORIZED`         | "API Key is missing"               |
| 401         | `UNAUTHORIZED`         | "Invalid API Key format"           |
| 401         | `UNAUTHORIZED`         | "Invalid API Key"                  |
| 403         | `INVALID_PARTNER_FLOW` | "The partner has an invalid flow." |

### Endpoint-Specific Errors

| HTTP Status | Code                       | Message              |
| ----------- | -------------------------- | -------------------- |
| 400         | `INVALID_USER_INPUT_ERROR` | "Invalid User Input" |


## OpenAPI

````yaml reference/openapi/PartnerWebhookSettingsV2Controller_update.json PUT /api/partner/v2/webhook-settings
openapi: 3.0.0
info:
  title: Capa Partner API - V2
  description: >-
    Partner API for integrating cryptocurrency on-ramp and off-ramp services
    using Capa's infrastructure. Enable your users to seamlessly convert between
    fiat and crypto.
  version: v2
  contact: {}
servers:
  - url: https://staging-api.capa.fi
  - url: https://production-api.capa.fi
security: []
paths:
  /api/partner/v2/webhook-settings:
    put:
      tags:
        - webhook-settings
      operationId: PartnerWebhookSettingsV2Controller_update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  nullable: true
                  description: >-
                    the url where the webhook notifications will be sent to. To
                    reset the value `null` can be sent in the body.
                  example: https://some-webhook-endpoint.url
              required:
                - url
              x-readme-ref-name: UpdatePartnerWebhookSettingsBody
      responses:
        '200':
          description: >-
            Allows an affiliated partner to update the settings for receiving
            webhook notifications.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The entity id.
                        example: 12a121ad-cbea-4ec4-9e0a-5c861e528bba
                      partnerId:
                        type: string
                        description: The id of the partner that can manage these settings.
                        example: 12a121ad-cbea-4ec4-9e0a-5c861e528bba
                      url:
                        type: string
                        nullable: true
                        description: >-
                          The url where the partner will receive webhook
                          notifications.
                        example: https://some-webhook-endpoint.url
                      createdAt:
                        format: date-time
                        type: string
                        description: The creation date of the entity.
                        example: '2024-04-05 13:45:27.063'
                      updatedAt:
                        format: date-time
                        type: string
                        description: The update date of the entity.
                        example: '2024-04-05 13:45:27.063'
                    required:
                      - id
                      - partnerId
                      - url
                      - createdAt
                      - updatedAt
                    x-readme-ref-name: PartnerWebhookSettingsHttpResponse
              example:
                success: true
                data:
                  id: 12a121ad-cbea-4ec4-9e0a-5c861e528bba
                  partnerId: 12a121ad-cbea-4ec4-9e0a-5c861e528bba
                  url: https://some-webhook-endpoint.url
                  createdAt: '2024-04-05 13:45:27.063'
                  updatedAt: '2024-04-05 13:45:27.063'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                INVALID_USER_INPUT_ERROR:
                  value:
                    success: false
                    code: INVALID_USER_INPUT_ERROR
                    message: Invalid User Input
                BAD_REQUEST:
                  value:
                    success: false
                    code: BAD_REQUEST
                    message: Provided url {url} is not valid
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                UNAUTHORIZED:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: API Key is missing
                UNAUTHORIZED_2:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key format
                UNAUTHORIZED_3:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                code: NOT_FOUND_ERROR
                message: Requested PartnerWebhookSettings was not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                code: INTERNAL_SERVER_ERROR
                message: Internal server error
      security:
        - PartnerApiKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          description: Optional per-field validation details.
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
      required:
        - success
        - code
        - message
  securitySchemes:
    PartnerApiKey:
      type: apiKey
      in: header
      name: partner-api-key
      description: API key for the affiliated partner performing the request.

````