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 Online Archive API version: '2.0' x-xgen-sha: 3d70e065843c008b9871ea7836c98c9de6f202f9 servers: - url: https://cloud.mongodb.com security: - ServiceAccounts: [] - DigestAuth: [] tags: - description: Returns, adds, edits, or removes an online archive. name: Online Archive paths: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives: get: description: Returns details of all online archives. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. externalDocs: description: Online Archive url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive operationId: listGroupClusterOnlineArchives parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/includeCount' - $ref: '#/components/parameters/itemsPerPage' - $ref: '#/components/parameters/pageNum' - $ref: '#/components/parameters/pretty' - description: Human-readable label that identifies the cluster that contains the collection for which you want to return the online archives. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string responses: '200': content: application/vnd.atlas.2023-01-01+json: schema: $ref: '#/components/schemas/PaginatedOnlineArchiveView' x-xgen-version: '2023-01-01' 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 Online Archives for One Cluster tags: - Online Archive x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api onlineArchive listOnlineArchives --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.ListGroupClusterOnlineArchivesApiParams{}\n\tsdkResp, httpResp, err := client.OnlineArchiveApi.\n\t\tListGroupClusterOnlineArchivesWithParams(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}/clusters/{clusterName}/onlineArchives?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}/clusters/{clusterName}/onlineArchives?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/listGroupClusterOnlineArchives x-xgen-operation-id-override: listOnlineArchives post: description: Creates one online archive. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. externalDocs: description: Online Archive url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive operationId: createGroupClusterOnlineArchive parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/pretty' - description: Human-readable label that identifies the cluster that contains the collection for which you want to create one online archive. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string requestBody: content: application/vnd.atlas.2023-01-01+json: schema: $ref: '#/components/schemas/BackupOnlineArchiveCreate' description: Creates one online archive. required: true responses: '200': content: application/vnd.atlas.2023-01-01+json: schema: $ref: '#/components/schemas/BackupOnlineArchive' x-xgen-version: '2023-01-01' 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: Create One Online Archive tags: - Online Archive x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api onlineArchive createOnlineArchive --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.CreateGroupClusterOnlineArchiveApiParams{}\n\tsdkResp, httpResp, err := client.OnlineArchiveApi.\n\t\tCreateGroupClusterOnlineArchiveWithParams(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}/clusters/{clusterName}/onlineArchives\" \\\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}/clusters/{clusterName}/onlineArchives\" \\\n -d '{ }'" x-rolesRequirements: - Project Data Access Admin x-xgen-changelog: '2023-08-02': If 'criteria':'DATE' is specified, then you must specify 'DATE' values in partition fields x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/createGroupClusterOnlineArchive x-xgen-operation-id-override: createOnlineArchive /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz: get: description: 'Downloads query logs for the specified online archive. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: `Accept: application/vnd.atlas.YYYY-MM-DD+gzip`.' externalDocs: description: Online Archive url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive operationId: downloadGroupClusterOnlineArchiveQueryLogs parameters: - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/envelope' - description: Date and time that specifies the starting point for the range of log messages to return. This resource expresses this value in the number of seconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). in: query name: startDate schema: example: 1636481348 format: int64 minimum: 1199145600 type: integer - description: Date and time that specifies the end point for the range of log messages to return. This resource expresses this value in the number of seconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). in: query name: endDate schema: example: 1636481348 format: int64 minimum: 1199145600 type: integer - description: Human-readable label that identifies the cluster that contains the collection for which you want to return the query logs from one online archive. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string - description: Flag that indicates whether to download logs for queries against your online archive only or both your online archive and cluster. in: query name: archiveOnly schema: default: false type: boolean responses: '200': content: application/vnd.atlas.2023-01-01+gzip: schema: description: This resource downloads a compressed log file to your current working directory. You can specify its name using the `--output` option or use the default filename using the `-OJ` option. The default filename varies based on whether you download logs for queries of your online archive only or both your online archive and cluster. format: binary type: string x-xgen-version: '2023-01-01' 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: Download Online Archive Query Logs tags: - Online Archive x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api onlineArchive downloadQueryLogs --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.DownloadGroupClusterOnlineArchiveQueryLogsApiParams{}\n\tsdkResp, httpResp, err := client.OnlineArchiveApi.\n\t\tDownloadGroupClusterOnlineArchiveQueryLogsWithParams(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+gzip\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz\" \\\n --output \"file_name.gz\"" - lang: cURL label: curl (Digest) source: "curl --user \"${PUBLIC_KEY}:${PRIVATE_KEY}\" \\\n --digest --include \\\n --header \"Accept: application/vnd.atlas.2025-03-12+gzip\" \\\n -X GET \"https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz\" \\\n --output \"file_name.gz\"" x-rolesRequirements: - Project Data Access Admin - Project Data Access Read Only - Project Data Access Read Write - Project Stream Processing Owner x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/downloadGroupClusterOnlineArchiveQueryLogs x-xgen-method-verb-override: customMethod: 'True' verb: download x-xgen-operation-id-override: downloadQueryLogs /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}: delete: description: Removes one online archive. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. externalDocs: description: Online Archive url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive operationId: deleteGroupClusterOnlineArchive parameters: - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/pretty' - description: Unique 24-hexadecimal digit string that identifies the online archive to delete. in: path name: archiveId required: true schema: pattern: ^([a-f0-9]{24})$ type: string - description: Human-readable label that identifies the cluster that contains the collection from which you want to remove an online archive. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string responses: '204': content: application/vnd.atlas.2023-01-01+json: x-xgen-version: '2023-01-01' 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: Remove One Online Archive tags: - Online Archive x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api onlineArchive deleteOnlineArchive --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.DeleteGroupClusterOnlineArchiveApiParams{}\n\thttpResp, err := client.OnlineArchiveApi.\n\t\tDeleteGroupClusterOnlineArchiveWithParams(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}/clusters/{clusterName}/onlineArchives/{archiveId}\"" - 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}/clusters/{clusterName}/onlineArchives/{archiveId}\"" x-rolesRequirements: - Project Data Access Admin x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/deleteGroupClusterOnlineArchive x-xgen-operation-id-override: deleteOnlineArchive get: description: Returns one online archive for one cluster. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. externalDocs: description: Online Archive url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive operationId: getGroupClusterOnlineArchive parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/pretty' - description: Unique 24-hexadecimal digit string that identifies the online archive to return. in: path name: archiveId required: true schema: pattern: ^([a-f0-9]{24})$ type: string - description: Human-readable label that identifies the cluster that contains the specified collection from which Application created the online archive. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string responses: '200': content: application/vnd.atlas.2023-01-01+json: schema: $ref: '#/components/schemas/BackupOnlineArchive' x-xgen-version: '2023-01-01' 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: Return One Online Archive tags: - Online Archive x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api onlineArchive getOnlineArchive --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.GetGroupClusterOnlineArchiveApiParams{}\n\tsdkResp, httpResp, err := client.OnlineArchiveApi.\n\t\tGetGroupClusterOnlineArchiveWithParams(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}/clusters/{clusterName}/onlineArchives/{archiveId}?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}/clusters/{clusterName}/onlineArchives/{archiveId}?pretty=true\"" x-rolesRequirements: - Project Read Only x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/getGroupClusterOnlineArchive x-xgen-operation-id-override: getOnlineArchive patch: description: Updates, pauses, or resumes one online archive. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. externalDocs: description: Online Archive url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive operationId: updateGroupClusterOnlineArchive parameters: - $ref: '#/components/parameters/envelope' - $ref: '#/components/parameters/groupId' - $ref: '#/components/parameters/pretty' - description: Unique 24-hexadecimal digit string that identifies the online archive to update. in: path name: archiveId required: true schema: pattern: ^([a-f0-9]{24})$ type: string - description: Human-readable label that identifies the cluster that contains the specified collection from which Application created the online archive. in: path name: clusterName required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ type: string requestBody: content: application/vnd.atlas.2023-01-01+json: schema: $ref: '#/components/schemas/BackupOnlineArchive' description: Updates, pauses, or resumes one online archive. required: true responses: '200': content: application/vnd.atlas.2023-01-01+json: schema: $ref: '#/components/schemas/BackupOnlineArchive' x-xgen-version: '2023-01-01' 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: Update One Online Archive tags: - Online Archive x-codeSamples: - lang: cURL label: Atlas CLI source: atlas api onlineArchive updateOnlineArchive --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.UpdateGroupClusterOnlineArchiveApiParams{}\n\tsdkResp, httpResp, err := client.OnlineArchiveApi.\n\t\tUpdateGroupClusterOnlineArchiveWithParams(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}/clusters/{clusterName}/onlineArchives/{archiveId}\" \\\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}/clusters/{clusterName}/onlineArchives/{archiveId}\" \\\n -d '{ }'" x-rolesRequirements: - Project Data Access Admin x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/updateGroupClusterOnlineArchive x-xgen-operation-id-override: updateOnlineArchive 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: WeeklyScheduleView: allOf: - $ref: '#/components/schemas/OnlineArchiveSchedule' - properties: dayOfWeek: description: Day of the week when the scheduled archive starts. The week starts with Monday (`1`) and ends with Sunday (`7`). format: int32 maximum: 7 minimum: 1 type: integer endHour: description: Hour of the day when the scheduled window to run one online archive ends. This field uses the UTC time zone. The window must have a duration of at least two hours. If the end time is before or equal to the start time, the window extends to the next day. format: int32 maximum: 23 minimum: 0 type: integer endMinute: description: Minute of the hour when the scheduled window to run one online archive ends. This field uses the UTC time zone. The window must have a duration of at least two hours. If the end time is before or equal to the start time, the window extends to the next day. format: int32 maximum: 59 minimum: 0 type: integer startHour: description: Hour of the day when the scheduled window to run one online archive starts. This field uses the UTC time zone. format: int32 maximum: 23 minimum: 0 type: integer startMinute: description: Minute of the hour when the scheduled window to run one online archive starts. This field uses the UTC time zone. format: int32 maximum: 59 minimum: 0 type: integer type: object required: - type type: object PartitionFieldView: description: Metadata to partition this online archive. properties: fieldName: description: Human-readable label that identifies the parameter that MongoDB Cloud uses to partition data. To specify a nested parameter, use the dot notation. maxLength: 700 type: string fieldType: description: Data type of the parameter that that MongoDB Cloud uses to partition data. Partition parameters of type UUID must be of binary subtype 4. MongoDB Cloud skips partition parameters of type UUID with subtype 3. enum: - date - int - long - objectId - string - uuid externalDocs: description: UUID url: http://bsonspec.org/spec.html readOnly: true type: string order: default: 0 description: Sequence in which MongoDB Cloud slices the collection data to create partitions. The resource expresses this sequence starting with zero. The value of the `criteria.dateField` parameter defaults as the first item in the partition sequence. format: int32 type: integer required: - fieldName - order title: Online Archive Partition 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 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 PaginatedOnlineArchiveView: 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/BackupOnlineArchive' 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 DataProcessRegionView: description: Settings to configure the region where you wish to store your archived data. discriminator: mapping: AWS: '#/components/schemas/AWSDataProcessRegionView' AZURE: '#/components/schemas/AzureDataProcessRegionView' GCP: '#/components/schemas/GCPDataProcessRegionView' propertyName: cloudProvider properties: cloudProvider: description: Human-readable label that identifies the Cloud service provider where you store your archived data. enum: - AWS - AZURE - GCP readOnly: true type: string readOnly: true 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 CreateDataProcessRegionView: description: Settings to configure the region where you wish to store your archived data. discriminator: mapping: AWS: '#/components/schemas/AWSCreateDataProcessRegionView' AZURE: '#/components/schemas/AzureCreateDataProcessRegionView' GCP: '#/components/schemas/GCPCreateDataProcessRegionView' propertyName: cloudProvider properties: cloudProvider: description: Human-readable label that identifies the Cloud service provider where you wish to store your archived data. `AZURE` or `GCP` may be selected only if it is the Cloud service provider for the cluster and no archives for any other cloud provider have been created for the cluster. enum: - AWS - AZURE - GCP type: string type: object writeOnly: true BackupOnlineArchive: properties: _id: description: Unique 24-hexadecimal digit string that identifies the online archive. example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ readOnly: true type: string clusterName: description: Human-readable label that identifies the cluster that contains the collection for which you want to create an online archive. pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ readOnly: true type: string collName: description: Human-readable label that identifies the collection for which you created the online archive. readOnly: true type: string collectionType: default: STANDARD description: 'Classification of MongoDB database collection that you want to return. If you set this parameter to `TIMESERIES`, set `"criteria.type" : "date"` and `"criteria.dateFormat" : "ISODATE"`.' enum: - TIMESERIES - STANDARD readOnly: true type: string criteria: $ref: '#/components/schemas/CriteriaView' dataExpirationRule: $ref: '#/components/schemas/DataExpirationRuleView' dataProcessRegion: $ref: '#/components/schemas/DataProcessRegionView' dataSetName: description: Human-readable label that identifies the dataset that Atlas generates for this online archive. readOnly: true type: string dbName: description: Human-readable label of the database that contains the collection that contains the online archive. readOnly: true type: string groupId: description: Unique 24-hexadecimal digit string that identifies the project that contains the specified cluster. The specified cluster contains the collection for which to create the online archive. example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ readOnly: true type: string partitionFields: description: 'List that contains document parameters to use to logically divide data within a collection. Partitions provide a coarse level of filtering of the underlying collection data. To divide your data, specify parameters that you frequently query. If you specified `criteria.type`: `DATE` in the Create One Online Archive endpoint, then you can specify up to three parameters by which to query. One of these parameters must be the `DATE` value, which is required in this case. If you specified `criteria.type`: `CUSTOM` in the Create One Online Archive endpoint, then you can specify up to two parameters by which to query. Queries that don''t use `criteria.type`: `DATE` or `criteria.type`: `CUSTOM` parameters cause MongoDB to scan a full collection of all archived documents. This takes more time and increases your costs.' items: $ref: '#/components/schemas/PartitionFieldView' minItems: 1 readOnly: true type: array paused: description: Flag that indicates whether this online archive exists in the paused state. A request to resume fails if the collection has another active online archive. To pause an active online archive or resume a paused online archive, you must include this parameter. To pause an active archive, set this to **true**. To resume a paused archive, set this to **false**. type: boolean schedule: $ref: '#/components/schemas/OnlineArchiveSchedule' state: description: 'Phase of the process to create this online archive when you made this request. | State | Indication | |-------------|------------| | `PENDING` | MongoDB Cloud has queued documents for archive. Archiving hasn''t started. | | `ARCHIVING` | MongoDB Cloud started archiving documents that meet the archival criteria. | | `IDLE` | MongoDB Cloud waits to start the next archival job. | | `PAUSING` | Someone chose to stop archiving. MongoDB Cloud finishes the running archival job then changes the state to `PAUSED` when that job completes. | | `PAUSED` | MongoDB Cloud has stopped archiving. Archived documents can be queried. The specified archiving operation on the active cluster cannot archive additional documents. You can resume archiving for paused archives at any time. | | `ORPHANED` | Someone has deleted the collection associated with an active or paused archive. MongoDB Cloud doesn''t delete the archived data. You must manually delete the online archives associated with the deleted collection. | | `DELETED` | Someone has deleted the archive was deleted. When someone deletes an online archive, MongoDB Cloud removes all associated archived documents from the cloud object storage. |' enum: - PENDING - ACTIVE - PAUSING - PAUSED - DELETED - ORPHANED readOnly: true type: string type: object OnlineArchiveSchedule: description: Regular frequency and duration when archiving process occurs. discriminator: mapping: DAILY: '#/components/schemas/DailyScheduleView' DEFAULT: '#/components/schemas/DefaultScheduleView' MONTHLY: '#/components/schemas/MonthlyScheduleView' WEEKLY: '#/components/schemas/WeeklyScheduleView' propertyName: type oneOf: - $ref: '#/components/schemas/DefaultScheduleView' - $ref: '#/components/schemas/DailyScheduleView' - $ref: '#/components/schemas/WeeklyScheduleView' - $ref: '#/components/schemas/MonthlyScheduleView' properties: type: description: Type of schedule. enum: - DEFAULT - DAILY - WEEKLY - MONTHLY type: string required: - type title: Online Archive Schedule 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 DailyScheduleView: allOf: - $ref: '#/components/schemas/OnlineArchiveSchedule' - properties: endHour: description: Hour of the day when the scheduled window to run one online archive ends. This field uses the UTC time zone. The window must have a duration of at least two hours. If the end time is before or equal to the start time, the window extends to the next day. format: int32 maximum: 23 minimum: 0 type: integer endMinute: description: Minute of the hour when the scheduled window to run one online archive ends. This field uses the UTC time zone. The window must have a duration of at least two hours. If the end time is before or equal to the start time, the window extends to the next day. format: int32 maximum: 59 minimum: 0 type: integer startHour: description: Hour of the day when the scheduled window to run one online archive starts. This field uses the UTC time zone. format: int32 maximum: 23 minimum: 0 type: integer startMinute: description: Minute of the hour when the scheduled window to run one online archive starts. This field uses the UTC time zone. format: int32 maximum: 59 minimum: 0 type: integer type: object required: - type type: object DataExpirationRuleView: description: Rule for specifying when data should be deleted from the archive. properties: expireAfterDays: description: Number of days used in the date criteria for nominating documents for deletion. format: int32 maximum: 9215 minimum: 7 type: integer type: object BackupOnlineArchiveCreate: properties: _id: description: Unique 24-hexadecimal digit string that identifies the online archive. example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ readOnly: true type: string clusterName: description: Human-readable label that identifies the cluster that contains the collection for which you want to create an online archive. pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ readOnly: true type: string collName: description: Human-readable label that identifies the collection for which you created the online archive. type: string writeOnly: true collectionType: default: STANDARD description: 'Classification of MongoDB database collection that you want to return. If you set this parameter to `TIMESERIES`, set `"criteria.type" : "date"` and `"criteria.dateFormat" : "ISODATE"`.' enum: - TIMESERIES - STANDARD type: string writeOnly: true criteria: $ref: '#/components/schemas/CriteriaView' dataExpirationRule: $ref: '#/components/schemas/DataExpirationRuleView' dataProcessRegion: $ref: '#/components/schemas/CreateDataProcessRegionView' dataSetName: description: Human-readable label that identifies the dataset that Atlas generates for this online archive. readOnly: true type: string dbName: description: Human-readable label of the database that contains the collection that contains the online archive. maxLength: 64 type: string writeOnly: true groupId: description: Unique 24-hexadecimal digit string that identifies the project that contains the specified cluster. The specified cluster contains the collection for which to create the online archive. example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ readOnly: true type: string partitionFields: description: 'List that contains document parameters to use to logically divide data within a collection. Partitions provide a coarse level of filtering of the underlying collection data. To divide your data, specify parameters that you frequently query. If you specified `criteria.type`: `DATE` in the Create One Online Archive endpoint, then you can specify up to three parameters by which to query. One of these parameters must be the `DATE` value, which is required in this case. If you specified `criteria.type`: `CUSTOM` in the Create One Online Archive endpoint, then you can specify up to two parameters by which to query. Queries that don''t use `criteria.type`: `DATE` or `criteria.type`: `CUSTOM` parameters cause MongoDB to scan a full collection of all archived documents. This takes more time and increases your costs.' items: $ref: '#/components/schemas/PartitionFieldView' minItems: 1 type: array writeOnly: true paused: description: Flag that indicates whether this online archive exists in the paused state. A request to resume fails if the collection has another active online archive. To pause an active online archive or resume a paused online archive, you must include this parameter. To pause an active archive, set this to **true**. To resume a paused archive, set this to **false**. type: boolean schedule: $ref: '#/components/schemas/OnlineArchiveSchedule' state: description: 'Phase of the process to create this online archive when you made this request. | State | Indication | |-------------|------------| | `PENDING` | MongoDB Cloud has queued documents for archive. Archiving hasn''t started. | | `ARCHIVING` | MongoDB Cloud started archiving documents that meet the archival criteria. | | `IDLE` | MongoDB Cloud waits to start the next archival job. | | `PAUSING` | Someone chose to stop archiving. MongoDB Cloud finishes the running archival job then changes the state to `PAUSED` when that job completes. | | `PAUSED` | MongoDB Cloud has stopped archiving. Archived documents can be queried. The specified archiving operation on the active cluster cannot archive additional documents. You can resume archiving for paused archives at any time. | | `ORPHANED` | Someone has deleted the collection associated with an active or paused archive. MongoDB Cloud doesn''t delete the archived data. You must manually delete the online archives associated with the deleted collection. | | `DELETED` | Someone has deleted the archive was deleted. When someone deletes an online archive, MongoDB Cloud removes all associated archived documents from the cloud object storage. |' enum: - PENDING - ACTIVE - PAUSING - PAUSED - DELETED - ORPHANED readOnly: true type: string required: - collName - criteria - dbName type: object MonthlyScheduleView: allOf: - $ref: '#/components/schemas/OnlineArchiveSchedule' - properties: dayOfMonth: description: Day of the month when the scheduled archive starts. format: int32 maximum: 31 minimum: 1 type: integer endHour: description: Hour of the day when the scheduled window to run one online archive ends. This field uses the UTC time zone. The window must have a duration of at least two hours. If the end time is before or equal to the start time, the window extends to the next day. format: int32 maximum: 23 minimum: 0 type: integer endMinute: description: Minute of the hour when the scheduled window to run one online archive ends. This field uses the UTC time zone. The window must have a duration of at least two hours. If the end time is before or equal to the start time, the window extends to the next day. format: int32 maximum: 59 minimum: 0 type: integer startHour: description: Hour of the day when the scheduled window to run one online archive starts. This field uses the UTC time zone. format: int32 maximum: 23 minimum: 0 type: integer startMinute: description: Minute of the hour when the scheduled window to run one online archive starts. This field uses the UTC time zone. format: int32 maximum: 59 minimum: 0 type: integer type: object required: - type type: object CriteriaView: description: 'Rules by which MongoDB Cloud archives data. Use the `criteria.type` field to choose how MongoDB Cloud selects data to archive. Choose data using the age of the data or a MongoDB query. `"criteria.type": "DATE"` selects documents to archive based on a date. `"criteria.type": "CUSTOM"` selects documents to archive based on a custom JSON query. MongoDB Cloud doesn''t support `"criteria.type": "CUSTOM"` when `"collectionType": "TIMESERIES"`.' discriminator: mapping: CUSTOM: '#/components/schemas/CustomCriteriaView' DATE: '#/components/schemas/DateCriteriaView' propertyName: type properties: type: description: 'Means by which MongoDB Cloud selects data to archive. Data can be chosen using the age of the data or a MongoDB query. `DATE` selects documents to archive based on a date. `CUSTOM` selects documents to archive based on a custom JSON query. MongoDB Cloud doesn''t support `CUSTOM` when `"collectionType": "TIMESERIES"`.' enum: - DATE - CUSTOM type: string type: object DefaultScheduleView: allOf: - $ref: '#/components/schemas/OnlineArchiveSchedule' required: - type 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 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