curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/constraints' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"description": "Cannot ship before payment received",
"expression": "shipped(X) -> paid(X)",
"id": "ship_after_payment",
"source": "domain_rule",
"strength": {
"type": "hard"
}
}'
{
"description": "Two-person tent, green — replacement for damaged pole set.",
"expression": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source": "string",
"strength": {
"type": "hard"
}
}
Create a new constraint
Required scope: write
POST
/
api
/
v1
/
constraints
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/constraints' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"description": "Cannot ship before payment received",
"expression": "shipped(X) -> paid(X)",
"id": "ship_after_payment",
"source": "domain_rule",
"strength": {
"type": "hard"
}
}'
{
"description": "Two-person tent, green — replacement for damaged pole set.",
"expression": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source": "string",
"strength": {
"type": "hard"
}
}
Required scope:
write
Request body
CreateConstraintRequest
string
required
Human-readable description
string
required
Logical expression in NSR-L syntax
string
required
Unique constraint identifier
string
Source of the constraint
ConstraintStrengthRequest
required
Response
ConstraintResponse
string
required
string
required
string
required
string
required
Status codes
| Code | Meaning |
|---|---|
201 | Constraint created |
400 | Invalid constraint |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
409 | Constraint already exists |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/constraints' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"description": "Cannot ship before payment received",
"expression": "shipped(X) -> paid(X)",
"id": "ship_after_payment",
"source": "domain_rule",
"strength": {
"type": "hard"
}
}'
{
"description": "Two-person tent, green — replacement for damaged pole set.",
"expression": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"source": "string",
"strength": {
"type": "hard"
}
}
Last modified on August 31, 2026