Authentication
The API uses the OAuth 2.0 client credentials grant, for a backend that works with one Duranta workspace.
Get a token
Create a key in Settings → API in the Duranta app. You get a client ID and a client secret; the same page shows the workspace ID they are tied to. If you don't see the API tab, ask your Duranta account manager to enable the API for your workspace. Then exchange the key for a token:
curl https://logto.app.getduranta.com/oidc/token \
-u "$CLIENT_ID:$CLIENT_SECRET" \
-d grant_type=client_credentials \
-d resource=https://public.api.getduranta.com \
-d organization_id=$WORKSPACE_ID \
-d scope=sites:scanresource and organization_id are required. A token without them does not work
with this API.
The dialog that shows your client secret has this command ready to copy, with your values filled in. To try calls without writing code, press Try in Playground on any operation page, or use the playground in Settings → API. Both take your key and get the token for you.
Use the token
Send the returned access_token as Authorization: Bearer <access_token>. The token
names the workspace, so no other header is needed. There is no refresh token: when
expires_in runs out, request a new token the same way. Reuse one token for all
calls until then; don't request a token per call. Keep the client secret on your
server.
Scopes
Ask for the scope of each service you call. A token without it gets
permission_denied.
| Scope | Grants |
|---|---|
customers:import | CustomerService |
sites:scan | SiteService |
Sandbox
Build and test your integration in the sandbox, a separate environment with the same API. Ask your Duranta account manager for a sandbox login.