---
title: "Create a new API-key"
method: POST
path: "/key-auths"
tags: ["API-keys"]
---

# Create a new API-key

`POST /key-auths`

Create a new API-key

## Request body

- KeyAuth
  - `created_at` integer — Unix epoch when the resource was created.
  - `id` string
  - `key` string
  - `tags` string[]
  - `consumer` object
    - `id` string

## Response `201`

Successfully created API-key

- KeyAuth
  - `created_at` integer — Unix epoch when the resource was created.
  - `id` string
  - `key` string
  - `tags` string[]
  - `consumer` object
    - `id` string

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.dev/kong/apis/kong-enterprise-admin-api.md) · [All operations](https://skmtc.dev/kong/apis/kong-enterprise-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kong/kong-enterprise-admin-api/revisions/5bd52189d290/schema)
