curl -X GET "https://postsyncer.com/api/v1/snippets?workspace_id=12" \
-H "Authorization: Bearer YOUR_API_TOKEN"
[
{
"id": 31,
"workspace_id": 12,
"kind": "hashtags",
"name": "Launch tags",
"body": "#launch #buildinpublic #saas",
"created_by": 7,
"created_at": "2026-11-17T09:12:44+00:00",
"updated_at": "2026-11-17T09:12:44+00:00"
},
{
"id": 32,
"workspace_id": 12,
"kind": "snippet",
"name": "Sign-off",
"body": "Thanks for reading! New posts every Tuesday.",
"created_by": 7,
"created_at": "2026-11-17T09:14:02+00:00",
"updated_at": "2026-11-17T09:14:02+00:00"
}
]
Snippets
List Snippets
Retrieve the saved snippets and hashtag groups of your workspaces
GET
snippets
curl -X GET "https://postsyncer.com/api/v1/snippets?workspace_id=12" \
-H "Authorization: Bearer YOUR_API_TOKEN"
[
{
"id": 31,
"workspace_id": 12,
"kind": "hashtags",
"name": "Launch tags",
"body": "#launch #buildinpublic #saas",
"created_by": 7,
"created_at": "2026-11-17T09:12:44+00:00",
"updated_at": "2026-11-17T09:12:44+00:00"
},
{
"id": 32,
"workspace_id": 12,
"kind": "snippet",
"name": "Sign-off",
"body": "Thanks for reading! New posts every Tuesday.",
"created_by": 7,
"created_at": "2026-11-17T09:14:02+00:00",
"updated_at": "2026-11-17T09:14:02+00:00"
}
]
List Snippets
Retrieves the saved snippets and hashtag groups of the workspaces the authenticated user has access to, ordered bykind, then name.
Request
curl -X GET "https://postsyncer.com/api/v1/snippets?workspace_id=12" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Response
An array of snippet objects.[
{
"id": 31,
"workspace_id": 12,
"kind": "hashtags",
"name": "Launch tags",
"body": "#launch #buildinpublic #saas",
"created_by": 7,
"created_at": "2026-11-17T09:12:44+00:00",
"updated_at": "2026-11-17T09:12:44+00:00"
},
{
"id": 32,
"workspace_id": 12,
"kind": "snippet",
"name": "Sign-off",
"body": "Thanks for reading! New posts every Tuesday.",
"created_by": 7,
"created_at": "2026-11-17T09:14:02+00:00",
"updated_at": "2026-11-17T09:14:02+00:00"
}
]
Code Examples
curl -X GET "https://postsyncer.com/api/v1/snippets?kind=hashtags" \
-H "Authorization: Bearer YOUR_API_TOKEN"
const axios = require('axios');
const getSnippets = async () => {
try {
const response = await axios.get('https://postsyncer.com/api/v1/snippets', {
params: { kind: 'hashtags' },
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
});
console.log('Snippets:', response.data);
return response.data;
} catch (error) {
console.error('Error fetching snippets:', error.response?.data || error.message);
}
};
getSnippets();
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://postsyncer.com/api/v1/snippets?kind=hashtags');
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_TOKEN'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$snippets = json_decode($response, true);
echo "Found " . count($snippets) . " snippets";
} else {
echo "Error: " . $response;
}
?>
import requests
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.get(
'https://postsyncer.com/api/v1/snippets',
params={'kind': 'hashtags'},
headers=headers
)
if response.status_code == 200:
snippets = response.json()
print(f"Found {len(snippets)} snippets")
for snippet in snippets:
print(f"{snippet['name']}: {snippet['body']}")
else:
print(f"Error: {response.status_code}")
print(response.text)
Error Codes
Was this page helpful?