curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/macros/batch' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"macros": [
{
"auto_send": true,
"body": "string",
"channel": "string",
"name": "string",
"rule_name": "string",
"source": "string",
"status": {
"0": "c",
"1": "a",
"2": "n",
"3": "d",
"4": "i",
"5": "d",
"6": "a",
"7": "t",
"8": "e"
},
"tags": [],
"title": "string",
"tool": {
"arguments": null,
"name": null
}
}
]
}'
{
"created": 1,
"errors": [
{
"code": "string",
"message": "string"
}
],
"macros": [
{
"auto_send": true,
"body": "string",
"channel": "string",
"created_at": "string",
"id": "string",
"name": "string",
"org_id": "string",
"rule_name": "string",
"slots": [],
"source": "string",
"status": "candidate",
"tags": [],
"title": "string",
"tool": {
"arguments": null,
"name": null
},
"updated_at": "string"
}
],
"replaced": 1
}
Upload a whole library in one call.
Required scope: write
POST
/
api
/
v1
/
macros
/
batch
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/macros/batch' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"macros": [
{
"auto_send": true,
"body": "string",
"channel": "string",
"name": "string",
"rule_name": "string",
"source": "string",
"status": {
"0": "c",
"1": "a",
"2": "n",
"3": "d",
"4": "i",
"5": "d",
"6": "a",
"7": "t",
"8": "e"
},
"tags": [],
"title": "string",
"tool": {
"arguments": null,
"name": null
}
}
]
}'
{
"created": 1,
"errors": [
{
"code": "string",
"message": "string"
}
],
"macros": [
{
"auto_send": true,
"body": "string",
"channel": "string",
"created_at": "string",
"id": "string",
"name": "string",
"org_id": "string",
"rule_name": "string",
"slots": [],
"source": "string",
"status": "candidate",
"tags": [],
"title": "string",
"tool": {
"arguments": null,
"name": null
},
"updated_at": "string"
}
],
"replaced": 1
}
Required scope:
write
Request body
BatchCreateMacrosRequest
CreateMacroRequest[]
required
Response
BatchCreateMacrosResponse
integer
required
BatchItemError[]
required
Macro[]
required
Show Macro
Show Macro
boolean
required
string
required
string
string
required
string
required
string
required
Upsert key within an org, matching the rules convention.
string
required
string
The policy rule whose citation selects this macro.
string[]
required
Merge fields parsed from
body at write time.string
MacroStatus
required
string[]
string
string
required
integer
required
Status codes
| Code | Meaning |
|---|---|
200 | Batch upload result |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/macros/batch' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"macros": [
{
"auto_send": true,
"body": "string",
"channel": "string",
"name": "string",
"rule_name": "string",
"source": "string",
"status": {
"0": "c",
"1": "a",
"2": "n",
"3": "d",
"4": "i",
"5": "d",
"6": "a",
"7": "t",
"8": "e"
},
"tags": [],
"title": "string",
"tool": {
"arguments": null,
"name": null
}
}
]
}'
{
"created": 1,
"errors": [
{
"code": "string",
"message": "string"
}
],
"macros": [
{
"auto_send": true,
"body": "string",
"channel": "string",
"created_at": "string",
"id": "string",
"name": "string",
"org_id": "string",
"rule_name": "string",
"slots": [],
"source": "string",
"status": "candidate",
"tags": [],
"title": "string",
"tool": {
"arguments": null,
"name": null
},
"updated_at": "string"
}
],
"replaced": 1
}