Sign-in
Create a workspace, list your workspaces, sign in and join with an invite. These endpoints take a Camel Accounts token and need no bearer.
Create a workspace
POST /v1/auth/signup
No bearer token: these calls carry a Camel Accounts token in the body.
Creates a workspace owned by the person signed in at Camel Accounts and returns a platform access token for it.
Request body (application/json)
| Field | Type | Required | Notes |
|---|---|---|---|
provider_token | string | yes | The person’s Camel Accounts access token (from signing in at accounts.camelcreatives.com). Used once to sign in; never stored. |
workspace_name | string | yes | min length 1, max length 128 |
curl -X POST https://api.ngamia.com/v1/auth/signup \
-H 'content-type: application/json' \
-d '{"provider_token": "…", "workspace_name": "Duka la Asha"}'Response 201 fields
| Field | Type | Required | Notes |
|---|---|---|---|
access_token | string | Use as Authorization: Bearer .... | |
token_type | Bearer | ||
expires_in | integer | Seconds until it expires. | |
user_id | string | ||
workspace_id | string (uuid) | ||
role | owner | admin | developer | viewer |
Responses
| Status | Meaning |
|---|---|
201 | Workspace created |
400 | The request is invalid (invalid_request). |
401 | Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected). |
403 | The person already owns 20 workspaces (workspace_limit). |
413 | The request body is over the limit (too_large). |
429 | Too many requests (rate_limited); retry after a minute. |
503 | A platform service is unavailable (unavailable); retry with backoff. |
Sign in with Camel Accounts (browser)
GET /v1/auth/camel/start
No bearer token: these calls carry a Camel Accounts token in the body.
Open this URL in a browser. It redirects to Camel Accounts (OAuth
authorization code with PKCE) and back to /v1/auth/camel/callback,
which shows a sign-in page where the person lists or creates
workspaces and gets a platform access token.
CLIs and scripts can pass return_to with a loopback address they
listen on (for example http://127.0.0.1:53682/done). After sign-in
the browser is sent there with #provider_token=…&expires_in=… in the
URL fragment, for use with the other /v1/auth/* endpoints.
The response sets a short-lived cookie
(__Host-ngamia_login; Secure; HttpOnly; SameSite=Lax) that binds
the sign-in to this browser: the callback refuses a sign-in finished
in a different browser, so complete it in the browser that opened
this URL.
Parameters
| Parameter | In | Type | Notes |
|---|---|---|---|
return_to | query | string | Optional loopback URL (http://127.0.0.1:<port>/… or http://localhost:<port>/…). max length 512 |
curl -X GET https://api.ngamia.com/v1/auth/camel/startResponses
| Status | Meaning |
|---|---|
302 | Redirect to Camel Accounts |
400 | The request is invalid (invalid_request). |
429 | Too many requests (rate_limited); retry after a minute. |
Camel Accounts sign-in callback
GET /v1/auth/camel/callback
No bearer token: these calls carry a Camel Accounts token in the body.
Camel Accounts returns here. Not called directly. Each sign-in link works once, expires after ten minutes and only completes in the browser that started it (the __Host-ngamia_login cookie, cleared here).
Parameters
| Parameter | In | Type | Notes |
|---|---|---|---|
code | query | string | |
state | query | string |
curl -X GET https://api.ngamia.com/v1/auth/camel/callbackResponses
| Status | Meaning |
|---|---|
200 | Sign-in page (HTML) |
302 | Redirect to the loopback return_to |
400 | The sign-in failed, the link expired, or it was started in another browser (HTML) |
List my workspaces
POST /v1/auth/workspaces
No bearer token: these calls carry a Camel Accounts token in the body.
Request body (application/json)
| Field | Type | Required | Notes |
|---|---|---|---|
provider_token | string | yes | The person’s Camel Accounts access token (from signing in at accounts.camelcreatives.com). Used once to sign in; never stored. |
curl -X POST https://api.ngamia.com/v1/auth/workspaces \
-H 'content-type: application/json' \
-d '{"provider_token": "…"}'Response 200 fields
| Field | Type | Required | Notes |
|---|---|---|---|
workspaces | array of object |
Responses
| Status | Meaning |
|---|---|
200 | The workspaces this person belongs to |
401 | Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected). |
429 | Too many requests (rate_limited); retry after a minute. |
Sign in to a workspace
POST /v1/auth/token
No bearer token: these calls carry a Camel Accounts token in the body.
Returns a platform access token for a workspace the person belongs to. Call again before it expires.
Request body (application/json)
| Field | Type | Required | Notes |
|---|---|---|---|
provider_token | string | yes | The person’s Camel Accounts access token (from signing in at accounts.camelcreatives.com). Used once to sign in; never stored. |
workspace_id | string (uuid) | yes |
curl -X POST https://api.ngamia.com/v1/auth/token \
-H 'content-type: application/json' \
-d '{"provider_token": "…", "workspace_id": "…"}'Response 200 fields
| Field | Type | Required | Notes |
|---|---|---|---|
access_token | string | Use as Authorization: Bearer .... | |
token_type | Bearer | ||
expires_in | integer | Seconds until it expires. | |
user_id | string | ||
workspace_id | string (uuid) | ||
role | owner | admin | developer | viewer |
Responses
| Status | Meaning |
|---|---|
200 | Signed in |
401 | Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected). |
403 | The person was removed from this workspace (forbidden), or was never added to it (not_a_member). |
429 | Too many requests (rate_limited); retry after a minute. |
Join a workspace with an invite code
POST /v1/auth/join
No bearer token: these calls carry a Camel Accounts token in the body.
Each join takes one of the invite’s max_uses before the person is
enrolled, so concurrent joins never admit more people than the invite
allows. A join that fails (for example a rejected sign-in) gives its
use back.
Request body (application/json)
| Field | Type | Required | Notes |
|---|---|---|---|
provider_token | string | yes | The person’s Camel Accounts access token (from signing in at accounts.camelcreatives.com). Used once to sign in; never stored. |
invite_code | string | yes |
curl -X POST https://api.ngamia.com/v1/auth/join \
-H 'content-type: application/json' \
-d '{"provider_token": "…", "invite_code": "ngi_Q2hhbmdlIG1lIHBsZWFzZQ"}'Response 200 fields
| Field | Type | Required | Notes |
|---|---|---|---|
access_token | string | Use as Authorization: Bearer .... | |
token_type | Bearer | ||
expires_in | integer | Seconds until it expires. | |
user_id | string | ||
workspace_id | string (uuid) | ||
role | owner | admin | developer | viewer |
Responses
| Status | Meaning |
|---|---|
200 | Joined. role is the invite’s role, or the person’s existing higher role. |
401 | Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected). |
403 | The invite is invalid, expired, revoked or used up. |
429 | Too many requests (rate_limited); retry after a minute. |