Skip to navigation

Acquire or release a lease

Acquires, renews or releases your application’s lease on the conversation, depending on action.

Actions

  • acquire — every acquisition generates a new fencing token for the conversation: a decimal string, never reused, so a holder that lost its lease can never send under it again. ttlSeconds is clamped to 15–300 seconds (default 60).
  • renew — needs the current token of a live lease, otherwise 409 STALE_FENCING_TOKEN; while a person’s reply pauses automation, 409 AUTOMATION_PAUSED.
  • release — idempotent under the lease’s token.

Who can hold a lease

Besides write:messages, your application needs write:messages:automated or write:messages:operator: the lease is held by your application’s automation or by its live CRM operator. takeover is refused, because taking a conversation over is a person’s action alone. See conversation leases.

Events

EVVA sends lease.acquired, and lease.lost to an application whose lease a takeover or a lapse replaced. A person’s reply in the conversation ends your application’s lease (lease.lost with reason HUMAN_REPLIED).

Errors

  • 409 LEASE_HELD — the conversation is already leased. Retry-After is set when the other lease’s end is known.
  • 409 STALE_FENCING_TOKEN — renew without the current token of a live lease.
  • 409 AUTOMATION_PAUSED — acquire or renew while a person’s reply pauses automation, with Retry-After (the agency’s window: 5 minutes by default, 1 to 60 minutes), or after a handoff to a person.

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

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.
actionenumRequired
Allowed values:
fencingTokenstring or integerOptional

Required for renew and release — the token the acquire answered (a decimal string; a JSON integer is tolerated).

ttlSecondsintegerOptional>=1

Clamped to the configured bounds (15..300; default 60).

takeoverbooleanOptional

Response

The lease after an acquire or a renew, or the release.
ConversationLeaseobject
OR
ConversationLeaseReleasedobject

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