AddKeyToClient
POST/v1/customers/:customer_id/projects/:project_id/clients/:client_id/keys
AddKeyToClient attaches an existing key to a client. A key still in the default project is moved into the client's project.
Fails with FAILED_PRECONDITION when the key would leave a client that other keys stay in and whose per-key budget is active: that budget sums the client's current keys, so the move would carry the key's accrued spend out of it. Deactivate the budget first, then attach.
Fails with ALREADY_EXISTS when the key carries its own per-key budget and the client already holds an active one at the same intent: a standalone key's budget moves with it, and two cannot govern one client. The attachment is rolled back with it.
Request
Responses
- 200
Success