For the complete documentation index, see llms.txt. This page is also available as Markdown.

Marketing Consent

Marketing email consent management

get
/marketing-consent

Returns the authenticated user's effective newsletter subscription state from Sendy. Sendy is the source of truth.

consent is true only when status is subscribed. Pending confirmation, delivery failures, complaints, and missing subscribers all return consent: false with the corresponding status.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

Current Sendy consent status

application/json
resultstring · enumRequiredExample: successPossible values:
get/marketing-consent
GET /marketing-consent HTTP/1.1
Host: network.ruuvi.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "result": "success",
  "data": {
    "consent": true,
    "status": "subscribed"
  }
}

Update marketing consent

post
/marketing-consent

Subscribes or unsubscribes the authenticated user's email address in Sendy, then returns the effective status held by Sendy.

When subscribing to a double opt-in list, the normal result may be unconfirmed. Set silent to true only when the client is allowed to bypass the confirmation email and complete the subscription immediately.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
consentbooleanRequired

Set to true to subscribe or false to unsubscribe.

silentbooleanOptional

When true, bypass Sendy double opt-in confirmation for subscriptions. Ignored when consent is false.

Default: false
joiningSourcestring · min: 1 · max: 32Required

Lowercase client identifier stored in Sendy's joiningSource custom field. Ignored when consent is false.

Pattern: ^[a-z][a-z0-9_-]*$
languagestring · min: 2 · max: 2Required

Two-letter Ruuvi application language code, matching the uppercase WPML language-code format used by the Ruuvi website (for example, EN, FI, or DE). Input is case-insensitive; Ruuvi Cloud converts it to uppercase before storing it in Sendy's Language custom field. Ignored when consent is false.

Example: ENPattern: ^[A-Za-z]{2}$
Responses
200

Consent updated in Sendy

application/json
resultstring · enumRequiredExample: successPossible values:
post/marketing-consent
POST /marketing-consent HTTP/1.1
Host: network.ruuvi.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 69

{
  "consent": true,
  "silent": false,
  "joiningSource": "app",
  "language": "EN"
}
{
  "result": "success",
  "data": {
    "consent": true,
    "status": "subscribed"
  }
}

Last updated