Sign in and create a workspace
People sign in with Camel Accounts (accounts.camelcreatives.com)
through the agent builder’s own OAuth client (ngamia-agent-web). The
platform runs the sign-in for you at /v1/auth/camel/start (authorization
code with PKCE) and gets the person’s Camel access token, the
provider_token. The /v1/auth/* endpoints exchange it for platform tokens. The platform passes it to KIDA, Ngamia’s identity
service, which verifies it with Camel Accounts and issues a short-lived
platform token. Ngamia never stores the Camel token.
person ──login──► Camel Accounts ──access token──► your console
your console ──provider_token──► api.ngamia.com/v1/auth/* ──► KIDA ──► Camel Accounts
◄── platform access token (about 5 minutes) ──In a browser
Open https://api.ngamia.com/v1/auth/camel/start . After you sign in with Camel Accounts, a sign-in page lists your workspaces, lets you create one, and gives you a platform access token to copy.
From a CLI or script
Listen on a loopback port and open
https://api.ngamia.com/v1/auth/camel/start?return_to=http://127.0.0.1:53682/done
in the user’s browser. After sign-in the browser is sent to
http://127.0.0.1:53682/done#provider_token=…&expires_in=900. Read the
fragment in your local page and use provider_token with the endpoints below.
Only loopback return_to addresses are accepted.
New workspace
curl -s https://api.ngamia.com/v1/auth/signup -H 'content-type: application/json' \
-d '{"provider_token":"<camel token>","workspace_name":"Duka la Asha"}'{
"access_token": "eyJ…",
"token_type": "Bearer",
"expires_in": 300,
"user_id": "…",
"workspace_id": "6d0c…",
"role": "owner"
}Existing workspaces
# which workspaces am I in?
curl -s https://api.ngamia.com/v1/auth/workspaces -H 'content-type: application/json' \
-d '{"provider_token":"<camel token>"}'
# a platform token for one of them
curl -s https://api.ngamia.com/v1/auth/token -H 'content-type: application/json' \
-d '{"provider_token":"<camel token>","workspace_id":"<workspace_id>"}'Keeping people signed in
Platform tokens last about five minutes. Keep the Camel session in your
console and call /v1/auth/token again shortly before expires_in runs out,
or when a call returns 401.
Apps that run agents for customers do not sign in at all: they use an API key.