Navigation

Get X.509 Certificates for a User

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

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.

Required Roles

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

Resource

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

GET /groups/{GROUP-ID}/databaseUsers/{USERNAME}/certs

Request

Path Parameters

Name Type Necessity Description
GROUP-ID string Required Identifier for the Atlas project associated with the X.509 configuration.
USERNAME string Required Username of the database user to get certificates for.

Query Parameters

The following query parameters are optional:

Query Parameter Type Description Default
pretty boolean Displays response in a prettyprint format. false
envelope boolean Specifies whether or not to wrap the response in an envelope. false

Body Parameters

This endpoint does not use HTTP request body parameters.

Response

Name Type Description
links array One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification
results array of objects Array of objects where each details one unexpired database user certificate.
results[n]._id number Serial number of this certificate.
results[n].createdAt string Timestamp in ISO 8601 date and time format in UTC when Atlas created this X.509 certificate.
results[n].groupId string Unique identifier of the Atlas project to which this certificate belongs.
results[n].notAfter string Timestamp in ISO 8601 date and time format in UTC when this certificate expires.
results[n].subject string Fully distinguished name of the database user to which this certificate belongs. To learn more, see RFC 2253.
totalCount number Total number of unexpired certificates returned in this response.

Example

Request

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"

Response

The following example shows the JSON document returned:

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