Help & Docs

API Getting Started

Authentication, rate limits, and first API call

API Getting Started

Reading time: 10 minutes

Integrate with Atlas programmatically using the REST API. This guide covers authentication, base URL, rate limits, request/response format, error handling, pagination, and webhooks.


Base URL

All API requests use the following base URL:

https://api.atlas-accounting.com/api/v1

The API follows REST conventions with JSON request and response bodies.


Authentication

Atlas uses JWT (JSON Web Token) authentication with refresh tokens.

Obtaining Tokens

POST /auth/login
Content-Type: application/json

{
  "email": "your@email.com",
  "password": "your-password"
}

Response:

{
  "tokens": {
    "access_token": "eyJhbG...",
    "refresh_token": "eyJhbG...",
    "token_type": "bearer",
    "expires_in": 3600
  },
  "user": {
    "id": "uuid",
    "email": "your@email.com",
    "full_name": "Your Name",
    "role": "admin"
  }
}

Using Tokens

Include the access token in the Authorization header:

Authorization: Bearer eyJhbG...

Refreshing Tokens

When the access token expires (after 1 hour):

POST /auth/refresh
Content-Type: application/json

{
  "refresh_token": "eyJhbG..."
}

Rate Limits

TierRequests per MinuteBurst
Standard6010
Professional30050
Enterprise1000100

Rate limit headers are included in every response:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1680000000

When rate limited, the API returns 429 Too Many Requests.


Request Format

Content Type

All requests with a body must use:

Content-Type: application/json

Organization Context

Most endpoints require a company context. Include the company ID in the request path or as a query parameter where specified.


Response Format

Success Responses

{
  "id": "uuid",
  "created_at": "2026-01-15T10:30:00Z",
  "updated_at": "2026-01-15T10:30:00Z",
  ...
}

List Responses

{
  "items": [...],
  "total": 150,
  "page": 1,
  "page_size": 50,
  "has_next": true
}

Error Handling

Error Response Format

{
  "detail": "Human-readable error message",
  "status_code": 422,
  "errors": [
    {
      "field": "amount",
      "message": "Amount must be greater than zero"
    }
  ]
}

HTTP Status Codes

CodeMeaning
200Success
201Created
204No Content (successful deletion)
400Bad Request — invalid input
401Unauthorized — invalid or expired token
403Forbidden — insufficient permissions
404Not Found
409Conflict — duplicate or state conflict
422Validation Error — check the errors array
429Rate Limited — slow down
500Internal Server Error

Pagination

List endpoints support cursor-based pagination:

ParameterTypeDefaultDescription
pageinteger1Page number
page_sizeinteger50Items per page (max 100)
sort_bystringvariesSort field
sort_orderstring"desc""asc" or "desc"

Example

GET /api/v1/invoices?page=2&page_size=25&sort_by=created_at&sort_order=desc

First API Call

Let's fetch the current user's profile:

curl -X GET https://api.atlas-accounting.com/api/v1/auth/me \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

{
  "id": "uuid",
  "email": "your@email.com",
  "full_name": "Your Name",
  "role": "admin",
  "organization": {
    "id": "uuid",
    "name": "Your Organization"
  },
  "companies": [
    {
      "id": "uuid",
      "name": "Your Company",
      "role": "admin"
    }
  ]
}

Common Endpoints

EndpointMethodDescription
/auth/meGETCurrent user profile
/companiesGETList companies
/invoicesGET, POSTList and create invoices
/billsGET, POSTList and create bills
/journal-entriesGET, POSTList and create journal entries
/contacts/customersGET, POSTList and create customers
/contacts/vendorsGET, POSTList and create vendors
/reports/profit-lossGETProfit & Loss report
/reports/balance-sheetGETBalance Sheet report
/chart-of-accountsGETChart of Accounts

Webhooks

Receive real-time notifications when events occur in Atlas.

Setting Up Webhooks

  1. Go to Settings > API > Webhooks
  2. Click New Webhook
  3. Enter:
    • URL — your endpoint that receives webhook events
    • Events — select which events to subscribe to
    • Secret — used to verify webhook signatures

Available Events

EventTriggered When
invoice.createdA new invoice is created
invoice.sentAn invoice is sent to a customer
invoice.paidAn invoice is fully paid
bill.approvedA bill is approved
payment.receivedA payment is recorded
period.closedAn accounting period is closed

Webhook Payload

{
  "event": "invoice.paid",
  "timestamp": "2026-01-15T10:30:00Z",
  "data": {
    "id": "uuid",
    "invoice_number": "INV-001",
    "amount": 1500.0,
    "currency": "USD",
    "customer_id": "uuid"
  }
}

Verifying Signatures

Each webhook includes an X-Atlas-Signature header. Verify it by computing an HMAC-SHA256 of the payload using your webhook secret.


SDKs and Libraries

Official client libraries:

LanguagePackage
Pythonpip install atlas-accounting
JavaScript/TypeScriptnpm install @atlas-accounting/sdk

What's Next

  • Get your API tokens by logging in via the API
  • Explore the endpoints with the API Reference (coming soon)
  • Set up webhooks for real-time event notifications