Set Authentication

Open in CMS

When several APIs share the same credentials, for example all the actions you imported from one OpenAPI schema, you can configure authentication once and apply it to all of them in a single step. This tutorial walks you through Set authentication on the Custom API page, using the project APIs of Atlas, Kirana Group's operations assistant.


Before you start

  • You have at least one API on the Custom API page, either added by hand (Connect Your API) or from a spec (Import an OpenAPI Schema). Atlas has get_project_status and list_projects.
  • You have the credentials for those APIs: a token, a username and password, a custom header key, or OAuth details.
  • You know how to test and publish changes. See Preview and Publish Changes.

About the sample API: the Kirana Projects API used in these tutorials is a public sample and does not accept credentials. If you send it a Bearer token, it answers 403. Kirana's real Projects API would require a Bearer token, which is the situation this page describes. If you follow along with the sample, click Cancel at the end of Step 3 instead of Apply to N APIs, or set the APIs back to None afterwards.


When to Use This Feature

Use Set authentication when:

  • You have just imported multiple APIs from an OpenAPI schema and need to add credentials to all of them at once
  • Several existing APIs on your agent use the same token or username and password, and you need to rotate or update that credential
  • You want to apply or remove authentication on a specific set of APIs without editing each one individually

Supported Authentication Types

Authentication typeWhen to use
NonePublic endpoints, no credentials needed. Also removes existing authentication.
BasicAPIs that use a username and password
BearerAPIs secured with a static Bearer token
CustomAPIs with a custom header name (for example X-API-Key)
OauthAPIs secured with OAuth 2.0 (Client Credentials or Google Service Account)

Step 1: Open Set authentication

On the Custom API page, open More actions and click Set authentication. The Set authentication drawer opens with the line "Set the authentication once and apply it to several custom APIs. It replaces what each of them has now."

Set authentication drawer with an Authentication section (Authentication type Bearer and the Token field) and an APIs to update section with a Search APIs box, 1 of 1 selected, Select all and Clear all, the Uncategorized group and get_project_status ticked, and the buttons Cancel and Apply to 1 API

Step 2: Configure the Authentication

In the Authentication section, choose the Authentication type that matches your API. The fields for that type appear next to it. For Kirana's Projects API, choose Bearer and paste the token into Token. The value is masked as you type.

Authentication typeFields to fill in
BearerToken: the token value
BasicUsername and Password
CustomHeader name (for example X-API-Key) and Key. qlar sends Header name: Key with every request.
OauthOAuth provider (Client Credentials or Google Service Account), Token URL, and the provider's credentials. See Authentication Details Reference.
NoneNo fields. Use it to remove authentication from the selected APIs.

Step 3: Select the APIs and Apply

Under APIs to update, tick the APIs that should get this authentication. APIs are grouped by category; APIs without a category are under Uncategorized. The header shows how many are selected, for example 1 of 3 selected.

  • Select all ticks every API in the list.
  • Clear all unticks every API.
  • The checkbox on a category header ticks or unticks all APIs in that category. Use Search APIs to find one by name.

In the screenshot, get_project_status is ticked. For Atlas, tick list_projects as well, since both call the same API.

Click Apply to N APIs, where N follows your selection. It is off until at least one API is ticked. A confirmation asks Replace authentication?, says how many APIs lose their current authentication, and warns that the page's other changes are saved too. Click Yes.

Note: This overwrites the existing authentication on every selected API. APIs you do not select are left untouched.


Step 4: Confirm the Save

Clicking Yes saves the new authentication straight away, so you do not need Save all changes. The CMS confirms Custom APIs saved.

The updated authentication is saved as a draft. It reaches real users after you click Publish in the top bar.


Check the result

  1. In the list, the chip next to each updated API now shows the new auth type, for example Bearer instead of None.
  2. Click one of the updated APIs, then Test API. The API section shows the new Authentication. Fill in a sample value, for example KG-2041, and click Call API. A 401 or 403 status usually means the credentials are wrong, or, with the public sample, that the API does not accept credentials at all.
  3. In the preview panel, ask a question that should trigger one of the updated APIs, for example "What is the status of KG-2041?", and confirm that Atlas answers with real data.
  4. Click Publish when everything works. See Preview and Publish Changes.

Authentication Details Reference

Bearer token

FieldDescription
KeyThe full token value (without the Bearer prefix; qlar adds it automatically)

Basic authentication

FieldDescription
UsernameThe account username
PasswordThe account password

Custom header

FieldDescription
Header nameThe HTTP header name your API expects (for example X-API-Key or Authorization)
KeyThe value sent in that header

OAuth 2.0, Client Credentials

FieldDescription
Token URLThe endpoint qlar calls to obtain an access token
Client IDYour OAuth client identifier
Client secretYour OAuth client secret
ScopesOAuth scopes your API needs (optional). Type each scope and press Enter.

OAuth 2.0, Google Service Account

FieldDescription
Token URLFilled in for you (https://oauth2.googleapis.com/token)
Google Service Account JSONThe key file of your service account from Google Cloud Console
API ScopesThe Google API scopes the token should cover
User Delegation (Optional)The email of the user to impersonate. Required for Gmail APIs, optional for Calendar APIs.

Next steps