Create One Private Endpoint Connection String for One Cluster Beta PREVIEW

POST /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/privateEndpointConnectionStrings

This API is in preview. Breaking changes might be introduced before it is released. Don't use preview APIs in production.

Creates one private endpoint connection string for the specified cluster. The new record is returned with status = PENDING; MongoDB Cloud publishes the DNS records asynchronously, so poll the record until it reports AVAILABLE before connecting with it.

Role requirements
  • Project Owner

Path parameters

  • groupId string Required

    Unique 24-hexadecimal digit string that identifies your project. Use the /groups 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.

    Format should match the following pattern: ^([a-f0-9]{24})$.

  • clusterName string Required

    Human-readable label that identifies the cluster.

Query parameters

  • envelope boolean

    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.

    Default value is false.

  • pretty boolean

    Flag that indicates whether the response body should be in the prettyprint format.

    Default value is false.

    Prettyprint
application/vnd.atlas.preview+json

Body Required

Private endpoint connection string to create.

  • name string Required

    Human-readable label of at most 64 characters that identifies this private endpoint connection string. You can change this label without changing the connection string.

    Minimum length is 1, maximum length is 64.

  • optimizedModeEnabled boolean

    Flag that indicates whether this private endpoint connection string uses the optimized load-balanced mode. This mode requires a sharded cluster and a private endpoint selection that satisfies the optimized connection string requirements.

    Default value is false.

  • privateEndpointIds array[string] Required

    Set of private endpoints that this connection string covers. MongoDB Cloud stores this set as a snapshot of your selection and never adds newly created private endpoints to it. The set accepts at most one private endpoint per cloud provider region, and can include private endpoints that the cluster does not use yet. Order is not significant and MongoDB Cloud rejects duplicate values.

    At least 1 but not more than 50 elements. Maximum length of each is 512.

