Quick Start
The PWM CRM API is built on a RESTful architecture, all requests use the HTTPS protocol, and the data format is JSON. The base URL is:
https://api.pwmapp.com/v1
Step 1: Get an API Key
Sign in to the PWM CRM admin panel, go to "Settings - Developers - API Keys", and click "Create Key." The system will generate a pair of API Key and API Secret, make sure to save them properly.
Security Tip: The API Secret is only shown once when created and cannot be viewed again. Please save it somewhere safe. If lost, delete the old key and create a new one.
Step 2: Make Your First Request
Use curl to test retrieving the list of Clients:
curl -X GET "https://api.pwmapp.com/v1/customers?page=1&page_size=10" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Successful response example:
{
"code": 0,
"message": "success",
"data": {
"total": 156,
"page": 1,
"page_size": 10,
"items": [
{
"id": "cus_abc123",
"name": "PIN Group",
"industry": "building_materials",
"level": "A",
"contact": "Manager Zhang",
"phone": "138****8888",
"created_at": "2026-01-15T10:30:00Z"
}
]
}
}
Authentication Method
PWM CRM API supports two authentication methods:
1. API Key (Recommended)
Include the API Key in the request header:
Authorization: Bearer YOUR_API_KEY
2. OAuth 2.0
For third-party app integration. The process:
- Create an OAuth app in the developer dashboard to get
client_idandclient_secret - Guide users to the authorization page:
https://app.pwmapp.com/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code - After the user authorizes, get the
codeand exchange it for anaccess_token - Use the
access_tokento call the API
Error Code
| HTTP Status Code | Error Code | Description |
|---|---|---|
| 200 | 0 | Request successful |
| 400 | 10001 | Request parameter error |
| 401 | 10002 | Authentication failed, API Key invalid or expired |
| 403 | 10003 | Insufficient permissions, cannot access the resource |
| 404 | 10004 | Resource not found |
| 429 | 10005 | Request rate limit exceeded |
| 500 | 20001 | Internal server error |
| 503 | 20002 | Service temporarily unavailable, please try again later |
Wrong response format:
{
"code": 10002,
"message": "Invalid API Key",
"request_id": "req_xyz789"
}
Frequency Limit
| Plan | Requests per Minute | Requests per Day |
|---|---|---|
| Free | 60 | 10,000 |
| Starter | 120 | 50,000 |
| Professional | 300 | 200,000 |
| Enterprise | 1,000 | Unlimited |
If you exceed the limit, a 429 status code is returned, with the response header X-RateLimit-Reset showing the reset time (Unix timestamp).
SDK Download
We offer official SDKs in multiple languages to make integration easier:
- Python SDK:
pip install pwmapp - Node.js SDK:
npm install @pwmapp/sdk - Java SDK: Maven dependency, see GitHub for details
- Go SDK:
go get github.com/pwmapp/go-sdk - PHP SDK: Install via Composer
SDK source code and examples: https://github.com/pwmapp
API Reference
Client Management
<| Method | Path | Description |
|---|---|---|
| GET | /v1/customers | Get list of Clients |
| POST | /v1/customers | Create a Client |
| GET | /v1/customers/{id} | Get Client details |
| PUT | /v1/customers/{id} | Update Client |
| DELETE | /v1/customers/{id} | Delete Client |
| POST | /v1/customers/batch | Batch import Clients |
Example request to create a Client:
POST /v1/customers
{
"name": "Hengrui Pharmaceutical Chain",
"industry": "pharmaceutical",
"level": "A",
"contact": "Director Li",
"phone": "13900001111",
"email": "li@hengrui.com",
"address": "100 Zhangjiang Road, Pudong New Area, Shanghai",
"tags": ["Key Client", "Pharmaceutical"],
"custom_fields": {
"hospital_level": "Top Tier (Class 3, Grade A)",
"annual_budget": "5,000,000"
}
}
Opportunity Management
| Method | and path | explanation |
|---|---|---|
| GET | /v1/opportunities | to get a list of business opportunities |
| POST | /v1/opportunities | creates business opportunities |
| GET | /v1/opportunities/{id} | Get details about the opportunity |
| PATCH | /v1/opportunities/{id}/stage | updates the Business Opportunity Phase |
| GET | /v1/opportunities/{id}/score | to obtain AI business opportunities for Scoring |
Field Visit
| Method | and path | explanation |
|---|---|---|
| GET | /v1/visits retrieves | the list of visit records |
| POST | /v1/visits/checkin | |
| POST | /v1/visits/checkout | |
| GET | /v1/visits/{id}/report | Get the AI-generated Visit Reports |
| GET | /v1/visits/routes | to get the optimal visit route |
Follow-up Records
| Method | and path | explanation |
|---|---|---|
| GET | /v1/activities | retrieves the list of Follow-up Records |
POST/v1/activities | creates Follow-up Records | |
| POST | /v1/activities/summarize | AI Smart summary |
Data Reports
| Method | and path | explanation |
|---|---|---|
| GET | /v1/reports/sales-overview | |
| GET | /v1/reports/pipeline | Sales Pipeline Analytics |
| GET | /v1/reports/field-efficiency | Field Efficiency |
| GET | /v1/reports/team-ranking | Team Ranking |
POST/v1/reports/export | exports reports (asynchronous). |
AI Capabilities
| Method | and path | explanation |
|---|---|---|
| POST | /v1/ai/chat | AI conversation query |
| POST | /v1/ai/transcribe | Speech-to-text |
| POST | /v1/ai/tts | text-to-speech |
| POST | /v1/ai/opportunity-score | Business Opportunity Scoring |
POST/v1/ai/visit-report | generates Visit Reports | |
| POST | /v1/ai/route-optimize | route optimization |
Example of an AI conversational request:
POST /v1/ai/chat
{
"query": "East China this month sales funnel pipeline health?",
"context": {
"user_id": "usr_001",
"page": "dashboard"
},
"stream": false
}
Webhook
Webhooks let you receive real-time notifications when specific events happen. You can configure the callback URL and subscribe to events in 'Settings - Developer - Webhook' on Medium.
Supported event types:
customer.created/customer.updated/customer.deletedopportunity.created/opportunity.stage_changed/opportunity.won/opportunity.lostvisit.checkin/visit.checkout/visit.report_generatedactivity.createdai.alert.triggered(AI Anomaly Alerts)
Webhook push example:
POST /your-webhook-endpoint
X-pwmapp-Signature: sha256=abc123...
{
"event": "opportunity.won",
"timestamp": "2026-08-29T10:30:00Z",
"data": {
"id": "opp_001",
"name": "East China Building Materials Annual Procurement",
"amount": 500000,
"customer_id": "cus_001",
"owner_id": "usr_001"
}
}
Verify Signature: Every webhook request includes an X-pwmapp-Signature header, which is an HMAC-SHA256 signature of the payload using your Webhook Secret. Make sure to verify the signature before processing to confirm the request is from PWM CRM.
Need Help? If you run into any tech issues, check out the Plugin Development Guide, or email the developer support team at developer@pwmapp.com.