> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prelude.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketing Compliance Rules

> Learn about the compliance rules and regulations that apply to marketing messages in different countries.

When sending marketing messages through the Notify API, Prelude automatically enforces compliance rules based on local regulations in the destination country. These rules help ensure your messages comply with local laws and carrier requirements.

> [!NOTE]
>
> In the United States and Canada, carriers approve your toll-free number, 10DLC number, or short code only after they review your SMS opt-in. Marketing messages need their own, separate opt-in checkbox. See [SMS Opt-in for the US and Canada](https://docs.prelude.so/notify/v2/documentation/us-canada-opt-in.md).

## Content restrictions

Certain message categories are restricted or forbidden in specific countries. When you configure a marketing template with our Customer Success team, you'll specify the category to ensure compliance.

> [!WARNING]
>
> If you attempt to send a marketing message with a forbidden category, the API will return an error before sending the message.

## Time window restrictions

Marketing messages can only be sent during specific time windows based on local regulations. If you attempt to send a message outside these windows, it will automatically be scheduled for the next available time slot.

### Automatic scheduling

When you send a marketing message outside allowed time windows:

1. The message is **not rejected** - it's automatically scheduled for delivery
2. The next available time slot is calculated based on the recipient's timezone
3. The API response includes a `schedule_at` field showing when the message will be sent
4. You'll receive webhook events when the message is actually delivered

> [!NOTE]
>
> Time windows are enforced based on the **recipient's local timezone**, not your timezone. Prelude automatically handles timezone conversion.

## Public holidays

Marketing messages are blocked on public holidays in certain jurisdictions. Prelude maintains an up-to-date database of public holidays for each country and automatically schedules messages accordingly.

If a marketing message is scheduled for a public holiday, it will be automatically rescheduled for the next business day during allowed hours.

## Scheduling marketing messages

You can schedule marketing messages up to **90 days in advance** using the `schedule_at` parameter:

```json Example: Schedule a campaign theme={null}
{
  "template_id": "template_01k8ap1btqf5r9fq2c8ax5fhc9",
  "to": "+33612345678",
  "schedule_at": "2025-01-15T14:00:00Z",
  "variables": {
    "campaign": "New Year Sale"
  }
}
```

The scheduled message will be validated against time window restrictions when it's about to be sent, and automatically delayed if necessary.

See [Message Scheduling](https://docs.prelude.so/notify/v2/documentation/scheduling.md) for more information.

## Opt-out instruction

When a marketing template is linked to a subscription management config, Prelude adds the opt-out instruction of that config under the message, in the recipient's language. It depends on the channel:

| Channel | Instruction | Where the STOP arrives |
| - | - | - |
| SMS | `STOP <number>`, the MO number of the config for the destination country | The number, by SMS |
| RCS | `Reply STOP to unsubscribe.`, no number | The RCS conversation, as a reply |
| WhatsApp | None | WhatsApp handles marketing opt-out itself |

On RCS the instruction goes under the text, and under the body of a rich card. It counts toward the length of the message: an RCS text is billed as a basic message up to 160 characters, including the instruction, and as a single message above.

The wording per locale can be customized in the subscription management config by our Customer Success team.

## Error codes

When marketing compliance rules prevent immediate delivery:

| Error Code | Description |
| - | - |
| `category_forbidden` | The message category is forbidden in the destination country |
| `unsubscribed` | The provided phone number is unsubscribed |

> [!NOTE]
>
> Time window restrictions don't generate errors - messages are automatically scheduled for the next available time slot.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.