Skip to main content

SDKs & Client Libraries

PostBoost provides auto-generated client libraries for 9 languages, all generated from the OpenAPI spec using OpenAPI Generator.

Available SDKs

LanguagePackageGenerator
Pythonpostboostpython
PHPpostboost/php-sdkphp
Node.js / TypeScriptpostboosttypescript-node
Gopostboost-gogo
Rubypostboostruby
Javacom.postboost:postboost-java-sdkjava
C# / .NETPostBoost.Clientcsharp
Rustpostboostrust
Bash (CLI)postboost-clibash

Python

pip install postboost

List accounts

from postboost import ApiClient, Configuration
from postboost.api.accounts_api import AccountsApi

config = Configuration(access_token="YOUR_API_TOKEN")
with ApiClient(config) as client:
api = AccountsApi(client)
accounts = api.list_accounts(workspace_uuid="YOUR_WORKSPACE_UUID")
account_id = accounts.data[0].id
print(account_id)

Create a post

from postboost import ApiClient, Configuration
from postboost.api.posts_api import PostsApi
from postboost.models import PostInput, PostVersion, PostContent

config = Configuration(access_token="YOUR_API_TOKEN")
with ApiClient(config) as client:
api = PostsApi(client)
post = api.create_post(
workspace_uuid="YOUR_WORKSPACE_UUID",
post_input=PostInput(
accounts=[account_id],
versions=[PostVersion(
account_id=0,
is_original=True,
content=[PostContent(body="Hello from PostBoost Python SDK!")]
)],
schedule_now=True,
)
)
print(post.uuid)

PHP

composer require postboost/php-sdk

List accounts

use PostBoostClient\Api\AccountsApi;
use PostBoostClient\Configuration;

$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_API_TOKEN');
$httpClient = new GuzzleHttp\Client();

$accountsApi = new AccountsApi($httpClient, $config);
$accounts = $accountsApi->listAccounts($workspaceUuid);
$accountId = $accounts->getData()[0]->getId();

Create a post

use PostBoostClient\Api\PostsApi;
use PostBoostClient\Model\PostInput;
use PostBoostClient\Model\PostVersion;
use PostBoostClient\Model\PostContent;

$postsApi = new PostsApi($httpClient, $config);
$post = $postsApi->createPost($workspaceUuid, new PostInput([
'accounts' => [$accountId],
'versions' => [new PostVersion([
'account_id' => 0,
'is_original' => true,
'content' => [new PostContent(['body' => 'Hello from PostBoost PHP SDK!'])],
])],
'schedule_now' => true,
]));
echo $post->getUuid();

Node.js / TypeScript

npm install postboost

List accounts

import { AccountsApi, Configuration } from 'postboost';

const config = new Configuration({ accessToken: process.env.POSTBOOST_API_TOKEN });
const accountsApi = new AccountsApi(config);

const result = await accountsApi.listAccounts(workspaceUuid);
const accountId = result.body.data[0].id;

Create a post

import { PostsApi, PostInput, PostVersion, PostContent } from 'postboost';

const postsApi = new PostsApi(config);
const post = await postsApi.createPost(workspaceUuid, {
accounts: [accountId],
versions: [{ accountId: 0, isOriginal: true, content: [{ body: 'Hello from PostBoost Node.js SDK!' }] }],
scheduleNow: true,
});
console.log(post.body.uuid);

Go

go get github.com/postboost-co/postboost-go

List accounts

import postboost "github.com/postboost-co/postboost-go"

cfg := postboost.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+apiToken)
client := postboost.NewAPIClient(cfg)

accounts, _, err := client.AccountsAPI.ListAccounts(ctx, workspaceUuid).Execute()
accountID := accounts.Data[0].Id

Create a post

post, _, err := client.PostsAPI.CreatePost(ctx, workspaceUuid).
PostInput(postboost.PostInput{
Accounts: []int32{accountID},
Versions: []postboost.PostVersion{{
AccountId: postboost.PtrInt32(0),
IsOriginal: postboost.PtrBool(true),
Content: []postboost.PostContent{{Body: postboost.PtrString("Hello from PostBoost Go SDK!")}},
}},
ScheduleNow: postboost.PtrBool(true),
}).Execute()

Ruby

gem install postboost

List accounts

require 'postboost'

PostBoost.configure { |c| c.access_token = ENV['POSTBOOST_API_TOKEN'] }

accounts_api = PostBoost::AccountsApi.new
accounts = accounts_api.list_accounts(workspace_uuid)
account_id = accounts.data[0].id

Create a post

