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

# Create a new API key

`POST /api-key`

## Request

- Base URL: `https://api-ch-gva-2.exoscale.com/v2`
- URL: `https://api-ch-gva-2.exoscale.com/v2/api-key`
- Auth: none declared
- TypeScript: <https://skmtc.dev/exoscale/apis/exoscale-api/docs/api-key/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `role-id` string, uuid, required: IAM API Key Role ID
  - `name` string, required: IAM API Key Name

## Response `200`

200

- IamApiKeyCreated: IAM API Key
  - `name` string: IAM API Key name
  - `key` string: IAM API Key
  - `secret` string: IAM API Key Secret
  - `role-id` string, uuid: IAM API Key Role ID

## Changes

- **2026-03-16** `e05707a7b346`: 2 info
  - api tag `api-key` added
  - api tag `iam` removed
- **2023-12-08** `ec6a2a6bc1c1`: 1 breaking, 1 warning
  - the `name` request property's minLength was increased from `0` to `1`
  - the `name` request property's maxLength was set to `255`
- **2023-02-03** `6e9809fd1444`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/exoscale/apis/exoscale-api/changes/api-key/post.md)

---

[API](https://skmtc.dev/exoscale/apis/exoscale-api.md) - [All operations](https://skmtc.dev/exoscale/apis/exoscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/exoscale/apis/exoscale-api/revisions/63da6f74c845?raw)
