Path parameters
-
An Atlas Project/Group ID.
-
The ObjectID of your application. The App Services API Project and Application IDs section demonstrates how to find this value.
Body
Required
A valid configuration object for the new endpoint.
-
Values are
GET
,POST
,PUT
,PATCH
,DELETE
, or*
. -
The endpoint function's unique ID.
-
Values are
NO_VALIDATION
,SECRET_AS_QUERY_PARAM
, orVERIFY_PAYLOAD
. -
If
validation_method
is set to"SECRET_AS_QUERY_PARAM"
or"VERIFY_PAYLOAD"
, this is the_id
of the Secret that authorizes requests. -
A data format supported by the Data API & custom endpoints.
Values are
JSON
orEJSON
. -
The endpoint's unique ID.
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"
}