posts_api = PostBoost::PostsApi.new
post = posts_api.create_post(workspace_uuid, PostBoost::PostInput.new(
accounts: [account_id],
versions: [PostBoost::PostVersion.new(
account_id: 0,
is_original: true,
content: [PostBoost::PostContent.new(body: 'Hello from PostBoost Ruby SDK!')]
)],
schedule_now: true
))
puts post.uuid

Java

<!-- Maven — add GitHub Packages repository first -->
<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/postboost-co/postboost-java</url>
</repository>
</repositories>

<dependency>
<groupId>com.postboost</groupId>
<artifactId>postboost-java-sdk</artifactId>
<version>1.5.0</version>
</dependency>
GitHub Packages authentication required

GitHub Packages requires a Personal Access Token (PAT) to download Maven packages. Add this to ~/.m2/settings.xml:

<settings>
<servers>
<server>
<id>github</id>
<username>YOUR_GITHUB_USERNAME</username>
<password>YOUR_GITHUB_PAT</password>
</server>
</servers>
</settings>

Generate a PAT at GitHub → Settings → Developer settings → Personal access tokens with the read:packages scope.

List accounts

import com.postboost.api.AccountsApi;
import com.postboost.ApiClient;

ApiClient client = new ApiClient();
client.setBearerToken(apiToken);

AccountsApi accountsApi = new AccountsApi(client);
Integer accountId = accountsApi.listAccounts(workspaceUuid).getData().get(0).getId();

Create a post

import com.postboost.api.PostsApi;
import com.postboost.model.*;

PostsApi postsApi = new PostsApi(client);
Post post = postsApi.createPost(workspaceUuid, new PostInput()
.addAccountsItem(accountId)
.addVersionsItem(new PostVersion()
.accountId(0)
.isOriginal(true)
.addContentItem(new PostContent().body("Hello from PostBoost Java SDK!")))
.scheduleNow(true));
System.out.println(post.getUuid());

C# / .NET

dotnet add package PostBoost.Client

List accounts

using PostBoost.Client.Api;
using PostBoost.Client.Model;

var config = new Configuration { AccessToken = apiToken };

var accountsApi = new AccountsApi(config);
var accounts = await accountsApi.ListAccountsAsync(workspaceUuid);
var accountId = accounts.Data[0].Id;

Create a post

var postsApi = new PostsApi(config);
var post = await postsApi.CreatePostAsync(workspaceUuid, new PostInput(
accounts: new List<int> { accountId },
versions: new List<PostVersion> {
new PostVersion(accountId: 0, isOriginal: true,
content: new List<PostContent> { new PostContent(body: "Hello from PostBoost C# SDK!") })
},
scheduleNow: true
));
Console.WriteLine(post.Uuid);

Rust

[dependencies]
postboost = "1.5.0"

List accounts

use postboost::apis::accounts_api;
use postboost::apis::configuration::Configuration;

let mut config = Configuration::new();
config.bearer_access_token = Some(api_token.to_string());

let accounts = accounts_api::list_accounts(&config, &workspace_uuid).await?;
let account_id = accounts.data[0].id;

Create a post

use postboost::apis::posts_api;
use postboost::models::{PostInput, PostVersion, PostContent};

let post_input = PostInput {
accounts: Some(vec![account_id]),
versions: vec![PostVersion {
account_id: 0,
is_original: true,
content: vec![PostContent {
body: Some("Hello from PostBoost Rust SDK!".to_string()),
..Default::default()
}],
..Default::default()
}],
schedule_now: Some(true),
..Default::default()
};

let post = posts_api::create_post(&config, &workspace_uuid, post_input).await?;
println!("{}", post.uuid.unwrap());

Bash CLI

# Download latest release
curl -LO https://github.com/postboost-co/postboost-cli/releases/latest/download/postboost-cli.tar.gz
tar xzf postboost-cli.tar.gz

# Set token
export POSTBOOST_API_TOKEN="YOUR_API_TOKEN"

List accounts

./postboost-cli listAccounts --workspaceUuid "your-workspace-uuid"

Create a post

./postboost-cli createPost \
--workspaceUuid "your-workspace-uuid" \
--body '{"accounts":[42],"versions":[{"account_id":0,"is_original":true,"content":[{"body":"Hello from PostBoost CLI!"}]}],"schedule_now":true}'

Next steps

Generating SDKs yourself

All SDKs are generated from the OpenAPI spec. You can regenerate them at any time:

# Clone the PostBoost repo and install the generator
npm install @openapitools/openapi-generator-cli

# Generate all SDKs
make sdks

# Or a specific language
make sdk-python

Requires Java 11+.