ReferenceMessages
Message rules
9 operations. Send Authorization: Bearer $PASSBOOK_KEY. Markdown
GET
/api/v1/message-rulesmessages:writeSDK pb.messageRules.list
Query
cursorstring · max 512
limitinteger · ≥ 1 · ≤ 200
state"on" | "paused"
Returns
200
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
POST
/api/v1/message-rulesmessages:writeSDK pb.messageRules.create
Body
orgIdstring · max 64Required
namestring · max 80Required
templateIdsstring · max 64[]Required
anchorobject | objectRequired
offsetobjectRequired
amountinteger · ≥ 0 · ≤ 366Required
unit"day" | "hour"Required
when"before" | "after"Required
timeZonestring · max 64Required
messagestring · max 256Required
matchobject | object | object[]
yearlyboolean
sendAtstring · ^([01]\d|2[0-3]):[0-5]\d$
clearAfterinteger | null · ≥ 60000 · ≤ 31622400000
onboolean
Returns
201
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
GET
/api/v1/message-rules/{id}messages:writeSDK pb.messageRules.retrieve
Path
idstring · max 64Required
Returns
200
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| NOT_FOUND | Check the id, and that the key's mode (test or live) matches the object. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
PUT
/api/v1/message-rules/{id}messages:writeSDK pb.messageRules.update
Path
idstring · max 64Required
Body
orgIdstring · max 64Required
namestring · max 80Required
templateIdsstring · max 64[]Required
anchorobject | objectRequired
offsetobjectRequired
amountinteger · ≥ 0 · ≤ 366Required
unit"day" | "hour"Required
when"before" | "after"Required
timeZonestring · max 64Required
messagestring · max 256Required
versionintegerRequired
matchobject | object | object[]
yearlyboolean
sendAtstring · ^([01]\d|2[0-3]):[0-5]\d$
clearAfterinteger | null · ≥ 60000 · ≤ 31622400000
onboolean
Returns
200
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| NOT_FOUND | Check the id, and that the key's mode (test or live) matches the object. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
DEL
/api/v1/message-rules/{id}messages:writeSDK pb.messageRules.delete
Path
idstring · max 64Required
Returns
200
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| NOT_FOUND | Check the id, and that the key's mode (test or live) matches the object. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
POST
/api/v1/message-rules/{id}/pausemessages:writeSDK pb.messageRules.pause
Path
idstring · max 64Required
Returns
200
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| NOT_FOUND | Check the id, and that the key's mode (test or live) matches the object. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
POST
/api/v1/message-rules/previewmessages:writeSDK pb.messageRules.countDue
Body
orgIdstring · max 64Required
namestring · max 80Required
templateIdsstring · max 64[]Required
anchorobject | objectRequired
offsetobjectRequired
amountinteger · ≥ 0 · ≤ 366Required
unit"day" | "hour"Required
when"before" | "after"Required
timeZonestring · max 64Required
messagestring · max 256Required
matchobject | object | object[]
yearlyboolean
sendAtstring · ^([01]\d|2[0-3]):[0-5]\d$
clearAfterinteger | null · ≥ 60000 · ≤ 31622400000
onboolean
ruleIdstring · max 64
Returns
200
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
POST
/api/v1/message-rules/{id}/testmessages:writeSDK pb.messageRules.sendTest
Path
idstring · max 64Required
Body
passIdstring · max 64Required
Returns
201
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| NOT_FOUND | Check the id, and that the key's mode (test or live) matches the object. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |
Runs
GET
/api/v1/message-rules/{id}/runsmessages:writeSDK pb.messageRules.runs.list
Path
idstring · max 64Required
Query
cursorstring · max 512
limitinteger · ≥ 1 · ≤ 200
Returns
200
Errors
| Code | Status | Fix |
|---|---|---|
| FORBIDDEN | Use a key with the scope the operation lists, or ask an org admin. | |
| INVALID_API_KEY | Create a new key in the console and update PASSBOOK_KEY. | |
| MESSAGING_UNSUPPORTED | Use a template that defines a message field, or add one to it. | |
| MISSING_SCOPE | Create a key with the scope the operation lists under security. | |
| NOT_FOUND | Check the id, and that the key's mode (test or live) matches the object. | |
| ORG_NOT_FOUND | Check orgId with GET /api/v1/orgs. | |
| PASS_NOT_FOUND | Check the id with GET /api/v1/passes and the key's mode. | |
| RATE_LIMITED | Wait for Retry-After seconds, then retry. Back off on repeats. | |
| RULE_HOURS_NEED_DATETIME | Use a date-and-time input for the rule, or remove the hours. | |
| RULE_INPUT_MISMATCH | Pick templates where the input has the same type. | |
| RULE_INPUT_MISSING | Use an input name from GET /api/v1/templates/{id}/input-schema for every template. | |
| RULE_LIMIT | Pause one with POST /api/v1/message-rules/{id}/pause, then turn this one on. | |
| RULE_NOT_FOUND | Check the id with GET /api/v1/message-rules. | |
| RULE_VERSION | Fetch it with GET /api/v1/message-rules/{id} and send your change again. | |
| UNAUTHENTICATED | Send Authorization: Bearer $PASSBOOK_KEY. | |
| VALIDATION | Fix each field in issues and resend. |