Skip to main content
Every Courier workspace has two environments: Production and Test. The two environments are fully isolated; all assets within them (templates, brands, tags, subscription topics, integrations, API keys, log data) belong only to that environment.

Production and Test Environments

Any changes made to a template and its associated assets are only applied within the current environment until you migrate the template and overwrite any changes to the corresponding Notification ID and assets in the other environment.

Switching Between Environments

Use the environments toggle in the lower-left settings menu to switch between your Production and Test environments. Look for the Test Environment indicator at the top of the application window to confirm that you’re in the test environment.
Use the Environments Toggle to Switch Between Environments
Simply switching from Production to Test does not impact your notifications in either environment in any way. It just changes the environment you are viewing.

API Keys and Environments

Each environment has its own API keys that determine which environment and state your requests target.

New workspaces

New workspaces receive keys with the token_ prefix. By default you get two keys:
  • Production (published) - targets live, published templates and data
  • Test (published) - targets test environment published templates and data
You can generate additional keys (including draft keys) from Settings > API Keys. Each key is scoped to a specific environment and state.

Legacy workspaces

Older workspaces use prefix-based keys that encode the environment and state:
  • pk_prod_ - published data in the Production environment
  • dk_prod_ - draft data in the Production environment
  • pk_test_ - published data in the Test environment
  • dk_test_ - draft data in the Test environment
Both key formats work the same way. The scope (environment + state) is stored server-side; the prefix is a convenience for identifying which key you’re using.
Your Test Environment API Keys

Define the Routing Behavior of Custom API Keys

Business Tier customers can also define the routing behavior of their API keys. A mock key simulates the full notification lifecycle without invoking the downstream provider, so you can see how a request flows through Courier without incurring any send cost.
Define Routing Behavior for Custom API Keys

Notifications, Assets and Environments

You can move a template and its associated assets (brands, tags, subscription topics) between environments in either direction. You can also select a destination workspace when migrating assets. To copy a template between environments, Courier also copies all dependencies attached to it so functionality is preserved. After you’ve copied associated assets once (e.g. a brand or category), you can choose to overwrite them in future migrations.
Courier will copy the current template. All other assets copied will be their most recent published version.

Migrating Templates and Assets Between Environments

  1. Open the notification you wish to migrate.
  2. Open the dropdown menu in the ‘Publish Changes’ button.
  3. Select ‘Migrate Assets’.
Migrate Your Template and Assets
Click the 'Copy Assets' Button to be Prompted by a Confirmation Modal
  1. Select either ‘Copy Assets’ or ‘Copy And Publish’ option.
Copy Templates and Assets Confirmation Modal
Confirm by Selecting 'Copy And Publish'

Migrating Templates to Another Workspace

If you have multiple workspaces, you can migrate a template to another workspace from the same modal.
  1. In the migrate assets modal, choose a Destination Workspace from the dropdown menu.
Select Destination Workspace From Dropdown
  1. Select the workspace you wish to migrate your template to.
Choose the Destination Workspace
  1. The template will be migrated to the selected workspace and environment.

Event Mapping and Template Migration

If you have an event mapped to a template that you are migrating between environments, the event and its mapping will automatically migrate as well. If the associated event is already mapped to a different template in the destination environment, then you will receive an error:
Event Mapping Error

Integrations and Environments

Integrations are shared across environments; you only need to add an integration once and it works in both Production and Test.

Adding a Test Environment Configuration

By default, all integrations work in both environments. If you want to isolate test traffic, you can add a test-specific API key for any integration. Courier will use that configuration for any notification sent with a test API key.
Courier Integrations Allow Users to Set An Integration for Both Environments

Data Logs, Metrics, and Environments

Data Logs and Metrics are environment-specific. Sends made with a test API key only appear in the Test environment dashboard, and sends made with a production key only appear in the Production dashboard. This applies regardless of whether your keys use the token_ or pk_/dk_ prefix format.

Segment and Environments

To use Courier environments with Segment, create multiple Courier destinations in Segment with different environment API keys:
  1. Send production data from Segment using your production API key.
  2. Set up a second destination using your test API key for development and QA.
See the Segment integration guide for setup details.

Content Promotion Best Practices

Courier’s environment model is designed to give you confidence when moving notification changes to production. Here’s a recommended workflow:
  1. Build and test in Test. Create or edit templates, brands, and subscription topics using your test API key. Test sends only appear in the Test dashboard and never reach real users (unless you use real contact info).
  2. Validate with draft keys. If your workspace has draft keys, use them to preview unpublished template changes against real send payloads before publishing. This lets you catch rendering issues before they affect live notifications.
  3. Migrate to Production. Use the “Migrate Assets” flow to copy templates and their dependencies (brands, tags, subscription topics) from Test to Production. Courier copies all dependencies automatically so nothing breaks.
  4. Verify after promotion. Check Message Logs in the Production environment to confirm sends are rendering and delivering as expected.
Use separate provider configurations for Test and Production (e.g., a sandbox SendGrid key for Test) to prevent test sends from reaching real inboxes. Configure this under each integration’s Test Configuration.

Environments and Billing

Billing takes both test and production sends into account.