set_consent
Record or withdraw ONE consent for ONE purpose on a lead or contact — the data the send gate reads. A consent is always for ONE purpose: whoever agreed to the newsletter did not agree to cold outreach, so there is one row per person and purpose and setting it again replaces that row. status 'revoked' is a withdrawal and is NEVER overridable by any role. Optional expires_at: after that date the consent stops counting even while the status still says 'granted' — an unrenewed consent is the most common way to treat an expired one as valid. Every change lands in the audit trail with old and new value.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"purpose": "<purpose>",
"status": "<status>"
},
"name": "set_consent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | Free-text notes | |
| status | Yes | New status | |
| channel | No | How it was given: verbal | written | web_form | email. | |
| lead_id | No | ID of the lead | |
| purpose | Yes | The purpose, stored in the existing column consent_type. Common values in this system: recording, marketing, data_processing, sms — plus whatever the tenant uses in campaigns (akquise, newsletter, bestandskunde, terminabstimmung, vertrag, rechnung). Must match the purpose used when sending, or the consent will not be found. | |
| proof_url | No | Where the proof is. Without provenance a consent is worth little in a dispute. | |
| contact_id | No | Either lead_id or contact_id. | |
| expires_at | No | ISO date. Omit for open-ended. |