Getting Started with Solatis API
This guide walks you through everything you need to start using the Solatis API in 5 minutes.
Step 1: Generate Your API Key
Generate Key via Dashboard
- Sign in to app.solatis.team
- Go to Settings → Developer → API Keys
- Click "Generate New Key"
- Enter a descriptive name (e.g., "Production API Key")
- Select scopes your key needs
- Click "Generate"
- Copy the key immediately (you won't see it again!)
API Key Format
Your key will look like this:
sol_live_abc123def456ghi789jkl012mno345pqrKey Prefixes:
sol_test_- Testing (limited rate limit: 100 req/hour)sol_live_- Production (full rate limit based on plan)
Store Your Key Securely
Never commit your API key to version control:
# Create .env file (NOT in git)
SOLATIS_API_KEY="sol_live_abc123..."
# Add to .gitignore
echo ".env" >> .gitignoreStep 2: Choose Your Integration Method
Option A: cURL (Simple Testing)
Perfect for testing API endpoints quickly:
curl -X GET https://api.solatis.team/v2/documents \
-H "Authorization: Bearer YOUR_API_KEY"Option B: JavaScript/TypeScript (Recommended)
For web and Node.js applications:
const response = await fetch('https://api.solatis.team/v2/documents', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();Option C: Python
For Python applications:
import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get(
'https://api.solatis.team/v2/documents',
headers=headers
)
data = response.json()Option D: Official SDK
For type-safe, production-ready integration:
JavaScript:
npm install @solatis/sdkPython:
pip install solatisGo:
go get github.com/solatis/solatis-goStep 3: Make Your First Request
Example: Analyze a Document
curl -X POST https://api.solatis.team/v2/documents/analyze \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_url": "https://example.com/contract.pdf",
"analysis_type": "contract_review",
"extract_fields": ["parties", "dates", "obligations"]
}'Understanding the Request
| Part | Description |
|---|---|
| Method | POST - We're creating an analysis |
| URL | https://api.solatis.team/v2/documents/analyze |
| Header | Authorization: Bearer YOUR_API_KEY |
| Header | Content-Type: application/json |
| Body | JSON object with parameters |
Understanding the Response
{
"id": "doc_abc123xyz",
"status": "processing",
"estimated_completion": "2026-02-02T10:30:00Z",
"webhook_url": "https://yourapp.com/webhook"
}| Field | Meaning |
|---|---|
| id | Unique identifier for this analysis |
| status | Current status (processing, completed, failed) |
| estimated_completion | When results will be ready |
| webhook_url | Optional: receives results when ready |
Step 4: Get Results
Option A: Wait for Webhook (Recommended)
Set up a webhook endpoint to receive results automatically:
# Register webhook URL
curl -X POST https://api.solatis.team/v2/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhook",
"events": ["document.analyzed"],
"secret": "your_webhook_secret"
}'Your webhook will receive:
{
"event": "document.analyzed",
"id": "doc_abc123xyz",
"status": "completed",
"summary": "This is a service agreement between Acme Corp and Client LLC...",
"extracted_fields": {
"parties": ["Acme Corp", "Client LLC"],
"dates": {
"start_date": "2024-01-01",
"end_date": "2025-01-01"
},
"obligations": [...]
},
"confidence": 0.92
}Option B: Poll for Results
Check status periodically (not recommended for production):
curl -X GET https://api.solatis.team/v2/documents/doc_abc123xyz \
-H "Authorization: Bearer YOUR_API_KEY"Step 5: Handle Errors
Common Status Codes
| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Use the response |
| 400 | Bad Request | Check request parameters |
| 401 | Unauthorized | Verify API key |
| 429 | Rate Limited | Wait and retry |
| 500 | Server Error | Retry with backoff |
Error Response Format
{
"error": {
"code": "invalid_request",
"message": "Missing required field: document_url",
"request_id": "req_abc123"
}
}Basic Error Handling
JavaScript:
async function analyzeDocument(documentUrl) {
try {
const response = await fetch(
'https://api.solatis.team/v2/documents/analyze',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
document_url: documentUrl,
analysis_type: 'contract_review'
})
}
);
if (!response.ok) {
const error = await response.json();
console.error(`Error: ${error.error.message}`);
return null;
}
const data = await response.json();
return data;
} catch (error) {
console.error('Network error:', error);
return null;
}
}Python:
import requests
def analyze_document(document_url):
try:
response = requests.post(
'https://api.solatis.team/v2/documents/analyze',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'document_url': document_url,
'analysis_type': 'contract_review'
}
)
response.raise_for_status()
return response.json()
except requests.exceptions.HTTPError as e:
print(f"HTTP error: {e.response.status_code}")
return None
except requests.exceptions.RequestException as e:
print(f"Request error: {e}")
return NoneStep 6: Next Steps
Explore More Endpoints
Now that you've made your first request, explore what else you can do:
- List All Documents - Get all documents in a workspace
- Chat with Documents - Ask questions about documents
- Transcribe Meetings - Convert recordings to text
- Generate Content - Create content with AI
Use Official SDK
For production applications, use an official SDK:
import { Solatis } from '@solatis/sdk';
const client = new Solatis({
apiKey: process.env.SOLATIS_API_KEY
});
const analysis = await client.documents.analyze({
documentUrl: 'https://example.com/contract.pdf',
analysisType: 'contract_review'
});Set Up Webhooks
Webhooks give you real-time notifications when tasks complete:
Handle Rate Limiting
Understand how rate limiting works and implement exponential backoff:
Troubleshooting
Getting 401 Unauthorized
Problem: Your request returns 401
Solutions:
- Check your API key is correct
- Verify the key prefix (
sol_test_orsol_live_) - Ensure the Authorization header format:
Authorization: Bearer YOUR_KEY - Generate a new key if the old one was compromised
Getting 429 Rate Limited
Problem: Your request returns 429 Too Many Requests
Solution:
- Check your current rate limit on API Keys page
- Wait for rate limit to reset
- Implement exponential backoff in your code
Getting 400 Bad Request
Problem: Your request returns 400 with missing field error
Solution:
- Check the error message for which field is missing
- Verify all required parameters are included
- Ensure JSON is properly formatted
Request Timing Out
Problem: API request takes too long or never completes
Solutions:
- Check status page for outages
- Add a timeout to your requests (recommended: 30 seconds)
- Implement retry logic with exponential backoff
JavaScript with timeout:
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 30000);
try {
const response = await fetch(url, {
signal: controller.signal
});
} finally {
clearTimeout(timeoutId);
}Security Best Practices
✅ Always:
- Store API keys in environment variables
- Use HTTPS (never HTTP)
- Rotate keys every 90 days
- Use the most restrictive scopes needed
- Verify webhook signatures
❌ Never:
- Commit API keys to version control
- Share API keys in Slack or email
- Log API keys to console
- Use same key across multiple environments
- Expose API keys in client-side code
Need Help?
- API Reference: Complete API docs →
- Code Examples: See examples →
- Support: developers@solatis.team
- Status: status.solatis.team