---
title: "Rename API Key"
method: PATCH
path: "/v1/api-keys/{id}"
tags: ["API Key Management"]
---

# Rename API Key

`PATCH /v1/api-keys/{id}`

## Request

- Base URL: `https://api.oilpriceapi.com`
- URL: `https://api.oilpriceapi.com/v1/api-keys/{id}`
- Auth: API key in header `Authorization`

Set or clear the display name of one of your API keys. The key value and its permissions are unchanged.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `name` string, nullable, required: New display name. Blank clears the name.

## Response `200`

Key renamed

- object
  - `status` 'success', required
  - `data` object, required

## Other responses

- `404`: Key not found (or belongs to another user)
- `422`: name is missing or invalid
- `500`: Unexpected server error. Retry transient failures with bounded backoff and retain the request ID when contacting support.

## Changes

- **2026-10-17** `d83e7b18c195`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/changes/v1/api-keys/:id/patch.md)

---

[API](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1.md) - [All operations](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/revisions/7f8b4d763210?raw)
