<div data-component="DocsIntegrationDocPage" class="docs-integration-doc-page" data-integration-title="Power Automate Integration">
<img class="docs-integration-banner" src="/assets/integration-banners/power-automate.svg" alt="Power Automate and MailSlurp integration banner" loading="eager" decoding="async" />
<div class="docs-integration-content">

MailSlurp integrates with Power Automate via REST API to provide email and SMS actions. Create and control real phone numbers and email accounts directly in your flows.

## Get JSON to import
If you want a reusable custom connector, import the MailSlurp OpenAPI JSON definition.

- OpenAPI JSON URL: [https://api.mailslurp.com/v2/api-docs/](https://api.mailslurp.com/v2/api-docs/)
- Docs-hosted Swagger JSON: [https://api.mailslurp.com/v2/api-docs/](https://api.mailslurp.com/v2/api-docs/)

You can either import directly from URL in Power Automate, or download JSON first:

```bash
curl -L "https://api.mailslurp.com/v2/api-docs/" -o mailslurp-openapi.json
```

Then in Power Automate:
1. Go to **Custom connectors**.
2. Select **New custom connector**.
3. Choose **Import an OpenAPI file** (or import from URL).
4. Upload `mailslurp-openapi.json` or paste the OpenAPI URL.
5. Configure API key auth using header name `x-api-key`.
6. Save and test the connector actions.

## HTTP Request integration
You can also call MailSlurp directly with built-in HTTP actions (without a custom connector):
1. Add an **HTTP** action.
2. Set method and URL for the MailSlurp endpoint.
3. Add `x-api-key` in request headers.
4. Use **Parse JSON** on the response body for typed outputs.

### How to get JSON for Parse JSON
1. Run the HTTP action once with sample input.
2. Open the run history and copy the response `body` JSON.
3. Add a **Parse JSON** action and choose **Generate from sample**.
4. Paste the copied JSON.

## Typical flow for OTP or email verification
1. Create an inbox for the current run.
2. Submit that email address to your app workflow.
3. Wait for the latest matching email.
4. Extract code or link content.
5. Continue flow logic and assertions.

## Important actions
Here are common actions for creating inboxes, waiting for messages, and extracting codes:

### Create inboxes

[API endpoint: `createInboxWithDefaults`](/docs/api/#createInboxWithDefaults)

### Wait for email

[API endpoint: `waitForLatestEmail`](/docs/api/#waitForLatestEmail)

### Extract content

[API endpoint: `getEmailContentMatch`](/docs/api/#getEmailContentMatch)

## Reliability tips
- Create a fresh inbox per run to avoid cross-test message collisions.
- Use bounded timeouts and branch on timeout/failure conditions.
- Keep API keys in environment/connection secrets, not inline flow steps.
- Add retries only for transient failures, not for invalid input errors.

## Related links
- [REST API docs](/docs/api/)
- [Wait for methods](/docs/wait-for/)
- [Testing overview](/docs/testing/)

</div>
</div>

