Skip to navigation

Edit a message

Edits the text of a message your application sent in the conversation.

Only messages your application sent can be edited, and EVVA records every edit. As on a send, the creator’s account must allow BULK_MESSAGING.

The rules of the creator’s own edits then apply: the edit window, the revision you read (expectedRevision), withdrawn messages, and the delivery policy for the new text. The creator’s and the fan’s open chats both receive the same messageEdited update as for the creator’s own edit.

Authorship

An edit keeps the message’s recorded authorship (message authorship). A message recorded as HUMAN_AUTHORED or AI_DRAFTED_HUMAN_SENT needs write:messages:operator; any other message needs write:messages:automated. Your application’s access and the creator’s consent must both cover that scope.

Conversation leases

Your application’s edit is coordinated like its send (conversation leases). Send the fencingToken in the body. EVVA decides in the same transaction as the edit, so a takeover and the edit are always ordered.

  • While a lease is live, only your application’s own lease admits the edit, with its current fencingToken. Under a lease held by a person on the agency’s team or by another application, or without the token, it is refused with 409 LEASE_HELD and Retry-After set to the lease’s remaining time.
  • A fencingToken that is not your lease’s current one is refused with 409 STALE_FENCING_TOKEN. Once the lease is released or has expired, send no token: an old one is refused the same way.
  • After a person on the agency’s team replies in the conversation, the edit is refused with 409 AUTOMATION_PAUSED for the agency’s pause window, with Retry-After. While a handoff to a person has been taken up, it is refused with 409 AUTOMATION_PAUSED and no Retry-After, until a person hands the conversation back. The creator’s own replies do not pause it.

Errors

  • 400 INVALID_REQUEST — the fencingToken is malformed.
  • 403 MESSAGE_EDIT_NOT_THE_SENDER — your application did not send the message.
  • 403 AUTHORSHIP_NOT_PERMITTED — the scope for the message’s recorded authorship is not covered. details.requiredScope names it.
  • 403 MESSAGE_EDIT_WINDOW_CLOSED — the edit window has closed.
  • 403 MESSAGE_EDIT_RETRACTED — the message was withdrawn.
  • 403 MESSAGE_EDIT_NOT_DELIVERABLE — the delivery policy refuses the new text.
  • 409 MESSAGE_EDIT_STALE_REVISION — the message changed after the revision you read.
  • 409 LEASE_HELD — a lease held by someone else is live, or you sent no fencingToken while a lease is live. Retry-After gives the lease’s remaining time.
  • 409 STALE_FENCING_TOKEN — the fencingToken is not your lease’s current one.
  • 409 AUTOMATION_PAUSED — a person on the agency’s team is handling the conversation. See Conversation leases.
  • 503 TEMPORARILY_UNAVAILABLE — EVVA cannot check the authorship scope right now. Retry after Retry-After.

Required scopes: write:messages.

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:messages

Path parameters

creatorIdstringRequired>=1 character

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

conversationIdstringRequired>=1 character
messageIdstringRequired>=1 character

Headers

X-Creator-IdstringOptional

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

Request

This endpoint expects an object.
expectedRevisionintegerRequired>=0
bodystring or nullOptional<=2000 characters
fencingTokenstring or integerOptional
The current fencing token of your application's own live lease on the conversation. Required while a lease is live.

Response

Edited.
revisioninteger

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