Authentication
API keys, bearer tokens, and securing your requests.
All requests to the Linq Partner API require authentication via a bearer token in the Authorization header. The official SDKs handle authentication automatically.
Bearer token authentication
Section titled “Bearer token authentication”Include your API token in every request:
Authorization: Bearer YOUR_TOKENYour token determines:
- Which phone numbers you can send from
- Which data you can access (chats, messages, attachments)
- Your rate limits and daily message quotas
Getting your token
Section titled “Getting your token”Contact your Linq representative to provision a bearer token for your organization. Each token is scoped to a specific set of phone numbers and permissions.
Making authenticated requests
Section titled “Making authenticated requests”curl https://api.linqapp.com/api/partner/v3/chats \ -H "Authorization: Bearer $LINQ_API_KEY" \ -H "Content-Type: application/json"import LinqAPIV3 from '@linqapp/sdk';
const client = new LinqAPIV3({ apiKey: process.env.LINQ_API_KEY, // reads LINQ_API_V3_API_KEY by default});import osfrom linq import LinqAPIV3
client = LinqAPIV3(api_key=os.environ["LINQ_API_KEY"])Token security best practices
Section titled “Token security best practices”- Use environment variables — Never hardcode tokens in source code
- Never commit tokens — Add
.envto.gitignore - Rotate regularly — Request new tokens periodically from your Linq representative
- Limit access — Only share tokens with team members who need them
- Use separate tokens — Use different tokens for development and production
Error responses
Section titled “Error responses”| Status | Code | Description |
|---|---|---|
401 | 2004 | Missing or invalid bearer token. Check that your Authorization header is correctly formatted. |
403 | 2005 | Valid token but insufficient permissions for this resource. |
403 | 2006 | You cannot send from this phone number. Verify the phone is assigned to your account. |
429 | 1007 | Rate limit exceeded. See Rate Limits. |
See Error Codes for the complete error reference and the API Reference for endpoint specifications.