API keys
Public and secret keys, scopes, rotation.
5 نقاط وصول. أسماء نقاط الوصول وأوصافها مأخوذة من ملف OpenAPI، لذلك تظهر بالإنجليزية.
GET /v1/keysPOST /v1/keysPATCH /v1/keys/{key_id}DELETE /v1/keys/{key_id}POST /v1/keys/{key_id}/rotate
GET
/v1/keysKeys List
يحتاج إلى مفتاح أو جلسة في لوحة التحكم
الردود
- 200Successful Response
ApiKeyOut[]
POST
/v1/keysCreate a key (the full key is returned once)
يحتاج إلى مفتاح أو جلسة في لوحة التحكم
المعاملات
| الاسم | الموضع | النوع | إلزامي | الوصف |
|---|---|---|---|---|
Idempotency-Key | header | string | null | لا | Unique per logical write (8-255 chars). Retries with the same key are safe. · pattern ^[A-Za-z0-9_\-:.]{8,255}$ |
جسم الطلب application/json ApiKeyCreate
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
name | string | نعم | max length 100 |
kind | "public" | "secret" | نعم | |
scopes | string[] | null | لا | Default: search, events (public) or all non-admin scopes (secret). |
allowed_origins | string[] | لا | Public keys: browser origins allowed. |
expires_at | string (date-time) | null | لا |
الردود
- 201Successful Response
ApiKeyCreated
PATCH
/v1/keys/{key_id}Keys Update
يحتاج إلى مفتاح أو جلسة في لوحة التحكم
المعاملات
| الاسم | الموضع | النوع | إلزامي | الوصف |
|---|---|---|---|---|
key_id | path | string | نعم |
جسم الطلب application/json ApiKeyUpdate
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
name | string | null | لا | max length 100 |
scopes | string[] | null | لا | |
allowed_origins | string[] | null | لا |
الردود
- 200Successful Response
ApiKeyOut
DELETE
/v1/keys/{key_id}Revoke a key now
يحتاج إلى مفتاح أو جلسة في لوحة التحكم
المعاملات
| الاسم | الموضع | النوع | إلزامي | الوصف |
|---|---|---|---|---|
key_id | path | string | نعم |
الردود
- 200Successful Response
Deleted
POST
/v1/keys/{key_id}/rotateNew key now; the old one works for grace_hours more
يحتاج إلى مفتاح أو جلسة في لوحة التحكم
المعاملات
| الاسم | الموضع | النوع | إلزامي | الوصف |
|---|---|---|---|---|
key_id | path | string | نعم |
جسم الطلب application/json ApiKeyRotate
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
grace_hours | integer | لا | The old key keeps working this long.default 24 · min 0 · max 720 |
الردود
- 200Successful Response
ApiKeyCreated
أشكال البيانات في هذه الصفحة
ApiKeyOut
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
id | string | نعم | |
name | string | نعم | |
kind | "public" | "secret" | نعم | |
prefix | string | نعم | |
last4 | string | نعم | |
scopes | string[] | نعم | |
allowed_origins | string[] | نعم | |
created_at | string (date-time) | نعم | |
last_used_at | string (date-time) | null | لا | |
expires_at | string (date-time) | null | لا | |
revoked_at | string (date-time) | null | لا |
ApiKeyCreate
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
name | string | نعم | max length 100 |
kind | "public" | "secret" | نعم | |
scopes | string[] | null | لا | Default: search, events (public) or all non-admin scopes (secret). |
allowed_origins | string[] | لا | Public keys: browser origins allowed. |
expires_at | string (date-time) | null | لا |
ApiKeyCreated
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
id | string | نعم | |
name | string | نعم | |
kind | "public" | "secret" | نعم | |
prefix | string | نعم | |
last4 | string | نعم | |
scopes | string[] | نعم | |
allowed_origins | string[] | نعم | |
created_at | string (date-time) | نعم | |
last_used_at | string (date-time) | null | لا | |
expires_at | string (date-time) | null | لا | |
revoked_at | string (date-time) | null | لا | |
key | string | نعم | The full key. Shown ONCE; only a hash is stored. |
ApiKeyUpdate
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
name | string | null | لا | max length 100 |
scopes | string[] | null | لا | |
allowed_origins | string[] | null | لا |
Deleted
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
deleted | boolean | لا | default true |
id | string | نعم |
ApiKeyRotate
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
grace_hours | integer | لا | The old key keeps working this long.default 24 · min 0 · max 720 |