- Mail
- Conversation
  - get Find all conversations
  - post Create conversation
  - get Get conversation by id
- Entry
  - get Find entries of the conversation
  - post Create entry
  - get Get entry
  - put Update entry
  - del Delete entry
- Recipient
  - get Find recipients of the conversation
  - post Add recipient to conversation
  - del Remove recipient from conversation
- Tag
  - get Find tags of the conversation
  - put Update tags

API docs by Redocly

# HumHub - Mail API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub user module API reference.

# Mail

API to access and manage mail conversations.

# Conversation

## Find all conversations

##### query Parameters

page | string >= 0 The number of page of the result set.
limit | string [ 1 .. 50 ] Default: 20 The numbers of items to return per page.

### Responses

/api/v1/mail

### Response samples

- 200

Content type
application/json
`
{

- "total": 76,
- "page": 1,
- "pages": 8,
- "links":
  {
  - "self": "{endpoint_path}?page=1&per-page=10",
  - "next": "{endpoint_path}?page=2&per-page=10",
  - "last": "{endpoint_path}?page=8&per-page=10"
  },
- "results":
  [
  - {
    - "id": 23,
    - "title": "Hi guys!",
    - "created_at": "2020-10-28 10:16:34",
    - "created_by": 1,
    - "updated_at": "2020-10-28 10:17:22",
    - "updated_by": 2
    }
  ]

}`

## Create conversation

##### Request Body schema: application/json

Data for new conversation

title required | string Conversation title
message required | string First entry content
recipient required | Array of any Guid of users

### Responses

/api/v1/mail

### Request samples

- Payload

Content type
application/json
`
{

- "title": "Conversation from API",
- "message": "First message from API",
- "recipient":
  [
  - "8eddbecb-8207-4848-bba6-5910115d3e4a",
  - "b6b66077-916d-4718-af28-5ffc20895d30"
  ]

}`

### Response samples

- 200

Content type
application/json
`
{

- "id": 23,
- "title": "Hi guys!",
- "created_at": "2020-10-28 10:16:34",
- "created_by": 1,
- "updated_at": "2020-10-28 10:17:22",
- "updated_by": 2

}`

## Get conversation by id

##### path Parameters

messageId required | integer The id of conversation

### Responses

/api/v1/mail/{messageId}

### Response samples

- 200

Content type
application/json
`
{

- "id": 23,
- "title": "Hi guys!",
- "created_at": "2020-10-28 10:16:34",
- "created_by": 1,
- "updated_at": "2020-10-28 10:17:22",
- "updated_by": 2

}`

# Entry

## Find entries of the conversation

##### path Parameters

messageId required | integer The id of conversation

##### query Parameters

page | string >= 0 The number of page of the result set.
limit | string [ 1 .. 50 ] Default: 20 The numbers of items to return per page.

### Responses

/api/v1/mail/{messageId}/entries

### Response samples

- 200

Content type
application/json
`
{

- "total": 76,
- "page": 1,
- "pages": 8,
- "links":
  {
  - "self": "{endpoint_path}?page=1&per-page=10",
  - "next": "{endpoint_path}?page=2&per-page=10",
  - "last": "{endpoint_path}?page=8&per-page=10"
  },
- "results":
  [
  - {
    - "id": 23,
    - "user_id": 1,
    - "content": "Sample message",
    - "type": 0,
    - "created_at": "2020-10-28 10:16:34",
    - "created_by": 1,
    - "updated_at": "2020-10-28 10:17:22",
    - "updated_by": 2
    }
  ]

}`

## Create entry

##### path Parameters

messageId required | integer The id of conversation

##### Request Body schema: application/json

Data for new conversation entry

message required | string Conversation entry content

### Responses

/api/v1/mail/{messageId}/entry

### Request samples

- Payload

Content type
application/json
`
{

- "message": "Sample entry content from API"

}`

### Response samples

- 200

Content type
application/json
`
{

- "id": 23,
- "user_id": 1,
- "content": "Sample message",
- "type": 0,
- "created_at": "2020-10-28 10:16:34",
- "created_by": 1,
- "updated_at": "2020-10-28 10:17:22",
- "updated_by": 2

}`

