Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X DELETE "https://postsyncer.com/api/v1/posts/123" \ -H "Authorization: Bearer YOUR_API_TOKEN"
{ "message": "Post deleted successfully" }
Delete a post and cancel any scheduled publishing
const axios = require('axios'); const deletePost = async (postId) => { try { const response = await axios.delete(`https://postsyncer.com/api/v1/posts/${postId}`, { headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' } }); console.log('Post deleted:', response.data.message); } catch (error) { console.error('Error deleting post:', error.response?.data || error.message); } }; deletePost(123);
<?php $postId = 123; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://postsyncer.com/api/v1/posts/{$postId}"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); 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) { $result = json_decode($response, true); echo $result['message']; } else { echo "Error: " . $response; } ?>
import requests post_id = 123 headers = { 'Authorization': 'Bearer YOUR_API_TOKEN' } response = requests.delete( f'https://postsyncer.com/api/v1/posts/{post_id}', headers=headers ) if response.status_code == 200: result = response.json() print(result['message']) else: print(f"Error: {response.status_code}") print(response.text)
Was this page helpful?