# List posts

## List all posts

> Returns information about all posts

```json
{"openapi":"3.1.0","info":{"title":"Ocoya API","version":"1.1.0"},"servers":[{"url":"https://app.ocoya.com/api/_public/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"paths":{"/post":{"get":{"summary":"List all posts","description":"Returns information about all posts","parameters":[{"in":"query","name":"workspaceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"statuses","schema":{"type":"array","enum":["DRAFT","PENDING_CLIENT_APPROVAL","PENDING_INTERNAL_APPROVAL","SCHEDULED","POSTED","ERROR"]},"style":"form","explode":true},{"in":"query","name":"page","schema":{"type":"integer"}},{"in":"query","name":"perPage","schema":{"type":"integer"}}],"responses":{"200":{"description":"Success"},"500":{"description":"Unknown error"}}}}}}
```

### Query parameters explained

<table data-full-width="true"><thead><tr><th>Parameter</th><th width="117">Type</th><th>Required</th><th>Information</th></tr></thead><tbody><tr><td>page</td><td>integer</td><td>no</td><td>Page number</td></tr><tr><td>perPage</td><td>integer</td><td>no</td><td>Number of records per page (must follow <a href="/pages/pEGuObsL0YTJTwEhZdyl">Pagination limitations</a>)</td></tr></tbody></table>

### Sample response

{% code lineNumbers="true" fullWidth="true" expandable="true" %}

```json
[
    {
        "id": "clhbatosn000x8kfenovaodu2",
        "postType": "REGULAR",
        "status": "POSTED",
        "scheduledAt": "2023-05-06T02:20:00.000Z",
        "posts": [
            {
                "provider": "GENERAL",
                "caption": "Nice post",
                "creatives": [],
            },
            {
                "provider": "FACEBOOK",
                "caption": "Nice post",
                "creatives": [],
            }
        ],
        "socialProfiles": [
            {
                "socialProfile": {
                    "id": "cm1utmu9b000qr59cy6mupxsp",
                    "provider": "facebook",
                    "name": "Ocoya Test",
                    "image": "https://graph.facebook.com/110495374807404/picture?type=normal"
                }
            }
        ]
    }
]
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ocoya.com/endpoints/posts/list-posts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
