Oktopost
Approvals

Workflow Items

List, submit, approve, reject, and remove posts, messages, and stories in approval workflows.

Workflow items are posts, messages, and advocacy stories that have been submitted for approval and are moving through your workflow steps. Use these endpoints to retrieve items pending approval, check their status in the workflow, approve or reject items, and manage content in your approval pipeline.

Workflow items stay in the approval queue until all workflow steps are complete. Once approved, posts are ready for publishing and messages become available for scheduling.

List Items

Retrieve the messages and posts in your workflows.

GET /v2/workflow-item

Parameters

Prop

Type

Example Request

curl -X GET "https://api.oktopost.com/v2/workflow-item" \
  -u ACCOUNT_ID:API_KEY

Example Response

{
	"Result": true,
	"Total": 1,
	"Items": [
		{
			"Id": "cwi000000000001",
			"CreatedBy": "00A000000000002",
			"Status": "pending",
			"StepId": "cws000000000001",
			"WorkflowId": "cwf000000000001",
			"MessageId": "005000000000001"
		}
	],
	"Authors": {
		"00A000000000002": {
            "Id": "00A000000000002",
            "Created": "2020-09-03 11:10:27",
            "Name": "John Doe",
            "Email": "john.doe@example.com"
        }
	},
	"Steps": {
		"cws000000000001": {
			"Id": "cws000000000001",
			"Created": "2020-09-03 11:28:48",
			"WorkflowId": "cwf000000000001",
			"Name": "Step 1",
			"MustBeApprovedByEveryone": false,
			"Approvers": [
				{
					"Id": "00A000000000001",
					"Created": "2020-09-03 11:28:48",
					"Name": "Jane Smith",
					"Email": "jane.smith@example.com"
				}
			]
		}
	}
}

Sending items to approval

Send a message or post to approval.

POST /v2/workflow-item

Parameters

Prop

Type

Example Request

curl -X POST "https://api.oktopost.com/v2/workflow-item" \
  -u ACCOUNT_ID:API_KEY \
  -d entityId=005000000000001 \
  -d workflowId=cwf000000000001

Example Response

{
	"Result": true,
	"Data": {
		"Id": "cwi000000000001",
		"CreatedBy": "00A000000000002",
		"Status": "pending",
		"StepId": "cws000000000001",
		"WorkflowId": "cwf000000000001",
		"MessageId": "005000000000001"
	}
}

Approving and rejecting items

Approve an item pending approval, or reject it to request revisions.

POST /v2/workflow-item/:entityId

Posts scheduled within the last hour are approved with near-past confirmation. Posts scheduled further in the past return an error.

Parameters

Prop

Type

Example Request

curl -X POST "https://api.oktopost.com/v2/workflow-item/005000000000001" \
  -u ACCOUNT_ID:API_KEY \
  -d note="Approved for publishing." \
  -d isApprove=1 \
  -d stepId=cws000000000001

Example Response

{
	"Result": true,
	"Data": {
		"Id": "cwi000000000001",
		"CreatedBy": "00A000000000002",
		"Status": "pending",
		"StepId": "cws000000000001",
		"WorkflowId": "cwf000000000001",
		"MessageId": "005000000000001"
	}
}

Example Error

If approval fails (for example, the post's scheduled time is too far in the past), the endpoint returns a JSON error:

{
	"Result": false,
	"Error": {
		"Code": "ap-0030",
		"Message": "Cannot approve a post scheduled in the distant past"
	}
}

Removing items from the workflow

Remove a post or message from the workflow and revert it to a draft.

DELETE /v2/workflow-item/:entityId

Parameters

Prop

Type

Example Request

curl -X DELETE "https://api.oktopost.com/v2/workflow-item/005000000000001" \
  -u ACCOUNT_ID:API_KEY

Example Response

{
	"Result": true
}