api-keys

POST /v1/api-keys

Create an API key.

Tüm api-keys uç noktaları

Kimlik Doğrulama

Bearer token olarak bir API anahtarı gönderin. Anahtar apikeys.manage iznine sahip olmalıdır; bu izne sahip olmayan bir anahtar 404 ile değil, 403 ile reddedilir.

Kurum kimliğinizin yazılacağı yer

Bu uç nokta, JSON gövdesinde bir alan olarak org_id alır.

Kuruluş kimliğiniz (id), kontrol panelinizdeki API anahtarları ekranında, anahtarın hemen yanında yer alır. Yaptığınız her çağrıda aynı kimlik kullanılır.

Dene

Köşeli parantez içindeki her şeyi kendi değerlerinizle ve anahtar yer tutucusunu panonuzdan bir anahtarla değiştirin.

curl -X POST https://api.zinndigital.com/v1/api-keys \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "name": <string> }'

Oturum açtınız mı? Panonuzdaki API konsolu, gerçek organizasyon kimliğinizi ve kendi anahtarınızı otomatik olarak doldurur ve isteği canlı API üzerinde çalıştırarak gerçek yanıtı görmenizi sağlar. Bu uç noktayı API konsolunda açın

Ayrıntılar

Mints a new per-org API key and returns the full `zdk_…` token **once** — only its hash is stored, so a lost token is replaced, never recovered. The requested `scopes` must be permissions the caller already holds in the target org; asking for one you do not hold is a `403` (a key can never out-scope its creator). Send an `Idempotency-Key` so a retry after a lost response returns the same token rather than orphaning a key. Requires `apikeys.manage`.

Parametreler

AdTürZorunluNe olduğu
Idempotency-Key (header)stringHayırClient-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats.

İstek gövdesi

AdTürZorunluNe olduğu
namestringEvet
scopesstring[]HayırRBAC permission keys to grant. Each must be a permission the caller holds in the target org (a key can never out-scope its creator); an unheld scope is a `403`, an unknown one a…
sandboxbooleanHayırMint a sandbox (test-mode) key. Defaults to false.
org_idUuid | nullHayırThe organization the key belongs to. Defaults to the caller's org; the caller must hold `apikeys.manage` in the target org.

Yanıt

AdTürZorunluNe olduğu
idUuidEvetUUIDv7 identifier — sortable by creation time (docs/02 §8).
namestringEvet
prefixstringEvetThe key's public lookup id (the middle segment of the token).
scopesstring[]EvetThe RBAC permission keys this key may exercise.
sandboxbooleanEvetA sandbox (test-mode) key suppresses billing + provisioning (docs/09 §2).
last_used_atobjectHayırWhen the key last authenticated a request; null if never used.
revoked_atobjectHayırAlways null on a listed/fetched key — revoked keys are not returned.
created_atstringEvet
tokenstringEvetThe full `zdk_<mode>_<prefix>_<secret>` token. Shown **once, here only** — store it now; it cannot be retrieved again, only replaced.

Bu uç noktanın dönderebileceği hatalar

401 · 403 · 409 · 422 · 429