LinktLinkt

Authentication

Learn how to authenticate with the Linkt API

The Linkt API uses API key authentication. All requests must include a valid API key in the request headers.

Getting Your API Key

  1. Log in to your Linkt Dashboard
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Give your key a descriptive name (e.g., "Production API Key")
  5. Copy and securely store your API key

Using Your API Key

Include your API key in the x-api-key header with every request:

curl -X GET "https://api.linkt.ai/v1/icp" \
  -H "x-api-key: your_api_key_here"

Code Examples

Python

import requests
 
API_KEY = "your_api_key_here"
BASE_URL = "https://api.linkt.ai/v1"
 
headers = {
    "x-api-key": API_KEY,
    "Content-Type": "application/json"
}
 
# List ICPs
response = requests.get(f"{BASE_URL}/icp", headers=headers)
icps = response.json()
 
# Create an ICP
icp_data = {
    "name": "Enterprise SaaS Companies",
    "description": "B2B software companies",
    "entity_targets": [
        {
            "entity_type": "company",
            "description": "B2B SaaS companies with 100+ employees"
        }
    ]
}
response = requests.post(f"{BASE_URL}/icp", headers=headers, json=icp_data)
new_icp = response.json()

JavaScript / TypeScript

const API_KEY = "your_api_key_here";
const BASE_URL = "https://api.linkt.ai/v1";
 
const headers = {
  "x-api-key": API_KEY,
  "Content-Type": "application/json",
};
 
// List ICPs
async function listICPs() {
  const response = await fetch(`${BASE_URL}/icp`, { headers });
  return response.json();
}
 
// Create an ICP
async function createICP() {
  const response = await fetch(`${BASE_URL}/icp`, {
    method: "POST",
    headers,
    body: JSON.stringify({
      name: "Enterprise SaaS Companies",
      description: "B2B software companies",
      entity_targets: [
        {
          entity_type: "company",
          description: "B2B SaaS companies with 100+ employees",
        },
      ],
    }),
  });
  return response.json();
}

cURL

# Set your API key as an environment variable
export LINKT_API_KEY="your_api_key_here"
 
# List ICPs
curl -X GET "https://api.linkt.ai/v1/icp" \
  -H "x-api-key: $LINKT_API_KEY"
 
# Create an ICP
curl -X POST "https://api.linkt.ai/v1/icp" \
  -H "x-api-key: $LINKT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Enterprise SaaS Companies",
    "description": "B2B software companies",
    "entity_targets": [{
      "entity_type": "company",
      "description": "B2B SaaS companies with 100+ employees"
    }]
  }'

Security Best Practices

Environment Variables

Never hardcode API keys in your source code. Use environment variables:

# .env file (do not commit to version control)
LINKT_API_KEY=your_api_key_here
import os
API_KEY = os.environ.get("LINKT_API_KEY")

Server-Side Only

API keys should only be used in server-side code. Never expose your API key in:

  • Client-side JavaScript
  • Mobile app source code
  • Public repositories
  • Browser developer tools

Key Rotation

Periodically rotate your API keys for enhanced security:

  1. Create a new API key in the dashboard
  2. Update your application to use the new key
  3. Verify the new key works correctly
  4. Delete the old API key

Rate Limits

The Linkt API implements rate limiting to ensure fair usage.

PlanRequests per MinuteRequests per Day
Free601,000
Pro30010,000
EnterpriseCustomCustom

Rate Limit Headers

Responses include headers indicating your rate limit status:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1704456000

Handling Rate Limits

When you exceed the rate limit, the API returns a 429 Too Many Requests response:

{
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded. Please retry after 60 seconds.",
  "retry_after": 60
}

Implement exponential backoff:

import time
import requests
 
def make_request_with_retry(url, headers, max_retries=3):
    for attempt in range(max_retries):
        response = requests.get(url, headers=headers)
 
        if response.status_code == 429:
            retry_after = int(response.headers.get("Retry-After", 60))
            time.sleep(retry_after)
            continue
 
        return response
 
    raise Exception("Max retries exceeded")

Authentication Errors

Status CodeErrorDescription
401unauthorizedMissing or invalid API key
403forbiddenAPI key lacks permissions
429rate_limit_exceededToo many requests

Organization Scope

API keys are scoped to your organization. All resources created with an API key are automatically associated with your organization.

  • ICPs, Sheets, Tasks, and Runs are organization-scoped
  • Team members with API access can view and manage shared resources
  • API keys do not provide cross-organization access

Next Steps

On this page