Posts
Create, schedule, and manage social media posts across your connected networks.
A social media post is content that has been scheduled or published to a specific social profile on a specific date and time. Posts are based on Messages, which are reusable content templates that can be scheduled multiple times across different profiles and dates. Use these endpoints to create posts from messages, schedule them for publication, retrieve post details and analytics, and manage your posting queue.
Get Post
Retrieve a single post by ID.
GET /v2/post/:postId
To include the post's postlogs, add postlogs=1. Postlogs is returned beside Post, not inside it. Each entry is a postlog object and includes RemoteId. This flag is only for Get Post. List Posts uses withPostlogs instead.
Parameters
Prop
Type
Example Request
curl -X GET "https://api.oktopost.com/v2/post/004000000000001" \
-u ACCOUNT_ID:API_KEYTo include postlogs:
curl -X GET "https://api.oktopost.com/v2/post/004000000000001?postlogs=1" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Post": {
"Id": "004000000000001",
"Created": "2015-12-07 23:47:30",
"Modified": "2015-12-08 12:55:11",
"Status": "inqueue",
"AccountId": "001000000000001",
"CreatedBy": "00A000000000001",
"ModifiedBy": "00A000000000001",
"Source": "API",
"ContentSource": "User",
"Queued": 1,
"CampaignId": "002000000000001",
"MessageId": "005000000000001",
"MessageChildId": "",
"MessageStatus": "default",
"Network": "Twitter",
"StartDateTime": "2015-12-08 00:00:00",
"Groups": "",
"GroupsCount": 0,
"TotalCount": 1,
"TargetGeo": "",
"UpdateStatus": 1,
"Flag": "discussion",
"Clicks": 0,
"Converts": 0,
"Comments": 0,
"NewComments": 0,
"Likes": 0,
"Utm": "",
"Credentials": "003-001000000000001-12345678"
}
}Get Post Stats
Retrieve a single post with updated stats.
GET /v2/post/:postId
To get updated stats per social post, add stats=1 to the query parameters.
Parameters
Prop
Type
Example Request
curl -X GET "https://api.oktopost.com/v2/post/004000000000001?stats=1" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Post": {
"Id": "004000000000001",
"Created": "2015-12-07 23:47:30",
"Modified": "2015-12-08 12:55:11",
"Status": "inqueue",
"AccountId": "001000000000001",
"CreatedBy": "00A000000000001",
"ModifiedBy": "00A000000000001",
"Source": "API",
"ContentSource": "User",
"Queued": 1,
"CampaignId": "002000000000001",
"MessageId": "005000000000001",
"MessageChildId": "",
"MessageStatus": "default",
"Network": "Twitter",
"StartDateTime": "2015-12-08 00:00:00",
"Groups": "",
"GroupsCount": 0,
"TotalCount": 1,
"TargetGeo": "",
"UpdateStatus": 1,
"Flag": "discussion",
"Clicks": 0,
"Converts": 0,
"Comments": 0,
"NewComments": 0,
"Likes": 0,
"Utm": "",
"Credentials": "003-001000000000001-12345678"
},
"Stats": {
"LinkClicks": 0,
"Conversions": 0,
"Comments": 0,
"Likes": 0,
"Shares": 0,
"ImpressionsAdded": 69
}
}List Posts
Retrieve the account's posts.
GET /v2/post
Use filtering and ordering to get the results you need. List Posts cannot filter by social profile. To filter by profile and date, use the Calendar credentials filter.
Parameters
Prop
Type
See Pagination for shared behavior.
Example Request
curl -X GET "https://api.oktopost.com/v2/post?campaignId=002000000000001" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true,
"Items": [
{
"Id": "004000000000001",
"Created": "2015-12-07 23:47:30",
"Modified": "2015-12-08 12:55:11",
"Status": "inqueue",
"AccountId": "001000000000001",
"CreatedBy": "00A000000000001",
"ModifiedBy": "00A000000000001",
"Source": "API",
"ContentSource": "User",
"Queued": 1,
"CampaignId": "002000000000001",
"MessageId": "005000000000001",
"MessageChildId": "",
"MessageStatus": "default",
"Network": "Twitter",
"StartDateTime": "2015-12-08 00:00:00",
"Groups": "",
"GroupsCount": 0,
"TotalCount": 1,
"TargetGeo": "",
"UpdateStatus": 1,
"Flag": "discussion",
"Clicks": 0,
"Converts": 0,
"Comments": 0,
"NewComments": 0,
"Likes": 0,
"Utm": "",
"Credentials": "003-001000000000001-12345678"
},
...
],
"Total": 22509
}Create Post
Schedule a message as a post on one or more social profiles.
POST /v2/post
On success, the response is similar to Get Post.
Parameters
Prop
Type
Example Request
curl -X POST "https://api.oktopost.com/v2/post" \
-u ACCOUNT_ID:API_KEY \
-d messageId=005000000000001 \
-d credentialIds=003-001000000000001-12345678 \
-d startDateTime=1401908598Update Post
Update a post that hasn't been published yet.
POST /v2/post/:postId
Posts can only be updated or deleted before they're published. Once a post has been sent to a social network, it cannot be modified or removed through the API.
To move a post to a different campaign, use the dedicated Change Campaign endpoint. The update endpoint does not support changing campaignId.
To clear audience targeting from a post, pass an empty targetingPresetId value. The workflowId parameter is only supported on post creation. If sent on update, it is ignored.
To attach, update, or remove a LinkedIn first comment, pass the nested firstComment object. See First Comment.
All parameters available on post creation can be updated as well. On success, both create and update return a response similar to Get Post.
Parameters
Prop
Type
The body accepts the same parameters as Create Post.
Example Request
curl -X POST "https://api.oktopost.com/v2/post/004000000000001" \
-u ACCOUNT_ID:API_KEY \
-d startDateTime=1435767841 \
-d messageId=005000000000001Delete Post
Delete a post that hasn't been published yet.
DELETE /v2/post/:postId
Parameters
Prop
Type
Example Request
curl -X DELETE "https://api.oktopost.com/v2/post/004000000000001" \
-u ACCOUNT_ID:API_KEYExample Response
{
"Result": true
}First Comment
A first comment is an optional LinkedIn comment scheduled to publish after its parent post succeeds. Create, update, and remove first comments through the Create Post and Update Post endpoints by passing a nested firstComment object. Get Post and List Posts include a FirstComment object only when a first comment exists.
First comments are only supported for LinkedIn posts.
First comments can only be created or modified before the post is published. Once a post has been sent to a social network, the first comment cannot be changed through the API.
Content is required: non-empty text and/or an image media ID.
Mentioning is currently not supported via this API.
Request Fields
Pass nested form fields using firstComment[...] encoding.
Prop
Type
On update, omitted fields keep their existing values. To remove the first comment entirely, send an empty value (firstComment=) or null (firstComment=null). Updating only startDateTime on a post syncs FirstComment.ScheduledAt to match.
Example Requests
Create a post with a first comment:
curl -X POST "https://api.oktopost.com/v2/post" \
-u ACCOUNT_ID:API_KEY \
-d messageId=005000000000001 \
-d credentialIds=003-001000000000001-12345678 \
-d startDateTime=1401908598 \
-d status=draft \
-d firstComment[text]=Created+through+Post+APIUpdate the first comment text (other fields are preserved):
curl -X POST "https://api.oktopost.com/v2/post/004000000000001" \
-u ACCOUNT_ID:API_KEY \
-d firstComment[text]=Updated+through+Post+APIAttach a pre-uploaded image:
curl -X POST "https://api.oktopost.com/v2/post/004000000000001" \
-u ACCOUNT_ID:API_KEY \
-d firstComment[text]=With+media \
-d firstComment[media]=026000000000001Remove a first comment:
curl -X POST "https://api.oktopost.com/v2/post/004000000000001" \
-u ACCOUNT_ID:API_KEY \
-d firstComment=Or clear it with an explicit null:
curl -X POST "https://api.oktopost.com/v2/post/004000000000001" \
-u ACCOUNT_ID:API_KEY \
-d firstComment=nullResponse Fields
Create, update, get, and list post responses include Post.FirstComment (or Items[].FirstComment on list) only when a first comment exists. When none is attached, the FirstComment key is omitted.
Prop
Type
Example Response
{
"Result": true,
"Post": {
"Id": "004000000000001",
"Network": "LinkedIn",
"Status": "draft",
"FirstComment": {
"Id": "0fc000000000001",
"Network": "LinkedIn",
"Status": "pending",
"ScheduledAt": 1401908598,
"Text": "Created through Post API",
"CampaignId": "002000000000001",
"Media": []
}
}
}When no first comment is attached, FirstComment is omitted from the post object:
{
"Result": true,
"Post": {
"Id": "004000000000001",
"Network": "LinkedIn",
"Status": "draft"
}
}Change Post Campaign
Move a post to a different campaign.
POST /v2/post/:postId/change-campaign
This is a separate operation from updating a post. It reassigns the post's campaign association, updates related analytics, and recalculates stats.
The request returns 400 if the post is in a workflow and the caller is not the current approver, or if the post status is RUNNING.
Posts with a RUNNING status (already published or live) cannot be moved to a different campaign.
If the post is part of a content-approval workflow, only the assigned approver for the post's current workflow step may perform this action.
Parameters
Prop
Type
Example Request
curl -X POST "https://api.oktopost.com/v2/post/004000000000001/change-campaign" \
-u ACCOUNT_ID:API_KEY \
-d campaignId=002000000000002Example Response
{
"Post": {
"Id": "004000000000001",
"Created": "2015-12-07 23:47:30",
"Modified": "2015-12-08 12:55:11",
"Status": "inqueue",
"AccountId": "001000000000001",
"CreatedBy": "00A000000000001",
"ModifiedBy": "00A000000000001",
"Source": "API",
"ContentSource": "User",
"Queued": 1,
"CampaignId": "002000000000002",
"MessageId": "005000000000001",
"MessageChildId": "",
"MessageStatus": "default",
"Network": "Twitter",
"StartDateTime": "2015-12-08 00:00:00",
"Groups": "",
"GroupsCount": 0,
"TotalCount": 1,
"TargetGeo": "",
"UpdateStatus": 1,
"Flag": "discussion",
"Clicks": 0,
"Converts": 0,
"Comments": 0,
"NewComments": 0,
"Likes": 0,
"Utm": "",
"Credentials": "003-001000000000001-12345678"
}
}Properties
Sources
Post sources represent the channel used to create each post. Sources are used in Oktopost to analyze performance by channel.
Prop
Type
Statuses
The following statuses represent the different states of each post. They can be used for filtering results or for creating and updating posts.
Prop
Type