1# A. Create an ordinary draft post.
2curl --location 'https://api.nonli.com/v2.1/posts/bulk' \
3 --header 'Content-Type: application/json' \
4 --header 'Authorization: Bearer YOUR_API_TOKEN' \
5 --data '{
6 "post": [{
7 "brandId": 1,
8 "postType": "text",
9 "message": "Hello from the Nonli API",
10 "status": "draft",
11 "socialAccount": {
12 "externalId": "SOCIAL_ACCOUNT_ACCOUNT_ID",
13 "type": "facebook"
14 }
15 }]
16 }'
17
18# B. Build a three-segment thread.
19# 1. Create the root with the shortlink mapping.
20curl --location 'https://api.nonli.com/v2.1/posts/bulk' \
21 --header 'Content-Type: application/json' \
22 --header 'Authorization: Bearer YOUR_API_TOKEN' \
23 --data '{
24 "post": [
25 {
26 "brandId": 1,
27 "postType": "text",
28 "message": "The opening segment",
29 "status": "review",
30 "shortlink": { "mappingId": "SHORTLINK_MAPPING_ID" },
31 "socialAccount": {
32 "externalId": "SOCIAL_ACCOUNT_ACCOUNT_ID",
33 "type": "threads"
34 },
35 "thread": { "activated": true }
36 }
37 ]
38 }'
39
40# Save the returned id as ROOT_POST_ID and its shortDomain/shortId values.
41# 2. Create the middle segment. The first child's parent is also the origin.
42curl --location 'https://api.nonli.com/v2.1/posts/bulk' \
43 --header 'Content-Type: application/json' \
44 --header 'Authorization: Bearer YOUR_API_TOKEN' \
45 --data '{
46 "post": [{
47 "brandId": 1,
48 "postType": "text",
49 "message": "The middle segment",
50 "status": "review",
51 "socialAccount": { "externalId": "SOCIAL_ACCOUNT_ACCOUNT_ID", "type": "threads" },
52 "thread": {
53 "activated": true,
54 "isChild": true,
55 "parent": "ROOT_POST_ID",
56 "origin": "ROOT_POST_ID"
57 }
58 }]
59 }'
60
61# Save the returned id as MIDDLE_POST_ID.
62# Verify that the root lists the first child before continuing.
63curl --location 'https://api.nonli.com/v2.1/posts?filters=id:ROOT_POST_ID&fields=id,thread' \
64 --header 'Authorization: Bearer YOUR_API_TOKEN'
65
66# 3. Create the final segment without the URL. Its parent is the middle segment.
67curl --location 'https://api.nonli.com/v2.1/posts/bulk' \
68 --header 'Content-Type: application/json' \
69 --header 'Authorization: Bearer YOUR_API_TOKEN' \
70 --data '{
71 "post": [{
72 "brandId": 1,
73 "postType": "text",
74 "message": "Read the complete story:",
75 "status": "review",
76 "socialAccount": { "externalId": "SOCIAL_ACCOUNT_ACCOUNT_ID", "type": "threads" },
77 "thread": {
78 "activated": true,
79 "isChild": true,
80 "parent": "MIDDLE_POST_ID",
81 "origin": "ROOT_POST_ID"
82 }
83 }]
84 }'
85
86# Save the returned id as FINAL_POST_ID and verify the complete child order.
87curl --location 'https://api.nonli.com/v2.1/posts?filters=id:ROOT_POST_ID&fields=id,thread' \
88 --header 'Authorization: Bearer YOUR_API_TOKEN'
89
90# Then add the resolved root URL to the final segment.
91curl --request PUT --location 'https://api.nonli.com/v2.1/posts/bulk' \
92 --header 'Content-Type: application/json' \
93 --header 'Authorization: Bearer YOUR_API_TOKEN' \
94 --data '{
95 "post": [{
96 "id": "FINAL_POST_ID",
97 "message": "Read the complete story: https://ROOT_SHORT_DOMAIN/ROOT_SHORT_ID"
98 }]
99 }'
100
101# 4. Read back the root and final segment. Verify the ordered root thread.children
102# list and the final resolved URL before publication. This GET returns the usual
103# paginated { "total": ..., "rows": [...] } search response.
104curl --location 'https://api.nonli.com/v2.1/posts?filtersOr=id:ROOT_POST_ID,FINAL_POST_ID&fields=id,author,userId,status,postType,message,shortDomain,shortId,thread' \
105 --header 'Authorization: Bearer YOUR_API_TOKEN'
6.Social accounts
5 endpointsRead connected social accounts and quota data required before creating or scheduling posts.
/social-accountsBearer required6.1.Search social accounts
Return social accounts available to the authenticated company and user.
Query parameters
sizeint50pageint0qstringqfstringsortstringfiltersstringfiltersOrstringexcludesstringfieldsstringexistsstringembedstringResponse fields
totalintrowsSocialAccount[]idintaccountIdstringnamestringtypestringbrandIdintstatusstringExample
/social-accounts/:socialAccountIdBearer required6.2.Get a social account
Return one connected social account with publishing metadata.
Query parameters
fieldsstringResponse fields
idintaccountIdstringnamestringtypestringbrandIdintExample
/social-accounts/publishing-quotaBearer required6.3.Get publishing quota
Return publishing quota information for selected social accounts before scheduling posts.
Query parameters
socialAccountsstringResponse fields
quotaobjectusageobjectExample
/social-accounts/youtube/playlistsBearer required6.4.Get YouTube playlists
Return YouTube playlists for connected YouTube social accounts.
Query parameters
sizeint20 or endpoint-specificpageint0qstringqfstringsortstringfiltersstringfiltersOrstringexcludesstringfieldsstringexistsstringResponse fields
totalintrowsobject[]Example
/social-accounts/pinterest/boardsBearer required6.5.Get Pinterest boards
Return Pinterest boards for connected Pinterest social accounts.
Query parameters
sizeint20 or endpoint-specificpageint0qstringqfstringsortstringfiltersstringfiltersOrstringexcludesstringfieldsstringexistsstringResponse fields
totalintrowsobject[]Example