Skip to main content

Dart OAuth integration guide

Authorize with Dart in third party applications, including agents, MCPs, and other integrations

Updated over a week ago

If you want to authorize your third-party application with Dart, or set up a new generic integration for AI or agent use, you can set up an OAuth 2 flow between your code and Dart. Then you or your users can connect your application to Dart and make requests to the Dart API directly.

OAuth application registration

This endpoint is public and implements RFC 7591 for OAuth 2.0 Dynamic Client Registration.

Start by creating your application in Dart. This should only be done once per application. The raw request for that is

curl -X POST https://app.dartai.com/api/oauth/register/ \
-H "Content-Type: application/json" \
-d '{
"client_name": "Your App Name",
"redirect_uris": ["https://yourapp.com/callback"],
"grant_types": ["authorization_code", "refresh_token"],
"token_endpoint_auth_method": "client_secret_post"
}'

The response will include your client_id and client_secret.

Allowed configuration

  • Grant types: authorization_code, implicit, refresh_token

  • Auth methods: client_secret_basic, client_secret_post, none

OAuth authorization

Then, authorize

https://app.dartai.com/api/oauth/authorize/?client_id=YOUR_CLIENT_ID&redirect_uri=https://yourapp.com/callback&response_type=code&scope=read%20write&state=RANDOM_STRING

Parameters

client_id - Your application's client ID

redirect_uri - Where to redirect after authorization

response_type=code - For authorization code flow

state - Random string for CSRF protection

scope - Space-separated scopes: read and/or write

Scopes

read - View your Dart data

write - Change your Dart data

OAuth token exchange

The next step is to get the token

curl -X POST https://app.dartai.com/api/oauth/token/ \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code&code=CODE_FROM_REDIRECT&redirect_uri=https://yourapp.com/callback&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"

Using the Dart public API

Finally, you can make requests to the Dart API with the token, such as

curl -X GET https://app.dartai.com/api/v0/public/config \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Did this answer your question?