Skip to navigation

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_AUTOMATED needs write:messages:automated.
  • HUMAN_AUTHORED or AI_DRAFTED_HUMAN_SENT needs write:messages:operator and an operatorRef.

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:

  1. Your application’s effective access must cover write:paid_messages (scopes and grants). Otherwise the write is refused and nothing is written.
  2. The write must carry an Idempotency-Key.
  3. 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 with Partner-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 no authorship.
  • 400 IDEMPOTENCY_KEY_REQUIRED — the write sets or changes the price without an Idempotency-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.reason is CONSENT when your application’s effective access lacks write:paid_messages, and ACTION_APPROVAL_REQUIRED when 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

AuthorizationBearer

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.

Required scopes:write:automations

Path parameters

creatorIdstringRequired>=1 character

The creator profile id — the ONLY source of the creator a request acts for.

triggerenumRequired

An unknown trigger answers 404 NOT_FOUND.

Allowed values:

Headers

X-Creator-IdstringOptional

Optional echo of the path creatorId; any other value is refused with 403 CREATOR_CONTEXT_MISMATCH.

Idempotency-KeystringOptionalformat: "^[A-Za-z0-9_-]+$"1-128 characters

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.

Partner-Approval-IdstringOptionalformat: "^apr_[A-Za-z0-9]{24}$"

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 4xx or 429, hands it back for your next attempt.
  • A 5xx, 503 included, 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_CONSUMED with details.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

This endpoint expects an object.
bodystringRequired1-2000 characters
enabledbooleanOptional
Absent means false.
delaySecondsintegerOptional0-2592000Defaults to 0
quietAfterDaysinteger or nullOptional3-90

FAN_WENT_QUIET only (default 14).

attachmentslist of stringsOptional
mediaAssetIdslist of stringsOptional

Alias of attachments.

unlockPriceobject or nullOptional

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.

blurPreviewbooleanOptionalDefaults to true
authorshipenumOptional

REQUIRED for an application: AI_AUTOMATED needs write:messages:automated; HUMAN_AUTHORED / AI_DRAFTED_HUMAN_SENT need write:messages:operator and operatorRef. Internal (agency audit) only — the fan sees the creator’s own message.

Allowed values:
operatorRefstringOptional1-64 characters

The external CRM’s opaque operator id — required with HUMAN_AUTHORED / AI_DRAFTED_HUMAN_SENT, refused otherwise. Agency audit only.

Response

Saved.
ruleobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error