Record a client's marketing consent Run in API Explorer

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://apidocs.plannrcrm.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "PlannrCRM MCP server": {
    "url": "https://apidocs.plannrcrm.com/mcp"
  }
}

Close
PUT /api/v1/account/{account_uuid}/marketing-consent

Records one decision per channel supplied. Every call appends to the history; nothing is overwritten. Portal users are always recorded with the client_portal method at the current time.

Headers

  • X-PLANNR-ACCOUNT-UUID string

Path parameters

  • account_uuid string Required

    The UUID of the client account.

application/json

Body

  • consents array[object] Required

    One decision per channel. Saving the same channel twice records both; the later entry wins.

    Hide consents attributes Show consents attributes object
    • channel string

      The communication channel.

      Value Description
      email Email
      phone Phone
      letter Letter
      sms Sms

      Values are email, phone, letter, or sms.

    • opt_in boolean

      True to opt in, false to opt out.

    • method string

      How consent was obtained. Required when opting in as an employee. Ignored for portal users, who are always recorded as client_portal.

      Value Description
      verbal Verbal
      written Written
      electronic Electronic
      client_portal Client Portal

      Values are verbal, written, electronic, or client_portal.

    • statement_version string

      The consent statement version shown to the client. Required when opting in.

      Maximum length is 50.

    • effective_at string(date-time)

      When the decision took effect. Defaults to now. Ignored for portal users.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • email string

      Marketing consent status for email. One of not_captured, opted_in and opted_out

    • phone string

      Marketing consent status for phone. One of not_captured, opted_in and opted_out

    • letter string

      Marketing consent status for letter. One of not_captured, opted_in and opted_out

    • sms string

      Marketing consent status for SMS. One of not_captured, opted_in and opted_out

  • 400 application/json

    Account is not a client

    Hide response attribute Show response attribute object
    • message string Required

      A human-readable description of the error.

  • 422 application/json

    Validation error

    Hide response attributes Show response attributes object
    • message string Required

      A human-readable description of the error.

    • errors object

      Validation messages keyed by the field that failed.

      Hide errors attribute Show errors attribute object
      • * array[string] Additional properties
PUT /api/v1/account/{account_uuid}/marketing-consent
curl \
 --request PUT 'https://api.plannrcrm.com/api/v1/account/53f22fe4-3731-4cdc-aa12-e65bd0b15e52/marketing-consent' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --header "X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}" \
 --data '{
  "consents": [
    {
      "channel": "email",
      "opt_in": true,
      "method": "verbal",
      "statement_version": "v1",
      "effective_at": "2026-09-28T10:15:00+01:00"
    },
    {
      "channel": "sms",
      "opt_in": false
    }
  ]
}'
Request examples
# Headers
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}

# Payload
{
  "consents": [
    {
      "channel": "email",
      "opt_in": true,
      "method": "verbal",
      "statement_version": "v1",
      "effective_at": "2026-09-28T10:15:00+01:00"
    },
    {
      "channel": "sms",
      "opt_in": false
    }
  ]
}
Response examples (200)
{
  "email": "opted_in",
  "phone": "opted_out",
  "letter": "not_captured",
  "sms": "not_captured"
}
Response examples (400)
{
  "message": "Marketing consent can only be recorded for client accounts."
}
Response examples (422)
{
  "message": "The method field is required when opt in is true.",
  "errors": {
    "consents.0.method": [
      "The method field is required when opt in is true."
    ]
  }
}
{
  "message": "The statement version field is required when opt in is true.",
  "errors": {
    "consents.0.statement_version": [
      "The statement version field is required when opt in is true."
    ]
  }
}
{
  "message": "The selected channel is invalid.",
  "errors": {
    "consents.0.channel": [
      "The selected channel is invalid."
    ]
  }
}
{
  "message": "The selected method is invalid.",
  "errors": {
    "consents.0.method": [
      "The selected method is invalid."
    ]
  }
}
{
  "message": "The effective at field must be a valid date.",
  "errors": {
    "consents.0.effective_at": [
      "The effective at field must be a valid date."
    ]
  }
}