{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/mongodb/main/json-schema/mongodb-backup-online-archive-create-schema.json", "title": "BackupOnlineArchiveCreate", "x-generated": "2026-10-03", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/mongodb-online-archive-api-openapi.yml#/components/schemas/BackupOnlineArchiveCreate", "properties": { "_id": { "description": "Unique 24-hexadecimal digit string that identifies the online archive.", "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.\n\nIf you set this parameter to `TIMESERIES`, set `\"criteria.type\" : \"date\"` and `\"criteria.dateFormat\" : \"ISODATE\"`.", "enum": [ "TIMESERIES", "STANDARD" ], "type": "string", "writeOnly": true }, "criteria": { "$ref": "#/$defs/CriteriaView" }, "dataExpirationRule": { "$ref": "#/$defs/DataExpirationRuleView" }, "dataProcessRegion": { "$ref": "#/$defs/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.", "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": "#/$defs/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": "#/$defs/OnlineArchiveSchedule" }, "state": { "description": "Phase of the process to create this online archive when you made this request.\n\n| State | Indication |\n|-------------|------------|\n| `PENDING` | MongoDB Cloud has queued documents for archive. Archiving hasn't started. |\n| `ARCHIVING` | MongoDB Cloud started archiving documents that meet the archival criteria. |\n| `IDLE` | MongoDB Cloud waits to start the next archival job. |\n| `PAUSING` | Someone chose to stop archiving. MongoDB Cloud finishes the running archival job then changes the state to `PAUSED` when that job completes. |\n| `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. |\n| `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. |\n| `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", "$defs": { "CreateDataProcessRegionView": { "description": "Settings to configure the region where you wish to store your archived data.", "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 }, "CriteriaView": { "description": "Rules by which MongoDB Cloud archives data.\n\nUse 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.\n`\"criteria.type\": \"DATE\"` selects documents to archive based on a date.\n`\"criteria.type\": \"CUSTOM\"` selects documents to archive based on a custom JSON query. MongoDB Cloud doesn't support `\"criteria.type\": \"CUSTOM\"` when `\"collectionType\": \"TIMESERIES\"`.", "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.\n`DATE` selects documents to archive based on a date.\n`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" }, "DailyScheduleView": { "allOf": [ { "$ref": "#/$defs/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" }, "DefaultScheduleView": { "allOf": [ { "$ref": "#/$defs/OnlineArchiveSchedule" } ], "required": [ "type" ], "type": "object" }, "MonthlyScheduleView": { "allOf": [ { "$ref": "#/$defs/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" }, "OnlineArchiveSchedule": { "description": "Regular frequency and duration when archiving process occurs.", "oneOf": [ { "$ref": "#/$defs/DefaultScheduleView" }, { "$ref": "#/$defs/DailyScheduleView" }, { "$ref": "#/$defs/WeeklyScheduleView" }, { "$ref": "#/$defs/MonthlyScheduleView" } ], "properties": { "type": { "description": "Type of schedule.", "enum": [ "DEFAULT", "DAILY", "WEEKLY", "MONTHLY" ], "type": "string" } }, "required": [ "type" ], "title": "Online Archive Schedule", "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" ], "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" }, "WeeklyScheduleView": { "allOf": [ { "$ref": "#/$defs/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" } } }