---
title: "Create a hosted tenant API key"
method: POST
path: "/tenant/api-keys"
---

# Create a hosted tenant API key

`POST /tenant/api-keys`

## Request

- Base URL: `https://api.gravityads.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gravityads.dev/tenant/api-keys`
- Auth: HTTP bearer

## Request body

- object
  - `label` string
  - `ttl_days` integer
  - `scopes` string[]

## Response `200`

Tenant API key created

- object
  - `status` 'tenant_api_key_created' | 'tenant_api_key_create_unconfigured' | 'tenant_api_key_create_failed' | 'tenant_api_key_create_degraded', required
  - `tenant_id` string, required
  - `key_id` string, required
  - `label` string
  - `key_fingerprint` string, required
  - `fingerprint` string
  - `raw_key` string
  - `scopes` string[]
  - `expires_at` string
  - `hosted_auth_context` object
  - `database_url_configured` boolean
  - `raw_key_returned_once` true, required
  - `raw_secrets_returned` false, required

---

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