> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.coperniq.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coperniq.io/_mcp/server.

# List Account SMS

GET https://api.coperniq.io/v1/accounts/{account_id}/sms

Retrieve a paginated list of text messages (SMS and MMS) on an account, newest first.

Supports:
- Pagination (`page_size`, `page`)
- Filtering by `direction` (`INBOUND` or `OUTBOUND`)
- Date filtering (`updated_after`, `updated_before`)
- Sorting by creation time (`order_by`, newest first by default)

Read-only: sending texts is not supported through the API. Texts are sent through Coperniq automations.


Reference: https://docs.coperniq.io/api-reference/sms/list-account-sms

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `account_id` (integer, required) — Account identifier

### Query parameters

- `page_size` (integer, optional, default: 20) — Number of items per page (max 100)
- `page` (integer, optional, default: 1) — Page number (1-based)
- `direction` (enum, optional) — Only return texts in this direction
  - Allowed values: `INBOUND`, `OUTBOUND`
- `updated_after` (AccountsAccountIdSmsGetParametersUpdatedAfter, optional) — Only return texts updated after this timestamp (ISO 8601 date or date-time)
- `updated_before` (AccountsAccountIdSmsGetParametersUpdatedBefore, optional) — Only return texts updated before this timestamp (ISO 8601 date or date-time). Must not be earlier than `updated_after`.
- `order_by` (enum, optional, default: desc) — Sort by creation time. Defaults to newest first.
  - Allowed values: `asc`, `desc`

## Response

### 200

List of text messages

- `list of SmsMessage`

## Errors

### 400 Bad Request Error

Invalid request

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `GRAPHQL_ERROR`, `UPSTREAM_ERROR`
- `field` (string, optional) — Field that caused the validation error (if applicable)

### 401 Unauthorized Error

Authentication failed

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `GRAPHQL_ERROR`, `UPSTREAM_ERROR`

### 404 Not Found Error

Resource not found

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `GRAPHQL_ERROR`, `UPSTREAM_ERROR`

### 500 Internal Server Error

Internal server error

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `GRAPHQL_ERROR`, `UPSTREAM_ERROR`

### 502 Bad Gateway Error

Bad Gateway — upstream request failed

- `message` (string, required) — Summary of the upstream failure
- `code` (enum, required)
  - Allowed values: `GRAPHQL_ERROR`, `UPSTREAM_ERROR`

## Types

### AccountsAccountIdSmsGetParametersUpdatedAfter

- string
- string

### AccountsAccountIdSmsGetParametersUpdatedBefore

- string
- string

### SmsMessage

A text message (SMS or MMS) on a project, opportunity or account. Read-only: sending texts is not supported through the API. Texts are sent through Coperniq automations.

- `id` (integer, optional) — Text message identifier
- `recordId` (integer, optional, nullable) — ID of the project, opportunity or account the text is on
- `direction` (enum, optional)
  - Allowed values: `INBOUND`, `OUTBOUND`
- `status` (string, optional, nullable) — Delivery status from the carrier, lowercase (for example `queued`, `sent`, `delivered`, `undelivered`, `failed`, `received`, `scheduled`, `canceled`)
- `text` (string, optional, nullable)
- `fromPhone` (string, optional, nullable)
- `toPhone` (string, optional, nullable)
- `fromContact` (SmsMessageFromContact, optional, nullable) — Contact who sent the text
- `toContact` (SmsMessageToContact, optional, nullable) — Contact who received the text
- `fromUser` (SmsUserRef, optional, nullable) — Team member who sent the text
- `toUser` (SmsUserRef, optional, nullable) — Team member who received the text
- `createdBy` (SmsUserRef, optional, nullable) — Team member who created the text. `null` for inbound texts and texts sent by automations.
- `isMms` (boolean, optional)
- `media` (list of SmsMessageMediaItems, optional) — MMS attachments. Fetch each file with `GET /files/{file_id}`.
- `sentByAutomation` (boolean, optional) — `true` when a Coperniq automation sent the text
- `scheduledFor` (string, optional, nullable) — When a scheduled text is due to send. `null` otherwise.
- `createdAt` (string, optional)
- `updatedAt` (string, optional)

### SmsMessageFromContact

Contact who sent the text

- `id` (integer, optional)
- `name` (string, optional, nullable)

### SmsMessageToContact

Contact who received the text

- `id` (integer, optional)
- `name` (string, optional, nullable)

### SmsUserRef

- `id` (integer, optional)
- `firstName` (string, optional, nullable)
- `lastName` (string, optional, nullable)

### SmsMessageMediaItems

- `fileId` (integer, optional, nullable)
- `contentType` (string, optional, nullable)

## Examples

**Response**

```json
[
  {
    "id": 1004,
    "recordId": 311,
    "direction": "OUTBOUND",
    "status": "delivered",
    "text": "Reminder: your install is tomorrow at 9am.",
    "fromPhone": "+14155550199",
    "toPhone": "+14155550142",
    "fromContact": null,
    "toContact": {
      "id": 311,
      "name": "Maria Alvarez"
    },
    "fromUser": null,
    "toUser": null,
    "createdBy": null,
    "isMms": false,
    "media": [],
    "sentByAutomation": true,
    "scheduledFor": "2026-11-19T15:00:00.000Z",
    "createdAt": "2026-11-18T18:00:00.000Z",
    "updatedAt": "2026-11-19T15:00:03.000Z"
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.coperniq.io/v1/accounts/311/sms"

headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://api.coperniq.io/v1/accounts/311/sms';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.coperniq.io/v1/accounts/311/sms"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.coperniq.io/v1/accounts/311/sms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.coperniq.io/v1/accounts/311/sms")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.coperniq.io/v1/accounts/311/sms', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.coperniq.io/v1/accounts/311/sms");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.coperniq.io/v1/accounts/311/sms")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```