---
title: "Create an API Key"
method: POST
path: "/2/teams/{teamSlug}/api-keys"
tags: ["Key Management"]
---

# Create an API Key

`POST /2/teams/{teamSlug}/api-keys`

This creates an API Key, which will return the API Key components in the response. The Key ID will be found at `data.id` and
the Key Secret will be found at `data.attributes.secret`. For security reasons the Key Secret will only be available during creation so make sure to save it.

To use a newly-created Ingest Key it should be passed in the `X-Honeycomb-Team` header with the API Key's ID and secret
concatenated (and with no separator). For example, `X-Honeycomb-Team: hcxik_1234567890123456789012345612345678901234567890123456789012`

Check out our [best practices for API Keys](https://docs.honeycomb.io/get-started/best-practices/api-keys/#ingest-keys).

## Response `201`

Created

## Other responses

- `400` — The provided request body was invalid.
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `413` — The provided request body was over the maximum allowed size.
- `415` — The provided request body had an invalid Content-Type.
- `422` — Validation Failed
- `429` — Rate Limit Exceeded
- `500` — InternalError

---

[API](https://skmtc.net/honeycomb/apis/honeycomb-api.md) · [All operations](https://skmtc.net/honeycomb/apis/honeycomb-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/honeycomb/honeycomb-api/revisions/117619fac2a5/schema)
