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

# Managed

> Managed tenant, mailbox and scoped connection ready; replay returns the original connection

### Request body

`ManagedMailInput`

**environment** `string` *required*

**replace\_connection\_id** `string,null`

Explicitly replace this current revision if configuration changed while an earlier provisioning attempt was pending. Omit for ordinary retries.

### Response

`MailConnectionResponse`

**data** `MailConnectionView` *required*

**MailConnectionView**

**active** `boolean` *required*

**environment** `string` *required*

**id** `string` *required*

**mail\_tenant\_id** `string` *required*

**mailbox\_id** `string` *required*

**mode** `string` *required*

**paused** `boolean` *required*

**pending\_deliveries** `integer (int64)` *required*

**sender** `string` *required*

**service\_url** `string` *required*

**tested\_at** `string (date-time)` *required*

**success** `boolean` *required*

### Status codes

| Code | Meaning |
| - | - |
| `200` | Managed tenant, mailbox and scoped connection ready; replay returns the original connection |
| `409` | Setup is already running or provider configuration changed |

### Using this contract

Read the [source OpenAPI document](/spec/edi.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.edi.stateset.com/v1/connections/mail/managed' \
  --header "Authorization: Bearer $EDI_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "environment": "string",
  "replace_connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'
```

```json 200 theme={null}
{
  "data": {
    "active": true,
    "environment": "string",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "mail_tenant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "mailbox_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "mode": "string",
    "paused": true,
    "pending_deliveries": 1,
    "sender": "string",
    "service_url": "string",
    "tested_at": "2026-08-31T14:22:05Z"
  },
  "success": true
}
```


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