Modify the Data API
Update your app's Data API configuration.
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 endpoint.
-
A supported version of the Data API.
Value is
v1
. -
A data format supported by the Data API & custom endpoints.
Values are
JSON
orEJSON
. -
An application user's account ID. If defined, endpoints will always run as the specified user.
-
Stringified source code for a function that returns an application user's account ID. If defined, endpoints execute the function on every request and run as the user with the ID returned from the function.
-
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 thename
of the Secret that authorizes requests. -
A JSON expression that evaluates to
true
if an endpoint is allowed to run in response to an incoming request.
curl \
--request PATCH 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/data_api/config' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"disabled":true,"versions":["v1"],"return_type":"JSON","create_user_on_auth":true,"run_as_user_id":"string","run_as_user_id_script_source":"string","validation_method":"NO_VALIDATION","secret_name":"string","can_evaluate":{}}'
{
"disabled": true,
"versions": [
"v1"
],
"return_type": "JSON",
"create_user_on_auth": true,
"run_as_user_id": "string",
"run_as_user_id_script_source": "string",
"validation_method": "NO_VALIDATION",
"secret_name": "string",
"can_evaluate": {}
}