> ## 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.

# Save (/v1/connections/mail)

> Verified sender and immutable connection saved; no email sent

### Request body

`MailConnectionInput`

**api\_key** `string` *required*

A Mail tenant key. Platform-wide keys are rejected.

**environment** `string` *required*

**sender** `string` *required*

An active mailbox owned by the credential's Mail tenant.

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

HTTPS origin of a StateSet Mail-compatible service.

### 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` | Verified sender and immutable connection saved; no email sent |
| `403` | Organization administrator or explicit mail:configure scope required |

### 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' \
  --header "Authorization: Bearer $EDI_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "api_key": "YOUR_API_KEY",
  "environment": "string",
  "sender": "string",
  "service_url": "string"
}'
```

```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.