---
title: "Update a key name or IP allowlist"
method: PATCH
path: "/v1/keys/{id}"
tags: ["keys"]
---

# Update a key name or IP allowlist

`PATCH /v1/keys/{id}`

## Request

- Base URL: `https://api.hyperresearch.ai`
- URL: `https://api.hyperresearch.ai/v1/keys/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `hr_session`

P3-013 policy: the allowlist is a list of IPv4/IPv6 addresses or IPv4 CIDR blocks; empty clears it.

## Path parameters

- `id` string, required

## Request body

- UpdateKeyBody
  - `name` string
  - `ip_allowlist` string[]

## Response `200`

Updated

- ApiKey
  - `id` string, required
  - `name` string, nullable, required
  - `prefix` 'hr_live_' | 'hr_test_' | 'hr_chat_', required
  - `masked` string, required
  - `scopes` string[], required
  - `last_used_at` string, nullable, required
  - `expires_at` string, nullable, required
  - `revoked_at` string, nullable, required
  - `created_at` string, required
  - `ip_allowlist` string[], required
  - `rotate_by` string, nullable, required
  - `rotation_due` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Authentication failed
- `403`: Insufficient scope or plan
- `404`: Not found
- `429`: Rate limited or over quota
- `500`: Internal error

---

[API](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api.md) · [All operations](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api/revisions/726ef831ebf4?raw)
