Skip to main content
PATCH
/
v1
/
participants
/
{id}
/
status
Update participant state
curl --request PATCH \
  --url https://api.scrip.dev/v1/participants/{id}/status \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "status": "SUSPENDED",
  "force": false
}
'
import requests

url = "https://api.scrip.dev/v1/participants/{id}/status"

payload = {
"status": "SUSPENDED",
"force": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'SUSPENDED', force: false})
};

fetch('https://api.scrip.dev/v1/participants/{id}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrip.dev/v1/participants/{id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'SUSPENDED',
'force' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.scrip.dev/v1/participants/{id}/status"

payload := strings.NewReader("{\n \"status\": \"SUSPENDED\",\n \"force\": false\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.scrip.dev/v1/participants/{id}/status")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"SUSPENDED\",\n \"force\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.scrip.dev/v1/participants/{id}/status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"SUSPENDED\",\n \"force\": false\n}"

response = http.request(request)
puts response.read_body
{
  "attributes": {
    "plan": "premium",
    "region": "us-east"
  },
  "balances": [
    {
      "asset_id": "550e8400-e29b-41d4-a716-446655440000",
      "available": "1500.00",
      "deferred": "0.00",
      "held": "200.00"
    }
  ],
  "counters": {
    "points_earned": "1500",
    "purchases": "42"
  },
  "created_at": "2024-01-15T10:30:00Z",
  "display_name": "Jane Doe",
  "email": "jane@example.com",
  "external_id": "user_123",
  "first_name": "Jane",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "last_name": "Doe",
  "phone": "+15551234567",
  "program_ids": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "status": "ACTIVE",
  "tags": [
    "vip"
  ],
  "tiers": {
    "loyalty": {
      "level": "gold",
      "rank": 2
    }
  },
  "updated_at": "2024-01-15T10:30:00Z"
}
{
"code": "bad_request",
"details": {
"expected": "uuid",
"field": "asset_id",
"fields": [
{
"expected": "<unknown>",
"field": "amount",
"message": "This field is required",
"reason": "required",
"received": "-10.00"
}
],
"reason": "invalid",
"received": "not-a-uuid"
},
"message": "Invalid request parameters"
}
{
"code": "unauthorized",
"details": {
"expected": "uuid",
"field": "asset_id",
"fields": [
{
"expected": "<unknown>",
"field": "amount",
"message": "This field is required",
"reason": "required",
"received": "-10.00"
}
],
"reason": "invalid",
"received": "not-a-uuid"
},
"message": "Missing or invalid credentials"
}
{
"code": "forbidden",
"details": {
"expected": "uuid",
"field": "asset_id",
"fields": [
{
"expected": "<unknown>",
"field": "amount",
"message": "This field is required",
"reason": "required",
"received": "-10.00"
}
],
"reason": "invalid",
"received": "not-a-uuid"
},
"message": "Insufficient permissions for this action"
}
{
"code": "not_found",
"details": {
"expected": "uuid",
"field": "asset_id",
"fields": [
{
"expected": "<unknown>",
"field": "amount",
"message": "This field is required",
"reason": "required",
"received": "-10.00"
}
],
"reason": "invalid",
"received": "not-a-uuid"
},
"message": "Resource not found"
}
{
"code": "conflict",
"details": {
"expected": "uuid",
"field": "asset_id",
"fields": [
{
"expected": "<unknown>",
"field": "amount",
"message": "This field is required",
"reason": "required",
"received": "-10.00"
}
],
"reason": "invalid",
"received": "not-a-uuid"
},
"message": "Resource already exists or state conflict"
}
{
"code": "unsupported_media_type",
"details": {
"expected": "uuid",
"field": "asset_id",
"fields": [
{
"expected": "<unknown>",
"field": "amount",
"message": "This field is required",
"reason": "required",
"received": "-10.00"
}
],
"reason": "invalid",
"received": "not-a-uuid"
},
"message": "Content-Type must be application/json"
}
{
"code": "internal_error",
"message": "An internal error occurred"
}
Changes a participant’s lifecycle status.
  • ACTIVE: the participant can earn and spend normally
  • SUSPENDED: temporarily frozen. Financial actions (CREDIT, DEBIT, HOLD, RELEASE, FORFEIT, COUNTER) are blocked. Metadata actions (TAG, SET_ATTRIBUTE, SET_TIER) are still allowed. Reversible by setting status back to ACTIVE
  • CLOSED: deactivated. Same restrictions as SUSPENDED. Can be transitioned back to ACTIVE or SUSPENDED
When a rule triggers a blocked action against a suspended or closed participant, that action fails and the event is marked FAILED. Events where only allowed actions match will still complete successfully.
For the full breakdown of which actions are allowed by status, see Participants: What’s allowed by status.

Authorizations

X-API-Key
string
header
required

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

Path Parameters

id
string<uuid>
required

Participant ID

Body

application/json

State update

status
enum<string>
required

Lifecycle state

Available options:
ACTIVE,
SUSPENDED,
CLOSED
Example:

"SUSPENDED"

force
boolean

Force bypasses the group last-admin guard for incident response. When true, suspending/closing a participant who is the sole active ADMIN of a group proceeds and detaches the participant's ADMIN membership from each such group instead of returning 409 last_admin_status_change_forbidden.

Example:

false

Response

Participant updated

attributes
object

Key-value metadata. Each key is accessible in rules via the participant.attribute. shorthand (null if unset) or get(participant.attributes, "key", "")

Example:
{ "plan": "premium", "region": "us-east" }
balances
object[]

Current balances per asset, split by bucket

counters
object

Numeric accumulators, returned as strings for precision

Example:
{
"points_earned": "1500",
"purchases": "42"
}
created_at
string<date-time>

When the participant was created

Example:

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

display_name
string

Display name

Example:

"Jane Doe"

email
string

Contact email

Example:

"jane@example.com"

external_id
string

Your application's identifier for this user

Example:

"user_123"

first_name
string

First name

Example:

"Jane"

id
string<uuid>

Participant ID

Example:

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

last_name
string

Last name

Example:

"Doe"

phone
string

Contact phone

Example:

"+15551234567"

program_ids
string[]

Programs this participant is enrolled in

Example:
["550e8400-e29b-41d4-a716-446655440000"]
status
string

Lifecycle state

Example:

"ACTIVE"

tags
string[]

Labels for segmentation, accessible in rules via participant.tag. (true/false) or 'name' in participant.tags

Example:
["vip"]
tiers
object

Current tier level per tier type

Example:
{ "loyalty": { "level": "gold", "rank": 2 } }
updated_at
string<date-time>

When the participant was last modified

Example:

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