## Get entry

##### path Parameters

messageId required | integer The id of conversation
entryId required | integer The id of entry

### Responses

/api/v1/mail/{messageId}/entry/{entryId}

### Response samples

- 200

Content type
application/json
`
{

- "id": 23,
- "user_id": 1,
- "content": "Sample message",
- "type": 0,
- "created_at": "2020-10-28 10:16:34",
- "created_by": 1,
- "updated_at": "2020-10-28 10:17:22",
- "updated_by": 2

}`

## Update entry

##### path Parameters

messageId required | integer The id of conversation
entryId required | integer The id of entry

##### Request Body schema: application/json

Data to update conversation entry

content required | string Conversation entry content

### Responses

/api/v1/mail/{messageId}/entry/{entryId}

### Request samples

- Payload

Content type
application/json
`
{

- "content": "Updated sample entry content from API"

}`

### Response samples

- 200

Content type
application/json
`
{

- "id": 23,
- "user_id": 1,
- "content": "Sample message",
- "type": 0,
- "created_at": "2020-10-28 10:16:34",
- "created_by": 1,
- "updated_at": "2020-10-28 10:17:22",
- "updated_by": 2

}`

## Delete entry

##### path Parameters

messageId required | integer The id of conversation
entryId required | integer The id of entry

### Responses

/api/v1/mail/{messageId}/entry/{entryId}

# Recipient

## Find recipients of the conversation

##### path Parameters

messageId required | integer The id of conversation

### Responses

/api/v1/mail/{messageId}/users

### Response samples

- 200

Content type
application/json
`
[

- {
  - "id": 14,
  - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  - "display_name": "John Doe",
  - "url": "http://localhost/p/humhub/master/u/j.doe/",
  - "account":
    {
    - "id": 14,
    - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
    - "username": "john.doe",
    - "email": "john.doe@example.com",
    - "visibility": 0,
    - "status": 1,
    - "tags":
      [
      - "Administration",
      - "Support",
      - "HumHub"
      ],
    - "language": "DE",
    - "time_zone": "Europe/Paris",
    - "contentcontainer_id": 5
    },
  - "profile":
    {
    - "firstname": "John",
    - "lastname": "Doe",
    - "title": "Test user",
    - "gender": "male",
    - "street": "New Street 5",
    - "zip": 80331,
    - "city": "Munich",
    - "country": "DE (ISO 3166 code)",
    - "state": "string",
    - "birthday_hide_year": 0,
    - "birthday": "1990-01-01",
    - "about": "string",
    - "phone_private": "string",
    - "phone_work": "string",
    - "mobile": "string",
    - "fax": "string",
    - "im_skype": "string",
    - "im_xmpp": "string",
    - "url": "string",
    - "url_facebook": "string",
    - "url_linkedin": "string",
    - "url_xing": "string",
    - "url_youtube": "string",
    - "url_vimeo": "string",
    - "url_flickr": "string",
    - "url_myspace": "string",
    - "url_twitter": "string"
    }
  }

]`

## Add recipient to conversation

##### path Parameters

messageId required | integer The id of conversation
userId required | integer The id of user

### Responses

/api/v1/mail/{messageId}/user/{userId}

### Response samples

- 200

Content type
application/json
`
[

- {
  - "id": 14,
  - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  - "display_name": "John Doe",
  - "url": "http://localhost/p/humhub/master/u/j.doe/",
  - "account":
    {
    - "id": 14,
    - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
    - "username": "john.doe",
    - "email": "john.doe@example.com",
    - "visibility": 0,
    - "status": 1,
    - "tags":
      [
      - "Administration",
      - "Support",
      - "HumHub"
      ],
    - "language": "DE",
    - "time_zone": "Europe/Paris",
    - "contentcontainer_id": 5
    },
  - "profile":
    {
    - "firstname": "John",
    - "lastname": "Doe",
    - "title": "Test user",
    - "gender": "male",
    - "street": "New Street 5",
    - "zip": 80331,
    - "city": "Munich",
    - "country": "DE (ISO 3166 code)",
    - "state": "string",
    - "birthday_hide_year": 0,
    - "birthday": "1990-01-01",
    - "about": "string",
    - "phone_private": "string",
    - "phone_work": "string",
    - "mobile": "string",
    - "fax": "string",
    - "im_skype": "string",
    - "im_xmpp": "string",
    - "url": "string",
    - "url_facebook": "string",
    - "url_linkedin": "string",
    - "url_xing": "string",
    - "url_youtube": "string",
    - "url_vimeo": "string",
    - "url_flickr": "string",
    - "url_myspace": "string",
    - "url_twitter": "string"
    }
  }

]`

