GET
https://www.app.ocoya.com/api/_public/v1/post
List all posts
curl --request GET \
  --url https://www.app.ocoya.com/api/_public/v1/post \
  --header 'X-API-Key: <api-key>'
[
  {
    "id": "cmajvvb9q0003ja5vh0538j6r",
    "status": "SCHEDULED",
    "createdAt": "2024-01-01T00:00:00Z",
    "scheduledAt": "2024-01-01T00:00:00Z",
    "campaignId": null,
    "campaign": null,
    "workflowId": null,
    "workflow": null,
    "posts": [
      {
        "id": "cmajvvbaa0004ja5v2c0c8k1x",
        "provider": "instagram",
        "caption": "Happy new year everyone!",
        "title": null,
        "options": {
          "type": "post"
        },
        "creatives": [
          {
            "id": "cm2d687bf000q5h5vct2hdmyg",
            "position": 0,
            "image": "https://cdn.ocoya.com/prod/creative/13a76677.jpeg",
            "video": null,
            "thumbnail": null
          }
        ],
        "boardIds": []
      }
    ],
    "socialProfiles": [
      {
        "socialProfile": {
          "id": "clh49poxf008x8kov4ncbjty9",
          "provider": "instagram",
          "name": "Ocoya",
          "image": null,
          "socialAccount": {
            "options": {}
          }
        }
      }
    ]
  }
]

Authorizations

X-API-Keystringheaderrequired

Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.

Query Parameters

brandIdstringrequired

Ocoya brand ID. Get one from GET /brands.

Example:"cmayvq3hk00017apshay5qezu"
statusesenum<string>[]

Post statuses to include in the result.

Available options: GENERATING, DRAFT, PENDING_CLIENT_APPROVAL, PENDING_INTERNAL_APPROVAL, SCHEDULED, POSTED, NEEDS_ATTENTION, ERROR
Example:
[
  "DRAFT"
]
querystring

Only posts whose caption or title contains this text.

Example:"launch"
pageinteger

Zero-based page number for paginated results.

Example:0
perPageinteger

Maximum number of items to return per page.

Example:10

Response

application/json

Success. Newest scheduled first.

object[]
idstring

Post ID.

Example:"cmajvvb9q0003ja5vh0538j6r"
statusenum<string>

Where the post is in its life.

Available options: GENERATING, DRAFT, PENDING_CLIENT_APPROVAL, PENDING_INTERNAL_APPROVAL, SCHEDULED, POSTED, NEEDS_ATTENTION, ERROR
Example:"SCHEDULED"
createdAtstring

When the post was created.

Example:"2024-01-01T00:00:00Z"
scheduledAtstring | null

When the post is scheduled to publish, or null for a draft.

Example:"2024-01-01T00:00:00Z"
campaignIdstring | null

AI campaign the post belongs to.

campaignobject | null

The campaign, when the post belongs to one.

Show child attributesHide child attributes
campaign.idstring
campaign.optionsobject | null
workflowIdstring | null

Workflow that created the post.

workflowobject | null

The workflow, when one created the post.

Show child attributesHide child attributes
workflow.idstring
workflow.namestring | null
postsobject[]

One variation per network the post goes to.

Show child attributesHide child attributes
posts.idstring
Example:"cmajvvbaa0004ja5v2c0c8k1x"
posts.providerstring

Network this variation publishes to.

Example:"instagram"
posts.captionstring | null

Caption for this network.

Example:"Happy new year everyone!"
posts.titlestring | null

Title, for networks that have one (YouTube, Pinterest, blogs).

posts.optionsobject | null

Network settings for this variation, as set by options on create or update.

Example:
{
  "type": "post"
}
posts.creativesobject[]

Attached media, in order.

Show child attributesHide child attributes
posts.creatives.idstring
Example:"cm2d687bf000q5h5vct2hdmyg"
posts.creatives.positioninteger

Order of the media in the post, from 0.

Example:0
posts.creatives.imagestring | null

Image URL, for an image.

Example:"https://cdn.ocoya.com/prod/creative/13a76677.jpeg"
posts.creatives.videostring | null

Video URL, for a video.

posts.creatives.thumbnailstring | null

Video thumbnail URL.

posts.boardIdsstring[]

Pinterest boards the post goes to.

Example:[]
socialProfilesobject[]

Social profiles the post publishes to.

Show child attributesHide child attributes
socialProfiles.socialProfileobject
Show child attributesHide child attributes
socialProfiles.socialProfile.idstring
Example:"clh49poxf008x8kov4ncbjty9"
socialProfiles.socialProfile.providerstring
Example:"instagram"
socialProfiles.socialProfile.namestring | null
Example:"Ocoya"
socialProfiles.socialProfile.imagestring | null
socialProfiles.socialProfile.socialAccountobject | null
Show child attributesHide child attributes
socialProfiles.socialProfile.socialAccount.optionsobject | null