Skip to content

Update

PATCH/users/{user_ref}

Updates a user.

Path ParametersExpand Collapse
user_ref: string

User id or external_id.

Body ParametersJSONExpand Collapse
tags: object { create, delete, set, update }

Tag updates.

create: optional array of object { key, value }

Tags to create. The tag key must not already exist.

key: string

Tag key. Must not contain #, /, or :. Max 50 characters.

value: string

Tag value. Must not contain #, /, or :. Max 200 characters.

delete: optional array of object { key }

Tags to remove.

key: string

Tag key to delete.

set: optional array of object { key, value }

Tags to set. Creates a new tag or updates an existing tag.

key: string

Tag key. Must not contain #, /, or :. Max 50 characters.

value: string

Tag value. Must not contain #, /, or :. Max 200 characters.

update: optional array of object { key, value }

Tags to update. The tag key must already exist.

key: string

Tag key. Must not contain #, /, or :. Max 50 characters.

value: string

Tag value. Must not contain #, /, or :. Max 200 characters.

ReturnsExpand Collapse
data: User { id, external_id, tags }

User object.

id: string

FRAGMENT generated unique ID.

external_id: string

User-provided unique ID.

tags: array of object { key, value }

Tags for the user.

key: string

Tag key.

value: string

Tag value.

Update

curl https://api.us-west-2.fragment.dev/billing/users/$USER_REF \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -d '{
          "tags": {
            "set": [
              {
                "key": "department",
                "value": "engineering"
              }
            ]
          }
        }'
{
  "data": {
    "id": "user_abc123",
    "external_id": "user_ext_123",
    "tags": [
      {
        "key": "department",
        "value": "engineering"
      }
    ]
  }
}
Returns Examples
{
  "data": {
    "id": "user_abc123",
    "external_id": "user_ext_123",
    "tags": [
      {
        "key": "department",
        "value": "engineering"
      }
    ]
  }
}