Groups

Update a group

Rename a group, archive or restore it, or change its tags, attributes and counters. Scrip applies every change together or none of them, and returns the group with its updated state.

patch/v1/groups/{group_id}

Request

  • Base URL: https://api.scrip.dev
  • URL: https://api.scrip.dev/v1/groups/{group_id}
  • Auth: HTTP bearer

Path parameters

group_idstring uuid required

The group's id.

Headers

Idempotency-Keystring

A key you choose to make this request safe to retry: 1 to 255 printable ASCII characters. Send the same key with the same request to get the first response again, marked Idempotent-Replayed: true. Routes that return a secret once, and claim links, do not replay a response. Event ingest uses the key as the event's identity.

Request body

attributesobject

Attributes to change, as a merge patch. Keys you send are set, keys you leave out keep their value, and a key sent as null is removed. Removing a key that does not exist succeeds and changes nothing, so retries are safe.

countersobject

Counters to change. Each key maps to {"increment": n} to add to the counter, {"set": n} to replace its value, {"reset_after": "720h"} to change only the reset window and keep the value, or null to remove it. Removing a counter that does not exist succeeds and changes nothing, so retries are safe. Scrip applies every change in the request together or none of them.

namestring

New display name for the group (1-255 chars)

status'ACTIVE' | 'ARCHIVED'

Set to ARCHIVED to archive the group, or back to ACTIVE to restore it.

tagsstring[]

The group's full tag set. Sending tags replaces every existing tag, and an empty list removes them all. Leave the field out to keep the tags. null is not allowed.

Example request

{
  "attributes": {
    "legacy_segment": null,
    "plan": "premium"
  },
  "counters": {
    "points_cycle": {
      "set": "0"
    },
    "purchases": {
      "increment": "1"
    },
    "trial_days": null
  },
  "name": "Updated Team Name",
  "status": "ARCHIVED",
  "tags": [
    "enterprise"
  ]
}

Response

Updated group

attributesobject

Key-value metadata. An empty object when the group has none.

counter_settingsobject

Auto-reset settings for the counters that have one, keyed by counter key. An empty object when no counter resets. Set them with reset_after on a counter in PATCH.

countersobject

Numeric accumulators, returned as strings for precision. An empty object when the group has none.

created_atstring date-time

When this group was created

deleted_atstring date-time

When the group was archived (present only if archived)

idstring uuid

Unique identifier for this group

namestring

The name people see for the group.

status'ACTIVE' | 'ARCHIVED'

The group's lifecycle state.

tagsstring[]

Labels for segmentation. An empty list when the group has none.

updated_atstring date-time

When this group was last updated

Example response

{
  "attributes": {
    "plan": "premium",
    "region": "us-east"
  },
  "counters": {
    "points_earned": "1500",
    "purchases": "42"
  },
  "created_at": "2027-01-15T10:30:00Z",
  "deleted_at": "2027-01-15T10:30:00Z",
  "id": "0b9e7d3c-5a41-4f68-a2c7-81e4d6b3f907",
  "name": "Sales Team",
  "status": "ACTIVE",
  "tags": [
    "enterprise"
  ],
  "updated_at": "2027-01-15T10:30:00Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.