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

# Refresh VTXOs in delegated mode

> Registers the specified VTXOs for refresh as a delegated participation: the wallet hands the server a signed participation and the server carries it through the round, so the wallet doesn't need to follow the round interactively. The input VTXOs are locked immediately and will be forfeited once the round completes, yielding new VTXOs with a fresh expiry.

Set `height` to schedule the refresh for a future block height: the refresh fee is priced at that height and the server includes the participation in the first round once the chain tip reaches it. When `height` is omitted, the participation is eligible for the next round. Use the `rounds` endpoint to track progress.



## OpenAPI

````yaml https://gitlab.com/ark-bitcoin/bark/-/raw/master/bark-rest/openapi.json post /api/v1/wallet/refresh/delegated/vtxos
openapi: 3.1.0
info:
  title: barkd REST API
  description: >-
    A simple REST API for barkd, a wallet daemon for integrating bitcoin
    payments into your app over HTTP. Supports self-custodial Lightning, Ark,
    and on-chain out of the box.


    barkd is a long-running daemon best suited for always-on or
    high-connectivity environments like nodes, servers, desktops, and
    point-of-sale terminals.


    All endpoints return JSON. Amounts are denominated in satoshis.
  contact:
    name: Second Team
    email: hello@second.tech
  license:
    name: MIT
    identifier: MIT
  version: 0.6.0
servers: []
security:
  - bearer: []
tags:
  - name: boards
    description: Move on-chain bitcoin onto the Ark protocol.
  - name: exits
    description: Move bitcoin back on-chain without server cooperation.
  - name: fees
    description: Estimate fees for wallet operations before executing them.
  - name: history
    description: Inspect and annotate wallet movement history.
  - name: lightning
    description: Create Lightning invoices and track receives.
  - name: onchain
    description: Manage barkd's on-chain bitcoin wallet.
  - name: wallet
    description: Manage Ark balances and VTXOs, send payments via Ark, LN, and on-chain.
  - name: bitcoin
    description: Query bitcoin network data.
  - name: notifications
    description: Receive real-time notifications from barkd.
paths:
  /api/v1/wallet/refresh/delegated/vtxos:
    post:
      tags:
        - wallet
      summary: Refresh VTXOs in delegated mode
      description: >-
        Registers the specified VTXOs for refresh as a delegated participation:
        the wallet hands the server a signed participation and the server
        carries it through the round, so the wallet doesn't need to follow the
        round interactively. The input VTXOs are locked immediately and will be
        forfeited once the round completes, yielding new VTXOs with a fresh
        expiry.


        Set `height` to schedule the refresh for a future block height: the
        refresh fee is priced at that height and the server includes the
        participation in the first round once the chain tip reaches it. When
        `height` is omitted, the participation is eligible for the next round.
        Use the `rounds` endpoint to track progress.
      operationId: refresh_delegated
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DelegatedRefreshRequest'
        required: true
      responses:
        '200':
          description: Returns the refresh result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PendingRoundInfo'
        '400':
          description: No VTXO IDs provided, or one of the provided VTXO IDs is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '404':
          description: One the VTXOs wasn't found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    DelegatedRefreshRequest:
      type: object
      required:
        - vtxos
      properties:
        height:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Optional block height to schedule the refresh at. When set, the
            refresh fee is priced at

            that height and the server includes the participation in the first
            round once the chain

            tip reaches it; when omitted, the participation is eligible for the
            next round.
          minimum: 0
        vtxos:
          type: array
          items:
            type: string
          description: >-
            List of VTXO IDs to refresh. The sum of the VTXOs being refreshed
            must be

            >= [P2TR_DUST](bitcoin_ext::P2TR_DUST). Keep in mind that fees set
            out in

            [RefreshFees](crate::cli::fees::RefreshFees) will be deducted from
            the newly created VTXO, this

            value must also be >= [P2TR_DUST](bitcoin_ext::P2TR_DUST).
    PendingRoundInfo:
      type: object
      required:
        - id
        - status
        - participation
        - unlock_hash
        - funding_txid
      properties:
        funding_tx_hex:
          type:
            - string
            - 'null'
        funding_txid:
          type:
            - string
            - 'null'
          description: The round transaction id, if already assigned
        id:
          type: integer
          format: int32
          description: Unique identifier for the round
          minimum: 0
        participation:
          $ref: '#/components/schemas/RoundParticipationInfo'
          description: the round participation details
        status:
          $ref: '#/components/schemas/RoundStatus'
          description: the current status of the round
        unlock_hash:
          type:
            - string
            - 'null'
    BadRequestError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    NotFoundError:
      type: object
      required:
        - resources
        - message
      properties:
        message:
          type: string
        resources:
          type: array
          items:
            type: string
    InternalServerError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    RoundParticipationInfo:
      type: object
      required:
        - inputs
        - outputs
      properties:
        inputs:
          type: array
          items:
            type: string
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/VtxoRequestInfo'
    RoundStatus:
      oneOf:
        - type: object
          description: Failed to sync round
          required:
            - error
            - status
          properties:
            error:
              type: string
            status:
              type: string
              enum:
                - sync-error
        - type: object
          description: The round was successful and is fully confirmed
          required:
            - funding_txid
            - status
          properties:
            funding_txid:
              type: string
            status:
              type: string
              enum:
                - confirmed
        - type: object
          description: Round successful but not fully confirmed
          required:
            - funding_txid
            - status
          properties:
            funding_txid:
              type: string
            status:
              type: string
              enum:
                - unconfirmed
        - type: object
          description: We have unsigned funding transactions that might confirm
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - pending
        - type: object
          description: The round failed
          required:
            - error
            - status
          properties:
            error:
              type: string
            status:
              type: string
              enum:
                - failed
        - type: object
          description: The round canceled
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - canceled
    VtxoRequestInfo:
      type: object
      required:
        - amount_sat
        - policy_type
        - user_pubkey
      properties:
        amount_sat:
          type: integer
          format: int64
          minimum: 0
        policy_type:
          type: string
        user_pubkey:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: AuthToken
      description: Base64url-encoded auth token

````