---
title: "Create an endpoint"
method: POST
path: "/groups/{groupId}/apps/{appId}/endpoints"
tags: ["endpoints"]
---

# Create an endpoint

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

Create a new [endpoint](https://www.mongodb.com/docs/atlas/app-services/data-api/custom-endpoints/).

## Request body

- Endpoint
  - `route` string, required
  - `http_method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | '*', required
  - `function_id` string, required — The endpoint function's unique ID.
  - `validation_method` 'NO_VALIDATION' | 'SECRET_AS_QUERY_PARAM' | 'VERIFY_PAYLOAD', required
  - `secret_id` string — If `validation_method` is set to `"SECRET_AS_QUERY_PARAM"` or `"VERIFY_PAYLOAD"`, this is the `_id` of the [Secret](https://www.mongodb.com/docs/atlas/app-services/values-and-secrets/) that authorizes requests.
  - `return_type` 'JSON' | 'EJSON', required — A [data format](https://mongodb.com/docs/atlas/app-services/data-api/#data-formats) supported by the Data API & custom endpoints.
  - `respond_result` boolean, required
  - `fetch_custom_user_data` boolean
  - `create_user_on_auth` boolean
  - `disabled` boolean, required
  - `_id` string — The endpoint's unique ID.

## Response `201`

Created

- object
  - `route` string, required
  - `http_method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | '*', required
  - `function_id` string, required — The endpoint function's unique ID.
  - `validation_method` 'NO_VALIDATION' | 'SECRET_AS_QUERY_PARAM' | 'VERIFY_PAYLOAD', required
  - `secret_id` string — If `validation_method` is set to `"SECRET_AS_QUERY_PARAM"` or `"VERIFY_PAYLOAD"`, this is the `_id` of the [Secret](https://www.mongodb.com/docs/atlas/app-services/values-and-secrets/) that authorizes requests.
  - `return_type` 'JSON' | 'EJSON', required — A [data format](https://mongodb.com/docs/atlas/app-services/data-api/#data-formats) supported by the Data API & custom endpoints.
  - `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

## Changes

- **2024-02-20** (v3) `e2240dd053bd` — 4 breaking, 19 warning, 1 info
  - added `#/components/schemas/BaseEndpoint, subschema #2` to the request body `allOf` list
  - the request's body type/format changed from `object`/`` to ``/``
  - the `allOf[#/components/schemas/Endpoint]/` response's property type/format changed from `object`/`` to ``/`` for status `201`
  - removed the required property `allOf[#/components/schemas/Endpoint]/function_id` from the response with the `201` status
  - …20 more
- **2023-03-31** (v3) `eb671cf4e125` — 2 warning
  - removed the request property `function_name`
  - removed the optional property `allOf[#/components/schemas/Endpoint]/function_name` from the response with the `201` status
- **2023-03-27** (v3) `c75e1135f5d4` — 2 breaking, 10 warning, 1 info
  - the response's body type/format changed from `object`/`` to ``/`` for status `201`
  - removed the required property `function_id` from the response with the `201` status
  - removed the optional property `create_user_on_auth` from the response with the `201` status
  - removed the optional property `disabled` from the response with the `201` status
  - …9 more

[Change history](https://skmtc.dev/mongodb/apis/mongodb-atlas-app-services-admin-api/changes/groups/:groupId/apps/:appId/endpoints/post.md)

---

[API](https://skmtc.dev/mongodb/apis/mongodb-atlas-app-services-admin-api.md) · [All operations](https://skmtc.dev/mongodb/apis/mongodb-atlas-app-services-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mongodb/mongodb-atlas-app-services-admin-api/revisions/1365ab72bc03/schema)