## Remove recipient from conversation

##### path Parameters

messageId required | integer The id of conversation
userId required | integer The id of user

### Responses

/api/v1/mail/{messageId}/user/{userId}

### Response samples

- 200

Content type
application/json
`
[

- {
  - "id": 14,
  - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  - "display_name": "John Doe",
  - "url": "http://localhost/p/humhub/master/u/j.doe/",
  - "account":
    {
    - "id": 14,
    - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
    - "username": "john.doe",
    - "email": "john.doe@example.com",
    - "visibility": 0,
    - "status": 1,
    - "tags":
      [
      - "Administration",
      - "Support",
      - "HumHub"
      ],
    - "language": "DE",
    - "time_zone": "Europe/Paris",
    - "contentcontainer_id": 5
    },
  - "profile":
    {
    - "firstname": "John",
    - "lastname": "Doe",
    - "title": "Test user",
    - "gender": "male",
    - "street": "New Street 5",
    - "zip": 80331,
    - "city": "Munich",
    - "country": "DE (ISO 3166 code)",
    - "state": "string",
    - "birthday_hide_year": 0,
    - "birthday": "1990-01-01",
    - "about": "string",
    - "phone_private": "string",
    - "phone_work": "string",
    - "mobile": "string",
    - "fax": "string",
    - "im_skype": "string",
    - "im_xmpp": "string",
    - "url": "string",
    - "url_facebook": "string",
    - "url_linkedin": "string",
    - "url_xing": "string",
    - "url_youtube": "string",
    - "url_vimeo": "string",
    - "url_flickr": "string",
    - "url_myspace": "string",
    - "url_twitter": "string"
    }
  }

]`

# Tag

## Find tags of the conversation

##### path Parameters

messageId required | integer The id of conversation

##### query Parameters

page | string >= 0 The number of page of the result set.
limit | string [ 1 .. 50 ] Default: 20 The numbers of items to return per page.

### Responses

/api/v1/mail/{messageId}/tags

### Response samples

- 200

Content type
application/json
`
{

- "total": 76,
- "page": 1,
- "pages": 8,
- "links":
  {
  - "self": "{endpoint_path}?page=1&per-page=10",
  - "next": "{endpoint_path}?page=2&per-page=10",
  - "last": "{endpoint_path}?page=8&per-page=10"
  },
- "results":
  [
  - {
    - "id": 12,
    - "name": "Meeting",
    - "sort_order": 4,
    - "color": null
    }
  ]

}`

## Update tags

##### path Parameters

messageId required | integer The id of conversation

##### Request Body schema: application/json

Data to update conversation tags

tags required | Array of any Conversation tags

### Responses

/api/v1/mail/{messageId}/tags

### Request samples

- Payload

Content type
application/json
`
{

- "tags":
  [
  - "Meeting",
  - "Holidays",
  - "Work"
  ]

}`

### Response samples

- 200

Content type
application/json
`
{

- "total": 76,
- "page": 1,
- "pages": 8,
- "links":
  {
  - "self": "{endpoint_path}?page=1&per-page=10",
  - "next": "{endpoint_path}?page=2&per-page=10",
  - "last": "{endpoint_path}?page=8&per-page=10"
  },
- "results":
  [
  - {
    - "id": 12,
    - "name": "Meeting",
    - "sort_order": 4,
    - "color": null
    }
  ]

}`