Enqueue latest post
Enqueue LinkedIn profiles for latest post enrichment.
https://api.up2data.ai/api/open-refresh/latest-postEnqueue LinkedIn profiles for latest post enrichment: what did this person publish most recently? Send the same profile URLs or LinkedIn slugs you would send to profiles-bulk, and get back one Post record per profile holding a single item - the commentary, the date, and whether it was their own writing or a repost.
Use profiles-activity instead for the full history of posts, comments and reactions rather than the newest item, or profiles-posts for that history for posts alone.
Ensure you have sufficient credits before making requests - see the credit pill above.
Your profiles array is normalized and de-duplicated before anything is charged, so you pay for enqueued, not for what you sent. skipped reports what was removed and why. If nothing survives filtering, you get a 400 and no queue is created.
A latest-post queue's results belong to the queue itself. Read them back with queues-list or wait for the webhook callback, and see Post for the shape.
#Request
| Field | Type | Notes |
|---|---|---|
profilesrequired | string[] | LinkedIn profile URLs or bare slugs. |
name | string | Optional. |
priority | number | Optional, 1 = High, 2 = Normal, 3 = Low, defaults to 2. |
webhookTags | string[] | Optional, defaults to every webhook on the team. Send [] to switch callbacks off - see the Webhooks guide. |
#Call it
curl -X POST "https://api.up2data.ai/api/open-refresh/latest-post" \
-H "Authorization: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Q1 Leads Latest Post",
"profiles": [
"https://www.linkedin.com/in/johndoe",
"https://www.linkedin.com/in/janedoe",
"johndoe123"
],
"priority": 2
}'import requests
url = "https://api.up2data.ai/api/open-refresh/latest-post"
headers = {
"Authorization": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
}
payload = {
"name": "Q1 Leads Latest Post",
"profiles": [
"https://www.linkedin.com/in/johndoe",
"https://www.linkedin.com/in/janedoe",
"johndoe123"
],
"priority": 2
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())const url = "https://api.up2data.ai/api/open-refresh/latest-post";
const headers = {
"Authorization": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
};
const body = {
"name": "Q1 Leads Latest Post",
"profiles": [
"https://www.linkedin.com/in/johndoe",
"https://www.linkedin.com/in/janedoe",
"johndoe123"
],
"priority": 2
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.up2data.ai/api/open-refresh/latest-post"
body := bytes.NewBufferString(`{
"name": "Q1 Leads Latest Post",
"profiles": [
"https://www.linkedin.com/in/johndoe",
"https://www.linkedin.com/in/janedoe",
"johndoe123"
],
"priority": 2
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "YOUR_ACCESS_TOKEN")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}#Response
{
"message": "3 latest post items have been enqueued (15 credits).",
"queueId": "507f1f77bcf86cd799439011",
"enqueued": 3,
"skipped": {
"invalid": 0,
"duplicates": 0
},
"webhooks": [
{
"_id": "6512c1a4f1b2c3d4e5f60789",
"name": "Production",
"url": "https://api.example.com/hooks/up2data"
}
]
}{
"message": "No valid profiles to enqueue: of 4 submitted, 1 were invalid and 3 were duplicates."
}#Webhook payload
{
"queueId": "507f1f77bcf86cd799439011",
"name": "Q1 Leads Latest Post",
"url": "https://www.linkedin.com/in/johndoe",
"type": "LatestPost",
"status": 200,
"_id": "8f14e45fceea167a5a36dedd4bea2548",
"result": { ... }
}#Errors
| Status | Type | When |
|---|---|---|
| 400 | No valid profiles to enqueue | Every entry in profiles was invalid or a duplicate after normalization, so no queue was created. |
| 400 | No webhook matches webhookTags | One or more webhookTags do not match any webhook on the team. |
See the Errors guide for every error type this version can return.