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

**Download Apple Mail setup profile from a link**

Download the Apple Mail setup profile behind a link created by `POST /api/v2/shared-hosting/{accountId}/email-accounts/{address}/actions/mail-profile-link`. No API key or session is required: the signed `token` in the path is the whole authorization, so the link can be opened on a phone that is not logged in. The response is the file itself (`application/x-apple-aspen-config`), not JSON; it contains servers, ports and the username, never a password. Links are 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 shared-hosting accounts
- `GET /api/v2/shared-hosting/{accountId}`: Get shared-hosting account
- `PATCH /api/v2/shared-hosting/{accountId}`: Rename shared-hosting account

### Headers

- `Accept`: application/json
- No authorization header required.

### Parameters

- `token` (path, string, required): Signed token from the `url` returned by the mail-profile-link action. Use the URL exactly as returned. Example: `id_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl -X GET "https://cloud.hostup.se/api/v2/mail-profiles/id_01hxa3b4c5d6e7f8g9h0j1k2m3" \
  -H "Accept: application/json"
```

### Responses

#### 200 - Apple configuration profile 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 body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/domainName",
      "detail": "`domainName` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 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": "Too many requests. Retry after the limit resets.",
  "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"
}
```