Responses

  • 201 application/vnd.atlas.preview+json

    Created

    Hide headers attributes Show headers attributes
    • RateLimit-Limit

      The maximum number of requests that a user can make within a specific time window.

    • RateLimit-Remaining

      The number of requests remaining in the current rate limit window before the limit is reached.

    Hide response attributes Show response attributes object
    • connectionString string

      Private endpoint-aware connection string that uses the mongodb:// protocol to connect to this cluster through the selected private endpoints. MongoDB Cloud returns this value when status is AVAILABLE. After you submit an update, MongoDB Cloud continues to return the existing connection string until the updated connection string becomes available.

      Maximum length is 2048.

    • connectionStringId string Required

      Unique 24-hexadecimal digit string that identifies this private endpoint connection string. This value is the connectionStringId path parameter of this resource's endpoints.

      Format should match the following pattern: ^([a-f0-9]{24})$.

    • createdAt string(date-time)

      Date and time when MongoDB Cloud created this private endpoint connection string. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

    • errorMessage string

      Error message that explains why this private endpoint connection string is in the FAILED state, including the remediation, for example when a selected endpoint was deleted mid-flight. Present only when status is FAILED.

    • managementType string Required

      Party that manages this private endpoint connection string. MongoDB Cloud returns SELF_MANAGED for connection strings that you create and maintain through this resource, and IMPORTED for records that preserve the private endpoint connection strings that this cluster exposed before migration. You can delete an imported record but not update it.

      Values are SELF_MANAGED or IMPORTED.

    • name string Required

      Human-readable label of at most 64 characters that identifies this private endpoint connection string. You can change this label without changing the connection string.

      Maximum length is 64.

    • optimizedModeEnabled boolean

      Flag that indicates whether this private endpoint connection string uses the optimized load-balanced mode. This mode requires a sharded cluster and a private endpoint selection that satisfies the optimized connection string requirements.

      Default value is false.

    • privateEndpointIds array[string] Required

      Set of private endpoints that this connection string covers. MongoDB Cloud stores this set as a snapshot of your selection and never adds newly created private endpoints to it. The set accepts at most one private endpoint per cloud provider region, and can include private endpoints that the cluster does not use yet. Order is not significant and MongoDB Cloud rejects duplicate values.

      Not more than 50 elements. Maximum length of each is 512.

    • slug string

      Short generated pin of at most 64 characters, unique per project. Present only when managementType is SELF_MANAGED. A self-managed connection string embeds this value in its DNS names, and its replica set horizon name is cs- plus this value.

      Maximum length is 64.

    • srvConnectionString string

      Private endpoint-aware connection string that uses the mongodb+srv:// protocol to connect to this cluster through the selected private endpoints. MongoDB Cloud returns this value when status is AVAILABLE. After you submit an update, MongoDB Cloud continues to return the existing connection string until the updated connection string becomes available.

      Maximum length is 2048.

    • status string Required

      State of this private endpoint connection string. MongoDB Cloud returns PENDING while it reconfigures the cluster, AVAILABLE once the connection string is usable, and FAILED when creation cannot complete.

      Values are PENDING, AVAILABLE, or FAILED.

    • updatedAt string(date-time)

      Date and time when MongoDB Cloud last updated this private endpoint connection string. This parameter expresses its value in the ISO 8601 timestamp format in UTC.

  • 400 application/json

    Bad Request.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string | null

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • policiesCausingDecision array[object]

      Atlas Resource Policies that caused the request to be denied. Returned only when errorCode is ATLAS_RESOURCE_POLICIES_VIOLATION_NOT_AUTHORIZED.

      Not more than 100 elements.

      Hide policiesCausingDecision attributes Show policiesCausingDecision attributes object

      Atlas Resource Policy that caused the request to be denied.

      • id string Required

        Unique 24-hexadecimal character string that identifies the Atlas Resource Policy.

        Format should match the following pattern: ^([a-f0-9]{24})$.

      • name string Required

        Human-readable label that identifies the Atlas Resource Policy.

    • reason string | null

      Application error message returned with this error.

  • 401 application/json

    Unauthorized.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string | null

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • policiesCausingDecision array[object]

      Atlas Resource Policies that caused the request to be denied. Returned only when errorCode is ATLAS_RESOURCE_POLICIES_VIOLATION_NOT_AUTHORIZED.

      Not more than 100 elements.

      Hide policiesCausingDecision attributes Show policiesCausingDecision attributes object

      Atlas Resource Policy that caused the request to be denied.

      • id string Required

        Unique 24-hexadecimal character string that identifies the Atlas Resource Policy.

        Format should match the following pattern: ^([a-f0-9]{24})$.

      • name string Required

        Human-readable label that identifies the Atlas Resource Policy.

    • reason string | null

      Application error message returned with this error.

  • 403 application/json

    Forbidden.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string | null

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • policiesCausingDecision array[object]

      Atlas Resource Policies that caused the request to be denied. Returned only when errorCode is ATLAS_RESOURCE_POLICIES_VIOLATION_NOT_AUTHORIZED.

      Not more than 100 elements.

      Hide policiesCausingDecision attributes Show policiesCausingDecision attributes object

      Atlas Resource Policy that caused the request to be denied.

      • id string Required

        Unique 24-hexadecimal character string that identifies the Atlas Resource Policy.

        Format should match the following pattern: ^([a-f0-9]{24})$.

      • name string Required

        Human-readable label that identifies the Atlas Resource Policy.

    • reason string | null

      Application error message returned with this error.

  • 404 application/json

    Not Found.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string | null

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • policiesCausingDecision array[object]

      Atlas Resource Policies that caused the request to be denied. Returned only when errorCode is ATLAS_RESOURCE_POLICIES_VIOLATION_NOT_AUTHORIZED.

      Not more than 100 elements.

      Hide policiesCausingDecision attributes Show policiesCausingDecision attributes object

      Atlas Resource Policy that caused the request to be denied.

      • id string Required

        Unique 24-hexadecimal character string that identifies the Atlas Resource Policy.

        Format should match the following pattern: ^([a-f0-9]{24})$.

      • name string Required

        Human-readable label that identifies the Atlas Resource Policy.

    • reason string | null

      Application error message returned with this error.

  • 409 application/json

    Conflict.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string | null

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • policiesCausingDecision array[object]

      Atlas Resource Policies that caused the request to be denied. Returned only when errorCode is ATLAS_RESOURCE_POLICIES_VIOLATION_NOT_AUTHORIZED.

      Not more than 100 elements.

      Hide policiesCausingDecision attributes Show policiesCausingDecision attributes object

      Atlas Resource Policy that caused the request to be denied.

      • id string Required

        Unique 24-hexadecimal character string that identifies the Atlas Resource Policy.

        Format should match the following pattern: ^([a-f0-9]{24})$.

      • name string Required

        Human-readable label that identifies the Atlas Resource Policy.

    • reason string | null

      Application error message returned with this error.

  • 429 application/json

    Too Many Requests.

    Hide headers attributes Show headers attributes
    • RateLimit-Limit

      The maximum number of requests that a user can make within a specific time window.

    • RateLimit-Remaining

      The number of requests remaining in the current rate limit window before the limit is reached.

    • Retry-After

      The minimum time you should wait, in seconds, before retrying the API request. This header might be returned for 429 or 503 error responses.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string | null

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • policiesCausingDecision array[object]

      Atlas Resource Policies that caused the request to be denied. Returned only when errorCode is ATLAS_RESOURCE_POLICIES_VIOLATION_NOT_AUTHORIZED.

      Not more than 100 elements.

      Hide policiesCausingDecision attributes Show policiesCausingDecision attributes object

      Atlas Resource Policy that caused the request to be denied.

      • id string Required

        Unique 24-hexadecimal character string that identifies the Atlas Resource Policy.

        Format should match the following pattern: ^([a-f0-9]{24})$.

      • name string Required

        Human-readable label that identifies the Atlas Resource Policy.

    • reason string | null

      Application error message returned with this error.

  • 500 application/json

    Internal Server Error.

    Hide response attributes Show response attributes object
    • badRequestDetail object

      Bad request detail.

      Hide badRequestDetail attribute Show badRequestDetail attribute object
      • fields array[object]

        Describes all violations in a client request.

        Hide fields attributes Show fields attributes object
        • description string Required

          A description of why the request element is bad.

        • field string Required

          A path that leads to a field in the request body.

    • detail string | null

      Describes the specific conditions or reasons that cause each type of error.

    • error integer(int32) Required

      HTTP status code returned with this error.

      External documentation
    • errorCode string Required

      Application error code returned with this error.

    • parameters array[object]

      Parameters used to give more information about the error.

    • policiesCausingDecision array[object]

      Atlas Resource Policies that caused the request to be denied. Returned only when errorCode is ATLAS_RESOURCE_POLICIES_VIOLATION_NOT_AUTHORIZED.

      Not more than 100 elements.

      Hide policiesCausingDecision attributes Show policiesCausingDecision attributes object

      Atlas Resource Policy that caused the request to be denied.

      • id string Required

        Unique 24-hexadecimal character string that identifies the Atlas Resource Policy.

        Format should match the following pattern: ^([a-f0-9]{24})$.

      • name string Required

        Human-readable label that identifies the Atlas Resource Policy.

    • reason string | null

      Application error message returned with this error.

