---
title: "Creates or updates a custom attribute for a project"
method: PUT
path: "/api/v4/projects/{id}/custom_attributes/{key}"
tags: ["custom_attributes"]
---

# Creates or updates a custom attribute for a project

`PUT /api/v4/projects/{id}/custom_attributes/{key}`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/custom_attributes/{key}`
- Auth: none declared

Creates or updates a custom attribute for a specified project. If the attribute already exists, it is updated, otherwise a new attribute is created.

## Path parameters

- `key` string, required
- `id` integer, required

## Request body

- PutApiV4ProjectsIdCustomAttributesKey: Creates or updates a custom attribute for a project
  - `value` string, required: The value of the custom attribute

## Response `200`

Creates or updates a custom attribute for a project

- APIEntitiesCustomAttribute: API_Entities_CustomAttribute model
  - `key` string, required
  - `value` string, required

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
