---
title: "Create new API key"
method: POST
path: "/api_keys"
tags: ["API Keys"]
---

# Create new API key

`POST /api_keys`

## Request

- Base URL: `https://tlsradar.com/api/v1`
- URL: `https://tlsradar.com/api/v1/api_keys`
- Auth: one of:
  - OAuth 2 (authorization code, authorization URL `https://tlsradar.com/oauth/authorize`, token URL `https://tlsradar.com/oauth/token`, scopes: `read`, `write`)
  - HTTP bearer

Creates a new API key. The raw key is only shown once in the response.

## Request body

- object
  - `api_key` object, required
    - `name` string, required: Name for the API key
    - `scopes` string[]
    - `team_id` string, uuid: Scope key to specific team
    - `expires_at` string, date-time: Expiration date

## Response `201`

API key created. IMPORTANT: The raw_key is only shown once.

- object
  - `data` ApiKey
    - `id` string, uuid
    - `name` string
    - `key_prefix` string: First 8 characters of the key
    - `scopes` string[]
    - `status` 'active' | 'revoked'
    - `team_id` string, uuid, nullable
    - `last_used_at` string, date-time, nullable
    - `expires_at` string, date-time, nullable
    - `created_at` string, date-time
  - `raw_key` string: Full API key (only shown once)
  - `warning` string

---

[API](https://skmtc.dev/tlsradar/apis/tls-radar-api.md) · [All operations](https://skmtc.dev/tlsradar/apis/tls-radar-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tlsradar/apis/tls-radar-api/revisions/ecf1eb879b34?raw)
