Skip to content

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

  1. Sign in to app.solatis.team
  2. Go to Settings → Developer → API Keys
  3. Click "Generate New Key"
  4. Enter a descriptive name (e.g., "Production API Key")
  5. Select scopes your key needs
  6. Click "Generate"
  7. Copy the key immediately (you won't see it again!)

API Key Format

Your key will look like this:

sol_live_abc123def456ghi789jkl012mno345pqr

Key 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:

bash
# Create .env file (NOT in git)
SOLATIS_API_KEY="sol_live_abc123..."

# Add to .gitignore
echo ".env" >> .gitignore

Step 2: Choose Your Integration Method

Option A: cURL (Simple Testing)

Perfect for testing API endpoints quickly:

bash
curl -X GET https://api.solatis.team/v2/documents \
  -H "Authorization: Bearer YOUR_API_KEY"

For web and Node.js applications:

javascript
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:

python
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:

bash
npm install @solatis/sdk

Python:

bash
pip install solatis

Go:

bash
go get github.com/solatis/solatis-go

See all SDKs →

Step 3: Make Your First Request

Example: Analyze a Document

bash
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

PartDescription
MethodPOST - We're creating an analysis
URLhttps://api.solatis.team/v2/documents/analyze
HeaderAuthorization: Bearer YOUR_API_KEY
HeaderContent-Type: application/json
BodyJSON object with parameters

Understanding the Response

json
{
  "id": "doc_abc123xyz",
  "status": "processing",
  "estimated_completion": "2026-02-02T10:30:00Z",
  "webhook_url": "https://yourapp.com/webhook"
}
FieldMeaning
idUnique identifier for this analysis
statusCurrent status (processing, completed, failed)
estimated_completionWhen results will be ready
webhook_urlOptional: receives results when ready

Step 4: Get Results

Set up a webhook endpoint to receive results automatically:

bash
# 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:

json
{
  "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):

bash
curl -X GET https://api.solatis.team/v2/documents/doc_abc123xyz \
  -H "Authorization: Bearer YOUR_API_KEY"

Step 5: Handle Errors

Common Status Codes

CodeMeaningAction
200SuccessUse the response
400Bad RequestCheck request parameters
401UnauthorizedVerify API key
429Rate LimitedWait and retry
500Server ErrorRetry with backoff

Error Response Format

json
{
  "error": {
    "code": "invalid_request",
    "message": "Missing required field: document_url",
    "request_id": "req_abc123"
  }
}

Basic Error Handling

JavaScript:

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:

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 None

Step 6: Next Steps

Explore More Endpoints

Now that you've made your first request, explore what else you can do:

Use Official SDK

For production applications, use an official SDK:

javascript
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:

Setup Webhooks →

Handle Rate Limiting

Understand how rate limiting works and implement exponential backoff:

Rate Limiting Guide →

Troubleshooting

Getting 401 Unauthorized

Problem: Your request returns 401

Solutions:

  1. Check your API key is correct
  2. Verify the key prefix (sol_test_ or sol_live_)
  3. Ensure the Authorization header format: Authorization: Bearer YOUR_KEY
  4. Generate a new key if the old one was compromised

Getting 429 Rate Limited

Problem: Your request returns 429 Too Many Requests

Solution:

  1. Check your current rate limit on API Keys page
  2. Wait for rate limit to reset
  3. Implement exponential backoff in your code

Rate Limiting Guide →

Getting 400 Bad Request

Problem: Your request returns 400 with missing field error

Solution:

  1. Check the error message for which field is missing
  2. Verify all required parameters are included
  3. Ensure JSON is properly formatted

Request Timing Out

Problem: API request takes too long or never completes

Solutions:

  1. Check status page for outages
  2. Add a timeout to your requests (recommended: 30 seconds)
  3. Implement retry logic with exponential backoff

JavaScript with timeout:

javascript
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?

Released under the MIT License.