Access the Keap API with managed OAuth authentication. Manage contacts, companies, tags, tasks, orders, opportunities, campaigns, and more for CRM and marketing automation.
# List contacts
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/keap/crm/rest/v2/contacts?page_size=10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
https://api.maton.ai/keap/crm/rest/{api-path}
Maton proxies requests to api.infusionsoft.com/crm/rest and automatically injects your OAuth token.
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Manage your Keap OAuth connections at https://api.maton.ai.
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=keap&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'keap'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"connection": {
"connection_id": "{connection_id}",
"status": "ACTIVE",
"creation_time": "2026-02-08T01:34:44.738374Z",
"last_updated_time": "2026-02-08T01:35:20.106942Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "keap",
"metadata": {}
}
}
Open the returned url in a browser to complete OAuth authorization.
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple Keap connections, specify which one to use with the Maton-Connection header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/keap/crm/rest/v2/contacts')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple connections, always include this header to ensure requests go to the intended account.
GET /keap/crm/rest/v2/oauth/connect/userinfo
Response:
{
"email": "user@example.com",
"sub": "1",
"id": "4236128",
"keap_id": "user@example.com",
"family_name": "Doe",
"given_name": "John",
"is_admin": true
}
GET /keap/crm/rest/v2/contacts
Query parameters:
page_size - Number of results per page (default 50, max 1000)page_token - Token for next pagefilter - Filter expressionorder_by - Sort orderfields - Fields to include in responseResponse:
{
"contacts": [
{
"id": "9",
"family_name": "Park",
"given_name": "John"
}
],
"next_page_token": ""
}
GET /keap/crm/rest/v2/contacts/{contact_id}
POST /keap/crm/rest/v2/contacts
Content-Type: application/json
{
"given_name": "John",
"family_name": "Doe",
"email_addresses": [
{"email": "john@example.com", "field": "EMAIL1"}
],
"phone_numbers": [
{"number": "555-1234", "field": "PHONE1"}
]
}
Response:
{
"id": "13",
"family_name": "Doe",
"given_name": "John"
}
PATCH /keap/crm/rest/v2/contacts/{contact_id}
Content-Type: application/json
{
"given_name": "Jane"
}
DELETE /keap/crm/rest/v2/contacts/{contact_id}
Returns 204 on success.
GET /keap/crm/rest/v2/contacts/{contact_id}/notes
POST /keap/crm/rest/v2/contacts/{contact_id}/notes
Content-Type: application/json
{
"body": "Note content here",
"title": "Note Title"
}
GET /keap/crm/rest/v2/companies
GET /keap/crm/rest/v2/companies/{company_id}
POST /keap/crm/rest/v2/companies
Content-Type: application/json
{
"company_name": "Acme Corp",
"phone_number": {"number": "555-1234", "type": "MAIN"},
"website": "https://acme.com"
}
PATCH /keap/crm/rest/v2/companies/{company_id}
Content-Type: application/json
{
"company_name": "Acme Corporation"
}
DELETE /keap/crm/rest/v2/companies/{company_id}
GET /keap/crm/rest/v2/tags
Response:
{
"tags": [
{
"id": "91",
"name": "Nurture Subscriber",
"description": "",
"category": {"id": "10"},
"create_time": "2017-04-24T17:26:26Z",
"update_time": "2017-04-24T17:26:26Z"
}
],
"next_page_token": ""
}
GET /keap/crm/rest/v2/tags/{tag_id}
POST /keap/crm/rest/v2/tags
Content-Type: application/json
{
"name": "VIP Customer",
"description": "High value customers"
}
PATCH /keap/crm/rest/v2/tags/{tag_id}
Content-Type: application/json
{
"name": "Premium Customer"
}
DELETE /keap/crm/rest/v2/tags/{tag_id}
GET /keap/crm/rest/v2/tags/{tag_id}/contacts
POST /keap/crm/rest/v2/tags/{tag_id}/contacts:applyTags
Content-Type: application/json
{
"contact_ids": ["1", "2", "3"]
}
POST /keap/crm/rest/v2/tags/{tag_id}/contacts:removeTags
Content-Type: application/json
{
"contact_ids": ["1", "2", "3"]
}
GET /keap/crm/rest/v2/tags/categories
POST /keap/crm/rest/v2/tags/categories
Content-Type: application/json
{
"name": "Customer Segments"
}
GET /keap/crm/rest/v2/tasks
GET /keap/crm/rest/v2/tasks/{task_id}
POST /keap/crm/rest/v2/tasks
Content-Type: application/json
{
"title": "Follow up call",
"description": "Call to discuss proposal",
"due_date": "2026-02-15T10:00:00Z",
"contact": {"id": "9"}
}
PATCH /keap/crm/rest/v2/tasks/{task_id}
Content-Type: application/json
{
"completed": true
}
DELETE /keap/crm/rest/v2/tasks/{task_id}
GET /keap/crm/rest/v2/opportunities
GET /keap/crm/rest/v2/opportunities/{opportunity_id}
POST /keap/crm/rest/v2/opportunities
Content-Type: application/json
{
"opportunity_title": "New Deal",
"contact": {"id": "9"},
"stage": {"id": "1"},
"estimated_close_date": "2026-03-01"
}
PATCH /keap/crm/rest/v2/opportunities/{opportunity_id}
Content-Type: application/json
{
"stage": {"id": "2"}
}
DELETE /keap/crm/rest/v2/opportunities/{opportunity_id}
GET /keap/crm/rest/v2/opportunities/stages
GET /keap/crm/rest/v2/orders
GET /keap/crm/rest/v2/orders/{order_id}
POST /keap/crm/rest/v2/orders
Content-Type: application/json
{
"contact": {"id": "9"},
"order_date": "2026-02-08",
"order_title": "Product Order"
}
POST /keap/crm/rest/v2/orders/{order_id}/items
Content-Type: application/json
{
"product": {"id": "1"},
"quantity": 2
}
GET /keap/crm/rest/v2/products
GET /keap/crm/rest/v2/products/{product_id}
POST /keap/crm/rest/v2/products
Content-Type: application/json
{
"product_name": "Consulting Package",
"product_price": 500.00,
"product_short_description": "1 hour consulting"
}
GET /keap/crm/rest/v2/campaigns
GET /keap/crm/rest/v2/campaigns/{campaign_id}
GET /keap/crm/rest/v2/campaigns/{campaign_id}/sequences
POST /keap/crm/rest/v2/campaigns/{campaign_id}/sequences/{sequence_id}:addContacts
Content-Type: application/json
{
"contact_ids": ["1", "2"]
}
POST /keap/crm/rest/v2/campaigns/{campaign_id}/sequences/{sequence_id}:removeContacts
Content-Type: application/json
{
"contact_ids": ["1", "2"]
}
GET /keap/crm/rest/v2/emails
GET /keap/crm/rest/v2/emails/{email_id}
POST /keap/crm/rest/v2/emails:send
Content-Type: application/json
{
"contacts": [{"id": "9"}],
"subject": "Hello",
"html_content": "<p>Email body</p>"
}
GET /keap/crm/rest/v2/users
GET /keap/crm/rest/v2/users/{user_id}
GET /keap/crm/rest/v2/subscriptions
GET /keap/crm/rest/v2/subscriptions/{subscription_id}
GET /keap/crm/rest/v2/affiliates
GET /keap/crm/rest/v2/affiliates/{affiliate_id}
GET /keap/crm/rest/v2/automations
GET /keap/crm/rest/v2/automations/{automation_id}
Keap uses token-based pagination:
GET /keap/crm/rest/v2/contacts?page_size=50
Response:
{
"contacts": [...],
"next_page_token": "abc123"
}
For subsequent pages, use the page_token parameter:
GET /keap/crm/rest/v2/contacts?page_size=50&page_token=abc123
When next_page_token is empty, there are no more pages.
Use the filter parameter for filtering results:
GET /keap/crm/rest/v2/contacts?filter=given_name==John
GET /keap/crm/rest/v2/contacts?filter=email_addresses.email==john@example.com
GET /keap/crm/rest/v2/tasks?filter=completed==false
const response = await fetch(
'https://api.maton.ai/keap/crm/rest/v2/contacts?page_size=10',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();
import os
import requests
response = requests.get(
'https://api.maton.ai/keap/crm/rest/v2/contacts',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
params={'page_size': 10}
)
data = response.json()
/crm/rest prefix (e.g., /keap/crm/rest/v2/contacts)page_size and page_token (not offset-based)page_size is 1000jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments| Status | Meaning |
|---|---|
| -------- | --------- |
| 400 | Missing Keap connection or invalid request |
| 401 | Invalid or missing Maton API key |
| 403 | Not authorized (check OAuth scopes) |
| 404 | Resource not found |
| 429 | Rate limited |
| 4xx/5xx | Passthrough error from Keap API |
MATON_API_KEY environment variable is set:echo $MATON_API_KEY
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
keap. For example:https://api.maton.ai/keap/crm/rest/v2/contactshttps://api.maton.ai/crm/rest/v2/contacts共 2 个版本