Create an endpoint

POST /groups/{groupId}/apps/{appId}/endpoints

Create a new endpoint.

Path parameters

application/json

Body Required

A valid configuration object for the new endpoint.

  • route string Required
  • http_method string Required

    Values are GET, POST, PUT, PATCH, DELETE, or *.

  • function_id string Required

    The endpoint function's unique ID.

  • validation_method string Required

    Values are NO_VALIDATION, SECRET_AS_QUERY_PARAM, or VERIFY_PAYLOAD.

  • secret_id string

    If validation_method is set to "SECRET_AS_QUERY_PARAM" or "VERIFY_PAYLOAD", this is the _id of the Secret that authorizes requests.

  • return_type string Required

    A data format supported by the Data API & custom endpoints.

    Values are JSON or EJSON.

  • respond_result boolean Required
  • fetch_custom_user_data boolean
  • create_user_on_auth boolean
  • disabled boolean Required
  • _id string

    The endpoint's unique ID.

Responses

  • 201 application/json

    Created

    Hide response attributes Show response attributes object
    • route string Required
    • http_method string Required

      Values are GET, POST, PUT, PATCH, DELETE, or *.

    • function_id string Required

      The endpoint function's unique ID.

    • validation_method string Required

      Values are NO_VALIDATION, SECRET_AS_QUERY_PARAM, or VERIFY_PAYLOAD.

    • secret_id string

      If validation_method is set to "SECRET_AS_QUERY_PARAM" or "VERIFY_PAYLOAD", this is the _id of the Secret that authorizes requests.

    • return_type string Required

      A data format supported by the Data API & custom endpoints.

      Values are JSON or EJSON.

    • respond_result boolean Required
    • fetch_custom_user_data boolean
    • create_user_on_auth boolean
    • disabled boolean Required
    • _id string

      The endpoint's unique ID.

    • function_name string
POST /groups/{groupId}/apps/{appId}/endpoints
curl \
 --request POST 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/endpoints' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"route":"string","http_method":"GET","function_id":"string","validation_method":"NO_VALIDATION","secret_id":"string","return_type":"JSON","respond_result":true,"fetch_custom_user_data":true,"create_user_on_auth":true,"disabled":true,"_id":"string"}'
Request examples
{
  "route": "string",
  "http_method": "GET",
  "function_id": "string",
  "validation_method": "NO_VALIDATION",
  "secret_id": "string",
  "return_type": "JSON",
  "respond_result": true,
  "fetch_custom_user_data": true,
  "create_user_on_auth": true,
  "disabled": true,
  "_id": "string"
}
Response examples (201)
{
  "route": "string",
  "http_method": "GET",
  "function_id": "string",
  "validation_method": "NO_VALIDATION",
  "secret_id": "string",
  "return_type": "JSON",
  "respond_result": true,
  "fetch_custom_user_data": true,
  "create_user_on_auth": true,
  "disabled": true,
  "_id": "string",
  "function_name": "string"
}