All endpoints on this page require a JWT:
Authorization: Bearer <access_token>Choose the operation
| Need | Endpoint | Method | Result |
|---|---|---|---|
| Read the current profile | /v1/me | GET | Profile object |
| Update profile fields | /v1/me | PATCH | Updated profile |
| Soft-delete the account | /v1/me | DELETE | Empty object; account becomes unusable |
| List workspaces | /v1/workspaces | GET | Workspace array; default first |
| Create a workspace | /v1/workspaces | POST | Created workspace |
| Read or update a workspace | /v1/workspaces/{slug} | GET / PATCH | Workspace object |
| Delete a workspace | /v1/workspaces/{slug} | DELETE | Deletion status |
Profile
/v1/meJWT{
"id": "52cd58a7-8e06-43e7-b8d5-e51d656e0178",
"full_name": "Emmanuel Lugenge",
"avatar_url": null,
"email": "you@example.com",
"phone_number": "+255628587749",
"email_verified": true,
"phone_verified": true,
"status": "active",
"role": "user",
"created_at": "2026-07-14T11:59:52.99Z"
}Optional fields such as avatar_url, email, and phone_number may be omitted rather than returned as null when they are unset. If your UI needs to distinguish those states, check whether the key exists.
/v1/meJWTSend only the fields that changed:
{
"full_name": "New Name",
"avatar_url": "https://cdn.example.com/me.png"
}full_name and avatar_url are independent optional fields. When supplied, avatar_url must be a valid URL. A successful response is 200 and returns the updated profile in the same shape as GET /v1/me.
/v1/meJWTThis performs a soft delete and accepts no body. The 200 response is {}. The account becomes unusable and cannot be restored through the API, so expose this action only behind an explicit confirmation step.
Add or change your phone number
/v1/me/phoneJWTThe way to attach a (new) phone number to your account — required before a mobile-money top-up is allowed. Sets the number, resets phone_verified to false, and fires a verify_phone OTP to it.
{ "phone_number": "+255712345678" }phone_number must be E.164 (+ and country code). Response 200:
{ "pending_verification": true }Complete the verification with the existing POST /v1/auth/otp/verify using {"identifier", "channel": "phone", "purpose": "verify_phone", "code"}. Errors: validation_error (400, malformed number), conflict (409, that phone is already registered to another account).
Workspaces
Ngamia creates a default workspace automatically when the user first logs in or verifies their account. Create additional workspaces when you need separate API keys and usage views—for example, one for Production and one for Staging.
/v1/workspacesJWTThe response is an array, with the default workspace first. A workspace has this shape:
{
"id": "910e5104-f604-47d4-b194-3db2fbd83f76",
"name": "Production App",
"slug": "production-app",
"description": "my prod app",
"is_default": false,
"created_at": "2026-07-14T11:21:34Z",
"updated_at": "2026-07-14T11:21:45Z"
}description is omitted when it is unset.
/v1/workspacesJWT{
"name": "Production App",
"slug": "production-app",
"description": "my prod app"
}| Field | Rules |
|---|---|
name | Required. |
slug | Optional. If blank, Ngamia derives it from name by lowercasing and replacing spaces with hyphens. Otherwise use one to 63 lowercase letters, digits, or hyphens, without a leading or trailing hyphen. default is reserved. |
description | Optional. |
A successful create returns 201 and the new workspace. A bad slug returns validation_error (400); a slug already used by the account returns conflict (409). Each user may create up to 20 additional workspaces; exceeding that limit returns 403 forbidden.
Read, update, or delete a workspace
/v1/workspaces/{slug}JWT/v1/workspaces/{slug}JWTUpdate either field independently:
{
"name": "Production API",
"description": "Customer-facing production traffic"
}Send "description": "" to clear the description. A successful update returns 200 with the updated workspace.
/v1/workspaces/{slug}JWTA successful delete returns:
{ "status": "deleted" }The default workspace cannot be deleted and returns validation_error (400). When deleting another workspace, Ngamia first reassigns its API keys to the default workspace. Warn users that the keys move; they are not deleted.
A gateway request and its activity record belong to the workspace associated with the API key used for that request. The client does not select a workspace in the chat request itself. A workspace switcher in your UI should therefore control which keys and activity records are displayed, not add a workspace field to POST /v1/chat/completions.
For key creation and workspace assignment, continue with API keys. For usage records, see Activity & analytics.