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

# Withdraw vesting lock

> Build a transaction that unlocks and withdraws vested tokens

Builds a transaction that unlocks and withdraws tokens from a vesting lock.

**Auth:** Public

## Request body

<ParamField body="id" type="string" required>
  Vesting UTxO ID in `txHash:index` format.
</ParamField>

<ParamField body="address" type="string" required>
  Caller's Cardano address (must match the lock owner).
</ParamField>

## Response

<ResponseField name="cbor" type="string">
  Hex-encoded signed transaction CBOR.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://token-vesting.snek.fun/withdraw \
    --header 'Content-Type: application/json' \
    --data '{
      "id": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef:0",
      "address": "addr1..."
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "cbor": "84a500..."
  }
  ```
</ResponseExample>

## Error response

<ResponseField name="cause" type="string">
  Machine-readable error code.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable error message.
</ResponseField>

Possible errors:

* `400 INVALID_PARAMS` — one or more required fields are missing or have the wrong type.
* `400 UTxO_SPENT` — the vesting UTxO has already been spent.
* `400 INVALID_DATUM` — the referenced UTxO has no inline datum.
* `400 LOCK_NOT_EXPIRED` — the vesting lock is still active and cannot be withdrawn yet.
* `403 NOT_OWNER` — `address` does not match the lock owner.
* `404 UTxO_NOT_FOUND` — the referenced vesting UTxO does not exist.
* `500 SERVER_ERROR` — unexpected server-side failure.

<ResponseExample>
  ```json 400 theme={null}
  {
    "cause": "LOCK_NOT_EXPIRED",
    "message": "Lock is still active. Unlocks at 2026-12-31T00:00:00.000Z"
  }
  ```
</ResponseExample>
