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

# List posts and reels

GET https://api-chat.parstechai.com/v1/robots/{robot_id}/channels/{channel_id}/media

Returns the connected page's newest 100 posts and reels, newest first. `total_count` counts at most those 100, so paging always ends within them.

This is what lets you build a post picker: your customer chooses which post a comment rule applies to, then you pass that `media_id` as `trigger.media_id`. Without it you would be asking an end user to paste a 17-digit id by hand.

Reference: https://docs-parschat.parstechai.com/api-reference/instagram-media/list-media

## Authentication

- `Authorization` header (bearer token, required) — Your API key, issued by ParsChat sales. One key per account, spanning every robot you own. Send it as `Authorization: Bearer pk_live_…`.

## Request

### Path parameters

- `robot_id` (string, required) — The robot's id, as returned by the create call.
- `channel_id` (string, required) — The channel's id.

### Query parameters

- `limit` (integer, optional, default: 50) — How many items to return per page.
- `offset` (integer, optional, default: 0) — How many records to skip. Use `offset = page * limit`, and `total_count` from the response to know when to stop.

## Response

### 200

A page of media.

- `data` (list of Media, optional)
- `pagination` (Pagination, optional) — Offset pagination. `total_count` tells you how many records match, so you know how many pages to fetch before you start.

## Errors

### 400 Bad Request Error

The request itself is malformed: a parameter is missing, unparseable, or out of range. Unlike 422, the request never reached validation of its contents.

- `error` (ErrorError, optional)

### 401 Unauthorized Error

The key is missing, wrong, revoked, or past its expiry date. All four answer `invalid_key`: telling an expired key from an unknown one would confirm to whoever holds a leaked key that it was once real.

- `error` (ErrorError, optional)

### 403 Forbidden Error

The call is understood but not permitted: a missing role, a lapsed plan, or exhausted capacity.

- `error` (ErrorError, optional)

### 404 Not Found Error

No such resource, or it belongs to another partner. We return 404 rather than 403 here, because a 403 would confirm the id exists.

- `error` (ErrorError, optional)

### 429 Too Many Requests Error

You are calling the API too fast. `details` names the limit you are held to. This never means an automated reply to an end customer was discarded: those are queued, not dropped.

- `error` (ErrorError, optional)

### 500 Internal Server Error

Something failed on our side. Retry with backoff, and quote `request_id` if it persists.

- `error` (ErrorError, optional)

### 503 Service Unavailable Error

A service we depend on (a channel provider, or our AI service) is unavailable. Retry with backoff.

- `error` (ErrorError, optional)

## Types

### Media

One post or reel on the connected page.

- `media_id` (string, optional) — Use this as `trigger.media_id` to scope a rule to this post.
- `type` (enum, optional) — What kind of media this is. `reel` is not reported yet: reels currently come back as `video`.
  - Allowed values: `image`, `video`, `carousel`, `reel`
- `caption` (string, optional) — The post's caption, as published.
- `permalink` (string, optional) — Public Instagram URL.
- `thumbnail_url` (string, optional) — Preview image. This is what makes a post picker usable: a customer recognises their own post by its image, not by a 17-digit id.
- `comments_count` (integer, optional) — Comments so far. Useful for showing which post is getting traffic.
- `published_at` (datetime, optional) — When the post went up.

### Pagination

Offset pagination. `total_count` tells you how many records match, so you know how many pages to fetch before you start.

- `limit` (integer, optional) — How many items were requested per page.
- `offset` (integer, optional) — How many items were skipped to reach this page.
- `total_count` (integer, optional) — Total records matching the query, across every page. Divide by `limit` to get the number of calls you need.
- `has_more` (boolean, optional) — Whether another page exists after this one.

### ErrorError

- `code` (string, optional) — Stable machine-readable code. Branch on this, not on the message.
- `message` (string, optional) — Human-readable explanation. Wording may change.
- `request_id` (string, optional) — Log this. It is what lets support find your exact request.
- `details` (map from string to any, optional) — Machine-readable context for the code. On `capacity_exhausted` it carries `occupied`, `requested` and `capacity`; on `rate_limited`, `limit_per_minute` and `window_seconds`.

## Examples

**Response**

```json
{
  "data": [
    {
      "media_id": "17895695668004550",
      "type": "image",
      "caption": "Dutch roses, in stock",
      "permalink": "https://www.instagram.com/p/C8xK2mQaB/",
      "thumbnail_url": "https://cdn.parstechai.com/ig/thumb/17895695668004550.jpg",
      "comments_count": 42,
      "published_at": "2026-09-14T08:20:00Z"
    },
    {
      "media_id": "17895695668004551",
      "type": "reel",
      "caption": "How to care for cut flowers",
      "permalink": "https://www.instagram.com/reel/C8xK3nRbC/",
      "thumbnail_url": "https://cdn.parstechai.com/ig/thumb/17895695668004551.jpg",
      "comments_count": 12,
      "published_at": "2026-09-12T16:05:00Z"
    }
  ],
  "pagination": {
    "limit": 25,
    "offset": 0,
    "total_count": 1,
    "has_more": false
  }
}
```

**SDK Code**

```python A post and a reel
import requests

url = "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript A post and a reel
const url = 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go A post and a reel
package main

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

func main() {

	url := "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby A post and a reel
require 'uri'
require 'net/http'

url = URI("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java A post and a reel
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php A post and a reel
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp A post and a reel
using RestSharp;

var client = new RestClient("https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift A post and a reel
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-chat.parstechai.com/v1/robots/rbt_8fK2mQ/channels/chn_3pQ7xL/media")! 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()
```