---
title: "Me Regenerate"
method: POST
path: "/api/auth/me/regenerate"
tags: ["auth"]
---

# Me Regenerate

`POST /api/auth/me/regenerate`

## Request

- Base URL: `https://api.halalterminal.com`
- URL: `https://api.halalterminal.com/api/auth/me/regenerate`
- Auth: API key in header `X-API-Key`

Deactivate the *calling* API key and issue a replacement.

Path-clean replacement for `/api/keys/{api_key}/regenerate`. The
request must carry the old key in the `X-API-Key` header; after
success the old key is permanently deactivated and the response
carries the `new_key` to use for subsequent requests.

**curl example**:
```bash
curl -X POST -H "X-API-Key: ht_abc123"       https://api.halalterminal.com/api/auth/me/regenerate
```

## Response `200`

The old (deactivated) key and the new replacement key

- RegenerateKeyResponse: Response returned after regenerating an API key.
  - `old_key` string, required: The deactivated API key
  - `new_key` string, required: The newly generated replacement key
  - `email` string, required: Email associated with the key
  - `plan` string, required: Plan tier carried over to the new key

## Other responses

- `401`: Missing or invalid API key
- `404`: API key not found or already inactive

---

[API](https://skmtc.dev/halalterminal/apis/halal-terminal-api.md) · [All operations](https://skmtc.dev/halalterminal/apis/halal-terminal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/halalterminal/apis/halal-terminal-api/revisions/78768b250943?raw)
