# Create spending permission

Prepares a capped SPL approve on Solana devnet for the Abazi executor and returns the unsigned transaction (fee payer is the owner) for the wallet to sign. Console session or API key with delegation:sign; the cap can't exceed the organization budget, and 409 NO_TEST_USDC or NO_SOL_FOR_FEE returns a faucet link.

`POST /v1/delegations`

Prepares a capped SPL approve on Solana devnet for the Abazi executor and returns the unsigned transaction (fee payer is the owner) for the wallet to sign. Console session or API key with delegation:sign; the cap can't exceed the organization budget, and 409 NO_TEST_USDC or NO_SOL_FOR_FEE returns a faucet link.

Requires permission `delegation:sign`.

## Request body

```json
{
  "cap_base_units": "50000"
}
```

## Responses

- **200**: Success.
- **400**: Invalid request: a field is missing or malformed (VALIDATION_ERROR).
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).
- **403**: Authenticated but not allowed: missing permission, passkey step-up required, or denied by policy.

Example 200 response:

```json
{
  "delegation": {
    "id": "id_01jd2x3k4m5n6p7q8r9s0t1v2w",
    "network": "eip155:84532",
    "network_name": "string",
    "kind": "string",
    "status": "active",
    "owner_address": "string",
    "token_account": "string",
    "delegate": "string",
    "asset": "USDC",
    "cap_base_units": "50000",
    "used_base_units": "50000",
    "remaining_base_units": "50000",
    "onchain": {
      "delegate": "string",
      "delegate_ok": true,
      "remaining": "string",
      "balance": "string",
      "source": "string"
    },
    "tx_ref": "string"
  },
  "unsigned_tx": "string",
  "tx_encoding": "string",
  "tx_format": "string",
  "recent_blockhash": "string",
  "last_valid_block_height": 1,
  "explanation": {}
}
```
