---
title: "✨ Update GCP custom metric Cloud Function"
method: POST
path: "/api/projects/{id}/gcp-custom-function"
tags: ["Projects"]
---

# ✨ Update GCP custom metric Cloud Function

`POST /api/projects/{id}/gcp-custom-function`

<Card href="https://humansignal.com/goenterprise">
        <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
        <p style="margin-top: 10px; font-size: 14px;">
            This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
        </p>
    </Card>
Create or update the GCP Cloud Function used for custom metrics in this project.

## Path parameters

- `id` integer, required

## Request body

- GCPCustomFunctionUpdateRequest — Serializer for updating GCP Cloud Function custom metric.
  - `code` string, required — The Python code for the custom metric function.
  - `project` string, nullable — The GCP project ID. Uses default if not provided.
  - `region` string, nullable — The GCP region for the Cloud Function. Uses default if not provided.

## Response `200`

Updated successfully

## Other responses

- `202` — Accepted, activation pending
- `204` — No changes applied
- `500` — Error updating function

---

[API](https://skmtc.net/humansignal/apis/label-studio-api.md) · [All operations](https://skmtc.net/humansignal/apis/label-studio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/humansignal/label-studio-api/revisions/1b113b8df950/schema)
