Moderate a Customer

One endpoint for a customer's moderation state: you declare how you want them to end up and the API works out the effects.

PATCH https://api.platica.mx/v1/clients/{id}/moderation

URL parameters

ParameterTypeDescriptionRequired
idstringEither the customer ID or their phone number in E.164 format without +

Request body

You must send at least one of status, resetStrikes, or clearHistory.

FieldTypeDescription
statusenumblocked to block, active to unblock
reasonstringReason recorded on the customer. Up to 120 characters. Only applies with status: "blocked". Defaults to api_request
resetStrikesbooleanZeroes the strike counter. Implied by status: "active"
clearHistorybooleanAlso wipes the record of the last offence

How to do each operation

Block

{ "status": "blocked", "reason": "abuse_reported" }

Unblock

{ "status": "active" }

Reset strikes without unblocking

{ "resetStrikes": true }

Unblock and wipe the whole moderation record

{ "status": "active", "clearHistory": true }

What each field does

status: "blocked"

  1. Sets the customer to status: "blocked", so their future conversations start out marked as spam and agents skip them.
  2. Records moderation.blockedAt, moderation.blockedBy, and moderation.blockedReason.
  3. Marks the conversations the customer already had open as spam, so the block applies right away. Threads already in spam, finished, or expired are left alone.

status: "active"

  1. Sets the customer to status: "active" and clears the moderation.blocked* fields.
  2. Zeroes the strikes, even if you did not ask for it. If the counter stayed where it was, the next offence would cross the threshold again and the customer would be blocked immediately.
  3. Moves the conversations sitting in spam back to finished.

resetStrikes and clearHistory

resetStrikes sets moderation.totalStrikes to zero and removes moderation.lastAction. clearHistory also removes moderation.lastFlaggedAt, lastSource, lastCategories, lastMatchedTerms, and lastSeverity.

Neither one changes the status: a blocked customer stays blocked after their strikes are reset. Use them to forgive a customer who piled up offences but was never blocked.

Response

{
  "status": "success",
  "message": "Client moderation updated successfully",
  "data": {
    "id": "274fc73cb7d84a17955914fdc1a1f9d0",
    "status": "active",
    "strikesReset": true,
    "clearedHistory": false,
    "previousStrikes": 3,
    "conversationsUpdated": 2
  }
}
FieldDescription
idInternal ID of the customer
statusThe status the customer ended up in
strikesResetWhether the strikes were zeroed
clearedHistoryWhether the record of the last offence was wiped
previousStrikesStrikes the customer had before the call
conversationsUpdatedHow many conversations were synced. Always 0 when you do not send status

Webhooks

What you sentsource on the client.updated
status: "blocked"api.client.blocked
status: "active"api.client.unblocked
Only resetStrikes / clearHistoryapi.client.strikes_reset

When you send status you also get one conversation.status.updated per synced conversation.

Errors

CodeReason
400The body asks for nothing, carries unknown fields, or workspace is missing when the API key has access to several
404No customer matches that identifier