docs: add developer and api reference tabs (#190)

* docs: add developer and api reference tabs

* fix: remove duplicate image
This commit is contained in:
Sabiha Khan 2026-03-14 16:30:02 +05:30 committed by GitHub
parent 1b03191cf8
commit f075bcb623
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 1609 additions and 57 deletions

View file

@ -0,0 +1,7 @@
---
title: "Archive API Key"
description: "Deactivate an API key by ID"
openapi: "DELETE /api/v1/user/api-keys/{api_key_id}"
---
Archiving immediately revokes the key. Any request using the key after archiving returns `401`. Use [Reactivate](/api-reference/api-keys/reactivate) to restore access.

View file

@ -0,0 +1,34 @@
---
title: "Create API Key"
description: "Create a new API key for programmatic access"
openapi: "POST /api/v1/user/api-keys"
---
<Warning>
The full key is only returned once at creation. Store it immediately in a secrets manager or environment variable — it cannot be retrieved again.
</Warning>
## Authentication
This endpoint requires a valid user session token. If you do not yet have an API key, obtain a session token by logging in first and pass it as a `Bearer` token in the `Authorization` header.
**Step 1 — Log in to get a session token**
```bash
curl -X POST https://your-dograh-instance/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "your-password"}'
```
The response contains a `token` field. Use it in the next step.
**Step 2 — Create an API key**
```bash
curl -X POST https://your-dograh-instance/api/v1/user/api-keys \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "my-api-key"}'
```
Once you have an API key, you can use `X-API-Key: <key>` in place of `Authorization: Bearer` for all subsequent requests.

View file

@ -0,0 +1,7 @@
---
title: "List API Keys"
description: "Retrieve all API keys for your organization"
openapi: "GET /api/v1/user/api-keys"
---
The `key` field is never returned in list responses — only `key_prefix` (the first 8 characters) is shown for identification. To include archived keys, pass `?include_archived=true`.

View file

@ -0,0 +1,7 @@
---
title: "Reactivate API Key"
description: "Reactivate a previously archived API key"
openapi: "PUT /api/v1/user/api-keys/{api_key_id}/reactivate"
---
Restores a previously [archived](/api-reference/api-keys/archive) key. The key resumes accepting requests immediately.