Skip to main content
This guide takes you from zero to a subscriber added to one of your topics, using the Railmail Public API.
Looking for your first steps in the Railmail app instead? See Getting started in the User Guide.

Prerequisites

Before you begin, you need:
  • A Railmail project with a project-scoped API key (format rm_live_... or rm_test_...). Create one in the app under Settings → API Keys; see API keys. For this guide the key needs the topics:read and subscribers:write scopes (or Full access).
  • A tool to make HTTP requests: curl, Postman, or your language’s HTTP client.
Use a rm_test_... key while you’re integrating so you don’t touch live data.

Add a subscriber to a topic

1

Set your API key

Store your key in an environment variable so you don’t paste it into every request.
2

Discover your topic keys

List the topics in your project and note the topicKey you want to subscribe users to.
3

Create a subscriber and subscribe them

Create the subscriber and subscribe them to the topic in a single call by passing topicKeys and consent.
If the topic uses double opt-in, the consent is created PENDING_CONFIRMATION and the user must confirm via the email they receive before they count as subscribed.
4

Verify

Read the subscriber back to confirm the subscription.

Next steps

Explore all endpoints

Browse subscribers, campaigns, segments, automations and more.

Authentication & scopes

Understand what each key can do and how to keep it secure.
Need help? Reach out at support@railmail.app.