ReferenceMessages

Message rules

9 operations. Send Authorization: Bearer $PASSBOOK_KEY. Markdown

GET/api/v1/message-rules
messages:writeSDK pb.messageRules.list

Query

cursorstring · max 512
limitinteger · ≥ 1 · ≤ 200
state"on" | "paused"

Returns

200

Errors

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.
POST/api/v1/message-rules
messages: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

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.
GET/api/v1/message-rules/{id}
messages:writeSDK pb.messageRules.retrieve

Path

idstring · max 64Required

Returns

200

Errors

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
NOT_FOUNDCheck the id, and that the key's mode (test or live) matches the object.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix 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

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
NOT_FOUNDCheck the id, and that the key's mode (test or live) matches the object.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.
DEL/api/v1/message-rules/{id}
messages:writeSDK pb.messageRules.delete

Path

idstring · max 64Required

Returns

200

Errors

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
NOT_FOUNDCheck the id, and that the key's mode (test or live) matches the object.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.
POST/api/v1/message-rules/{id}/pause
messages:writeSDK pb.messageRules.pause

Path

idstring · max 64Required

Returns

200

Errors

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
NOT_FOUNDCheck the id, and that the key's mode (test or live) matches the object.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.
POST/api/v1/message-rules/preview
messages: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

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.
POST/api/v1/message-rules/{id}/test
messages:writeSDK pb.messageRules.sendTest

Path

idstring · max 64Required

Body

passIdstring · max 64Required

Returns

201

Errors

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
NOT_FOUNDCheck the id, and that the key's mode (test or live) matches the object.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.

Runs

GET/api/v1/message-rules/{id}/runs
messages:writeSDK pb.messageRules.runs.list

Path

idstring · max 64Required

Query

cursorstring · max 512
limitinteger · ≥ 1 · ≤ 200

Returns

200

Errors

CodeStatusFix
FORBIDDENUse a key with the scope the operation lists, or ask an org admin.
INVALID_API_KEYCreate a new key in the console and update PASSBOOK_KEY.
MESSAGING_UNSUPPORTEDUse a template that defines a message field, or add one to it.
MISSING_SCOPECreate a key with the scope the operation lists under security.
NOT_FOUNDCheck the id, and that the key's mode (test or live) matches the object.
ORG_NOT_FOUNDCheck orgId with GET /api/v1/orgs.
PASS_NOT_FOUNDCheck the id with GET /api/v1/passes and the key's mode.
RATE_LIMITEDWait for Retry-After seconds, then retry. Back off on repeats.
RULE_HOURS_NEED_DATETIMEUse a date-and-time input for the rule, or remove the hours.
RULE_INPUT_MISMATCHPick templates where the input has the same type.
RULE_INPUT_MISSINGUse an input name from GET /api/v1/templates/{id}/input-schema for every template.
RULE_LIMITPause one with POST /api/v1/message-rules/{id}/pause, then turn this one on.
RULE_NOT_FOUNDCheck the id with GET /api/v1/message-rules.
RULE_VERSIONFetch it with GET /api/v1/message-rules/{id} and send your change again.
UNAUTHENTICATEDSend Authorization: Bearer $PASSBOOK_KEY.
VALIDATIONFix each field in issues and resend.