Set a message automation
Creates or replaces the creator’s automation rule for one trigger.
Request
Every write replaces the whole rule. A write that does not set or change the price is idempotent by nature and needs
no Idempotency-Key.
Authorship
The body must declare authorship; see message authorship.
AI_AUTOMATEDneedswrite:messages:automated.HUMAN_AUTHOREDorAI_DRAFTED_HUMAN_SENTneedswrite:messages:operatorand anoperatorRef.
Switching it on
A write that switches the rule on needs the creator’s account to permit bulk messaging (BULK_MESSAGING).
Switching it off never does.
Price
The rule accepts unlockPrice (alias price) as {minor, currency}. minor is a string of minor units, in USD,
from 100 to 1000000, and a priced rule needs at least one attachment. When a write sets or changes the price:
- Your application’s effective access must cover
write:paid_messages(scopes and grants). Otherwise the write is refused and nothing is written. - The write must carry an
Idempotency-Key. - It then goes through action approval, with the price as the amount. Within the agency’s own
automatic limits it is saved. Otherwise you receive
202 APPROVAL_REQUIRED: once a person approves, re-send the same request withPartner-Approval-Id.
The approval covers the trigger, the message, its attachments, the price and blurPreview. Sending back the stored
price unchanged is not setting a price: it needs neither the scope nor approval.
Delivery
The rule’s sends pass the same coordination as the creator’s own automation: a conversation lease, a handoff or a person’s recent reply suppresses them. Fans receive them as the creator’s own automated message.
Errors
400 AUTHORSHIP_REQUIRED— the body declares noauthorship.400 IDEMPOTENCY_KEY_REQUIRED— the write sets or changes the price without anIdempotency-Key. Nothing is written.403 AUTHORSHIP_NOT_PERMITTED— the creator’s consent does not cover the declared authorship.403 CREATOR_SUSPENDED— the write switches the rule on while the creator’s account does not permit bulk messaging.403 PRICE_NOT_PERMITTED— the price was refused and nothing was written.details.reasonisCONSENTwhen your application’s effective access lackswrite:paid_messages, andACTION_APPROVAL_REQUIREDwhen the price is not valid (see Price), so it could not go through action approval.403 ACTION_DENIED_BY_POLICY— the agency’s policy does not allow your application to set this price.403 ENVIRONMENT_MISMATCH— a sandbox application reaches only its sandbox creators.
Required scopes: write:automations.
Approval: setting or changing unlockPrice runs through action approval.
Authentication
OAuth 2.0 client credentials. Request an access token at POST /partner/v1/oauth/token (grant_type=client_credentials) with the application’s client secret or a private_key_jwt assertion, then send it as Authorization: Bearer evpa_live_… (or evpa_test_… for a sandbox application). Tokens are opaque and short lived (see expires_in); there is no refresh token. Each operation lists the scopes it requires.
write:automationsPath parameters
The creator profile id — the ONLY source of the creator a request acts for.
An unknown trigger answers 404 NOT_FOUND.
Headers
Optional echo of the path creatorId; any other value is refused with 403 CREATOR_CONTEXT_MISMATCH.
Your key for this request. It is required when the request sets or changes one of the operation’s conditionalFields: without it the request is 400 IDEMPOTENCY_KEY_REQUIRED and nothing is done. The same key re-sent with its Partner-Approval-Id is that request again; the same key for a different action is 409 IDEMPOTENCY_KEY_REUSED. See action approval.
The approvalId a previous 202 APPROVAL_REQUIRED returned, for an operation your application may run only with approval. Re-send it with the same payload once a person has approved. A blank value is no approval.
The approval is spent once, for exactly that agency, application, creator, operation and payload digest, the same amount and currency, and at most the units it was given for. It is claimed for the request’s Idempotency-Key (required) and becomes final when the operation succeeds:
- A refusal before the effect, a
4xxor429, hands it back for your next attempt. - A
5xx,503included, keeps it claimed for this key, because the effect may have happened. It is handed back only when EVVA knows nothing was done. - The same key re-sent replays the request and never has a second effect. You get the stored result where the operation keeps one, otherwise
409 APPROVAL_CONSUMEDwithdetails.replay: true: read the resource to see the result. - Another key is
409 APPROVAL_CONSUMED.
When the approval cannot be used, the request is refused with 403 (APPROVAL_INVALID, APPROVAL_MISMATCH or APPROVAL_DECLINED) or 409 (APPROVAL_PENDING, APPROVAL_EXPIRED or APPROVAL_CONSUMED). See action approval.
Request
FAN_WENT_QUIET only (default 14).
Alias of attachments.
The rule’s price; price is accepted as an alias. Null or absent means free. A price that is set or changed needs at least one attachment and write:paid_messages, and goes through action approval. Sending back the stored price unchanged needs neither the scope nor approval.
The external CRM’s opaque operator id — required with HUMAN_AUTHORED / AI_DRAFTED_HUMAN_SENT, refused otherwise. Agency audit only.
