openapi: 3.0.1 info: description: "The MongoDB Atlas Administration API allows developers to manage all components in MongoDB Atlas.\n\nThe Atlas Administration API supports OAuth2 Service Accounts and HTTP Digest-based API keys. Service accounts are the recommended authentication method and API keys are considered a legacy option.\n\nTo authenticate with a Service Account, first exchange its client ID and secret for an access token using the OAuth 2.0 Client Credentials flow. Atlas provides a token endpoint at `POST https://cloud.mongodb.com/api/oauth/token`, which returns a Bearer token that is reusable and valid for 1 hour (3600 seconds).\n\nFor example, to [return a list of your organizations](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listorgs) with [cURL](https://en.wikipedia.org/wiki/CURL), first generate an access token and then use that token to call the same Atlas Administration API endpoint shown in the current example:\n\n```\nACCESS_TOKEN=$(curl -fsS --request POST https://cloud.mongodb.com/api/oauth/token \\\n --header \"Authorization: Basic $(printf '%s' \"${CLIENT_ID}:${CLIENT_SECRET}\" | base64 | tr -d '\\n')\" \\\n --header \"Content-Type: application/x-www-form-urlencoded\" \\\n --header \"Accept: application/json\" \\\n --data \"grant_type=client_credentials\" | jq -r '.access_token')\n\ncurl --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs?pretty=true\"\n```\n\nIf your organization requires an IP access list for the Atlas Administration API, the token can be created from any IP address, but the API call that uses the token must originate from an allowed IP.\n\nTo learn more, see [Get Started with the Atlas Administration API](https://www.mongodb.com/docs/atlas/configure-api-access/). For support, see [MongoDB Support](https://www.mongodb.com/support/get-started).\n\nYou can also explore the various endpoints available through the Atlas Administration API in MongoDB's [Postman workspace](https://www.postman.com/mongodb-devrel/workspace/mongodb-atlas-administration-apis/) (requires a Postman account)." 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 title: MongoDB Atlas Administration Access Tracking Service Accounts API version: '2.0' x-xgen-sha: 3d70e065843c008b9871ea7836c98c9de6f202f9 servers: - url: https://cloud.mongodb.com security: - ServiceAccounts: [] - DigestAuth: [] tags: - description: 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. externalDocs: description: Get Started with the Atlas Administration API url: https://www.mongodb.com/docs/atlas/configure-api-access/ name: Service Accounts paths: /api/atlas/v2/groups/{groupId}/serviceAccounts: get: description: Returns all Service Accounts for the specified Project. operationId: listGroupServiceAccounts parameters: - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - $ref: '#/components/parameters/envelope' responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/PaginatedGroupServiceAccounts' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Return All Project Service Accounts tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts listGroupServiceAccounts --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.ListGroupServiceAccountsApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tListGroupServiceAccountsWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts?pretty=true\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listGroupServiceAccounts post: description: Creates one Service Account for the specified Project. The Service Account will automatically be added as an Organization Member to the Organization that the specified Project is a part of. operationId: createGroupServiceAccount parameters: - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' requestBody: content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/GroupServiceAccountRequest' x-xgen-version: '2024-08-05' description: Details of the new Service Account. required: true responses: '201': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/GroupServiceAccount' x-xgen-version: '2024-08-05' description: Created headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Create One Project Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts createGroupServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.CreateGroupServiceAccountApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tCreateGroupServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts\" \\\n -d '{ }'" x-rolesRequirements: - Project Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createGroupServiceAccount /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}: delete: description: Removes the specified Service Account from the specified project. The Service Account will still be a part of the Organization it was created in, and the credentials will remain active until expired or manually revoked. operationId: deleteGroupServiceAccount parameters: - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' responses: '204': content: application/vnd.atlas.2024-08-05+json: x-xgen-version: '2024-08-05' description: This endpoint does not return a response body. headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' x-xgen-version: '2024-08-05' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Remove One Project Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts deleteGroupServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.DeleteGroupServiceAccountApiParams{}\n\thttpResp, err := client.ServiceAccountsApi.\n\t\tDeleteGroupServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}\"" x-rolesRequirements: - Project Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteGroupServiceAccount get: description: Returns one Service Account in the specified Project. operationId: getGroupServiceAccount parameters: - $ref: '#/components/parameters/groupId' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/GroupServiceAccount' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Return One Project Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts getGroupServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.GetGroupServiceAccountApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tGetGroupServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}?pretty=true\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/getGroupServiceAccount patch: description: Updates one Service Account in the specified Project. operationId: updateGroupServiceAccount parameters: - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' requestBody: content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/GroupServiceAccountUpdateRequest' description: The new details for the Service Account. required: true responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/GroupServiceAccount' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Update One Project Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts updateGroupServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.UpdateGroupServiceAccountApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tUpdateGroupServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X PATCH \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X PATCH \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}\" \\\n -d '{ }'" x-rolesRequirements: - Project Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/updateGroupServiceAccount /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList: get: description: Returns all access list entries that you configured for the specified Service Account for the project. operationId: listGroupServiceAccountAccessList parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/includeCount' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/PaginatedServiceAccountIPAccessEntryView' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Return All Access List Entries for One Project Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts listAccessList --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.ListGroupServiceAccountAccessListApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tListGroupServiceAccountAccessListWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList?pretty=true\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listGroupServiceAccountAccessList x-xgen-operation-id-override: listAccessList post: description: Add Access List Entries for the specified Service Account for the project. Resources require all API requests to originate from IP addresses on the API access list. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Access Manager role. operationId: createGroupServiceAccountAccessList parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/includeCount' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string requestBody: content: application/vnd.atlas.2024-08-05+json: schema: items: $ref: '#/components/schemas/ServiceAccountIPAccessListEntry' maxItems: 200 type: array x-xgen-version: '2024-08-05' description: A list of access list entries to add to the access list of the specified Service Account for the project. required: true responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/PaginatedServiceAccountIPAccessEntryView' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '409': $ref: '#/components/responses/conflict' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Add Access List Entries for One Project Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts createAccessList --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.CreateGroupServiceAccountAccessListApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tCreateGroupServiceAccountAccessListWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList\" \\\n -d '{ }'" x-rolesRequirements: - Project Access Manager x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createGroupServiceAccountAccessList x-xgen-operation-id-override: createAccessList /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}: delete: description: Removes the specified access list entry from the specified Service Account for the project. You can't remove the requesting IP address from the access list. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Access Manager role. operationId: deleteGroupServiceAccountAccessListEntry parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/pretty' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - description: One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. in: path name: ipAddress required: true schema: example: 192.0.2.0%2F24 pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ type: string responses: '204': content: application/vnd.atlas.2024-08-05+json: x-xgen-version: '2024-08-05' description: This endpoint does not return a response body. headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Remove One Access List Entry from One Project Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts deleteGroupAccessEntry --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.DeleteGroupServiceAccountAccessListEntryApiParams{}\n\thttpResp, err := client.ServiceAccountsApi.\n\t\tDeleteGroupServiceAccountAccessListEntryWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}\"" x-rolesRequirements: - Project Access Manager x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteGroupServiceAccountAccessListEntry x-xgen-method-verb-override: customMethod: false verb: deleteEntry x-xgen-operation-id-override: deleteGroupAccessEntry /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets: post: description: Create a secret for the specified Service Account in the specified Project. operationId: createGroupServiceAccountSecret parameters: - $ref: '#/components/parameters/groupId' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' requestBody: content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/ServiceAccountSecretRequest' description: Details for the new secret. required: true responses: '201': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/ServiceAccountSecret' x-xgen-version: '2024-08-05' description: Created headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Create One Project Service Account Secret tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts createGroupSecret --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.CreateGroupServiceAccountSecretApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tCreateGroupServiceAccountSecretWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets\" \\\n -d '{ }'" x-rolesRequirements: - Project Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createGroupServiceAccountSecret x-xgen-operation-id-override: createGroupSecret /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}: delete: description: Deletes the specified Service Account secret. operationId: deleteGroupServiceAccountSecret parameters: - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - description: Unique 24-hexadecimal digit string that identifies the secret. in: path name: secretId required: true schema: type: string - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' responses: '204': content: application/vnd.atlas.2024-08-05+json: x-xgen-version: '2024-08-05' description: This endpoint does not return a response body. headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Delete One Project Service Account Secret tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts deleteGroupSecret --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.DeleteGroupServiceAccountSecretApiParams{}\n\thttpResp, err := client.ServiceAccountsApi.\n\t\tDeleteGroupServiceAccountSecretWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}\"" x-rolesRequirements: - Project Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteGroupServiceAccountSecret x-xgen-operation-id-override: deleteGroupSecret /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite: post: description: Assigns the specified Service Account to the specified Project. operationId: inviteGroupServiceAccount parameters: - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' requestBody: content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/GroupServiceAccountRoleAssignment' x-xgen-version: '2024-08-05' description: The Project permissions for the Service Account in the specified Project. required: true responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/GroupServiceAccount' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Assign One Service Account to One Project tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts inviteGroupServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.InviteGroupServiceAccountApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tInviteGroupServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite\" \\\n -d '{ }'" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/inviteGroupServiceAccount /api/atlas/v2/orgs/{orgId}/serviceAccounts: get: description: Returns all Service Accounts for the specified Organization. operationId: listOrgServiceAccounts parameters: - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - $ref: '#/components/parameters/envelope' responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/PaginatedOrgServiceAccounts' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Return All Organization Service Accounts tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts listOrgServiceAccounts --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.ListOrgServiceAccountsApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tListOrgServiceAccountsWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts?pretty=true\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts?pretty=true\"" x-rolesRequirements: - Organization Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listOrgServiceAccounts post: description: Creates one Service Account for the specified Organization. operationId: createOrgServiceAccount parameters: - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' requestBody: content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/OrgServiceAccountRequest' description: Details of the new Service Account. required: true responses: '201': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/OrgServiceAccount' x-xgen-version: '2024-08-05' description: Created headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Create One Organization Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts createOrgServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.CreateOrgServiceAccountApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tCreateOrgServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts\" \\\n -d '{ }'" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createOrgServiceAccount /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}: delete: description: Deletes the specified Service Account. operationId: deleteOrgServiceAccount parameters: - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' responses: '204': content: application/vnd.atlas.2024-08-05+json: x-xgen-version: '2024-08-05' description: This endpoint does not return a response body. headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Delete One Organization Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts deleteOrgServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.DeleteOrgServiceAccountApiParams{}\n\thttpResp, err := client.ServiceAccountsApi.\n\t\tDeleteOrgServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}\"" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteOrgServiceAccount get: description: Returns the specified Service Account. operationId: getOrgServiceAccount parameters: - $ref: '#/components/parameters/orgId' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/OrgServiceAccount' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Return One Organization Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts getOrgServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.GetOrgServiceAccountApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tGetOrgServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}?pretty=true\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}?pretty=true\"" x-rolesRequirements: - Organization Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/getOrgServiceAccount patch: description: Updates the specified Service Account in the specified Organization. operationId: updateOrgServiceAccount parameters: - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' requestBody: content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/OrgServiceAccountUpdateRequest' description: The new details for the Service Account. required: true responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/OrgServiceAccount' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Update One Organization Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts updateOrgServiceAccount --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.UpdateOrgServiceAccountApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tUpdateOrgServiceAccountWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X PATCH \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X PATCH \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}\" \\\n -d '{ }'" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/updateOrgServiceAccount /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList: get: description: Returns all access list entries that you configured for the specified Service Account for the organization. operationId: listOrgServiceAccountAccessList parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/includeCount' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/PaginatedServiceAccountIPAccessEntryView' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Return All Access List Entries for One Organization Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts listOrgAccessList --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.ListOrgServiceAccountAccessListApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tListOrgServiceAccountAccessListWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList?pretty=true\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList?pretty=true\"" x-rolesRequirements: - Organization Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listOrgServiceAccountAccessList x-xgen-operation-id-override: listOrgAccessList post: description: Add Access List Entries for the specified Service Account for the organization. Resources require all API requests to originate from IP addresses on the API access list. operationId: createOrgServiceAccountAccessList parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/includeCount' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string requestBody: content: application/vnd.atlas.2024-08-05+json: schema: items: $ref: '#/components/schemas/ServiceAccountIPAccessListEntry' maxItems: 200 type: array x-xgen-version: '2024-08-05' description: A list of access list entries to add to the access list of the specified Service Account for the organization. required: true responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/PaginatedServiceAccountIPAccessEntryView' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '409': $ref: '#/components/responses/conflict' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Add Access List Entries for One Organization Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts createOrgAccessList --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.CreateOrgServiceAccountAccessListApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tCreateOrgServiceAccountAccessListWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList\" \\\n -d '{ }'" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createOrgServiceAccountAccessList x-xgen-operation-id-override: createOrgAccessList /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}: delete: description: Removes the specified access list entry from the specified Service Account for the organization. You can't remove the requesting IP address from the access list. operationId: deleteOrgServiceAccountAccessListEntry parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/pretty' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - description: One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. in: path name: ipAddress required: true schema: example: 192.0.2.0%2F24 pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ type: string responses: '204': content: application/vnd.atlas.2024-08-05+json: x-xgen-version: '2024-08-05' description: This endpoint does not return a response body. headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Remove One Access List Entry from One Organization Service Account tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts deleteOrgAccessEntry --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.DeleteOrgServiceAccountAccessListEntryApiParams{}\n\thttpResp, err := client.ServiceAccountsApi.\n\t\tDeleteOrgServiceAccountAccessListEntryWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}\"" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteOrgServiceAccountAccessListEntry x-xgen-method-verb-override: customMethod: true verb: deleteEntry x-xgen-operation-id-override: deleteOrgAccessEntry /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups: get: description: Returns a list of all projects the specified Service Account is a part of. operationId: getOrgServiceAccountGroups parameters: - $ref: '#/components/parameters/orgId' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - $ref: '#/components/parameters/envelope' responses: '200': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/PaginatedServiceAccountGroup' x-xgen-version: '2024-08-05' description: OK headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Return All Service Account Project Assignments tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts getServiceAccountGroups --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.GetOrgServiceAccountGroupsApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tGetOrgServiceAccountGroupsWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups?pretty=true\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups?pretty=true\"" x-rolesRequirements: - Organization Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/getOrgServiceAccountGroups x-xgen-operation-id-override: getServiceAccountGroups /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets: post: description: Create a secret for the specified Service Account. operationId: createOrgServiceAccountSecret parameters: - $ref: '#/components/parameters/orgId' - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' requestBody: content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/ServiceAccountSecretRequest' description: Details for the new secret. required: true responses: '201': content: application/vnd.atlas.2024-08-05+json: schema: $ref: '#/components/schemas/ServiceAccountSecret' x-xgen-version: '2024-08-05' description: Created headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '400': $ref: '#/components/responses/badRequest' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Create One Organization Service Account Secret tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts createOrgSecret --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.CreateOrgServiceAccountSecretApiParams{}\n\tsdkResp, httpResp, err := client.ServiceAccountsApi.\n\t\tCreateOrgServiceAccountSecretWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets\" \\\n -d '{ }'" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n --header \"Content-Type: application/json\" \\\n -X POST \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets\" \\\n -d '{ }'" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createOrgServiceAccountSecret x-xgen-operation-id-override: createOrgSecret /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}: delete: description: Deletes the specified Service Account secret. operationId: deleteOrgServiceAccountSecret parameters: - description: The Client ID of the Service Account. in: path name: clientId required: true schema: example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string - description: Unique 24-hexadecimal digit string that identifies the secret. in: path name: secretId required: true schema: type: string - $ref: '#/components/parameters/orgId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' responses: '204': content: application/vnd.atlas.2024-08-05+json: x-xgen-version: '2024-08-05' description: This endpoint does not return a response body. headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' '401': $ref: '#/components/responses/unauthorized' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notFound' '429': $ref: '#/components/responses/tooManyRequests' '500': $ref: '#/components/responses/internalServerError' summary: Delete One Organization Service Account Secret tags: - Service Accounts x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api serviceAccounts deleteOrgSecret --help - lang: go label: Go source: "import (\n\t\"os\"\n\t\"context\"\n\t\"log\"\n\tsdk \"go.mongodb.org/atlas-sdk/v20250312001/admin\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclientID := os.Getenv(\"MONGODB_ATLAS_CLIENT_ID\")\n\tclientSecret := os.Getenv(\"MONGODB_ATLAS_CLIENT_SECRET\")\n\n\t// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n\tclient, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %v\", err)\n\t}\n\n\tparams = &sdk.DeleteOrgServiceAccountSecretApiParams{}\n\thttpResp, err := client.ServiceAccountsApi.\n\t\tDeleteOrgServiceAccountSecretWithParams(ctx, params).\n\t\tExecute()\n}\n" - lang: cURL label: curl (Service Accounts) source: "curl --include --header \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+json\" \\\n -X DELETE \"https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}\"" x-rolesRequirements: - Organization Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteOrgServiceAccountSecret x-xgen-operation-id-override: deleteOrgSecret components: responses: internalServerError: content: application/json: example: detail: (This is just an example, the exception may not be related to this endpoint) error: 500 errorCode: UNEXPECTED_ERROR reason: Internal Server Error schema: $ref: '#/components/schemas/ApiError' description: Internal Server Error. forbidden: content: application/json: example: detail: (This is just an example, the exception may not be related to this endpoint) error: 403 errorCode: CANNOT_CHANGE_GROUP_NAME reason: Forbidden schema: $ref: '#/components/schemas/ApiError' description: Forbidden. tooManyRequests: content: application/json: example: detail: (This is just an example, the exception may not be related to this endpoint) error: 429 errorCode: RATE_LIMITED reason: Too Many Requests schema: $ref: '#/components/schemas/ApiError' description: Too Many Requests. headers: RateLimit-Limit: $ref: '#/components/headers/HeaderRateLimitLimit' RateLimit-Remaining: $ref: '#/components/headers/HeaderRateLimitRemaining' Retry-After: $ref: '#/components/headers/HeaderRetryAfter' unauthorized: content: application/json: example: detail: (This is just an example, the exception may not be related to this endpoint) error: 401 errorCode: NOT_ORG_GROUP_CREATOR reason: Unauthorized schema: $ref: '#/components/schemas/ApiError' description: Unauthorized. conflict: content: application/json: example: detail: '(This is just an example, the exception may not be related to this endpoint) Cannot delete organization link while there is active migration in following project ids: 60c4fd418ebe251047c50554' error: 409 errorCode: CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK reason: Conflict schema: $ref: '#/components/schemas/ApiError' description: Conflict. badRequest: content: application/json: example: detail: (This is just an example, the exception may not be related to this endpoint) No provider AWS exists. error: 400 errorCode: VALIDATION_ERROR reason: Bad Request schema: $ref: '#/components/schemas/ApiError' description: Bad Request. notFound: content: application/json: example: detail: (This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS error: 404 errorCode: RESOURCE_NOT_FOUND reason: Not Found schema: $ref: '#/components/schemas/ApiError' description: Not Found. schemas: ServiceAccountSecret: properties: createdAt: description: The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. format: date-time readOnly: true type: string expiresAt: description: The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC. format: date-time readOnly: true type: string id: description: Unique 24-hexadecimal digit string that identifies the secret. example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ readOnly: true type: string lastUsedAt: description: The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC. format: date-time readOnly: true type: string maskedSecretValue: description: The masked Service Account secret. example: mdb_sa_sk_... readOnly: true type: string secret: description: The secret for the Service Account. It will be returned only the first time after creation. example: mdb_sa_sk_... readOnly: true type: string required: - createdAt - expiresAt - id type: object Link: properties: href: description: Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with `https://cloud.mongodb.com/api/atlas`. example: https://cloud.mongodb.com/api/atlas type: string rel: description: Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with `https://cloud.mongodb.com/api/atlas`. example: self type: string type: object ServiceAccountIPAccessListEntry: properties: cidrBlock: description: Range of network addresses in the access list for the Service Account. This parameter requires the range to be expressed in Classless Inter-Domain Routing (CIDR) notation of Internet Protocol version 4 or version 6 addresses. You can set a value for this parameter or `ipAddress`, but not for both in the same request. example: 203.0.113.0/24 pattern: ^((([0-9]{1,3}\.){3}[0-9]{1,3})|(:{0,2}([0-9a-f]{1,4}:){0,7}[0-9a-f]{1,4}[:]{0,2}))((%2[fF]|/)[0-9]{1,3})+$ type: string createdAt: description: Date MongoDB Cloud added the entry was added to the Access List. This parameter expresses its value in the ISO 8601 timestamp format in UTC. format: date-time readOnly: true type: string ipAddress: description: Network address in the access list for the Service Account. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. You can set a value for this parameter or `cidrBlock`, but not for both in the same request. example: 203.0.113.10 pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ type: string lastUsedAddress: description: Network address that issued the most recent request to the API. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. The resource returns this parameter after this IP address makes at least one request. example: 203.0.113.10 readOnly: true type: string lastUsedAt: description: Date when MongoDB Cloud received the most recent request that originated from this Internet Protocol version 4 or version 6 address. The resource returns this parameter when at least one request originates from this IP address. MongoDB Cloud updates this parameter each time a client accesses the permitted resource, with a delay of up to 5 minutes. This parameter expresses its value in the ISO 8601 timestamp format in UTC. format: date-time readOnly: true type: string requestCount: description: The number of requests that has originated from this network address. format: int32 readOnly: true type: integer type: object PaginatedServiceAccountIPAccessEntryView: properties: links: description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. externalDocs: description: Web Linking Specification (RFC 5988) url: https://datatracker.ietf.org/doc/html/rfc5988 items: $ref: '#/components/schemas/Link' readOnly: true type: array results: description: List of returned documents that MongoDB Cloud provides when completing this request. items: $ref: '#/components/schemas/ServiceAccountIPAccessListEntry' readOnly: true type: array totalCount: description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. format: int32 minimum: 0 readOnly: true type: integer required: - results type: object GroupServiceAccountUpdateRequest: properties: description: description: Human readable description for the Service Account. maxLength: 250 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string name: description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. maxLength: 64 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string roles: description: A list of Project roles associated with the Service Account. externalDocs: description: Project-level Roles for Service Accounts url: https://www.mongodb.com/docs/atlas/reference/user-roles/ items: type: string type: array type: object OrgServiceAccount: description: Organization Service Account that Atlas created for the organization. properties: clientId: description: The Client ID of the Service Account. example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string createdAt: description: The date that the Service Account was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. format: date-time type: string description: description: Human readable description for the Service Account. type: string name: description: Human-readable name for the Service Account. type: string roles: description: A list of Organization roles associated with the Service Account. items: description: Organization roles available for Service Accounts. enum: - ORG_MEMBER - ORG_READ_ONLY - ORG_BILLING_ADMIN - ORG_BILLING_READ_ONLY - ORG_STREAM_PROCESSING_ADMIN - ORG_GROUP_CREATOR - ORG_OWNER type: string type: array uniqueItems: true secrets: description: A list of secrets associated with the specified Service Account. items: $ref: '#/components/schemas/ServiceAccountSecret' type: array uniqueItems: true readOnly: true type: object PaginatedServiceAccountGroup: description: A list of projects associated with the Service Account. properties: links: description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. externalDocs: description: Web Linking Specification (RFC 5988) url: https://datatracker.ietf.org/doc/html/rfc5988 items: $ref: '#/components/schemas/Link' readOnly: true type: array results: description: List of returned documents that MongoDB Cloud provides when completing this request. items: $ref: '#/components/schemas/ServiceAccountGroup' readOnly: true type: array totalCount: description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. format: int32 minimum: 0 readOnly: true type: integer required: - results type: object ApiError: properties: badRequestDetail: $ref: '#/components/schemas/BadRequestDetail' detail: description: Describes the specific conditions or reasons that cause each type of error. type: string error: description: HTTP status code returned with this error. externalDocs: url: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status format: int32 readOnly: true type: integer errorCode: description: Application error code returned with this error. readOnly: true type: string parameters: description: Parameters used to give more information about the error. items: type: object readOnly: true type: array reason: description: Application error message returned with this error. readOnly: true type: string required: - error - errorCode type: object OrgServiceAccountRequest: description: Organization Service Account that Atlas creates for this organization. If omitted, Atlas doesn't create an organization Service Account for this organization. If specified, this object requires all body parameters. Note that API Keys cannot be specified in the same request. properties: description: description: Human readable description for the Service Account. maxLength: 250 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string name: description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. maxLength: 64 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string roles: description: A list of organization-level roles for the Service Account. items: description: Organization roles available for Service Accounts. enum: - ORG_MEMBER - ORG_READ_ONLY - ORG_BILLING_ADMIN - ORG_BILLING_READ_ONLY - ORG_STREAM_PROCESSING_ADMIN - ORG_GROUP_CREATOR - ORG_OWNER type: string minItems: 1 type: array secretExpiresAfterHours: description: The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. example: 8 format: int32 type: integer required: - description - name - roles - secretExpiresAfterHours type: object GroupServiceAccountRequest: properties: description: description: Human readable description for the Service Account. maxLength: 250 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string name: description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. maxLength: 64 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string roles: description: A list of project-level roles for the Service Account. externalDocs: description: Project-level Roles for Service Accounts url: https://www.mongodb.com/docs/atlas/reference/user-roles/ items: type: string minItems: 1 type: array secretExpiresAfterHours: description: The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. example: 8 format: int32 type: integer required: - description - name - roles - secretExpiresAfterHours type: object BadRequestDetail: description: Bad request detail. properties: fields: description: Describes all violations in a client request. items: $ref: '#/components/schemas/FieldViolation' type: array readOnly: true type: object ServiceAccountGroup: properties: groupId: description: 'Unique 24-hexadecimal digit string that identifies your project. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.' example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ readOnly: true type: string type: object PaginatedOrgServiceAccounts: description: A list of Organization Service Accounts. properties: links: description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. externalDocs: description: Web Linking Specification (RFC 5988) url: https://datatracker.ietf.org/doc/html/rfc5988 items: $ref: '#/components/schemas/Link' readOnly: true type: array results: description: List of returned documents that MongoDB Cloud provides when completing this request. items: $ref: '#/components/schemas/OrgServiceAccount' readOnly: true type: array totalCount: description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. format: int32 minimum: 0 readOnly: true type: integer required: - results type: object FieldViolation: properties: description: description: A description of why the request element is bad. type: string field: description: A path that leads to a field in the request body. type: string required: - description - field type: object OrgServiceAccountUpdateRequest: properties: description: description: Human readable description for the Service Account. maxLength: 250 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string name: description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. maxLength: 64 minLength: 1 pattern: ^[\p{L}\p{N}\-_.,' ]*$ type: string roles: description: A list of organization-level roles for the Service Account. items: description: Organization roles available for Service Accounts. enum: - ORG_MEMBER - ORG_READ_ONLY - ORG_BILLING_ADMIN - ORG_BILLING_READ_ONLY - ORG_STREAM_PROCESSING_ADMIN - ORG_GROUP_CREATOR - ORG_OWNER type: string type: array type: object GroupServiceAccountRoleAssignment: properties: roles: description: The Project permissions for the Service Account in the specified Project. externalDocs: description: Project-level Roles for Service Accounts url: https://www.mongodb.com/docs/atlas/reference/user-roles/ items: type: string minItems: 1 type: array uniqueItems: true required: - roles type: object PaginatedGroupServiceAccounts: description: A list of Project Service Accounts. properties: links: description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. externalDocs: description: Web Linking Specification (RFC 5988) url: https://datatracker.ietf.org/doc/html/rfc5988 items: $ref: '#/components/schemas/Link' readOnly: true type: array results: description: List of returned documents that MongoDB Cloud provides when completing this request. items: $ref: '#/components/schemas/GroupServiceAccount' readOnly: true type: array totalCount: description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. format: int32 minimum: 0 readOnly: true type: integer required: - results type: object GroupServiceAccount: properties: clientId: description: The Client ID of the Service Account. example: mdb_sa_id_1234567890abcdef12345678 pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ type: string createdAt: description: The date that the Service Account was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. format: date-time type: string description: description: Human readable description for the Service Account. type: string name: description: Human-readable name for the Service Account. type: string roles: description: A list of Project roles associated with the Service Account. externalDocs: description: Project-level Roles for Service Accounts url: https://www.mongodb.com/docs/atlas/reference/user-roles/ items: type: string type: array uniqueItems: true secrets: description: A list of secrets associated with the specified Service Account. items: $ref: '#/components/schemas/ServiceAccountSecret' type: array uniqueItems: true type: object ServiceAccountSecretRequest: properties: secretExpiresAfterHours: description: The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. example: 8 format: int32 type: integer required: - secretExpiresAfterHours type: object parameters: envelope: description: Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. in: query name: envelope schema: default: false type: boolean groupId: description: 'Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.' in: path name: groupId required: true schema: example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ type: string itemsPerPage: description: Number of items that the response returns per page. in: query name: itemsPerPage schema: default: 100 maximum: 500 minimum: 1 type: integer pretty: description: Flag that indicates whether the response body should be in the prettyprint format. in: query name: pretty schema: default: false externalDocs: description: Prettyprint url: https://en.wikipedia.org/wiki/Prettyprint type: boolean pageNum: description: Number of the page that displays the current set of the total objects that the response returns. in: query name: pageNum schema: default: 1 minimum: 1 type: integer includeCount: description: Flag that indicates whether the response returns the total number of items (`totalCount`) in the response. in: query name: includeCount schema: default: true type: boolean orgId: description: Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [`/orgs`](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. in: path name: orgId required: true schema: example: 4888442a3354817a7320eb61 pattern: ^([a-f0-9]{24})$ type: string headers: HeaderRetryAfter: description: The minimum time you should wait, in seconds, before retrying the API request. This header might be returned for 429 or 503 error responses. schema: type: integer HeaderRateLimitLimit: description: The maximum number of requests that a user can make within a specific time window. schema: type: integer HeaderRateLimitRemaining: description: The number of requests remaining in the current rate limit window before the limit is reached. schema: type: integer securitySchemes: DigestAuth: scheme: digest type: http ServiceAccounts: description: Learn more about [Service Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview). flows: clientCredentials: scopes: {} tokenUrl: https://cloud.mongodb.com/api/oauth/token type: oauth2 x-externalLinks: - label: Back to Atlas Docs url: https://www.mongodb.com/docs/atlas/ - label: API Changelog url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog/ x-topics: - content: The MongoDB Atlas Administration API is rate limited. To learn more about rate limiting, see the [Atlas Documentation on Rate Limiting](http://dochub.mongodb.org/core/atlas-api-rate-limit) title: Rate Limiting