# Testing The API



> Use a test Workspace and scoped credentials to check your integration before connecting real Subscriber data. Start with read requests, then test writes with an address you control.



- Human page: https://mailrith.com/developers/testing-the-api

- Markdown page: https://mailrith.com/developers/testing-the-api.md

- Category: Getting Started

- Reading time: 7 min read

- Last updated: 2026-09-28

- Related keywords: Testing The API, Testing The API developer docs, Getting Started, Getting Started developer docs, Mailrith developer docs, Mailrith public API, Prepare A Test Workspace, Quickstart, Authentication, API Reference



## AI Agent Notes

- Use this page as implementation guidance, then validate exact endpoint fields against the OpenAPI document.

- Keep API keys server-side and workspace-scoped unless a guide explicitly says otherwise.

- Do not invent privacy, consent, or lawful-basis evidence. Send only fields that appear in the OpenAPI schema for the endpoint you are using.



## What This Guide Covers

Test the Mailrith API with a scoped key, controlled data, and a separate Workspace.



## Prepare A Test Workspace

Use a separate Workspace with controlled test data. Before writing data, confirm it has no active Automations or Sequences that could send email in response to your test.

Mailrith’s public API is at `https://api.mailrith.com/v1`. API calls act on the Workspace authorized by your credential; a test Workspace still uses the live API.

1. In Mailrith, switch to your test Workspace. Open Settings → API Keys and click Generate API Key.
2. Name the key for your test, choose only the Permissions you need, set an expiration, and click Generate. Store the secret on your server.
3. Call `GET /v1/capabilities` to confirm the Workspace and Permissions before making changes.
4. Start with a read request. If you need to test writes, create an Unconfirmed Subscriber using an address you control. Do not enroll it in a Sequence or send a campaign.
5. Read the saved record and compare it with your request. Check validation, missing-permission, and duplicate behavior before running a larger sync.
6. Delete your test data and revoke the test key when you finish.

> A timeout does not prove a write failed. Read the current state before retrying. See [Idempotency](https://mailrith.com/developers/idempotency.md) for supported retry keys and [Errors](https://mailrith.com/developers/errors.md) for error handling.

**Read Your Capabilities**

```bash
curl https://api.mailrith.com/v1/capabilities -H "Authorization: Bearer $MAILRITH_API_KEY"
```



## Related Guides

- [Quickstart](https://mailrith.com/developers/quickstart.md): Start with one workspace API key, one authenticated request, and the generated response envelope. This page covers the minimum steps needed to create a working subscriber sync.

- [Authentication](https://mailrith.com/developers/authentication.md): Every protected `v1` request uses a Workspace API key or an authorized OAuth access token. This page covers the required header shape, workspace scoping behavior, and authentication failure handling.

- [API Reference](https://mailrith.com/developers/api-reference.md): The full API reference is generated from the same public contract used by the API worker and SDK tooling. Use the API reference to find exact paths, methods, parameters, request schemas, response schemas, operation IDs, and the downloadable OpenAPI document.
