GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Go to GitLab Docs homepage
  • What's new?
  • Get free trial
  • Use GitLab
  • GitLab Duo
  • GitLab Orbit
  • Extend
  • Install
  • Administer
  • Subscribe
  • Contribute
  • Solutions
  • Getting started
  • Tutorials

This view

  • Original page
  • New address

GeezerVison is showing docs.gitlab.com — Custom Attributes API | GitLab Docs

 / 

Custom Attributes API

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed, GitLab Dedicated

Use this API to manage custom attributes for users, groups, and projects.

Prerequisites:

  • You must be an administrator for the instance.

List all custom attributes

Lists all custom attributes for a specified resource.

GET /users/:id/custom_attributes
GET /groups/:id/custom_attributes
GET /projects/:id/custom_attributes
AttributeTypeRequiredDescription
idintegeryesThe ID of a resource
shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/users/42/custom_attributes"

Example response:

json
[
   {
      "key": "location",
      "value": "Antarctica"
   },
   {
      "key": "role",
      "value": "Developer"
   }
]

Retrieve a custom attribute

Retrieves a specified custom attribute for a resource.

GET /users/:id/custom_attributes/:key
GET /groups/:id/custom_attributes/:key
GET /projects/:id/custom_attributes/:key
AttributeTypeRequiredDescription
idintegeryesThe ID of a resource
keystringyesThe key of the custom attribute
shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"

Example response:

json
{
   "key": "location",
   "value": "Antarctica"
}

Update a custom attribute

Updates or creates a custom attribute for a specified resource. The attribute is updated if it already exists, or newly created otherwise.

PUT /users/:id/custom_attributes/:key
PUT /groups/:id/custom_attributes/:key
PUT /projects/:id/custom_attributes/:key
AttributeTypeRequiredDescription
idintegeryesThe ID of a resource
keystringyesThe key of the custom attribute
valuestringyesThe value of the custom attribute
shell
curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --data "value=Greenland" \
  --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"

Example response:

json
{
   "key": "location",
   "value": "Greenland"
}

Delete custom attribute

Deletes a specified custom attribute for a resource.

DELETE /users/:id/custom_attributes/:key
DELETE /groups/:id/custom_attributes/:key
DELETE /projects/:id/custom_attributes/:key
AttributeTypeRequiredDescription
idintegeryesThe ID of a resource
keystringyesThe key of the custom attribute
shell
curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"
Was this page helpful?
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.