Create a rule

Creates a keyword-triggered automation on one channel. A DM rule sends `actions`. A comment rule can post a public reply with `reply_in_comment`, follow it privately with `then_send_dm`, or do both, which is the pattern that turns a public comment into a private sale. A comment rule with neither is rejected with 422. Add `require_follow` to withhold the answer until the commenter follows the page.

Authentication

AuthorizationBearer

Your API key, issued by ParsChat sales. One key per account, spanning every robot you own. Send it as Authorization: Bearer pk_live_….

Path parameters

robot_idstringRequired
The robot's id, as returned by the create call.
channel_idstringRequired
The channel's id.

Request

This endpoint expects an object.
idstringOptional
ParsChat identifier for the rule.
namestringOptional
Your label for the rule. Shown in the panel.
triggerobjectOptional
What makes a rule fire.
actionslist of objectsOptional
What to send on a DM rule.
reply_in_commentobjectOptional
Comment rules only. Posts a public reply under the comment.
then_send_dmlist of objectsOptional
Comment rules only. Follows the public reply with a private message.
require_followobjectOptional

Withhold the reply until the commenter follows the page. The verification round-trip is ours: you do not implement it.

is_activebooleanOptionalDefaults to true
Whether the rule is currently firing.
created_atdatetimeOptional
When the rule was created.

Response

The rule was created and is live if is_active is true.

idstringOptional
ParsChat identifier for the rule.
namestringOptional
Your label for the rule. Shown in the panel.
triggerobjectOptional
What makes a rule fire.
actionslist of objectsOptional
What to send on a DM rule.
reply_in_commentobjectOptional
Comment rules only. Posts a public reply under the comment.
then_send_dmlist of objectsOptional
Comment rules only. Follows the public reply with a private message.
require_followobjectOptional

Withhold the reply until the commenter follows the page. The verification round-trip is ours: you do not implement it.

is_activebooleanOptionalDefaults to true
Whether the rule is currently firing.
created_atdatetimeOptional
When the rule was created.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error