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

> ## Agent Instructions
> The CoinStack API base URL is https://coinstack.net/api/v1. Authenticate with an API key sent as 'Authorization: Bearer sk_...' from a server, never from a browser. Every response is a JSON object with 'success' and 'response'. Amounts are strings; token amounts on quotes and payments are in the token's smallest unit. Fulfil an order when its checkout status is 'completed', not when the customer returns to success_url. Verify the CoinStack-Signature header on every webhook using the raw request body. The OpenAPI file is at https://docs.coinstack.net/openapi.json.

# Update a webhook

> Changes a webhook's URL, its events, or both. Fields you leave out stay as they are.

Requires an API key with write access.



## OpenAPI

````yaml /openapi.json patch /webhooks/{webhook_id}
openapi: 3.1.0
info:
  title: CoinStack API
  version: 1.0.0
  description: >-
    Create checkouts, read payments and manage webhooks. Authenticate with an
    API key sent as a Bearer token. Every response is a JSON object with
    `success` and `response`.
servers:
  - url: https://coinstack.net/api/v1
security:
  - bearerAuth: []
tags:
  - name: Checkouts
    description: Requests for one payment.
  - name: Quotes
    description: >-
      Deposit addresses and amounts for showing payment details in your own
      interface.
  - name: Payments
    description: Transfers customers have sent.
  - name: Tokens
    description: The tokens and networks customers can pay with.
  - name: Webhooks
    description: URLs that receive events.
  - name: Events
    description: Changes to checkouts and payments, and their deliveries.
  - name: Webhook events
    description: Requests CoinStack sends to your webhooks.
paths:
  /webhooks/{webhook_id}:
    patch:
      tags:
        - Webhooks
      summary: Update a webhook
      description: >-
        Changes a webhook's URL, its events, or both. Fields you leave out stay
        as they are.


        Requires an API key with write access.
      operationId: updateWebhook
      parameters:
        - name: webhook_id
          in: path
          required: true
          description: The webhook ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2000
                  description: >-
                    The new URL. It must start with `https://` and use a domain
                    name, not an IP address.
                events:
                  type: array
                  items:
                    $ref: '#/components/schemas/EventKind'
                  description: The new list of events. An empty list means every event.
            example:
              events:
                - checkout.completed
                - checkout.expired
                - checkout.resolved
      responses:
        '200':
          description: The updated webhook.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - response
                properties:
                  success:
                    type: boolean
                    description: Always `true` for a successful request.
                  response:
                    type: object
                    required:
                      - webhook
                    properties:
                      webhook:
                        $ref: '#/components/schemas/Webhook'
              example:
                success: true
                response:
                  webhook:
                    webhook_id: c2a9f1d4-7b3e-4c6a-9d2f-5e8b1a4c7d30
                    url: https://example.com/webhooks/coinstack
                    events:
                      - checkout.completed
                      - checkout.expired
                      - checkout.resolved
                    active: true
                    created_at: '2026-12-02T15:58:20.331904Z'
                    updated_at: '2026-12-02T16:40:09.118452Z'
        '400':
          description: A field is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_url:
                  summary: Invalid url
                  value:
                    success: false
                    response: Invalid url
                invalid_events:
                  summary: Invalid events
                  value:
                    success: false
                    response: Invalid events
        '401':
          description: The API key is missing, wrong or deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_authentication:
                  summary: Invalid authentication
                  value:
                    success: false
                    response: Invalid authentication
        '403':
          description: >-
            The API key is read only. This endpoint needs a key with write
            access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_permissions:
                  summary: Invalid permissions
                  value:
                    success: false
                    response: Invalid permissions
        '404':
          description: No webhook with this ID belongs to your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_webhook:
                  summary: Invalid webhook
                  value:
                    success: false
                    response: Invalid webhook
components:
  schemas:
    EventKind:
      type: string
      enum:
        - checkout.confirming
        - checkout.partial
        - checkout.completed
        - checkout.expired
        - checkout.resolved
        - payment.pending
        - payment.completed
        - payment.refunded
    Webhook:
      type: object
      description: A URL that CoinStack sends events to.
      required:
        - webhook_id
        - url
        - events
        - active
        - created_at
        - updated_at
      properties:
        webhook_id:
          type: string
          format: uuid
          description: The webhook ID.
        url:
          type: string
          format: uri
          description: The URL events are sent to.
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventKind'
          description: The events this webhook receives. An empty list means every event.
        active:
          type: boolean
          description: '`true` while the webhook exists.'
        created_at:
          type: string
          format: date-time
          description: When the webhook was created. Time in RFC 3339 format, in UTC.
        updated_at:
          type: string
          format: date-time
          description: When the webhook last changed. Time in RFC 3339 format, in UTC.
      example:
        webhook_id: c2a9f1d4-7b3e-4c6a-9d2f-5e8b1a4c7d30
        url: https://example.com/webhooks/coinstack
        events:
          - checkout.completed
          - checkout.expired
        active: true
        created_at: '2026-12-02T15:58:20.331904Z'
        updated_at: '2026-12-02T15:58:20.331904Z'
    Error:
      type: object
      required:
        - success
        - response
      properties:
        success:
          type: boolean
          description: Always `false` for an error.
        response:
          type: string
          description: What went wrong, for example `Invalid amount`.
      example:
        success: false
        response: Invalid amount
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key, which starts with `sk_`. Create one in the dashboard under
        Developers.

````

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