MongoDB Service Accounts API

Endpoints for managing Service Accounts and secrets. Service Accounts are used for programmatic access to the Atlas Admin API through the OAuth 2.0 Client Credentials flow.

GitHub OpenAPI
Business capability
Identity & Access Management BC-620.20

Operations 22

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/atlas/v2/groups/{groupId}/serviceAccounts List a project's service accounts · Return All Project Service Accounts #
Ask an LLM
“Which service accounts exist for a given project?”
“Can I see all service account clients in one project?”
Tell an agent
List the service accounts in project {groupId}.
Show every service account client for project {groupId}.
POST /api/atlas/v2/groups/{groupId}/serviceAccounts Create a service account for a project · Create One Project Service Account #
Ask an LLM
“How do I create a service account that can act on a single project?”
“Can I set roles and a secret expiry when creating a project service account?”
Tell an agent
Create service account {name} in project {groupId} with roles {roles} and secret expiry {secretExpiresAfterHours} hours.
Add a project service account {name} described as {description} to project {groupId}.
DELETE /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} Remove a service account from a project · Remove One Project Service Account #
Ask an LLM
“How do I revoke a service account's access to one project?”
“Does removing a service account from a project also remove its secret?”
Tell an agent destructive · confirm first
Remove service account {clientId} from project {groupId}.
Revoke project {groupId} access for service account {clientId}.
GET /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} Get one project service account · Return One Project Service Account #
Ask an LLM
“What roles does a specific service account in a project have?”
“Can I look up a single project service account by its client ID?”
Tell an agent
Show service account {clientId} in project {groupId}.
Get the roles of project service account {clientId} in {groupId}.
PATCH /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} Update a project service account · Update One Project Service Account #
Ask an LLM
“Can I change the roles of a service account in a project?”
“How do I rename a project service account?”
Tell an agent
Set the roles of service account {clientId} in project {groupId} to {roles}.
Rename project service account {clientId} in {groupId} to {name}.
GET /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList List a project service account's IP access list · Return All Access List Entries for One Project Service Account #
Ask an LLM
“Which IP addresses are allowed to call a project service account?”
“Can I see the access list entries for one project service account?”
Tell an agent
List the access list entries for service account {clientId} in project {groupId}.
Show which IPs project service account {clientId} in {groupId} can call from.
POST /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList Add access list entries to a project service account · Add Access List Entries for One Project Service Account #
Ask an LLM
“How do I allow a new IP address on my project service account?”
“Which role is needed to add an access list entry for a project service account?”
Tell an agent
Add new access list entries to project service account {clientId} in project {groupId}.
Extend the IP access list of service account {clientId} in project {groupId} so more addresses can call Atlas.
DELETE /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress} Remove an IP from a project service account's access list · Remove One Access List Entry from One Project Service Account #
Ask an LLM
“How do I block an IP address from calling a project service account?”
“Can I remove a CIDR block from a project service account's access list?”
Tell an agent destructive · confirm first
Remove {ipAddress} from the access list of service account {clientId} in project {groupId}.
Block project service account {clientId} in {groupId} from being called from {ipAddress}.
POST /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets Create a secret for a project service account · Create One Project Service Account Secret #
Ask an LLM
“How do I generate a new secret for a service account in a project?”
“Can I set how long a project service account secret stays valid?”
Tell an agent
Create a secret for service account {clientId} in project {groupId} that expires in {secretExpiresAfterHours} hours.
Rotate the secret of project service account {clientId} in {groupId}.
DELETE /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId} Delete a project service account secret · Delete One Project Service Account Secret #
Ask an LLM
“How do I revoke a project service account's secret?”
“Can I delete one secret of a project service account?”
Tell an agent destructive · confirm first
Delete secret {secretId} of service account {clientId} in project {groupId}.
Revoke project service account {clientId} in {groupId} by deleting secret {secretId}.
POST /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite Assign a service account to a project · Assign One Service Account to One Project #
Ask an LLM
“How do I assign an existing service account to a project?”
“Can I give a service account roles in a specific project?”
Tell an agent
Assign service account {clientId} to project {groupId} with roles {roles}.
Add existing service account {clientId} to project {groupId} as a member.
GET /api/atlas/v2/orgs/{orgId}/serviceAccounts List an organization's service accounts · Return All Organization Service Accounts #
Ask an LLM
“Which service accounts exist across my whole organization?”
“Can I see every service account client organization-wide?”
Tell an agent
List the service accounts in organization {orgId}.
Show every service account client across organization {orgId}.
POST /api/atlas/v2/orgs/{orgId}/serviceAccounts Create an organization service account · Create One Organization Service Account #
Ask an LLM
“How do I create a service account that spans my whole organization?”
“Can I set roles and a secret expiry when creating an organization service account?”
Tell an agent
Create organization service account {name} with roles {roles} and secret expiry {secretExpiresAfterHours} hours.
Add an organization service account {name} described as {description} to {orgId}.
DELETE /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} Delete an organization service account · Delete One Organization Service Account #
Ask an LLM
“How do I delete a service account from my organization?”
“Can I remove an organization service account entirely?”
Tell an agent destructive · confirm first
Delete organization service account {clientId} from {orgId}.
Remove organization service account {clientId} in {orgId} permanently.
GET /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} Get an organization service account · Return One Organization Service Account #
Ask an LLM
“Can I look up the details of an organization service account?”
“What does one org-wide service account look like?”
Tell an agent
Show organization service account {clientId} in org {orgId}.
Look up org service account {clientId} for org {orgId}.
PATCH /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} Update an organization service account · Update One Organization Service Account #
Ask an LLM
“Can I change the roles of an organization service account?”
“How do I rename an organization service account?”
Tell an agent
Set the roles of organization service account {clientId} in {orgId} to {roles}.
Rename organization service account {clientId} in {orgId} to {name}.
GET /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList List an organization service account's IP access list · Return All Access List Entries for One Organization Service Account #
Ask an LLM
“Which IP addresses are allowed to call an organization service account?”
“Can I see the access list entries for one organization service account?”
Tell an agent
List the access list entries for organization service account {clientId} in {orgId}.
Show which IPs organization service account {clientId} in {orgId} can call from.
POST /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList Add access list entries to an org service account · Add Access List Entries for One Organization Service Account #
Ask an LLM
“How do I restrict org-wide service account calls to certain IPs?”
“Can I add an IP range to an org service account's access list?”
Tell an agent
Add new access list entries to organization service account {clientId} in {orgId}.
Extend the IP access list of org service account {clientId} in org {orgId}.
DELETE /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress} Remove an IP from an org service account's access list · Remove One Access List Entry from One Organization Service Account #
Ask an LLM
“How do I revoke an IP from an org service account's access list?”
“Can I take my own IP off an org service account's access list?”
Tell an agent destructive · confirm first
Remove {ipAddress} from the access list of org service account {clientId} in org {orgId}.
Block org service account {clientId} in org {orgId} from calling Atlas from {ipAddress}.
GET /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups List projects a service account belongs to · Return All Service Account Project Assignments #
Ask an LLM
“Which projects is a given service account a member of?”
“Can I see all project assignments for an organization service account?”
Tell an agent
List the projects service account {clientId} in {orgId} belongs to.
Show every project assignment of organization service account {clientId} in {orgId}.
POST /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets Create a secret for an org service account · Create One Organization Service Account Secret #
Ask an LLM
“How do I issue an API key for an org-wide service account?”
“Can I set how long an org service account secret stays valid?”
Tell an agent
Create a secret for org service account {clientId} in org {orgId} that expires in {secretExpiresAfterHours} hours.
Issue a new API key for org service account {clientId} in {orgId} expiring after {secretExpiresAfterHours}.
DELETE /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId} Delete a secret from an organization service account · Delete One Organization Service Account Secret #
Ask an LLM
“How do I revoke a leaked service account secret?”
“Can I delete one secret without touching the service account itself?”
Tell an agent destructive · confirm first
Delete secret {secretId} from service account {clientId} in org {orgId}.
Revoke service account secret {secretId} for {clientId}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mongodb:mongodb-service-accounts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mongodb-service-accounts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mongodb Service Accounts API
  version: '2.0'
  license:
    name: CC BY-NC-SA 3.0 US
    url: https://creativecommons.org/licenses/by-nc-sa/3.0/us/
  termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions
  x-refined-note:
  - x-xgen-sha differs across the merged source definitions and was not carried
  description: 'Operations tagged Service Accounts across 2 of this provider''s published API definitions: mongodb-atlas-openapi.yaml, mongodb-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://cloud.mongodb.com
security:
- ServiceAccounts: []
- DigestAuth: []
tags:


# --- truncated at 32 KB (125 KB total) ---
# Full source: https://artifacts.apis.io/mongodb/openapi/mongodb-service-accounts-api-openapi.yml