Navigation

Get X.509 Certificates for a User

Get a list of all Atlas-managed, unexpired certificates for a database user.

Info With Circle IconCreated with Sketch.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.

You must have the Atlas admin role to use this endpoint.

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

GET /groups/{GROUP-ID}/databaseUsers/{USERNAME}/certs
NameTypeNecessityDescription
GROUP-IDstringRequiredIdentifier for the Atlas project associated with the X.509 configuration.
USERNAMEstringRequiredUsername of the database user to get certificates for.

The following query parameters are optional:

Query ParameterTypeDescriptionDefault
prettybooleanDisplays response in a prettyprint format.false
envelopebooleanSpecifies whether or not to wrap the response in an envelope.false

This endpoint does not use HTTP request body parameters.

NameTypeDescription
linksarrayOne or more links to sub-resources and/or related resources. The relations between URL s are explained in the Web Linking Specification
resultsarray of objectsArray of objects where each details one unexpired database user certificate.
results[n]._idnumberSerial number of this certificate.
results[n].createdAtstringTimestamp in ISO 8601 date and time format in UTC when Atlas created this X.509 certificate.
results[n].groupIdstringUnique identifier of the Atlas project to which this certificate belongs.
results[n].notAfterstringTimestamp in ISO 8601 date and time format in UTC when this certificate expires.
results[n].subjectstringFully distinguished name of the database user to which this certificate belongs. To learn more, see RFC 2253.
totalCountnumberTotal number of unexpired certificates returned in this response.

The following example returns a list of all Atlas-managed, unexpired certificates for a database user, along with a total count of those certificates.

curl --request GET \
--user "{publicApiKey}:{privateApiKey}" \
--digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/{groupId}/databaseUsers/{username}/certs?pretty=true"

The following example shows the JSON document returned:

1{
2 "links" : [ {
3 "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/ec13d5f09d521a5206e5d726/databaseUsers/myX509User/certs?pretty=true&pageNum=1&itemsPerPage=100",
4 "rel" : "self"
5 } ],
6 "results" : [ {
7 "_id" : 5433027191242719574,
8 "createdAt" : "2019-12-03T21:00:42Z",
9 "groupId" : "ec13d5f09d521a5206e5d726",
10 "notAfter" : "2020-06-03T22:00:42Z",
11 "subject" : "CN=myX509User"
12 }, {
13 "_id" : 0946028664465903704,
14 "createdAt" : "2019-12-05T13:50:49Z",
15 "groupId" : "ec13d5f09d521a5206e5d726",
16 "notAfter" : "2020-03-05T14:50:49Z",
17 "subject" : "CN=myX509User"
18 } ],
19 "totalCount" : 2
20}
Give Feedback