# User email preferences - Mailhub

## GET /mailhub/users/{userId}/preferences

> Get preferences

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User email preferences - Mailhub"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["organization:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/mailhub/users/{userId}/preferences":{"get":{"tags":["Users / User email preferences - Mailhub"],"summary":"Get preferences","parameters":[{"name":"userId","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"object","properties":{"id":{"type":"integer"},"uuid":{"type":"string"},"email":{"type":"string","format":"email"},"is_email_verified":{"type":"boolean"},"global":{"type":"object","properties":{"isEmailVerified":{"type":"boolean"},"preferences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"label":{"type":"string"},"description":{"type":"string"}}}}}},"zones":{"type":"array","items":{}}}}}}}}}}}}}}
```

## PATCH /mailhub/users/{userId}/preferences

> Update global preferences

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User email preferences - Mailhub"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["organization:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/mailhub/users/{userId}/preferences":{"patch":{"tags":["Users / User email preferences - Mailhub"],"summary":"Update global preferences","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"}}}}}},"parameters":[{"name":"userId","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"object","properties":{"global":{"type":"object","properties":{"preferences":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"}}}}}}}}}}}}}}}}}
```

## GET /mailhub/users/{userId}/organizations/{organizationId}/teams/{teamId}/preferences

> Get team preferences

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User email preferences - Mailhub"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["organization:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/mailhub/users/{userId}/organizations/{organizationId}/teams/{teamId}/preferences":{"get":{"tags":["Users / User email preferences - Mailhub"],"summary":"Get team preferences","parameters":[{"name":"userId","in":"path","schema":{"type":"string"},"required":true},{"name":"organizationId","in":"path","schema":{"type":"string"},"required":true},{"name":"teamId","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"uuid":{"type":"string"},"email":{"type":"string","format":"email"},"is_email_verified":{"type":"boolean"},"team":{"type":"object","properties":{"teamId":{"type":"integer"},"teamName":{"type":"string"},"preferences":{"type":"object","properties":{"native":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"subscribed":{"type":"boolean"},"label":{"type":"string"},"description":{"type":"string"}}}},"marketing":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"label":{"type":"string"},"description":{"type":"string"}}}}}}}}}}}}}}}}}}
```

## PATCH /mailhub/users/{userId}/organizations/{organizationId}/teams/{teamId}/preferences

> Update team preferences

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User email preferences - Mailhub"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["organization:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/mailhub/users/{userId}/organizations/{organizationId}/teams/{teamId}/preferences":{"patch":{"tags":["Users / User email preferences - Mailhub"],"summary":"Update team preferences","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"}}}}}},"parameters":[{"name":"userId","in":"path","schema":{"type":"string"},"required":true},{"name":"organizationId","in":"path","schema":{"type":"string"},"required":true},{"name":"teamId","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"preferences":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"}}}}}}}}}}}}}}}
```

## PATCH /mailhub/users/{userId}/organizations/{organizationId}/teams/{teamId}/native-preferences

> Update team native preferences

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User email preferences - Mailhub"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["organization:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/mailhub/users/{userId}/organizations/{organizationId}/teams/{teamId}/native-preferences":{"patch":{"tags":["Users / User email preferences - Mailhub"],"summary":"Update team native preferences","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"utc-millisec"},"enabled":{"type":"boolean"}}}}}},"parameters":[{"name":"userId","in":"path","schema":{"type":"string"},"required":true},{"name":"organizationId","in":"path","schema":{"type":"string"},"required":true},{"name":"teamId","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"preferences":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"}}}}}}}}}}}}}}}
```
