Social
Publish or schedule a post
Needs social:post and a full grant on every account, at most one account per network. Without scheduled_for the post goes out within about a minute; the outcome arrives as social.post_published or social.post_failed and in GET. Posts to X use X API credits (3, or 40 with a link) from the plan allowance, then from the prepaid balance. Reuse idempotency_key when retrying.
POST
/
api
/
v1
/
social-posts
Publish or schedule a post
curl --request POST \
--url https://agent-loadout.com/api/v1/social-posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_ids": [
"<string>"
],
"content": "<string>",
"media_urls": [
"<string>"
],
"scheduled_for": "2023-11-07T05:31:56Z",
"overrides": [
{
"account_id": "<string>",
"content": "<string>",
"options": {}
}
],
"idempotency_key": "<string>"
}
'import requests
url = "https://agent-loadout.com/api/v1/social-posts"
payload = {
"account_ids": ["<string>"],
"content": "<string>",
"media_urls": ["<string>"],
"scheduled_for": "2023-11-07T05:31:56Z",
"overrides": [
{
"account_id": "<string>",
"content": "<string>",
"options": {}
}
],
"idempotency_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_ids: ['<string>'],
content: '<string>',
media_urls: ['<string>'],
scheduled_for: '2023-11-07T05:31:56Z',
overrides: [{account_id: '<string>', content: '<string>', options: {}}],
idempotency_key: '<string>'
})
};
fetch('https://agent-loadout.com/api/v1/social-posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-loadout.com/api/v1/social-posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_ids' => [
'<string>'
],
'content' => '<string>',
'media_urls' => [
'<string>'
],
'scheduled_for' => '2023-11-07T05:31:56Z',
'overrides' => [
[
'account_id' => '<string>',
'content' => '<string>',
'options' => [
]
]
],
'idempotency_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-loadout.com/api/v1/social-posts"
payload := strings.NewReader("{\n \"account_ids\": [\n \"<string>\"\n ],\n \"content\": \"<string>\",\n \"media_urls\": [\n \"<string>\"\n ],\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"overrides\": [\n {\n \"account_id\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": {}\n }\n ],\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agent-loadout.com/api/v1/social-posts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_ids\": [\n \"<string>\"\n ],\n \"content\": \"<string>\",\n \"media_urls\": [\n \"<string>\"\n ],\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"overrides\": [\n {\n \"account_id\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": {}\n }\n ],\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-loadout.com/api/v1/social-posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_ids\": [\n \"<string>\"\n ],\n \"content\": \"<string>\",\n \"media_urls\": [\n \"<string>\"\n ],\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"overrides\": [\n {\n \"account_id\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": {}\n }\n ],\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"post": {
"id": "<string>",
"account_ids": [
"<string>"
],
"content": "<string>",
"media_urls": [
"<string>"
],
"status": "scheduled",
"scheduled_for": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"targets": [
{
"account_id": "<string>",
"platform": "<string>",
"status": "<string>",
"url": "<string>",
"post_id": "<string>",
"error": "<string>",
"published_at": "<string>",
"metrics": {
"impressions": 0,
"reach": 0,
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"clicks": 0,
"views": 0,
"engagements": 0,
"engagement_rate": 123,
"extra": {},
"updated_at": "2023-11-07T05:31:56Z"
}
}
],
"last_error": "<string>",
"agent_id": "<string>",
"cancel_requested": true,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}Authorizations
agentTokenorganizationKey
Body
application/json
⌘I
Publish or schedule a post
curl --request POST \
--url https://agent-loadout.com/api/v1/social-posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_ids": [
"<string>"
],
"content": "<string>",
"media_urls": [
"<string>"
],
"scheduled_for": "2023-11-07T05:31:56Z",
"overrides": [
{
"account_id": "<string>",
"content": "<string>",
"options": {}
}
],
"idempotency_key": "<string>"
}
'import requests
url = "https://agent-loadout.com/api/v1/social-posts"
payload = {
"account_ids": ["<string>"],
"content": "<string>",
"media_urls": ["<string>"],
"scheduled_for": "2023-11-07T05:31:56Z",
"overrides": [
{
"account_id": "<string>",
"content": "<string>",
"options": {}
}
],
"idempotency_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_ids: ['<string>'],
content: '<string>',
media_urls: ['<string>'],
scheduled_for: '2023-11-07T05:31:56Z',
overrides: [{account_id: '<string>', content: '<string>', options: {}}],
idempotency_key: '<string>'
})
};
fetch('https://agent-loadout.com/api/v1/social-posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-loadout.com/api/v1/social-posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_ids' => [
'<string>'
],
'content' => '<string>',
'media_urls' => [
'<string>'
],
'scheduled_for' => '2023-11-07T05:31:56Z',
'overrides' => [
[
'account_id' => '<string>',
'content' => '<string>',
'options' => [
]
]
],
'idempotency_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-loadout.com/api/v1/social-posts"
payload := strings.NewReader("{\n \"account_ids\": [\n \"<string>\"\n ],\n \"content\": \"<string>\",\n \"media_urls\": [\n \"<string>\"\n ],\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"overrides\": [\n {\n \"account_id\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": {}\n }\n ],\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agent-loadout.com/api/v1/social-posts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_ids\": [\n \"<string>\"\n ],\n \"content\": \"<string>\",\n \"media_urls\": [\n \"<string>\"\n ],\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"overrides\": [\n {\n \"account_id\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": {}\n }\n ],\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-loadout.com/api/v1/social-posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_ids\": [\n \"<string>\"\n ],\n \"content\": \"<string>\",\n \"media_urls\": [\n \"<string>\"\n ],\n \"scheduled_for\": \"2023-11-07T05:31:56Z\",\n \"overrides\": [\n {\n \"account_id\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": {}\n }\n ],\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"post": {
"id": "<string>",
"account_ids": [
"<string>"
],
"content": "<string>",
"media_urls": [
"<string>"
],
"status": "scheduled",
"scheduled_for": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"targets": [
{
"account_id": "<string>",
"platform": "<string>",
"status": "<string>",
"url": "<string>",
"post_id": "<string>",
"error": "<string>",
"published_at": "<string>",
"metrics": {
"impressions": 0,
"reach": 0,
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"clicks": 0,
"views": 0,
"engagements": 0,
"engagement_rate": 123,
"extra": {},
"updated_at": "2023-11-07T05:31:56Z"
}
}
],
"last_error": "<string>",
"agent_id": "<string>",
"cancel_requested": true,
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}