---
title: "Update a Function"
method: PUT
path: "/groups/{groupId}/apps/{appId}/functions/{functionId}"
tags: ["functions"]
---

# Update a Function

`PUT /groups/{groupId}/apps/{appId}/functions/{functionId}`

Update a [Function](https://www.mongodb.com/docs/realm/functions#std-label-functions).

## Response `200`

The function was successfully updated.

- NewFunction
  - `can_evaluate` object — A JSON expression that evaluates to `true` if the Function is allowed to run in response to an incoming request.
  - `name` string, required — A unique name for the Function.
  - `private` boolean, required — If `true`, the function is hidden from client applications. You can still call a private function from JSON expressions and other functions, including incoming webhooks and triggers.
  - `source` string, required — The stringified source code for the function. The code must be valid ES6.
  - `run_as_system` boolean, required — If `true`, the function executes with full privileges, bypassing rules on all services.

---

[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/eb671cf4e125/schema)