POST /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/privateEndpointConnectionStrings
atlas api clusters createEndpointConnectionString --help
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
  --header "Accept: application/vnd.atlas.preview+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/privateEndpointConnectionStrings" \
  -d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
  --digest --include \
  --header "Accept: application/vnd.atlas.preview+json" \
  --header "Content-Type: application/json" \
  -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/privateEndpointConnectionStrings" \
  -d '{ <Payload> }'
Request examples
{
  "name": "reporting-vpc",
  "optimizedModeEnabled": false,
  "privateEndpointIds": [
    "string"
  ]
}
Response examples (201)
# Headers

# Payload
{
  "connectionString": "string",
  "connectionStringId": "32b6e34b3d91647abb20e7b8",
  "createdAt": "2026-05-04T09:42:00Z",
  "errorMessage": "string",
  "managementType": "SELF_MANAGED",
  "name": "reporting-vpc",
  "optimizedModeEnabled": false,
  "privateEndpointIds": [
    "string"
  ],
  "slug": "ztevkhxb",
  "srvConnectionString": "string",
  "status": "PENDING",
  "updatedAt": "2026-05-04T09:42:00Z"
}
Response examples (400)
{
  "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"
}
Response examples (401)
{
  "detail": "(This is just an example, the exception may not be related to this endpoint)",
  "error": 401,
  "errorCode": "NOT_ORG_GROUP_CREATOR",
  "reason": "Unauthorized"
}
Response examples (403)
{
  "detail": "(This is just an example, the exception may not be related to this endpoint)",
  "error": 403,
  "errorCode": "CANNOT_CHANGE_GROUP_NAME",
  "reason": "Forbidden"
}
Response examples (404)
{
  "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"
}
Response examples (409)
{
  "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"
}
Response examples (429)
{
  "detail": "(This is just an example, the exception may not be related to this endpoint)",
  "error": 429,
  "errorCode": "RATE_LIMITED",
  "reason": "Too Many Requests"
}
Response examples (500)
{
  "detail": "(This is just an example, the exception may not be related to this endpoint)",
  "error": 500,
  "errorCode": "UNEXPECTED_ERROR",
  "reason": "Internal Server Error"
}