Symptom: All requests return 401 status.Common causes:
Missing Authorization header
Typo in token (extra spaces, newlines)
Expired or revoked token
Missing Bearer prefix
Solutions:
// Check your header formatconst headers = { 'Authorization': `Bearer ${process.env.INBOX_API_TOKEN}`, // Note the space after Bearer 'Content-Type': 'application/json'};// Verify token is loadedif (!process.env.INBOX_API_TOKEN) { throw new Error('INBOX_API_TOKEN environment variable not set');}// Test with a simple requestconst response = await fetch('https://inboxapp.com/api/v1/team', { headers });console.log('Status:', response.status);
Verification steps:
Print your token (first/last 4 chars only) to verify it’s loaded
Symptom:PROSPECT_NOT_FOUND when sending a message or looking up.Common causes:
Prospect has never interacted with your team
Wrong platform ID format
Prospect was deleted
Solutions:
// Verify prospect exists before operationsconst { data: prospect } = await client.get('/prospects/lookup', { params: { platformId: '1876543210987654321' }});if (!prospect) { console.log('Prospect not in system. They need to message you first,'); console.log('or you need to start a conversation via /threads endpoint.');}
Prospects are auto-created when they message you or when you create a thread with them. You cannot create prospects directly.
Symptom:ACCOUNT_LINK_NOT_FOUND when sending messages.Common causes:
Using platform ID instead of Inbox ID
Account was disconnected
Typo in account link ID
Solution:
// List your account links to get valid IDsconst { data: accountLinks } = await client.get('/account-links');console.log('Valid account link IDs:');accountLinks.forEach((a: any) => { console.log(` @${a.username}: ${a.id}`);});
Symptom:VALIDATION_ERROR when sending a message.Solution:
function validateMessage(text: string) { if (!text?.trim()) { throw new Error('Message cannot be empty'); } if (text.length > 10000) { throw new Error('Message exceeds 10,000 character limit'); }}// Always validate before sendingvalidateMessage(messageText);await client.post(`/threads/${threadId}/messages`, { text: messageText });
Symptom: Prospect profile data (followers, bio) seems outdated.Explanation: Prospect profile data is synced periodically from the platform, not in real-time.Solutions:
Profile data updates on each interaction
For critical decisions, fetch directly from X API
Don’t rely on real-time accuracy for follower counts