Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Handling Actions

When Coop triggers an Action—either through an automated rule or a moderator’s decision in the Review Console—it sends a POST request to the callback URL you configured for that Action. Your server receives this request and performs the corresponding operation.

Setting up your callback endpoint

For each Action you define in Coop, provide a publicly accessible callback URL and any authentication headers your endpoint requires (e.g. an API key Coop should send). Coop includes these headers on every outgoing request to that endpoint.

To verify that an incoming request actually came from Coop, check the Coop-Signature header. See API Keys & Authentication for the signature verification algorithm and a code example.

Failed deliveries are retried up to five times with exponential backoff.

Request body

{
  "item": { "id": "item-id", "typeId": "item-type-id" },
  "action": { "id": "action-id" },
  "policies": [{ "id": "policy-id", "name": "Spam", "penalty": "MEDIUM" }],
  "rules": [{ "id": "rule-id", "name": "Spam detector" }],
  "custom": {},
  "actorEmail": "moderator@example.com"
}

Field reference

FieldTypeAlways present?Description
itemItemAlwaysThe item that should receive this Action
actionActionAlwaysThe Action being triggered
policiesArray<Policy>AlwaysPolicies associated with this action. May contain multiple entries if several rules triggered the same action
rulesArray<Rule>Not alwaysRules that triggered this action. Empty if triggered via manual review or bulk actioning
customObjectNot alwaysCustom parameters configured in the Action form under “Body”
actorEmailStringNot alwaysEmail of the Coop user who took the action. Omitted for automated rule-triggered actions
actorNoteStringNot alwaysNote added by the moderator when taking the action. Omitted if no note was provided

Item schema:

FieldTypeDescription
idStringYour unique identifier for the item
typeIdStringThe Item Type ID
typeNameStringThe display name of the Item Type

Policy schema:

FieldTypeDescription
idStringCoop’s unique policy ID
nameStringPolicy name
penaltyStringPenalty level: NONE, LOW, MEDIUM, HIGH, or SEVERE

Rule schema:

FieldTypeDescription
idStringCoop’s unique rule ID
nameStringRule name

Appeal decision callback

When a moderator reviews an appeal in the Review Console and makes a decision, Coop sends a POST request to the Appeal callback URL configured in your Appeals Dashboard.

{
  "appealId": "your-appeal-id",
  "item": { "id": "item-id", "typeId": "item-type-id" },
  "appealedBy": { "id": "user-id", "typeId": "user-type-id" },
  "appealDecision": "ACCEPT",
  "custom": {}
}

Appeal callback field reference

FieldTypeAlways present?Description
appealIdStringAlwaysYour internal appeal ID, as sent via the Appeal API
itemItemAlwaysThe item that originally received the moderation action
appealedByItemIdentifierAlwaysThe user who submitted the appeal
appealDecisionStringAlwaysACCEPT means the original action was incorrect (appeal granted); REJECT means the original action stands
customObjectNot alwaysCustom parameters configured in the Appeal Configuration Form under “Body”

For the full appeal submission flow, see Appeals.