curl -X DELETE "https://api.hooked.ai/v1/integration/int_yt_abc123" \ -H "x-api-key: your_api_key_here"
{ "success": true, "message": "Integration disconnected successfully", "data": { "id": "int_yt_abc123", "type": "youtube", "deleted": true } }
Remove a connected social media platform
DELETE /v1/integration/{integrationId}
Show Data Object
true
pending
failed
async function disconnectSafely(integrationId) { // 1. Get all pending posts for this integration const postsResponse = await fetch( `https://api.hooked.ai/v1/schedule/list?status=pending`, { headers: { 'x-api-key': process.env.HOOKED_API_KEY } } ); const { data: { scheduledPosts } } = await postsResponse.json(); // 2. Filter posts for this integration const affectedPosts = scheduledPosts.filter( post => post.integration.id === integrationId ); if (affectedPosts.length > 0) { console.log(`Warning: ${affectedPosts.length} pending posts will fail`); // Optional: Cancel them first for (const post of affectedPosts) { await fetch(`https://api.hooked.ai/v1/schedule/${post.id}`, { method: 'DELETE', headers: { 'x-api-key': process.env.HOOKED_API_KEY } }); } } // 3. Disconnect the integration const response = await fetch( `https://api.hooked.ai/v1/integration/${integrationId}`, { method: 'DELETE', headers: { 'x-api-key': process.env.HOOKED_API_KEY } } ); return await response.json(); }
Integration ID
Integration disconnected successfully