Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.
Request post approval
Asks members of the post's brand to approve it before it goes out, exactly as Request approval in the Ocoya editor: the post becomes PENDING_INTERNAL_APPROVAL (Pending approval), each approver gets the approval email with Approve and Reject buttons and a notification in Ocoya, and they answer in Ocoya. Approved, the post goes out at scheduledAt (or stays a draft without one); rejected, it goes back to draft; still waiting when its time comes, it goes back to draft instead of going out. The API key's user is the one asking. Approving and rejecting are done by the approvers in Ocoya, not through the API.
curl --request POST \
--url https://www.app.ocoya.com/api/_public/v1/post/{postId}/approval \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"approvers": [
"jane@example.com"
],
"scheduledAt": "2024-01-01T00:00:00Z"
}
'{
"postGroupId": "cmajvvb9q0003ja5vh0538j6r",
"brandId": "cmayvq3hk00017apshay5qezu",
"status": "PENDING_INTERNAL_APPROVAL",
"scheduledAt": "2024-01-01T00:00:00Z",
"state": "pending",
"requestedBy": {
"id": "clh49n2u300008kovd2wq1p8z",
"name": "Ocoya"
},
"requestedAt": "2024-01-01T00:00:00Z",
"approvers": [
{
"id": "clh49n2u300008kovd2wq1p8z",
"email": "jane@example.com",
"name": "Jane",
"role": "ADMIN"
}
],
"answeredBy": null,
"answeredAt": null,
"comments": [
{
"id": "<string>",
"text": "Can we use the blue photo instead?",
"kind": "comment",
"parentId": "<string>",
"author": {
"id": "clh49n2u300008kovd2wq1p8z",
"name": "Aivaras",
"email": "jane@example.com"
},
"createdAt": "2024-01-01T00:00:00Z"
}
],
"asked": [
"jane@example.com"
]
}Authorizations
Body
Email addresses of the brand members who should approve the post. Everyone named must be a member of the post's brand, or nothing changes. People already asked are not asked again.
Response
Asked. The approval as GET /post/{postId}/approval returns it, plus asked: the emails newly asked by this call.
When it goes out once approved, or null: approved without a time, it stays a draft.
pending - waiting on approvers. approved - approved: scheduled for scheduledAt if that is still to come, else a draft. rejected - rejected: back to draft. cancelled - the request was taken back. none - never sent for approval.
Who it waits on, while pending. Any one of them approving or rejecting answers for all.
The post's comments, oldest first (the last 50): what approvers wrote, and Ocoya's status lines.
Was this page helpful?