---
title: "Replace or clear API-key policy bindings"
method: PUT
path: "/v1/api-keys/{keyId}/policy-bindings"
tags: ["API Keys"]
---

# Replace or clear API-key policy bindings

`PUT /v1/api-keys/{keyId}/policy-bindings`

Explicitly replaces the complete all-wallet/selected-wallet policy binding set, or clears it. Existing bindings are otherwise preserved by API-key updates and rotation.

## Path parameters

- `keyId` string, required — API key identifier.

## Headers

- `x-project-id` string — Selects the active project for this request. Required for session/dashboard callers. Ignored when authenticating with an API key, whose scope is fixed to the key's project.

## Request body

- union — Explicitly replace the complete API-key policy binding set, or clear every policy binding.
  - object
    - `mode` 'replace', required
    - `bindings` union[], required
      - union
        - object — All-wallet policy binding replacement.
          - `bindingScope` 'all', required
          - `apiKeyControlProfileId` string, required — Active API-key control profile shared by all wallets in key scope.
        - object — Selected-wallet policy binding replacement. At least one control profile ID is required.
          - `bindingScope` 'selected', required
          - `walletId` string, required — Selected custody wallet ID.
          - `walletControlProfileId` string — Optional active wallet control profile for this wallet.
          - `apiKeyControlProfileId` string — Optional active API-key control profile for this wallet.
  - object
    - `mode` 'clear', required

## Response `200`

API-key policy bindings updated

- object — Standard success response envelope.
  - `data` object, required
    - `policyBindings` object[], required
      - `id` string, required — API-key wallet policy binding ID.
      - `bindingScope` 'all' | 'selected', required — Whether this policy binding applies to every wallet or one selected wallet.
      - `walletId` string, nullable, required — Selected wallet ID when this binding is wallet-specific.
      - `custodyWalletId` string, nullable, required — Internal custody wallet row ID when this binding is wallet-specific.
      - `walletControlProfileId` string, nullable, required — Wallet control profile applied by this binding, if any.
      - `walletControlProfileRevisionId` string, nullable, required — Active wallet control profile revision applied by this binding, if any.
      - `apiKeyControlProfileId` string, nullable, required — API-key control profile applied by this binding, if any.
      - `apiKeyControlProfileRevisionId` string, nullable, required — Active API-key control profile revision applied by this binding, if any.
      - `createdAt` string, date-time, required — Policy binding creation timestamp.
      - `updatedAt` string, date-time, required — Policy binding update timestamp.
  - `meta` object, required — Response metadata.
    - `requestId` string, required — Request identifier for tracing.
    - `timestamp` string, date-time, required — ISO 8601 timestamp.

## Other responses

- `400` — Error
- `401` — Error
- `403` — Error
- `404` — Error
- `500` — Error

---

[API](https://skmtc.net/solana/apis/solana-developer-platform-api.md) · [All operations](https://skmtc.net/solana/apis/solana-developer-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/solana/solana-developer-platform-api/revisions/672b1916ba61/schema)
