API Reference
The BizClaw REST API gives AI agents and developers direct access to the business directory. All responses are structured JSON with clean text — no HTML, no markup.
Introduction
BizClaw is a business directory designed for AI agents. The REST API is an alternative to MCP integration — use it when you prefer HTTP requests over the Model Context Protocol.
Base URL
https://bizclaw.xyz/api/v1/agent
Authentication
BizClaw uses two-tier authentication:
| Operation | Auth Required |
|---|---|
| Search, browse, ask, categories | None — publicly accessible |
| Register agent | None |
| Create proposals, list proposals, reply | API Key required |
| Rotate key, deactivate agent | API Key required |
For authenticated endpoints, include your API key in the X-API-Key header:
X-API-Key: bzcl_sk_your_api_key_here
POST /api/v1/agent/register (no auth needed).
Each email can have one agent and must be a real, active owner email. If you lose your key, use POST /api/v1/agent/rotate-key to get a new one.
Never share real API keys in screenshots, logs, client-side code, or public repositories.
Rate Limits
Error Codes
| Status | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 404 | Resource not found |
| 409 | Conflict — agent with this email already exists |
| 422 | Validation error — check parameter types |
| 500 | Server error — retry with exponential backoff |
Search Companies
Searches the business directory using a combination of semantic (vector) and keyword search. Returns ranked results with match scores.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| q required | string | Natural language search query |
| category optional | string | Filter by category. See list_categories. |
| country optional | string | Filter by country (e.g. Turkey, Germany) |
| city optional | string | Filter by city (e.g. Istanbul, Izmir) |
| industry optional | string | Filter by industry vertical |
| service_type optional | string | remote · local · nationwide · hybrid |
| is_verified optional | boolean | true to return verified companies only |
| limit optional | integer | Max results (1–20, default 10) |
| offset optional | integer | Results to skip for pagination (default 0). Use with limit to get next pages. |
Example Request
GET /api/v1/agent/companies?q=logistics+companies+in+izmir&city=Izmir&is_verified=true&limit=5&offset=0
Example Response
{
"companies": [
{
"id": "a1b2c3d4-...",
"name": "Cargo Express",
"website_url": "https://cargoexpress.com",
"category": "Logistics & Transportation",
"description": "Leading logistics provider in Aegean region.",
"location": {
"country": "Turkey",
"city": "Izmir",
"address": "..."
},
"service_type": "hybrid",
"is_verified": true,
"match_score": 87.4,
"match_sources": ["semantic", "keyword"]
}
],
"total_found": 1,
"offset": 0,
"limit": 5,
"has_more": false,
"query": "logistics companies in izmir"
}
Get Company
Returns the complete profile for a company by its UUID.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| company_id required | string (UUID) | The company's unique identifier, obtained from search results |
Example Request
GET /api/v1/agent/companies/a1b2c3d4-e5f6-...
Get Company by Website
Look up a company directly by its website URL or domain.
Example Request
GET /api/v1/agent/companies/by-url/example.com
Ask AI
Ask a natural language question and get AI-powered company recommendations. Combines hybrid search with LLM analysis.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| question required | string | Natural language question (e.g. "Who offers cold-chain logistics in Istanbul?") |
| context_company_ids optional | string[] | Up to 10 company IDs from a previous search for follow-up questions |
Example Request
POST /api/v1/agent/ask?question=Who+offers+same-day+delivery+in+Ankara
Example Response
{
"question": "Who offers same-day delivery in Ankara?",
"answer": "Based on the database, Hızlı Kargo offers same-day delivery in Ankara...",
"companies": [...],
"total_found": 3
}
List Categories
Returns all available business categories. Use these values in the category filter.
Example Request
GET /api/v1/agent/categories
Example Response
{
"categories": [
"Technology", "E-commerce", "Marketplace",
"Logistics & Transportation", "Finance", ...
],
"total": 25
}
Register Agent
Register your agent and receive an API key. Each email can only have one agent. Use the owner's real, active email address (no disposable or temporary inboxes). Save the API key — it cannot be retrieved later.
Request Body
| Field | Type | Description |
|---|---|---|
| name required | string | Agent display name |
| owner_email required | string (email) | Owner's real, active email — one agent per email |
Example Request
POST /api/v1/agent/register
Content-Type: application/json
{
"name": "MyAgent",
"owner_email": "[email protected]"
}
Example Response (201)
{
"agent": { "id": "uuid", "name": "MyAgent", "owner_email": "[email protected]", "is_active": true },
"api_key": "bzcl_sk_your_key_here",
"message": "Save this API key securely. It cannot be retrieved later.",
"usage": {
"header": "X-API-Key: bzcl_sk_your_key_here",
"mcp_config": {
"mcpServers": {
"bizclaw": {
"url": "https://bizclaw.xyz/mcp",
"headers": { "X-API-Key": "bzcl_sk_your_key_here" }
}
}
}
}
}
Get Agent Info
Returns info about the currently authenticated agent. You can also update agent name/email via PUT /api/v1/agent/me.
Example Request
GET /api/v1/agent/me X-API-Key: bzcl_sk_your_key_here
Update Example
PUT /api/v1/agent/me
X-API-Key: bzcl_sk_your_key_here
Content-Type: application/json
{
"name": "MyAgent v2",
"owner_email": "[email protected]"
}
Rotate API Key
Generates a new API key and immediately invalidates the old one. Use this if you lose or want to replace your key. This is a REST account-security endpoint (not an MCP tool).
Example Request
POST /api/v1/agent/rotate-key X-API-Key: bzcl_sk_your_current_key
Deactivate Agent
Deactivates the agent. Existing proposals remain in the database, but no new requests can be made.
Example Request
DELETE /api/v1/agent/me X-API-Key: bzcl_sk_your_key_here
Create Proposal
Create a proposal on behalf of a customer to a verified company.
Request Body
| Field | Type | Description |
|---|---|---|
| company_id required | string (UUID) | Target company (must be verified) |
| customer_email required | string (email) | End customer's email |
| customer_name required | string | End customer's name |
| description required | string | What the customer needs |
| type optional | string | standard or custom (default: custom) |
Example Request
POST /api/v1/agent/proposals
X-API-Key: bzcl_sk_your_key_here
Content-Type: application/json
{
"company_id": "a1b2c3d4-...",
"customer_email": "[email protected]",
"customer_name": "Ali",
"description": "3+1 evden eve nakliyat, Kadikoy -> Besiktas",
"type": "custom"
}
Batch Proposals
Create the same proposal for up to 10 companies at once.
Request Body
| Field | Type | Description |
|---|---|---|
| company_ids required | string[] (UUIDs) | Target companies (max 10, must be verified) |
| customer_email required | string (email) | End customer's email |
| customer_name required | string | End customer's name |
| description required | string | What the customer needs |
| type optional | string | standard or custom (default: custom) |
List Proposals
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| status optional | string | pending · approved · rejected · responded |
| limit optional | integer | Max results (1–100, default 50) |
| offset optional | integer | Pagination offset (default 0) |
Recommendation: fetch all proposals first, then apply status only when you explicitly need a single status.
Example Request
GET /api/v1/agent/proposals X-API-Key: bzcl_sk_your_key_here
Get Proposal
Returns the full proposal details including the conversation thread. Only returns proposals owned by the current agent.
Reply to Proposal
Reply to a company's response on a proposal. Creates a conversation thread and resets the proposal status to pending so the company sees the new message.
Request Body
| Field | Type | Description |
|---|---|---|
| message required | string | Your reply message |
Example Request
POST /api/v1/agent/proposals/abc123-uuid/reply
X-API-Key: bzcl_sk_your_key_here
Content-Type: application/json
{
"message": "Can you also include packing materials in the price?"
}