/v1/me— Check a keyReturns the workspace, the key's name and scopes, and the user it acts as.
将您的 ERP、网站、BI 工具或任何其他系统连接到 MetriCRM。以下每个端点都由应用本身使用的同一规则生成,因此通过 API 能做的事情始终与密钥所有者在 MetriCRM 中能做的一致。
端点和字段说明为英文。
在 设置 → API 密钥 中创建密钥,并作为 Bearer 令牌发送。密钥格式为 mck_您的工作区_…,以创建者的身份操作,且只能访问其范围内的资源。使用 api.metricrm.com/v1,或您的工作区地址加 /api/v1。
curl https://api.metricrm.com/v1/me \
-H "Authorization: Bearer mck_your-workspace_…"列表每页最多返回 100 条记录并附带 nextCursor;将其作为 cursor 传回即可获取下一页。可按 createdAt 或 updatedAt 升序或降序排序,并使用 updatedSince 只同步有变化的记录。
curl "https://api.metricrm.com/v1/contacts?limit=50&updatedSince=2026-10-01T00:00:00Z&order=asc&sort=updatedAt"
# → { "data": [ … ], "nextCursor": "WyIyMDI2LTEwLTEz…" }
curl "https://api.metricrm.com/v1/contacts?limit=50&cursor=WyIyMDI2LTEwLTEz…"错误使用标准 HTTP 状态码和统一的 JSON 格式:可供程序判断的代码、易读的消息,以及输入无效时需要修正的字段。401 表示缺少密钥或密钥已失效;403 表示其范围、所有者角色或 IP 允许列表不允许该调用;404 也包括密钥无法查看的记录。
HTTP/1.1 400 Bad Request
{ "error": { "code": "invalid_request",
"message": "Some fields are missing or invalid.",
"details": [ { "path": "email", "message": "Invalid email address" } ] } }每个密钥有自己的每分钟限额(默认 600,在创建密钥时设置)。每个响应都会告诉您剩余额度;达到限额时,请等待 Retry-After 中的秒数。
HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 600
RateLimit-Remaining: 0
RateLimit-Reset: 42
Retry-After: 42POST 请求请附带 Idempotency-Key 请求头。如果网络失败而您在 24 小时内以相同的键和内容重试,您将得到第一次的响应,而不会产生重复记录。
curl https://api.metricrm.com/v1/contacts \
-H "Authorization: Bearer $METRICRM_API_KEY" \
-H "Idempotency-Key: 6f1c2a9e-0b6d-4c1e-9a55-2f1d0e7b3c11" \
-H "Content-Type: application/json" \
-d '{"firstName":"Aisyah","lastName":"Rahman","email":"aisyah@sinar.my"}'设置 → Webhook 会把事件(case.created、invoice.paid 等)以 JSON 发送到您的 HTTPS 端点。每个请求按 Standard Webhooks 签名:用端点的 whsec_ 密钥校验 webhook-signature,拒绝过旧的时间戳,并用 webhook-id 忽略重复请求。返回任意 2xx 状态即可;其他响应会重试约 3.5 天。
// Node.js: verify a MetriCRM webhook (Standard Webhooks)
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(secret, headers, rawBody) {
const id = headers["webhook-id"], ts = headers["webhook-timestamp"];
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // too old
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const expected = createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest();
return headers["webhook-signature"].split(" ").some((s) => {
const sig = Buffer.from(s.split(",")[1] ?? "", "base64");
return sig.length === expected.length && timingSafeEqual(sig, expected);
});
}
// Body: { "type": "case.created", "timestamp": "…",
// "data": { "id": "…", "entityType": "case", "object": { … }, "changes": { … } } }Check which key and workspace you are using.
curl "https://api.metricrm.com/v1/me?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/me— Check a keyReturns the workspace, the key's name and scopes, and the user it acts as.
Companies you do business with.
curl "https://api.metricrm.com/v1/accounts?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/accounts— List accountsCompanies you do business with. Requires the `accounts:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| ownerId | string (uuid) | Only accounts owned by this user. |
| teamId | string (uuid) | Only accounts of this team. |
| parentId | string (uuid) | Only child accounts of this account. |
| string | Exact email address (lower case). | |
| tier | string | Exact tier. |
/v1/accounts— Create an accountRequires the `accounts:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| name必填 | string | |
| legalName | string | null | |
| registrationNo | string | null | |
| industry | string | null | |
| website | string | null | |
| string (email) | null | "" | ||
| phone | string | null | |
| address | object | null | |
| tier | string | null | |
| parentId | string (uuid) | null | |
| ownerId | string (uuid) | null | |
| backupOwnerId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| tags | string[] | |
| custom | object |
/v1/accounts/{id}— Get one recordRequires the `accounts:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/accounts/{id}— Update an accountRequires the `accounts:write` scope.
| id必填 | string (uuid) | Record id. |
| name | string | |
| legalName | string | null | |
| registrationNo | string | null | |
| industry | string | null | |
| website | string | null | |
| string (email) | null | "" | ||
| phone | string | null | |
| address | object | null | |
| tier | string | null | |
| parentId | string (uuid) | null | |
| ownerId | string (uuid) | null | |
| backupOwnerId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| tags | string[] | |
| custom | object |
/v1/accounts/{id}— Move an account to the recycle binRequires the `accounts:write` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | null | |
| name必填 | string | |
| legalName必填 | string | null | |
| registrationNo必填 | string | null | |
| industry必填 | string | null | |
| website必填 | string | null | |
| email必填 | string | null | |
| phone必填 | string | null | |
| address必填 | object | null | |
| tier必填 | string | null | |
| parentId必填 | string (uuid) | null | |
| ownerId必填 | string (uuid) | null | |
| teamId必填 | string (uuid) | null | |
| tags必填 | string[] | |
| custom必填 | object | Custom field values by field key. |
| lastActivityAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
People at your customers.
curl "https://api.metricrm.com/v1/contacts?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/contacts— List contactsPeople at your customers. Requires the `contacts:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| accountId | string (uuid) | Only contacts whose primary account is this. |
| ownerId | string (uuid) | Only contacts owned by this user. |
| string | Exact email address (lower case). | |
| mobile | string | Exact mobile number in E.164 (+60…). |
/v1/contacts— Create a contactRequires the `contacts:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| firstName | string | null | |
| lastName | string | null | |
| fullName | string | null | |
| string (email) | null | "" | ||
| mobile | string | null | |
| office | string | null | |
| home | string | null | |
| title | string | null | |
| department | string | null | |
| locale | "en" | "ms" | "zh-CN" | null | |
| ownerId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| tags | string[] | |
| custom | object | |
| accountId | string (uuid) | null | |
| accountRole | string | null |
/v1/contacts/{id}— Get one recordRequires the `contacts:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/contacts/{id}— Update a contactRequires the `contacts:write` scope.
| id必填 | string (uuid) | Record id. |
| firstName | string | null | |
| lastName | string | null | |
| fullName | string | null | |
| string (email) | null | "" | ||
| mobile | string | null | |
| office | string | null | |
| home | string | null | |
| title | string | null | |
| department | string | null | |
| locale | "en" | "ms" | "zh-CN" | null | |
| ownerId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| tags | string[] | |
| custom | object |
/v1/contacts/{id}— Move a contact to the recycle binRequires the `contacts:write` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | null | |
| firstName必填 | string | null | |
| lastName必填 | string | null | |
| fullName必填 | string | |
| email必填 | string | null | |
| mobile必填 | string | null | |
| office必填 | string | null | |
| home必填 | string | null | |
| title必填 | string | null | |
| department必填 | string | null | |
| locale必填 | string | null | |
| primaryAccountId必填 | string (uuid) | null | |
| ownerId必填 | string (uuid) | null | |
| teamId必填 | string (uuid) | null | |
| tags必填 | string[] | |
| custom必填 | object | Custom field values by field key. |
| lastActivityAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Customer service cases (MetriCare). New cases are routed like any other case.
curl "https://api.metricrm.com/v1/cases?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/cases— List casesCustomer service cases (MetriCare). New cases are routed like any other case. Requires the `cases:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | string | Exact status key. |
| priority | string | Exact priority key. |
| accountId | string (uuid) | Only cases of this account. |
| contactId | string (uuid) | Only cases of this contact. |
| assigneeId | string (uuid) | Only cases assigned to this user. |
| teamId | string (uuid) | Only cases of this team. |
/v1/cases— Create a caseRequires the `cases:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| subject必填 | string | |
| description | string | |
| categoryId | string (uuid) | null | |
| subCategoryId | string (uuid) | null | |
| priority | string | null | |
| status | string | null | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| assigneeId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| tags | string[] | |
| custom | object |
/v1/cases/{id}— Get one recordRequires the `cases:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/cases/{id}— Update a caseRequires the `cases:write` scope.
| id必填 | string (uuid) | Record id. |
| subject | string | |
| description | string | |
| categoryId | string (uuid) | null | |
| subCategoryId | string (uuid) | null | |
| priority | string | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| tags | string[] | |
| custom | object | |
| resolution | string | null |
/v1/cases/{id}— Delete a caseRequires the `cases:write` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | |
| subject必填 | string | |
| description必填 | string | |
| channel必填 | string | |
| categoryId必填 | string (uuid) | null | |
| subCategoryId必填 | string (uuid) | null | |
| priority必填 | string | |
| status必填 | string | |
| statusCategory必填 | string | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| assigneeId必填 | string (uuid) | null | |
| teamId必填 | string (uuid) | null | |
| tags必填 | string[] | |
| custom必填 | object | Custom field values by field key. |
| resolution必填 | string | null | |
| language必填 | string | null | |
| firstResponseDueAt必填 | string (date-time) | null | |
| resolutionDueAt必填 | string (date-time) | null | |
| firstRespondedAt必填 | string (date-time) | null | |
| slaState必填 | string | |
| resolvedAt必填 | string (date-time) | null | |
| closedAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Replies and internal notes on cases. A public comment is emailed to the case contact.
curl "https://api.metricrm.com/v1/comments?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/comments— List case commentsReplies and internal notes on cases. A public comment is emailed to the case contact. Requires the `cases:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| caseId | string (uuid) | Only comments on this case. |
| kind | "public" | "internal" | Public replies or notes. |
/v1/comments— Add a reply or internal note to a caseRequires the `cases:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| caseId必填 | string (uuid) | |
| kind必填 | "public" | "internal" | |
| html必填 | string | HTML body (sanitised). |
/v1/comments/{id}— Get one recordRequires the `cases:read` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| caseId必填 | string (uuid) | |
| kind必填 | "public" | "internal" | |
| authorType必填 | string | |
| authorId必填 | string (uuid) | null | |
| authorName必填 | string | null | |
| body必填 | string | Sanitised HTML. |
| via必填 | string | null | |
| createdAt必填 | string (date-time) |
Prospects to qualify (MetriSales). New leads are routed to a sales rep.
curl "https://api.metricrm.com/v1/leads?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/leads— List leadsProspects to qualify (MetriSales). New leads are routed to a sales rep. Requires the `leads:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | string | Exact status. |
| ownerId | string (uuid) | Only leads owned by this user. |
| string | Exact email address (lower case). |
/v1/leads— Create a leadRequires the `leads:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| fullName必填 | string | |
| companyName | string | null | |
| string (email) | null | "" | ||
| phone | string | null | |
| source | "web_form" | "email" | "chat" | "social" | "import" | "api" | "manual" | |
| sourceDetail | string | null | |
| ownerId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| fields | object | |
| language | string | null |
/v1/leads/{id}— Get one recordRequires the `leads:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/leads/{id}— Update a leadRequires the `leads:write` scope.
| id必填 | string (uuid) | Record id. |
| fullName | string | |
| companyName | string | null | |
| string (email) | null | "" | ||
| phone | string | null | |
| status | "new" | "contacted" | "qualifying" | |
| fields | object |
/v1/leads/{id}— Delete a leadRequires the `leads:write` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | |
| fullName必填 | string | |
| companyName必填 | string | null | |
| email必填 | string | null | |
| phone必填 | string | null | |
| source必填 | string | |
| sourceDetail必填 | string | null | |
| status必填 | string | |
| ownerId必填 | string (uuid) | null | |
| teamId必填 | string (uuid) | null | |
| fields必填 | object | |
| score必填 | integer | null | |
| language必填 | string | null | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| dealId必填 | string (uuid) | null | |
| convertedAt必填 | string (date-time) | null | |
| disqualifiedReason必填 | string | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Deals in your sales pipelines.
curl "https://api.metricrm.com/v1/opportunities?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/opportunities— List opportunitiesDeals in your sales pipelines. Requires the `deals:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | "open" | "won" | "lost" | Open, won or lost. |
| pipelineId | string (uuid) | Only deals in this pipeline. |
| stageKey | string | Exact stage key. |
| accountId | string (uuid) | Only deals of this account. |
| ownerId | string (uuid) | Only deals owned by this user. |
/v1/opportunities— Create an opportunityRequires the `deals:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| name必填 | string | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| pipelineId | string (uuid) | null | |
| stageKey | string | null | |
| amountSen | integer | |
| currency | string | |
| expectedCloseDate | string (date) | null | |
| ownerId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| source | string | null | |
| competitors | string[] | |
| nextStep | string | null |
/v1/opportunities/{id}— Get one recordRequires the `deals:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/opportunities/{id}— Update an opportunityRequires the `deals:write` scope.
| id必填 | string (uuid) | Record id. |
| name | string | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| amountSen | integer | |
| expectedCloseDate | string (date) | null | |
| ownerId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| source | string | null | |
| competitors | string[] | |
| nextStep | string | null |
/v1/opportunities/{id}— Delete an opportunityRequires the `deals:write` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | |
| name必填 | string | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| pipelineId必填 | string (uuid) | null | |
| stageKey必填 | string | |
| probability必填 | integer | |
| amountSen必填 | integer | Deal value in the smallest currency unit (sen for MYR). |
| currency必填 | string | |
| expectedCloseDate必填 | string (date) | null | |
| ownerId必填 | string (uuid) | null | |
| teamId必填 | string (uuid) | null | |
| source必填 | string | null | |
| leadId必填 | string (uuid) | null | |
| competitors必填 | string[] | |
| nextStep必填 | string | null | |
| status必填 | "open" | "won" | "lost" | |
| wonAt必填 | string (date-time) | null | |
| lostAt必填 | string (date-time) | null | |
| lostReason必填 | string | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Quotations with line items, discounts and SST. Approval rules still apply.
curl "https://api.metricrm.com/v1/quotations?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/quotations— List quotationsQuotations with line items, discounts and SST. Approval rules still apply. Requires the `quotations:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | string | Exact status. |
| dealId | string (uuid) | Only quotations for this opportunity. |
| accountId | string (uuid) | Only quotations for this account. |
/v1/quotations— Create a draft quotationRequires the `quotations:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| title必填 | string | |
| dealId | string (uuid) | null | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| priceListId | string (uuid) | null | |
| tier | string | null | |
| language | "en" | "ms" | "zh-CN" | |
| validUntil | string | null | |
| paymentTermsDays | integer | null | |
| terms | string | null | |
| notes | string | null | |
| items | object[] |
/v1/quotations/{id}— Get one recordRequires the `quotations:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/quotations/{id}— Replace a draft quotation (send every field and all line items)Requires the `quotations:write` scope.
| id必填 | string (uuid) | Record id. |
| title必填 | string | |
| dealId | string (uuid) | null | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| priceListId | string (uuid) | null | |
| tier | string | null | |
| language | "en" | "ms" | "zh-CN" | |
| validUntil | string | null | |
| paymentTermsDays | integer | null | |
| terms | string | null | |
| notes | string | null | |
| items | object[] |
/v1/quotations/{id}— Delete a draft quotationRequires the `quotations:write` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | |
| version必填 | integer | |
| title必填 | string | |
| dealId必填 | string (uuid) | null | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| ownerId必填 | string (uuid) | null | |
| status必填 | string | |
| currency必填 | string | |
| language必填 | string | |
| validUntil必填 | string (date) | null | |
| paymentTermsDays必填 | integer | null | |
| terms必填 | string | null | |
| grossSen必填 | integer | Before discount and tax in the smallest currency unit (sen for MYR). |
| discountSen必填 | integer | Discount in the smallest currency unit (sen for MYR). |
| taxSen必填 | integer | Tax in the smallest currency unit (sen for MYR). |
| totalSen必填 | integer | Total in the smallest currency unit (sen for MYR). |
| sentAt必填 | string (date-time) | null | |
| decidedAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Sales orders, created from accepted quotations.
curl "https://api.metricrm.com/v1/orders?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/orders— List ordersSales orders, created from accepted quotations. Requires the `orders:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | string | Exact status. |
| accountId | string (uuid) | Only orders of this account. |
| quoteId | string (uuid) | Only the order for this quotation. |
/v1/orders— Create the sales order for an accepted quotationRequires the `orders:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| quoteId必填 | string (uuid) |
/v1/orders/{id}— Get one recordRequires the `orders:read` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | |
| quoteId必填 | string (uuid) | null | |
| dealId必填 | string (uuid) | null | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| ownerId必填 | string (uuid) | null | |
| title必填 | string | |
| status必填 | string | |
| currency必填 | string | |
| totalSen必填 | integer | Total in the smallest currency unit (sen for MYR). |
| taxSen必填 | integer | Tax in the smallest currency unit (sen for MYR). |
| fulfilledAt必填 | string (date-time) | null | |
| cancelledAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Invoices with SST and payment status.
curl "https://api.metricrm.com/v1/invoices?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/invoices— List invoicesInvoices with SST and payment status. Requires the `invoices:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | string | Exact status. |
| accountId | string (uuid) | Only invoices of this account. |
| orderId | string (uuid) | Only invoices for this order. |
/v1/invoices— Create a draft invoiceRequires the `invoices:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| title必填 | string | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| language | "en" | "ms" | "zh-CN" | |
| issueDate | string | null | |
| paymentTermsDays | integer | null | |
| terms | string | null | |
| notes | string | null | |
| items | object[] |
/v1/invoices/{id}— Get one recordRequires the `invoices:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/invoices/{id}— Replace a draft invoice (send every field and all line items)Requires the `invoices:write` scope.
| id必填 | string (uuid) | Record id. |
| title必填 | string | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| language | "en" | "ms" | "zh-CN" | |
| issueDate | string | null | |
| paymentTermsDays | integer | null | |
| terms | string | null | |
| notes | string | null | |
| items | object[] |
| id必填 | string (uuid) | |
| number必填 | string | |
| orderId必填 | string (uuid) | null | |
| dealId必填 | string (uuid) | null | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| ownerId必填 | string (uuid) | null | |
| title必填 | string | |
| status必填 | string | |
| currency必填 | string | |
| language必填 | string | |
| issueDate必填 | string (date) | |
| dueDate必填 | string (date) | |
| paymentTermsDays必填 | integer | |
| totalSen必填 | integer | Total in the smallest currency unit (sen for MYR). |
| taxSen必填 | integer | Tax in the smallest currency unit (sen for MYR). |
| paidSen必填 | integer | Paid so far in the smallest currency unit (sen for MYR). |
| sentAt必填 | string (date-time) | null | |
| paidAt必填 | string (date-time) | null | |
| voidedAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Payments recorded against invoices (bank transfer, cash, cheque, card).
curl "https://api.metricrm.com/v1/payments?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/payments— List paymentsPayments recorded against invoices (bank transfer, cash, cheque, card). Requires the `invoices:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| invoiceId | string (uuid) | Only payments for this invoice. |
/v1/payments— Record a payment against an invoiceRequires the `invoices:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| amountSen必填 | integer | |
| method必填 | "bank_transfer" | "cash" | "cheque" | "card" | "online" | "other" | |
| reference | string | null | |
| paidOn必填 | string | |
| note | string | null | |
| invoiceId必填 | string (uuid) |
/v1/payments/{id}— Get one recordRequires the `invoices:read` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| invoiceId必填 | string (uuid) | |
| number必填 | string | |
| amountSen必填 | integer | Amount in the smallest currency unit (sen for MYR). |
| method必填 | string | |
| reference必填 | string | null | |
| paidOn必填 | string (date) | |
| note必填 | string | null | |
| source必填 | string | |
| voidedAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) |
Your product and service catalogue.
curl "https://api.metricrm.com/v1/products?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/products— List productsYour product and service catalogue. Requires the `products:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | "active" | "archived" | Active or archived. |
| sku | string | Exact SKU (upper case). |
/v1/products— Create a productRequires the `products:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| sku必填 | string | |
| name必填 | string | |
| description | string | null | |
| unit | string | |
| priceSen必填 | integer | |
| costSen | integer | null | |
| currency | string | |
| taxCategoryId | string (uuid) | null | |
| parentId | string (uuid) | null | |
| options | object | |
| status | "active" | "archived" |
/v1/products/{id}— Get one recordRequires the `products:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/products/{id}— Replace a product (send every field)Requires the `products:write` scope.
| id必填 | string (uuid) | Record id. |
| sku必填 | string | |
| name必填 | string | |
| description | string | null | |
| unit | string | |
| priceSen必填 | integer | |
| costSen | integer | null | |
| currency | string | |
| taxCategoryId | string (uuid) | null | |
| parentId | string (uuid) | null | |
| options | object | |
| status | "active" | "archived" |
| id必填 | string (uuid) | |
| sku必填 | string | |
| name必填 | string | |
| description必填 | string | null | |
| unit必填 | string | |
| priceSen必填 | integer | List price in the smallest currency unit (sen for MYR). |
| costSen必填 | integer | null | |
| currency必填 | string | |
| taxCategoryId必填 | string (uuid) | null | |
| parentId必填 | string (uuid) | null | |
| options必填 | object | |
| status必填 | "active" | "archived" | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Follow-ups with due dates and reminders.
curl "https://api.metricrm.com/v1/tasks?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/tasks— List tasksFollow-ups with due dates and reminders. Requires the `tasks:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | "open" | "done" | "cancelled" | Open, done or cancelled. |
| assigneeId | string (uuid) | Only tasks assigned to this user. |
| accountId | string (uuid) | Only tasks about this account. |
| contactId | string (uuid) | Only tasks about this contact. |
/v1/tasks— Create a taskRequires the `tasks:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| title必填 | string | |
| description | string | null | |
| priority | "low" | "medium" | "high" | "urgent" | |
| dueAt | string (date-time) | null | |
| remindAt | string (date-time) | null | |
| assigneeId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| entityType | string | null | |
| entityId | string (uuid) | null | |
| recurrence | object | null |
/v1/tasks/{id}— Get one recordRequires the `tasks:read` scope.
| id必填 | string (uuid) | Record id. |
/v1/tasks/{id}— Update a taskRequires the `tasks:write` scope.
| id必填 | string (uuid) | Record id. |
| title | string | |
| description | string | null | |
| priority | "low" | "medium" | "high" | "urgent" | |
| dueAt | string (date-time) | null | |
| remindAt | string (date-time) | null | |
| assigneeId | string (uuid) | null | |
| teamId | string (uuid) | null | |
| entityType | string | null | |
| entityId | string (uuid) | null | |
| recurrence | object | null |
/v1/tasks/{id}— Delete a taskRequires the `tasks:write` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | null | |
| title必填 | string | |
| description必填 | string | null | |
| status必填 | "open" | "done" | "cancelled" | |
| priority必填 | string | |
| dueAt必填 | string (date-time) | null | |
| remindAt必填 | string (date-time) | null | |
| assigneeId必填 | string (uuid) | null | |
| teamId必填 | string (uuid) | null | |
| entityType必填 | string | null | |
| entityId必填 | string (uuid) | null | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| completedAt必填 | string (date-time) | null | |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
The timeline on accounts and contacts: calls, emails, chats, notes and more.
curl "https://api.metricrm.com/v1/activities?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/activities— List activitiesThe timeline on accounts and contacts: calls, emails, chats, notes and more. Requires the `activities:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| accountId | string (uuid) | Only activities on this account. |
| contactId | string (uuid) | Only activities on this contact. |
| kind | string | Exact kind (call, email, note …). |
/v1/activities— Log an activity (a call, meeting note or email from another system)Requires the `activities:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| kind必填 | "call" | "email" | "chat" | "note" | |
| accountId | string (uuid) | null | |
| contactId | string (uuid) | null | |
| title必填 | string | |
| body | string | null | |
| occurredAt | string (date-time) | null |
/v1/activities/{id}— Get one recordRequires the `activities:read` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| kind必填 | string | |
| subjectType必填 | string | |
| subjectId必填 | string (uuid) | |
| accountId必填 | string (uuid) | null | |
| contactId必填 | string (uuid) | null | |
| title必填 | string | |
| body必填 | string | null | Short preview (up to 500 characters). |
| actorUserId必填 | string (uuid) | null | |
| actorType必填 | string | |
| occurredAt必填 | string (date-time) |
Knowledge base articles with their published translations.
curl "https://api.metricrm.com/v1/articles?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/articles— List knowledge baseKnowledge base articles with their published translations. Requires the `knowledge:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | string | Exact status (published, draft …). |
| visibility | "internal" | "public" | Internal or public. |
| categoryId | string (uuid) | Only articles in this category. |
/v1/articles/{id}— Get one recordRequires the `knowledge:read` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| number必填 | string | null | |
| categoryId必填 | string (uuid) | null | |
| slug必填 | string | |
| visibility必填 | "internal" | "public" | |
| status必填 | string | |
| tags必填 | string[] | |
| version必填 | integer | |
| publishedAt必填 | string (date-time) | null | |
| translations必填 | object[] | Published content per language. |
| createdAt必填 | string (date-time) | |
| updatedAt必填 | string (date-time) |
Messages in MetriChat conversations (web chat, WhatsApp, SMS and more).
curl "https://api.metricrm.com/v1/messages?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/messages— List messagesMessages in MetriChat conversations (web chat, WhatsApp, SMS and more). Requires the `messages:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| conversationId | string (uuid) | Only messages in this conversation. |
| direction | "in" | "out" | "note" | "system" | Incoming, outgoing, internal note or system. |
/v1/messages— Reply in a conversation (through its channel)Requires the `messages:write` scope.
| Idempotency-Key (header) | string | Any unique value (a UUID works). A retry with the same key and body returns the first response instead of creating a duplicate. Kept for 24 hours. |
| conversationId必填 | string (uuid) | |
| text必填 | string |
/v1/messages/{id}— Get one recordRequires the `messages:read` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| conversationId必填 | string (uuid) | |
| direction必填 | "in" | "out" | "note" | "system" | |
| author必填 | "customer" | "agent" | "bot" | "system" | |
| authorUserId必填 | string (uuid) | null | |
| body必填 | string | |
| status必填 | string | null | |
| createdAt必填 | string (date-time) |
People in this workspace (read only).
curl "https://api.metricrm.com/v1/users?limit=10" \
-H "Authorization: Bearer $METRICRM_API_KEY"/v1/users— List usersPeople in this workspace (read only). Requires the `users:read` scope.
| limit | integer | Page size, 1–100 (default 25). |
| cursor | string | The nextCursor of the previous page. |
| sort | "createdAt" | "updatedAt" | Sort field (default createdAt). |
| order | "asc" | "desc" | Sort order (default desc). |
| createdSince | string (date-time) | Only records created after this time (ISO 8601). |
| updatedSince | string (date-time) | Only records changed after this time — use for incremental sync. |
| status | string | Exact status (active, invited …). |
| string | Exact email address. |
/v1/users/{id}— Get one recordRequires the `users:read` scope.
| id必填 | string (uuid) | Record id. |
| id必填 | string (uuid) | |
| email必填 | string | |
| displayName必填 | string | |
| title必填 | string | null | |
| locale必填 | string | null | |
| timezone必填 | string | null | |
| status必填 | string | |
| availability必填 | string | |
| createdAt必填 | string (date-time) |