Docs Menu

Get All Organization Events

On this page

  • Syntax
  • Request Path Parameters
  • Request Query Parameters
  • Request Body Parameters
  • Response
  • Response Document
  • results Embedded Document
  • Example Request
  • Example Response

The Atlas Administration API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request. To learn how to configure API access for an Atlas project, see Get Started with the Atlas Administration API.

https://cloud.mongodb.com/api/atlas/v1.0

GET /orgs/{ORG-ID}/events
Path Element
Required/Optional
Description
ORG-ID
Required
The unique identifier for the organization whose events you want to retrieve. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
Name
Type
Necessity
Description
Default
pageNum
integer
Optional
Page number, starting with one, that Atlas returns of the total number of objects.
1
itemsPerPage
integer
Optional
Number of items that Atlas returns per page, up to a maximum of 500.
100
includeCount
boolean
Optional
Flag that indicates whether Atlas returns the totalCount parameter in the response body.
true
pretty
boolean
Optional
Flag that indicates whether Atlas returns the JSON response in the prettyprint format.
false
envelope
boolean
Optional

Flag that indicates whether Atlas wraps the response in an envelope.

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. Atlas adds the status parameter to the response body.

false
clusterNames
string
Optional

Cluster on which the events occurred. To return events from multiple clusters, specify multiple clusterNames query parameters. For example:

<Request URL>?clusterNames=Cluster1&clusterNames=Cluster2
eventType
string
Optional

Event type to be returned.

Atlas accepts:

Alert Target
Condition
Backup
CPS_SNAPSHOT_SUCCESSFUL
Snapshot taken successfully
CPS_SNAPSHOT_FALLBACK_SUCCESSFUL
Fallback snapshot taken
CPS_SNAPSHOT_FALLBACK_FAILED
Fallback snapshot failed
CPS_SNAPSHOT_BEHIND
Snapshot schedule fell behind
CPS_RESTORE_FAILED
Backup restore failed
CPS_RESTORE_SUCCESSFUL
Backup restore succeeded
CPS_SNAPSHOT_DOWNLOAD_REQUEST_FAILED
Snapshot download request failed
Billing
CREDIT_CARD_ABOUT_TO_EXPIRE
Credit card is about to expire
PENDING_INVOICE_OVER_THRESHOLD
Monthly pending invoice ($) total is...
DAILY_BILL_OVER_THRESHOLD
Daily amount billed ($) is...
Encryption Key
AWS_ENCRYPTION_KEY_NEEDS_ROTATION
AWS encryption key elapsed time since last rotation is...
AZURE_ENCRYPTION_KEY_NEEDS_ROTATION
Azure encryption key elapsed time since last rotation is...
GCP_ENCRYPTION_KEY_NEEDS_ROTATION
GCP encryption key elapsed time since last rotation is...
Host
HOST_DOWN
Host is down
OUTSIDE_METRIC_THRESHOLD
Metric occurred outside of the metric threshold. See View Deployment Metrics.
HOST_MONGOT_CRASHING_OOM
Search process (mongot) ran out of memory. To learn more and troubleshoot the issue that triggered this alert, see Atlas Search alerts.
MONGOT_NOT_CRASHING_OOM
Search process (mongot) has enough memory.
Project
USERS_WITHOUT_MULTI_FACTOR_AUTH
Users do not have two-factor authentication enabled
Replica Set
PRIMARY_ELECTED
Replica set elected a new primary
NO_PRIMARY
Replica set has no primary
TOO_MANY_ELECTIONS
Number of election events is...
REPLICATION_OPLOG_WINDOW_RUNNING_OUT
Replication Oplog Window is...
Sharded Cluster
CLUSTER_MONGOS_IS_MISSING
Cluster is missing an active mongos
User
USER_ROLES_CHANGED_AUDIT
User had their role changed
JOINED_GROUP
User joined the project
REMOVED_FROM_GROUP
User left the project
USER_ROLES_CHANGED_AUDIT
User had their role changed
X.509
NDS_X509_USER_AUTHENTICATION_MANAGED_USER_CERTS_EXPIRATION_CHECK
X.509 User Authentication, Client Certificates Expiration Alert when days to expiration is...
NDS_X509_USER_AUTHENTICATION_CUSTOMER_CA_EXPIRATION_CHECK
X.509 User Authentication, Self-Managed CA Expiration Alert when days to expiration is...
minDate
date
Optional
Earliest Timestamp in ISO 8601 date and time format in UTC from when Atlas should return events.
maxDate
date
Optional
Latest Timestamp in ISO 8601 date and time format in UTC from when Atlas should return events.
includeRaw
boolean
Optional

