Register and manage APIs
Manage your APIs
The Kinde Management API lets you do everything you can do with the Kinde UI. It is useful for programmatically managing your Kinde account and resources, such as in CI/CD pipelines.
To call the Kinde Management API, you need a Machine to Machine (M2M) access token authorized to use the Management API.
This guide shows you how to set up and authorize a new M2M application with the appropriate scopes. Watch this YouTube video for a quick demo:
Go to your Kinde dashboard and select Add application.
Give the application a name (e.g., “API Automation”), and select Machine to machine (M2M) as the application type.
Select Save.
Go to the APIs page.
Select the three dots next to the Kinde Management API, then choose Authorize application.
Select the three dots next to the Kinde Management API again, and select Manage scopes.
Enable the scopes you want for this application (e.g., read:users, create:users, read:roles, create:roles).
Each Kinde endpoint requires specific permissions in the access token. These are known as scopes. If a required scope is missing from the access token, the API returns an error indicating which scope is needed. Learn more about Management API scopes.
Select Save.
Go to the Details page and copy the app keys:
You need these details when you call the Kinde Management API.
Make a curl request with your app keys to get an access token:
curl --request POST \ --url 'https://<YOUR_DOMAIN>/oauth2/token' \ --header 'content-type: application/x-www-form-urlencoded' \ --data 'grant_type=client_credentials' \ --data 'client_id=<YOUR_CLIENT_ID>' \ --data 'client_secret=<YOUR_CLIENT_SECRET>' \ --data 'audience=https://<your_business>.kinde.com/api'Replace <YOUR_DOMAIN> with either your Kinde subdomain (e.g., https://your_business.kinde.com) or your Custom domain (e.g., https://auth.your_business.com).
A successful response includes your access token:
{ "access_token": "<your_access_token>", // the JWT access token "expires_in": 86399, "scope": "", // any subset of the scopes you defined in the request "token_type": "Bearer",}See Call the Kinde Management API for an extended list of programming languages you can use to call the Kinde API.
Make a curl request with your M2M access token to call an endpoint on the Management API:
curl --request GET \ --url 'https://<YOUR_DOMAIN>/api/v1/users' \ --header 'Authorization: Bearer <your_m2m_access_token>'See The Kinde Management API for all available endpoints and actions you can perform.
Go to Settings > Environment > APIs in your Kinde dashboard.
Select View details on the Kinde Management API.
Select Test in the menu.
Select your M2M application from the dropdown (e.g., “API Automation”), then select Get token.
Select Use test token to open the Management API page with your domain and test token pre-populated.
Use test token opens a prepopulated Management API test view with your domain and token already set. Navigating to the Management API docs directly will not prepopulate this domain or token context.
Do not embed dashboard-generated Management API tokens in client-side code or long-lived production jobs. For production, request tokens server-side via the machine-to-machine client credentials flow and store secrets in your secure environment configuration.
The Kinde Management API page opens with your domain and test token pre-populated. You can test endpoints from this page.
Search for the endpoint you want to test (e.g., roles).
Select Test request in the code snippet. A pop-up opens.
Select Send to see the response JSON.
Sample response:
{ "code": "OK", "roles": [ { "id": "1234", "key": "admin", "name": "Admin", "description": null, "is_default_role": false }, { "id": "5678", "key": "content-moderator", "name": "Content Moderator", "description": "Can read and update posts for content moderation purposes", "is_default_role": false } ], "message": "Success", "next_token": "Mjo6Om5hbWVfYXNj"}Now that you have set up an authorized M2M app, see the following guides: