Skip to main content
POST
/
v1
/
groups
Create a group
curl --request POST \
  --url https://api.scrip.dev/v1/groups \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "members": [
    {
      "participant_id": "550e8400-e29b-41d4-a716-446655440000",
      "role": "MEMBER"
    }
  ],
  "name": "Sales Team",
  "on_behalf_of_participant_id": "550e8400-e29b-41d4-a716-446655440010"
}
'
{
  "created_at": "2024-01-15T10:30:00Z",
  "deleted_at": "2023-11-07T05:31:56Z",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Sales Team",
  "status": "ACTIVE",
  "updated_at": "2024-01-15T10:30:00Z"
}
Creates a new group with a name and an initial set of members. Each member references an existing participant by ID and is assigned a role of ADMIN or MEMBER. At least one member must have the ADMIN role; the request will fail otherwise. Groups exist at the organization level and can participate across multiple programs. Once created, a group can hold balances, receive events, and be targeted by rules independently of its individual members.
For usage patterns and examples, see the Groups guide.

Authorizations

X-API-Key
string
header
required

API key passed in the X-API-Key header.

Body

application/json

Group details with initial members (at least one ADMIN required)

members
object[]
required

Initial members (at least one ADMIN required)

Minimum array length: 1
name
string
required

Display name for the group (1-255 chars)

Required string length: 1 - 255
Example:

"Sales Team"

on_behalf_of_participant_id
string<uuid>

Participant who initiated this change, for audit purposes

Example:

"550e8400-e29b-41d4-a716-446655440010"

Response

Group created with ledger entity

created_at
string<date-time>

When this group was created

Example:

"2024-01-15T10:30:00Z"

deleted_at
string<date-time>

When the group was archived (present only if archived)

id
string<uuid>

Unique identifier for this group

Example:

"550e8400-e29b-41d4-a716-446655440000"

name
string

Display name of the group

Example:

"Sales Team"

status
string

Lifecycle status: ACTIVE or ARCHIVED

Example:

"ACTIVE"

updated_at
string<date-time>

When this group was last updated

Example:

"2024-01-15T10:30:00Z"