---
title: "List inbound messages"
description: "Returns received messages, newest first, 100 per page. Webhooks are the recommended way to\nreceive inbound messages; use this endpoint if you need to poll. Pass `id_after` (the last\nID you saw) or `created_after` to fetch only new messages.\n"
version: "v2"
---

> Documentation Index
> Fetch the complete documentation index at: https://dev.messageport.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

Path: MessagePort API › Inbound messages

`GET /v2/inbounds`

Returns received messages, newest first, 100 per page. Webhooks are the recommended way to
receive inbound messages; use this endpoint if you need to poll. Pass `id_after` (the last
ID you saw) or `created_after` to fetch only new messages.

## Authentication

- `basicAuth`, http, header `Authorization`

## Query parameters

- `created_after` (`listInbounds.query.created_after`; string, optional) — ISO 8601 date-time. Only return messages received at or after this time.
  - format `date-time`
- `id_after` (`listInbounds.query.id_after`; integer, optional) — Only return messages with an ID greater than this.
- `page` (`listInbounds.query.page`; integer, optional) — Page number. Prefer following `links.next` until it is `null`.
  - min 1; default `1`

## Code samples

### cURL

```bash
curl --request GET \
  --url https://app.messageport.com.au/api/v2/inbounds \
  --header 'Authorization: Basic <credentials>'
```

### TypeScript

```typescript
const url = 'https://app.messageport.com.au/api/v2/inbounds';
const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.messageport.com.au/api/v2/inbounds"

headers = {"Authorization": "Basic <credentials>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

A page of inbound messages.

#### Example

```json
{
  "data": [
    {
      "id": 1350660,
      "content": "Yes, see you then",
      "number": "61412345678",
      "received_by_number": "61491570159",
      "new": false,
      "optout": false,
      "channel": null,
      "media_urls": [],
      "updated": "2024-03-11T02:14:07.000000Z",
      "created": "2024-03-11T02:14:07.000000Z",
      "contact": null,
      "message": null
    }
  ],
  "links": {
    "first": "https://app.messageport.com.au/api/v2/contacts?page=1",
    "last": "https://app.messageport.com.au/api/v2/contacts?page=8",
    "prev": null,
    "next": "https://app.messageport.com.au/api/v2/contacts?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 8,
    "path": "https://app.messageport.com.au/api/v2/contacts",
    "per_page": 50,
    "to": 50,
    "total": 400
  }
}
```

- `data` (`listInbounds.response.200.data`; array<object>, optional)
  - `id` (`listInbounds.response.200.data.id`; integer, optional)
  - `content` (`listInbounds.response.200.data.content`; string, optional)
  - `number` (`listInbounds.response.200.data.number`; string, optional) — Sender's number.
  - `received_by_number` (`listInbounds.response.200.data.received_by_number`; string, optional) — Your number that received the message, or `SHARED_NUMBER`.
  - `new` (`listInbounds.response.200.data.new`; boolean | integer, optional) — Whether the message is unread.
  - `optout` (`listInbounds.response.200.data.optout`; boolean | integer, optional) — Whether the message was an opt-out request.
  - `channel` (`listInbounds.response.200.data.channel`; string | null, optional) — `webchat` for web chat messages, otherwise `null` (SMS).
    - one of `"webchat"`, `null`
  - `media_urls` (`listInbounds.response.200.data.media_urls`; array<string>, optional) — Direct URLs to inbound MMS media. Empty for SMS.
    - format `uri`
  - `updated` (`listInbounds.response.200.data.updated`; string, optional)
    - format `date-time`
  - `created` (`listInbounds.response.200.data.created`; string, optional)
    - format `date-time`
  - `contact` (`listInbounds.response.200.data.contact`; one of, optional) — The matching contact, if any.
    - one of: `Contact`, `null`
  - `message` (`listInbounds.response.200.data.message`; one of, optional) — The outbound message this is a reply to, if any.
    - one of: `SentMessage`, `null`
- `links` (`listInbounds.response.200.links`; object, optional) — Links to other pages. `next` is `null` on the last page.
  - example `{"first":"https://app.messageport.com.au/api/v2/contacts?page=1","last":"https://app.messageport.com.au/api/v2/contacts?page=8","prev":null,"next":"https://app.messageport.com.au/api/v2/contacts?page=2"}`
  - `first` (`listInbounds.response.200.links.first`; string | null, optional)
    - format `uri`
  - `last` (`listInbounds.response.200.links.last`; string | null, optional)
    - format `uri`
  - `prev` (`listInbounds.response.200.links.prev`; string | null, optional)
    - format `uri`
  - `next` (`listInbounds.response.200.links.next`; string | null, optional)
    - format `uri`
- `meta` (`listInbounds.response.200.meta`; object, optional) — Position in the result set. Read `per_page` rather than assuming a page size.
  - example `{"current_page":1,"from":1,"last_page":8,"path":"https://app.messageport.com.au/api/v2/contacts","per_page":50,"to":50,"total":400}`
  - `current_page` (`listInbounds.response.200.meta.current_page`; integer, optional)
  - `from` (`listInbounds.response.200.meta.from`; integer | null, optional)
  - `last_page` (`listInbounds.response.200.meta.last_page`; integer, optional)
  - `path` (`listInbounds.response.200.meta.path`; string, optional)
    - format `uri`
  - `per_page` (`listInbounds.response.200.meta.per_page`; integer, optional)
  - `to` (`listInbounds.response.200.meta.to`; integer | null, optional)
  - `total` (`listInbounds.response.200.meta.total`; integer, optional)
  - `links` (`listInbounds.response.200.meta.links`; array<object>, optional) — Page links for building pagination controls.
    - `url` (`listInbounds.response.200.meta.links.url`; string | null, optional)
    - `label` (`listInbounds.response.200.meta.links.label`; string, optional)
    - `active` (`listInbounds.response.200.meta.links.active`; boolean, optional)

### 401

Missing, malformed or invalid API credentials.

#### Example

```json
{
  "message": "Unauthenticated."
}
```

- `message` (`listInbounds.response.401.message`; string, required)

### 422

The request failed validation. `errors` lists the messages for each invalid field.

#### Example

```json
{
  "message": "The messages field is required.",
  "errors": {
    "messages": [
      "The messages field is required."
    ]
  }
}
```

- `message` (`listInbounds.response.422.message`; string, optional)
- `errors` (`listInbounds.response.422.errors`; map<array<string>>, optional)

### 429

Rate limit exceeded. Wait before retrying.

#### Example

```json
{
  "message": "Too Many Attempts."
}
```

- `message` (`listInbounds.response.429.message`; string, required)


Source: https://dev.messageport.com.au/api/inbounds/list/index.md
