---
title: "Rotate current user's API key"
method: POST
path: "/user/me/api-keys/rotate"
tags: ["User"]
---

# Rotate current user's API key

`POST /user/me/api-keys/rotate`

## Request

- Base URL: `https://api.crawlora.net/api/v1`
- URL: `https://api.crawlora.net/api/v1/user/me/api-keys/rotate`
- Auth: none declared. Required headers: `Authorization`

Generates a new active API key for the JWT-authenticated user and places the previous key into a 24 hour grace period.

## Headers

- `Authorization` string, required

## Response `200`

Rotated API key

- UserUserRotateAPIKeyResponseDoc
  - `code` integer
  - `data` UserUserRotateAPIKeyDoc
    - `active_key` UserUserAPIKeyItemDoc
      - `created_at` string
      - `expires_at` string
      - `id` string
      - `key_prefix` string
      - `key_suffix` string
      - `last_used_at` string
      - `last_used_ip` string
      - `masked_key` string
      - `rotated_at` string
      - `source` string
      - `status` string
      - `updated_at` string
    - `grace_period_seconds` integer
    - `new_api_key` string
    - `previous_key` UserUserAPIKeyItemDoc
      - `created_at` string
      - `expires_at` string
      - `id` string
      - `key_prefix` string
      - `key_suffix` string
      - `last_used_at` string
      - `last_used_ip` string
      - `masked_key` string
      - `rotated_at` string
      - `source` string
      - `status` string
      - `updated_at` string
  - `msg` string

## Other responses

- `401`: Authentication required
- `500`: Internal server error

---

[API](https://skmtc.dev/crawlora/apis/crawlora-api.md) · [All operations](https://skmtc.dev/crawlora/apis/crawlora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crawlora/apis/crawlora-api/revisions/028417aa35bb?raw)
