Account API
The Account API allows you to retrieve account information and usage statistics.
Get Account Information
Retrieve information about your account.
Endpoint:
GET /account
Example Request:
curl -X GET "https://api.lazyspond.com/v1/account" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response:
{
"success": true,
"data": {
"id": "acc_123456789",
"email": "user@example.com",
"name": "Sarah Johnson",
"plan": "pro",
"status": "active",
"created_at": "2024-01-15T10:00:00Z",
"instagram_accounts": [
{
"id": "ig_123456789",
"username": "sarah_fitness",
"display_name": "Sarah Johnson",
"status": "connected"
}
]
}
}
Get Usage Statistics
Retrieve usage statistics for your account.
Endpoint:
GET /account/usage
Query Parameters:
- period (string) — "month" or "year" (default: "month")
Example Request:
curl -X GET "https://api.lazyspond.com/v1/account/usage?period=month" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response:
{
"success": true,
"data": {
"plan": "pro",
"period": "month",
"replies_limit": 2000,
"replies_used": 1250,
"replies_remaining": 750,
"automations_limit": "unlimited",
"automations_count": 5,
"leads_captured": 450,
"leads_this_month": 125,
"api_calls_limit": 10000,
"api_calls_used": 2350,
"api_calls_remaining": 7650
}
}
Get Plan Information
Retrieve information about your current plan.
Endpoint:
GET /account/plan
Example Request:
curl -X GET "https://api.lazyspond.com/v1/account/plan" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response:
{
"success": true,
"data": {
"name": "Pro",
"price": 24,
"billing_cycle": "monthly",
"features": {
"replies_per_month": 2000,
"automations": "unlimited",
"icebreakers": "unlimited",
"reply_variations": 3,
"api_access": true,
"webhook_exports": true,
"priority_support": true,
"advanced_analytics": true
},
"next_billing_date": "2024-04-22",
"cancel_at_period_end": false
}
}
Get Connected Instagram Accounts
Retrieve all connected Instagram accounts.
Endpoint:
GET /account/instagram-accounts
Example Request:
curl -X GET "https://api.lazyspond.com/v1/account/instagram-accounts" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response:
{
"success": true,
"data": [
{
"id": "ig_123456789",
"username": "sarah_fitness",
"display_name": "Sarah Johnson",
"followers": 15000,
"status": "connected",
"connected_at": "2024-01-15T10:00:00Z",
"automations_count": 5,
"leads_captured": 450
},
{
"id": "ig_987654321",
"username": "sarah_coaching",
"display_name": "Sarah's Coaching",
"followers": 8000,
"status": "connected",
"connected_at": "2024-02-20T14:30:00Z",
"automations_count": 3,
"leads_captured": 120
}
]
}
Get Billing Information
Retrieve billing information for your account.
Endpoint:
GET /account/billing
Example Request:
curl -X GET "https://api.lazyspond.com/v1/account/billing" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response:
{
"success": true,
"data": {
"current_plan": "pro",
"billing_email": "user@example.com",
"billing_cycle": "monthly",
"next_billing_date": "2024-04-22",
"payment_method": {
"type": "card",
"last_four": "4242",
"brand": "visa",
"exp_month": 12,
"exp_year": 2025
},
"recent_invoices": [
{
"id": "inv_123456789",
"date": "2024-03-22",
"amount": 24.00,
"status": "paid",
"pdf_url": "https://invoices.lazyspond.com/inv_123456789.pdf"
}
]
}
}
Response Fields
Account Information
| Field | Type | Description |
|---|---|---|
id | string | Unique account ID |
email | string | Account email |
name | string | Account name |
plan | string | Current plan (free, starter, pro, premium) |
status | string | Account status (active, suspended, cancelled) |
created_at | string | ISO 8601 timestamp |
instagram_accounts | array | Connected Instagram accounts |
Usage Statistics
| Field | Type | Description |
|---|---|---|
replies_limit | integer | Monthly reply limit |
replies_used | integer | Replies used this month |
replies_remaining | integer | Replies remaining this month |
automations_limit | string or integer | Automation limit |
automations_count | integer | Current automations |
leads_captured | integer | Total leads captured |
leads_this_month | integer | Leads captured this month |
api_calls_limit | integer | Monthly API call limit |
api_calls_used | integer | API calls used this month |
api_calls_remaining | integer | API calls remaining this month |
Error Responses
Unauthorized
{
"success": false,
"error": "Invalid API key"
}
Account Suspended
{
"success": false,
"error": "Account is suspended"
}
Code Examples
Python
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.lazyspond.com/v1"
headers = {
"Authorization": f"Bearer {API_KEY}"
}
# Get account information
response = requests.get(f"{BASE_URL}/account", headers=headers)
account = response.json()['data']
print(f"Plan: {account['plan']}")
print(f"Email: {account['email']}")
# Get usage statistics
response = requests.get(f"{BASE_URL}/account/usage", headers=headers)
usage = response.json()['data']
print(f"Replies used: {usage['replies_used']} / {usage['replies_limit']}")
print(f"Leads captured: {usage['leads_captured']}")
# Get plan information
response = requests.get(f"{BASE_URL}/account/plan", headers=headers)
plan = response.json()['data']
print(f"Plan name: {plan['name']}")
print(f"Price: ${plan['price']}/month")
# Get connected Instagram accounts
response = requests.get(f"{BASE_URL}/account/instagram-accounts", headers=headers)
accounts = response.json()['data']
for account in accounts:
print(f"{account['username']}: {account['followers']} followers")
# Get billing information
response = requests.get(f"{BASE_URL}/account/billing", headers=headers)
billing = response.json()['data']
print(f"Next billing date: {billing['next_billing_date']}")
JavaScript
const API_KEY = "YOUR_API_KEY";
const BASE_URL = "https://api.lazyspond.com/v1";
const headers = {
"Authorization": `Bearer ${API_KEY}`
};
// Get account information
fetch(`${BASE_URL}/account`, { headers })
.then(res => res.json())
.then(data => {
console.log(`Plan: ${data.data.plan}`);
console.log(`Email: ${data.data.email}`);
});
// Get usage statistics
fetch(`${BASE_URL}/account/usage`, { headers })
.then(res => res.json())
.then(data => {
const usage = data.data;
console.log(`Replies: ${usage.replies_used} / ${usage.replies_limit}`);
console.log(`Leads: ${usage.leads_captured}`);
});
// Get plan information
fetch(`${BASE_URL}/account/plan`, { headers })
.then(res => res.json())
.then(data => {
const plan = data.data;
console.log(`Plan: ${plan.name}`);
console.log(`Price: $${plan.price}/month`);
});
// Get connected Instagram accounts
fetch(`${BASE_URL}/account/instagram-accounts`, { headers })
.then(res => res.json())
.then(data => {
data.data.forEach(account => {
console.log(`${account.username}: ${account.followers} followers`);
});
});
Next Steps
- Manage leads: See Leads API
- Manage automations: See Automations API
- API basics: See API Getting Started