## GET /api/v2/mail-profiles/{token}

**Download a mail setup profile**

Download the Apple Mail setup profile behind a link from `POST /api/v2/shared-hosting/{accountId}/email-accounts/{address}/actions/mail-profile-link`. The link works without an API key or a login. It can be opened on a phone that is not signed in. The response is the profile file (`application/x-apple-aspen-config`), not JSON. It holds the mail servers, ports and the mailbox address. It never holds a password.

A link is valid for 30 minutes. An expired or invalid link returns `410 link_expired`. Create a new link to continue.

### Related Endpoints

- `GET /api/v2/shared-hosting`: List web hosting accounts
- `GET /api/v2/shared-hosting/{accountId}`: Get a web hosting account
- `PATCH /api/v2/shared-hosting/{accountId}`: Rename a web hosting account

### Headers

- No authorization header required.

### Parameters

- `token` (path, string, required): The token from the `url` the mail-profile-link action returned. Example: `id_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl "https://cloud.hostup.se/api/v2/mail-profiles/id_01hxa3b4c5d6e7f8g9h0j1k2m3"
```

### Responses

#### 200 - The setup profile file for the mailbox.

#### 400 - Invalid request. The response body is an RFC 7807 Problem Details document.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request is invalid.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 410 - The link has expired or is invalid. Create a new link.
```json
{
  "type": "https://developer.hostup.se/errors/link_expired",
  "title": "Link expired",
  "status": 410,
  "detail": "This setup link is no longer valid. Open the mailbox in the client area again to get a new one.",
  "code": "link_expired",
  "instance": "/api/v2/mail-profiles"
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Rate limit exceeded. Please try again later.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```
