PWM CRM API Docs

RESTful API, supports JSON format, provides complete interfaces for Client, Opportunities, Fieldwork, and AI Capabilities, helping you integrate quickly.

Quick Start API Reference

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:

  1. Create an OAuth app in the developer dashboard to get client_id and client_secret
  2. 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
  3. After the user authorizes, get the code and exchange it for an access_token
  4. Use the access_token to call the API

Error Code

HTTP Status CodeError CodeDescription
2000Request successful
40010001Request parameter error
40110002Authentication failed, API Key invalid or expired
40310003Insufficient permissions, cannot access the resource
40410004Resource not found
42910005Request rate limit exceeded
50020001Internal server error
50320002Service temporarily unavailable, please try again later

Wrong response format:

{
  "code": 10002,
  "message": "Invalid API Key",
  "request_id": "req_xyz789"
}

Frequency Limit

PlanRequests per MinuteRequests per Day
Free6010,000
Starter12050,000
Professional300200,000
Enterprise1,000Unlimited

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

<
MethodPathDescription
GET/v1/customersGet list of Clients
POST/v1/customersCreate a Client
GET/v1/customers/{id}Get Client details
PUT/v1/customers/{id}Update Client
DELETE/v1/customers/{id}Delete Client
POST/v1/customers/batchBatch 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/summarizeAI Smart summary

Data Reports

Sales overview report report
Method and path explanation
GET/v1/reports/sales-overview
GET/v1/reports/pipelineSales Pipeline Analytics
GET/v1/reports/field-efficiencyField Efficiency
GET/v1/reports/team-rankingTeam Ranking
POST/v1/reports/export exports reports (asynchronous).

AI Capabilities

Method and path explanation
POST/v1/ai/chatAI 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.deleted
  • opportunity.created / opportunity.stage_changed / opportunity.won / opportunity.lost
  • visit.checkin / visit.checkout / visit.report_generated
  • activity.created
  • ai.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.