Flag that specifies whether to include the raw document in the output. The raw document contains additional meta information about the event.

Important

The values in the raw document are subject to change. Do not rely on raw values for formal monitoring.

false

This endpoint does not use HTTP request body parameters.

The response JSON document includes an array of result objects, an array of link objects and a count of the total number of result objects retrieved.

Name
Type
Description
results
array of objects
One object for each item detailed in the results Embedded Document section.
links
array of objects

One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification

totalCount
integer
Count of the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.
Name
Type
Description
alertId
string
Unique identifier for the alert associated to the event.
alertConfigId
string
Unique identifier for the alert configuration associated to the alertId.
apiKeyId
string
Unique identifier for the API Key that triggered the event. If this field is present in the response, Atlas does not return the userId field.
collection
string
Name of the collection on which the event occurred. This field can be present when the eventTypeName is either DATA_EXPLORER or DATA_EXPLORER_CRUD.
created
date
ISO 8601-formatted UTC date when the event occurred.
currentValue
document
Describes the value of the metricName at the time of the event.
currentValue.number
int
The value of the metricName at the time of the event.
currentValue.units
string

The unit of measurement of the currentValue.number.

Possible values are:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
database
string
Name of the database on which the event occurred. This field can be present when the eventTypeName is either DATA_EXPLORER or DATA_EXPLORER_CRUD.
eventTypeName
string

The type of event.

Possible values are:

Alert Target
Condition
Backup
CPS_SNAPSHOT_SUCCESSFUL
Snapshot taken successfully
CPS_SNAPSHOT_FALLBACK_SUCCESSFUL
Fallback snapshot taken
CPS_SNAPSHOT_FALLBACK_FAILED
Fallback snapshot failed
CPS_SNAPSHOT_BEHIND
Snapshot schedule fell behind
CPS_RESTORE_FAILED
Backup restore failed
CPS_RESTORE_SUCCESSFUL
Backup restore succeeded
CPS_SNAPSHOT_DOWNLOAD_REQUEST_FAILED
Snapshot download request failed
Billing
CREDIT_CARD_ABOUT_TO_EXPIRE
Credit card is about to expire
PENDING_INVOICE_OVER_THRESHOLD
Monthly pending invoice ($) total is...
DAILY_BILL_OVER_THRESHOLD
Daily amount billed ($) is...
Encryption Key
AWS_ENCRYPTION_KEY_NEEDS_ROTATION
AWS encryption key elapsed time since last rotation is...
AZURE_ENCRYPTION_KEY_NEEDS_ROTATION
Azure encryption key elapsed time since last rotation is...
GCP_ENCRYPTION_KEY_NEEDS_ROTATION
GCP encryption key elapsed time since last rotation is...
Host
HOST_DOWN
Host is down
OUTSIDE_METRIC_THRESHOLD
Metric occurred outside of the metric threshold. See View Deployment Metrics.
HOST_MONGOT_CRASHING_OOM
Search process (mongot) ran out of memory. To learn more and troubleshoot the issue that triggered this alert, see Atlas Search alerts.
MONGOT_NOT_CRASHING_OOM
Search process (mongot) has enough memory.
Project
USERS_WITHOUT_MULTI_FACTOR_AUTH
Users do not have two-factor authentication enabled
Replica Set
PRIMARY_ELECTED
Replica set elected a new primary
NO_PRIMARY
Replica set has no primary
TOO_MANY_ELECTIONS
Number of election events is...
REPLICATION_OPLOG_WINDOW_RUNNING_OUT
Replication Oplog Window is...
Sharded Cluster
CLUSTER_MONGOS_IS_MISSING
Cluster is missing an active mongos
User
USER_ROLES_CHANGED_AUDIT
User had their role changed
JOINED_GROUP
User joined the project
REMOVED_FROM_GROUP
User left the project
USER_ROLES_CHANGED_AUDIT
User had their role changed
X.509
NDS_X509_USER_AUTHENTICATION_MANAGED_USER_CERTS_EXPIRATION_CHECK
X.509 User Authentication, Client Certificates Expiration Alert when days to expiration is...
NDS_X509_USER_AUTHENTICATION_CUSTOMER_CA_EXPIRATION_CHECK
X.509 User Authentication, Self-Managed CA Expiration Alert when days to expiration is...
groupId
string
The unique identifier for the project in which the event occurred.
hostname
string
The hostname of the Atlas host machine associated to the event.
id
string
The unique identifier for the event.
invoiceId
string
The unique identifier of the invoice associated to the event.
isGlobalAdmin
boolean
Indicates whether the user who triggered the event is a MongoDB employee.
links
array

