Skip to Content
The Ngamia platform API is in preview. Endpoints may change before general availability.

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)

FieldTypeRequiredNotes
provider_tokenstringyesThe person’s Camel Accounts access token (from signing in at accounts.camelcreatives.com). Used once to sign in; never stored.
workspace_namestringyesmin 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

FieldTypeRequiredNotes
access_tokenstringUse as Authorization: Bearer ....
token_typeBearer
expires_inintegerSeconds until it expires.
user_idstring
workspace_idstring (uuid)
roleowner | admin | developer | viewer

Responses

StatusMeaning
201Workspace created
400The request is invalid (invalid_request).
401Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected).
403The person already owns 20 workspaces (workspace_limit).
413The request body is over the limit (too_large).
429Too many requests (rate_limited); retry after a minute.
503A 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

ParameterInTypeNotes
return_toquerystringOptional 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/start

Responses

StatusMeaning
302Redirect to Camel Accounts
400The request is invalid (invalid_request).
429Too 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

ParameterInTypeNotes
codequerystring
statequerystring
curl -X GET https://api.ngamia.com/v1/auth/camel/callback

Responses

StatusMeaning
200Sign-in page (HTML)
302Redirect to the loopback return_to
400The 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)

FieldTypeRequiredNotes
provider_tokenstringyesThe 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

FieldTypeRequiredNotes
workspacesarray of object

Responses

StatusMeaning
200The workspaces this person belongs to
401Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected).
429Too 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)

FieldTypeRequiredNotes
provider_tokenstringyesThe person’s Camel Accounts access token (from signing in at accounts.camelcreatives.com). Used once to sign in; never stored.
workspace_idstring (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

FieldTypeRequiredNotes
access_tokenstringUse as Authorization: Bearer ....
token_typeBearer
expires_inintegerSeconds until it expires.
user_idstring
workspace_idstring (uuid)
roleowner | admin | developer | viewer

Responses

StatusMeaning
200Signed in
401Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected).
403The person was removed from this workspace (forbidden), or was never added to it (not_a_member).
429Too 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)

FieldTypeRequiredNotes
provider_tokenstringyesThe person’s Camel Accounts access token (from signing in at accounts.camelcreatives.com). Used once to sign in; never stored.
invite_codestringyes
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

FieldTypeRequiredNotes
access_tokenstringUse as Authorization: Bearer ....
token_typeBearer
expires_inintegerSeconds until it expires.
user_idstring
workspace_idstring (uuid)
roleowner | admin | developer | viewer

Responses

StatusMeaning
200Joined. role is the invite’s role, or the person’s existing higher role.
401Camel Accounts sign-in was rejected or the person is not a member (sign_in_rejected).
403The invite is invalid, expired, revoked or used up.
429Too many requests (rate_limited); retry after a minute.
Last updated on