API Documentation

Current Version: v1.0 | Updated: May 19, 2025

Introduction

The Axiom API allows you to programmatically access and manipulate your data, automate workflows, and integrate Axiom with other systems. Our RESTful API provides secure access to leads, properties, campaigns, and analytics data.

Base URL

All API requests should be made to:

https://api.axiom-console.com/v1

The API requires an API key for authentication. All requests must be made over HTTPS to ensure data security.

Authentication

To authenticate API requests, you need to include your API key in the request headers. You can generate API keys in your Axiom account under Account Settings > API > API Keys.

API Key Authentication

Include your API key in the request header:

X-API-Key: your_api_key_here

Example Request

curl -X GET "https://api.axiom-console.com/v1/leads" \
     -H "X-Axiom-API-Key: your_api_key_here" \
     -H "Content-Type: application/json"
const axios = require('axios');

const getContacts = async () => {
  try {
    const response = await axios.get('https://api.axiom-console.com/v1/leads', {
      headers: {
        'X-Axiom-API-Key': 'your_api_key_here',
        'Content-Type': 'application/json'
      }
    });
    console.log(response.data);
    return response.data;
  } catch (error) {
    console.error('Error fetching leads:', error);
  }
};
import requests

def get_contacts():
    url = "https://api.axiom-console.com/v1/leads"
    headers = {
        "X-Axiom-API-Key": "your_api_key_here",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    
    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code}")
        print(response.text)
function getContacts() {
    $url = 'https://api.axiom-console.com/v1/leads';
    $headers = [
        'X-Axiom-API-Key: your_api_key_here',
        'Content-Type: application/json'
    ];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    
    curl_close($ch);
    
    if ($httpCode == 200) {
        return json_decode($response, true);
    } else {
        echo "Error: " . $httpCode . "\n";
        echo $response;
    }
}

Security Notice: Keep your API key secure and never share it in client-side code or public repositories.

Rate Limits

To ensure optimal performance for all users, the Axiom API implements rate limiting. Rate limits vary based on your plan.

Plan Rate Limit Burst Capacity
Starter 60 requests/minute 100 requests
Professional 120 requests/minute 200 requests
Enterprise 300 requests/minute 500 requests

Each response includes rate limit information in the headers:

X-RateLimit-Limit: 60 X-RateLimit-Remaining: 58 X-RateLimit-Reset: 1603123456

If you exceed the rate limit, you'll receive a 429 "Too Many Requests" response. The response will include a Retry-After header indicating how long to wait before making another request.

Error Handling

The Axiom API uses standard HTTP status codes to indicate success or failure of API requests. In case of an error, additional information is provided in the response body.

HTTP Status Codes

Status Code Description
200 - OK Request succeeded
201 - Created Resource created successfully
400 - Bad Request Invalid request parameters
401 - Unauthorized Authentication failed or not provided
403 - Forbidden Authorized but access denied
404 - Not Found Resource not found
422 - Unprocessable Content Duplicate Entries are (i.e., leads) Forbidden
429 - Too Many Requests Rate limit exceeded
500 - Server Error Server-side error occurred

Error Response Format

When an error occurs, the response body contains detailed information:

{
  error: {
    code: "invalid_parameter",
    message: "The parameter 'email' is invalid",  
    documentation_url: "https://api.axiom-console.com/docs/errors#invalid_parameter"
  }
}

Leads API

The Leads API allows you to manage your leads database, including creating, retrieving, updating, and deleting lead records.

Endpoints

GET
/leads
List all leads with pagination
GET
/leads/{contact_id}
Get a specific lead
POST
/leads/add
Create a new lead
PUT
/leads/{contact_id}
Update an existing lead
DELETE
/leads/{contact_id}
Delete a lead

List Leads

Retrieve a paginated list of leads in your account.

Request

GET /leads
Query Parameters
Parameter Type Required Description
page integer No Page number (default: 1)
limit integer No Results per page (default: 20, max: 100)
sort string No Sort field (e.g., "created_at", "name")
order string No Sort order: "asc" or "desc" (default: "desc")
search string No Search query for filtering results

Response

{
  "data": [
    {
      "id": "cnt_12345",
      "name": "John Smith",
      "email": "john.smith@example.com",
      "phone": "+11234567890",
      "company": "Acme Real Estate",
      "type": "client",
      "status": "active",
      "tags": ["buyer", "residential"],
      "custom_fields": {
        "preferred_location": "Downtown",
        "budget": "$500k-$750k"
      },
      "created_at": "2025-01-15T10:30:45Z",
      "updated_at": "2025-03-10T15:22:18Z"
    },
    // More leads...
  ],
  length: n
}

Create Lead

Add a new lead to your account. Name and Email are required fields.

Request

POST /leads/add
Request Body
{
  "name": "Jane Doe",
  "email": "jane.doe@example.com",
  "phone": "+11235550199",
  "type": "lead",
  "source": "API",
  "notes": ["seller", "commercial"],
  "custom_fields": {
    "property_type": "Office Space",
    "property_size": "2000-5000 sqft"
  }
}

Response

{
  "data": {
    "id": "cnt_67890",
    "name": "Jane Doe",
    "email": "jane.doe@example.com",
    "phone": "+11235550199",
    "status": "lead",
    "source": "API",
    "notes": ["seller", "commercial"],
    "created_at": "2025-04-01T08:15:30Z",
    "updated_at": "2025-04-01T08:15:30Z"
  }
}

Template API

The Template API allows you to create, manage, and view email marketing templates.

Endpoints

GET
/templates
List all email templates
GET
/templates/{templateId}
Get an email template
POST
/templates
Create a new email template

Create Template

Add a new lead to your account. Name and Email are required fields.

Request

POST /templates/add
Request Body
{
    "name": "From API",
    "subject": "Test from API",
    "content": "html content for email body"

}

Response

{
    "data": {
        "message": "Template created successfully",
        "template": "from-api-1612d101" 
    }
}

Campaign API

The Campaign API allows you to create, manage, and track email marketing campaigns.

Endpoints

GET
/campaigns
List all campaigns
GET
/campaigns/{campaign_id}
Get campaign details
POST
/campaigns/add
Create a new campaign
PATCH
/campaigns/{campaign_id}/toggle-status
Pause/Resume a campaign
DELETE
/campaigns/{campaign_id}
Delete an individual campaign

For detailed examples of creating and managing email campaigns, refer to our Email Campaign Guide.

API Changelog

Stay updated on the latest API changes and improvements.

May 19, 2025
v1.0

Major Release: API v1.0

Addition

Added Lead API endpoints

Addition

Added Template API endpoints

Addition

Added Campaign API endpoints

Contact Support

If you're having trouble with our API, feel free to reach out to our support team through your Axiom dashboard "Help" > "Send us a message".

Sign Up