Create Post
curl --request POST \
--url https://api.aisa.one/apis/v1/unipile/linkedin/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'account_id=<string>' \
--form 'text=<string>' \
--form video_thumbnail=@example-fileimport requests
url = "https://api.aisa.one/apis/v1/unipile/linkedin/posts"
files = { "video_thumbnail": ("example-file", open("example-file", "rb")) }
payload = {
"account_id": "<string>",
"text": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('account_id', '<string>');
form.append('text', '<string>');
form.append('video_thumbnail', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.aisa.one/apis/v1/unipile/linkedin/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://api.aisa.one/apis/v1/unipile/linkedin/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://api.aisa.one/apis/v1/unipile/linkedin/posts"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/unipile/linkedin/posts")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/unipile/linkedin/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"object": "PostCreated",
"post_id": "<string>"
}Posts
Create Post
Publish a post from the connected LinkedIn account.
POST
https://api.aisa.one
/
apis
/
v1
/
unipile
/
linkedin
/
posts
Create Post
curl --request POST \
--url https://api.aisa.one/apis/v1/unipile/linkedin/posts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'account_id=<string>' \
--form 'text=<string>' \
--form video_thumbnail=@example-fileimport requests
url = "https://api.aisa.one/apis/v1/unipile/linkedin/posts"
files = { "video_thumbnail": ("example-file", open("example-file", "rb")) }
payload = {
"account_id": "<string>",
"text": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('account_id', '<string>');
form.append('text', '<string>');
form.append('video_thumbnail', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.aisa.one/apis/v1/unipile/linkedin/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://api.aisa.one/apis/v1/unipile/linkedin/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://api.aisa.one/apis/v1/unipile/linkedin/posts"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/unipile/linkedin/posts")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/unipile/linkedin/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"account_id\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"video_thumbnail\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"object": "PostCreated",
"post_id": "<string>"
}Publishes a post as the connected account. Write action, and the result is publicly visible on LinkedIn, so treat it as irreversible. The request must be
Path parameters and required query parameters are documented in the operation reference.
multipart/form-data: a JSON body is rejected while upstream parses attachments. Add an image with -F "attachments=@image.jpg", mention someone by putting {{0}} in the text and passing mentions[0][profile_id] / mentions[0][name], or post on behalf of a company you administer by passing as_organization with the company id.
See Pricing for current prices. Where supported, get a quote for your request.
Example
curl -X POST "https://api.aisa.one/apis/v1/unipile/linkedin/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "account_id=YOUR_ACCOUNT_ID" \
-F "text=Shipping a new integration today."
Request contract
- Method and path: POST /apis/v1/unipile/linkedin/posts
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/unipile/linkedin/posts
{
"operationId": "post_unipile_linkedin_create_post",
"method": "POST",
"path": "/apis/v1/unipile/linkedin/posts",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"properties": {
"account_id": {
"description": "The id of the account to perform the request from.",
"minLength": 1,
"type": "string"
},
"as_organization": {
"description": "`Linkedin only` Provide the ID of an organization over which you have control to perform the action on its behalf.",
"minLength": 1,
"type": "string"
},
"attachments": {
"description": "On `linkedin`, image file resolution is limited to 6012px x 6012px max.",
"items": {
"format": "binary",
"type": "string"
},
"type": "array"
},
"external_link": {
"description": "`Linkedin only` An external link that should be displayed within a preview card. The URL must also be included in the post textual content. Otherwise, it will be automatically added at the end.",
"pattern": "^https?://",
"type": "string"
},
"include_job_posting": {
"description": "`Linkedin only` The ID of a job posting that should be displayed within a preview card.",
"type": "string"
},
"location": {
"description": "`Instagram only`: The location to tag in the post. The best match for the query is used, and a query matching no place leaves the post untagged. On a story, the location is also drawn on the media as a tappable sticker.",
"type": "string"
},
"mentions": {
"description": "`Linkedin only`",
"items": {
"properties": {
"is_company": {
"type": "boolean"
},
"name": {
"description": "The name of the user as it will be displayed in your message.",
"type": "string"
},
"profile_id": {
"description": "The provider ID of the user, which begins with ACo/ADo for individuals and is a series of digits for companies.",
"type": "string"
}
},
"required": [
"name",
"profile_id"
],
"type": "object"
},
"type": "array"
},
"post_type": {
"anyOf": [
{
"enum": [
"feed"
],
"type": "string"
},
{
"enum": [
"story"
],
"type": "string"
},
{
"enum": [
""
],
"type": "string"
}
],
"description": "`Instagram only`: Publish as a regular feed post or as a story. Defaults to `feed` when omitted or empty."
},
"repost": {
"description": "The id of an existing LinkedIn post to publish as repost. For a simple repost without commentary, `text` should be an empty string.",
"type": "string"
},
"targeted_audience": {
"description": "`Linkedin only` A set of filters to adjust the target audience of your posts.",
"properties": {
"headcount": {
"description": "Linkedin native filter : COMPANY SIZE.",
"items": {
"properties": {
"max": {
"enum": [
1,
10,
50,
200,
500,
1000,
5000,
10000
],
"type": "number"
},
"min": {
"enum": [
2,
11,
51,
201,
501,
1001,
5001,
10001
],
"type": "number"
}
},
"type": "object"
},
"type": "array"
},
"industry": {
"description": "The ID of the parameter. Use type INDUSTRY on the List search parameters route to find out the right ID.\nLinkedin native filter : INDUSTRY.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"job_function": {
"description": "The ID of the parameter. Use type POST_JOB_FUNCTION on the List search parameters route to find out the right ID.\nLinkedin native filter : JOB FUNCTION.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"language": {
"description": "The ID of the parameter. Use type LANGUAGE on the List search parameters route to find out the right ID.\nLinkedin native filter : LANGUAGE.",
"items": {
"pattern": "^[a-z]+_[A-Z]+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"location": {
"description": "The ID of the parameter. Use type LOCATION on the List search parameters route to find out the right ID.\nLinkedin native filter : LOCATION.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"region": {
"description": "The ID of the parameter. Use type REGION on the List search parameters route to find out the right ID.\nLinkedin native filter : REGION.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"school": {
"description": "The ID of the parameter. Use type SCHOOL on the List search parameters route to find out the right ID.\nLinkedin native filter : UNIVERSITY.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"seniority": {
"description": "The ID of the parameter. Use type SENIORITY on the List search parameters route to find out the right ID.\nLinkedin native filter : SENIORITY.",
"items": {
"pattern": "^\\d+$",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"type": "object"
},
"text": {
"description": "`Linkedin`: You can add a mention by inserting the index of the corresponding entry from the mentions array between two double braces. Example: Hey {{0}}, check this out ! <br> `Instagram`: To mention a user, use the @ symbol followed by their username. On a story, each mention is drawn on the media as a tappable `@username` sticker and the user is notified; the surrounding text is not displayed. A username that matches no account is left as plain text. Up to 10 mentions per story.",
"type": "string"
},
"video_thumbnail": {
"format": "binary",
"type": "string"
}
},
"required": [
"account_id",
"text"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Published reference price: $0.02 USD per successful request. Your account price may differ; use a request quote where supported.Authorizations
Body
multipart/form-data
Linkedin: You can add a mention by inserting the index of the corresponding entry from the mentions array between two double braces. Example: Hey {{0}}, check this out !
Instagram: To mention a user, use the @ symbol followed by their username. On a story, each mention is drawn on the media as a tappable @username sticker and the user is notified; the surrounding text is not displayed. A username that matches no account is left as plain text. Up to 10 mentions per story.