# Change a Gas Station Policy

Its limits, coverage or switch. Its chain and asset never change.

## Overview

- Only the fields sent change; the policy that results keeps the rules of [Create a Policy](https://docs.aureahub.com/docs/gas-station-policy-create.md), with the same refusals (`400` `GAS_STATION_INVALID`, `404` `GAS_STATION_ACCOUNT_NOT_FOUND`). `chain`, `isTestnet` and `asset` are not fields of this route: a policy for another chain or asset is a new one.
- A `coverage` changed without its `accountId` or `tag` drops the one it had: `account` → `custodial` clears `accountId`. Moving to `account` or `tag` needs its `accountId` or `tag` in the same call.
- `"enabled": false` stops its top-ups; the policy still stands in place of Aurea's default for its chain, network and asset.
- `200` with the policy. Another tenant's policy, or one of Aurea's defaults: `404` `GAS_STATION_POLICY_NOT_FOUND`.
- For `owner`, `tenantadmin` and `non_signing_admin`, on their own tenant. Written to your audit trail [Coming soon, upon request](https://docs.aureahub.com/docs/feature-availability.md), as `gas_station.policy.changed`, with the fields that changed.

## Endpoint

### `PATCH /v1/gas-station/policies/{policyId}`

Authentication: bearer token required.

Changes a Gas Station policy's limits, coverage or switch.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `policyId` | string (uuid) | yes | The policy's id |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `threshold` | string | no | Below this balance a covered wallet is topped up |
| `target` | string | no | The balance it is topped up to; above `threshold` |
| `capPerTopUp` | string | no | At most this much per top-up; above 0 |
| `capPerWalletDay` | string | no | At most this much per wallet in any 24 hours; at least `capPerTopUp` |
| `maxGasPriceWei` | string | no | No top-up while the network's gas price is above it, in wei; above 0 |
| `coverage` | string | no | `custodial`, `account` or `tag` |
| `accountId` | string (uuid) \| null | no | The account, with `coverage` `account` only |
| `tag` | string \| null | no | The accounts' tag, with `coverage` `tag` only |
| `includeNonCustodial` | boolean | no | Client-side and MPC wallets too |
| `enabled` | boolean | no | `false`: no top-up under this policy |

**Responses**

`200` Changed

```json
{
  "id": "8c3e1f5a-2b7d-4e90-a1c6-3d5f7b9e2a14",
  "scope": "tenant",
  "chain": "base",
  "isTestnet": false,
  "chainId": 8453,
  "asset": "native",
  "decimals": 18,
  "threshold": "200000000000000",
  "target": "1000000000000000",
  "capPerTopUp": "1000000000000000",
  "capPerWalletDay": "3000000000000000",
  "maxGasPriceWei": "5000000000",
  "coverage": "custodial",
  "accountId": null,
  "tag": null,
  "includeNonCustodial": false,
  "enabled": true,
  "createdAt": "2026-10-14T09:20:11.402Z",
  "updatedAt": "2026-10-14T11:05:48.930Z"
}
```

`400` Coverage

```json
{
  "statusCode": 400,
  "error": "BadRequestError",
  "message": "tag is given with coverage tag, and only then",
  "details": { "code": "GAS_STATION_INVALID", "field": "tag" }
}
```

`404` Not found

```json
{
  "statusCode": 404,
  "error": "NotFoundError",
  "message": "Gas Station policy not found",
  "details": { "code": "GAS_STATION_POLICY_NOT_FOUND" }
}
```

**Example request**

```bash
curl -X PATCH https://api.aureahub.com/v1/gas-station/policies/8c3e1f5a-2b7d-4e90-a1c6-3d5f7b9e2a14 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "capPerWalletDay": "3000000000000000" }'
```

## By Tenant Id

The same, with your tenant's id, for the same roles; another tenant's id answers `403`.

### `PATCH /v1/admin/tenants/{id}/gas-station/policies/{policyId}`

Authentication: bearer token required.

Changes a Gas Station policy of the tenant.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Your tenant's id |
| `policyId` | string (uuid) | yes | The policy's id |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `threshold` | string | no | Below this balance a covered wallet is topped up |
| `target` | string | no | The balance it is topped up to; above `threshold` |
| `capPerTopUp` | string | no | At most this much per top-up; above 0 |
| `capPerWalletDay` | string | no | At most this much per wallet in any 24 hours; at least `capPerTopUp` |
| `maxGasPriceWei` | string | no | No top-up while the network's gas price is above it, in wei; above 0 |
| `coverage` | string | no | `custodial`, `account` or `tag` |
| `accountId` | string (uuid) \| null | no | The account, with `coverage` `account` only |
| `tag` | string \| null | no | The accounts' tag, with `coverage` `tag` only |
| `includeNonCustodial` | boolean | no | Client-side and MPC wallets too |
| `enabled` | boolean | no | `false`: no top-up under this policy |

**Responses**

`403` Another tenant

```json
{ "statusCode": 403, "error": "ForbiddenError", "message": "Admin access required or you can only access your own tenant." }
```

---

Web version: https://docs.aureahub.com/#gas-station-policy-update