One or more uniform resource locators that link to sub-resources and/or related resources. The Web Linking Specification explains the relation-types between URLs.

metricName
string
The name of the metric associated to the alertId.
opType
string
Type of operation that occurred. This field is present when the eventTypeName is either DATA_EXPLORER or DATA_EXPLORER_CRUD.
orgId
string
The unique identifier for the organization in which the event occurred.
paymentId
string
The unique identifier of the invoice payment associated to the event.
port
int
The port on which the mongod or mongos listens.
publicKey
string
Public key associated with the API Key that triggered the event. If this field is present in the response, Atlas does not return the username field.
raw
document

Additional meta information about the event. This field only appears when the includeRaw query parameter is true.

Important

The values in the raw document are subject to change. Do not rely on raw values for formal monitoring.

remoteAddress
string
IP address of the userId Atlas user who triggered the event.
replicaSetName
string
The name of the replica set associated to the event.
shardName
string
The name of the shard associated to the event.
targetPublicKey
string
The public key of the API Key targeted by the event.
targetUsername
string
The username for the Atlas user targeted by the event.
teamId
string
The unique identifier for the Atlas team associated to the event.
userId
string
The unique identifier for the Atlas user who triggered the event. If this field is present in the response, Atlas does not return the apiKeyId field.
username
string
The username for the Atlas user who triggered the event. If this field is present in the response, Atlas does not return the publicKey field.
whitelistEntry
string
The white list entry of the API Key targeted by the event.
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest --include \
--header "Content-Type: application/json" \
"https://cloud.mongodb.com/api/atlas/v1.0/orgs/5b478b3afc4625789ce616a3/events"
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/5b478b3afc4625789ce616a3/events?pageNum=1&itemsPerPage=100",
"rel": "self"
}
],
"results": [
{
"created": "2018-07-12T16:30:05Z",
"eventTypeName": "JOINED_TEAM",
"id": "b3ad04e680eef540be141abe",
"isGlobalAdmin": true,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/5b478b3afc4625789ce616a3/events/5b47820d80eef5264e12514a",
"rel": "self"
}
],
"orgId": "5b478b3afc4625789ce616a3",
"remoteAddress": "203.0.113.22",
"targetUsername": "b.doe@example.com",
"userId": "5898b79080eef53b3ad04e68",
"username": "j.doe@example.com"
},
{
"created": "2018-07-09T21:14:40Z",
"eventTypeName": "GROUP_CREATED",
"groupId": "5b43d04087d9d6357de591a2",
"id": "5b478b3afc49d6357de591af",
"isGlobalAdmin": false,
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/5b478b3afc4625789ce616a3/events/5b43d04087d9d6357de591af",
"rel": "self"
}
],
"orgId": "5b478b3afc4625789ce616a3",
"remoteAddress": "192.0.2.88",
"userId": "5898b79080eef53b3ad04e68",
"username": "j.doe@example.com"
}
],
"totalCount": 2
}
Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.

About

  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.