Developers

API Documentation

Last updated: October 21, 2026

1. Overview

The Mad Ad Slingers API (v1) lets account holders work with their leads, campaigns, and analytics programmatically. List records, create leads and draft campaigns, move leads and campaigns through their statuses, and pull headline performance metrics — the same endpoints power integrations like our Zapier app, which connects Mad Ad Slingers to thousands of other tools.

All requests and responses are JSON. List endpoints return records newest first, and lead, campaign, and analytics responses wrap their payload in a data field.

2. Base URL

Every endpoint on this page is relative to:

https://mad-ad-slingers.online/api/v1

3. Authentication

The API uses API-key authentication. Send your key on every request in the X-API-Key header:

X-API-Key: mas_live_YOUR_KEY

Getting a key. API keys are available to Mad Ad Slingers account holders and are issued by the Mad Ad Slingers team — ask your agency admin for a key with the scopes you need. Live keys start with mas_live_.

Scopes. Each key carries one or more scopes that control what it can do:

  • read — list and fetch records, and run the /me key check.
  • write — create leads and campaigns, and update statuses.
  • analytics — required for the analytics summary endpoint.
  • webhooks — issued for webhook delivery setups.

Verify a key. Call GET /me (documented below). It works with any scope and returns the record for the key you sent, so you can confirm a key is valid before wiring up an integration.

Treat your key like a password: keep it server-side, never embed it in client-side code or public repositories, and ask us to rotate it if it is ever exposed.

4. Endpoints

Account

GET/me

Verify an API key and fetch the record for the key making the request. Works with any scope.

Leads

GET/leads

List leads, newest first. Query parameters:

  • limit — number of results to return (default 10, max 50).
  • page — page number when paging through results.
  • status — only return leads with this status.
  • business_id — only return leads belonging to this business.

Responds with a data array of lead objects (see the example in section 5).

POST/leads

Create a lead. Requires the write scope. Required fields: first_name, last_name, and email (must be a valid email address). Optional fields:

  • phone, company, position, industry, website, linkedin, city, state
  • status — defaults to new.
  • stage — defaults to new.
  • source — where the lead came from (e.g. zapier, website).
  • notes — free-text notes.
  • business_id — defaults to the API key owner's first business if omitted.

Responds with the created lead object.

PATCH/leads/{id}/status

Update a lead's status. Requires the write scope. JSON body:

  • status — required. For example: new, contacted, qualified, converted, lost.
  • stage — optional pipeline stage to set alongside the status.

Responds with the updated lead object.

Lead object fields:

FieldNotes
idLead ID
business_idBusiness the lead belongs to
first_name / last_name / full_nameContact name
email / phoneContact details
company / position / industryCompany details
website / linkedinWeb presence
status / stagePipeline position
score / qualityLead scoring
sourceWhere the lead came from
city / stateLocation
created_at / updated_atTimestamps (ISO 8601)

Campaigns

GET/campaigns

List campaigns, newest first. Accepts the same query parameters as GET /leads: limit (default 10, max 50), page, status, and business_id. Responds with a data array of campaign objects.

POST/campaigns

Create a campaign. Requires the write scope. New campaigns are always created as drafts and never spend until they are launched. Required field: name. Optional fields:

  • type — e.g. meta, google, tiktok, pinterest, linkedin.
  • budget / daily_budget — budget figures.
  • target_audience — who the campaign targets.
  • objective — campaign objective.
  • platforms — comma-separated: meta, google, tiktok, pinterest, linkedin, x, youtube, chatgpt.
  • start_date / end_date — schedule.
  • business_id, description

Responds with the created campaign object.

PATCH/campaigns/{id}/status

Pause, resume, or complete a campaign. Requires the write scope. JSON body: status — one of draft, active, paused, completed, archived. Use paused to pause spend and active to resume.

Responds with the updated campaign object.

Campaign object fields:

FieldNotes
idCampaign ID
business_idBusiness the campaign belongs to
nameCampaign name
typeCampaign type / platform
statusdraft, active, paused, completed, or archived
budgetTotal budget
target_audienceTarget audience description
start_date / end_dateSchedule (ISO 8601)
meta_campaign_id / google_campaign_id / tiktok_campaign_id / pinterest_campaign_id / linkedin_campaign_idIDs on the ad platforms once launched (null until then). ChatGPT Ads is a separate setup — see /api/chatgpt-ads/plans and /api/chatgpt-ads/one-click-setup
created_at / updated_atTimestamps (ISO 8601)

Analytics

GET/analytics/summary

Headline metrics for a time window: lead, campaign, and invoice totals, new items in the period, and breakdowns by status. Requires the analytics scope. Query parameter: days — how many days back to summarize (default 30, max 365). The response data object contains:

  • window_days — the window summarized.
  • totals — leads, campaigns, invoices, revenue_collected.
  • period — new_leads, new_campaigns, new_invoices, open_invoice_value for the window.
  • leads_by_status / campaigns_by_status — counts grouped by status.

5. Example Request & Response

List the 10 most recent leads:

curl https://mad-ad-slingers.online/api/v1/leads?limit=10 \
  -H "X-API-Key: mas_live_YOUR_KEY"

Response:

{
  "data": [
    {
      "id": 12345,
      "business_id": 7,
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "email": "jane.doe@example.com",
      "phone": "+15551234567",
      "company": "Acme Plumbing Co.",
      "position": "Owner",
      "industry": "Home Services",
      "website": "https://acmeplumbing.example.com",
      "linkedin": "https://www.linkedin.com/in/janedoe",
      "status": "new",
      "stage": "new",
      "score": 82,
      "source": "api",
      "quality": "high",
      "city": "Austin",
      "state": "TX",
      "created_at": "2026-10-01T14:22:31Z",
      "updated_at": "2026-10-01T14:22:31Z"
    }
  ]
}

Create a lead:

curl -X POST https://mad-ad-slingers.online/api/v1/leads \
  -H "X-API-Key: mas_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"first_name": "Jane", "last_name": "Doe", "email": "jane.doe@example.com", "company": "Acme Plumbing Co."}'

6. Errors

Failed requests return a standard HTTP error status (400 or above) with a JSON body containing a detail field describing the problem:

{
  "detail": "<error message>"
}
  • 401 / 403 — the API key is missing, invalid, or does not carry the scope the endpoint requires (for example, calling a create endpoint with a read-only key).
  • Other 4xx — the request itself was rejected, for example a lead create without a valid email address.
  • 5xx — a server-side problem; the detail field carries the message returned by the API.

7. Support

Questions about the API, or need a key issued or rotated? Email hello@mad-ad-slingers.com.