# Execute a function **POST /groups/{groupId}/apps/{appId}/debug/execute_function** Execute a [function](https://www.mongodb.com/zh-cn/docs/atlas/app-services/functions/) for testing. ## Servers - The root API resource and starting point for the App Services API.: https://services.cloud.mongodb.com/api/admin/v3.0 (The root API resource and starting point for the App Services API.) ## Authentication methods - Token auth ## Parameters ### Path parameters - **groupId** (string) An Atlas [Project/Group ID](https://docs.atlas.mongodb.com/tutorial/manage-projects/). - **appId** (string) The ObjectID of your application. [The App Services API Project and Application IDs section](#section/Project-and-Application-IDs) demonstrates how to find this value. ### Query parameters - **user_id** (string) The user as which to execute the function. Either `user_id` or `run_as_system` is required. You cannot specify both. - **run_as_system** (boolean) Determine whether or not to run as system user. Either `run_as_system` or `user_id` is required. You cannot specify both. ### Body: application/json (object) The function to execute. - **service** (string) The service to use when calling this function. - **name** (string) The name of the function you want to run. - **arguments** (array[string]) Any arguments that your function needs. ## Responses ### 200 Successfully executed. #### Body: application/json (object) - **error** (object) - **result** (object) - **stats** (object) [Powered by Bump.sh](https://bump.sh)