npx skills add https://github.com/vm0-ai/vm0-skills --skill twenty开源现代化 CRM 平台。通过 REST 或 GraphQL API 管理人员、公司、商机、笔记和任务。
官方文档:https://docs.twenty.com/developers/api-and-webhooks/api
在需要以下操作时使用此技能:
设置环境变量:
export TWENTY_TOKEN="your-api-key"
curl -s -X GET "https://api.twenty.com/rest/companies" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.companies[:3]'
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
curl -s -X GET "https://api.twenty.com/rest/companies?limit=10&offset=0" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.companies'
写入 /tmp/twenty_request.json:
{
"name": "Acme Corp",
"domainName": "acme.com",
"address": "123 Main St, San Francisco, CA"
}
然后运行:
curl -s -X POST "https://api.twenty.com/rest/companies" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
curl -s -X GET "https://api.twenty.com/rest/people" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.people[:3]'
写入 /tmp/twenty_request.json:
{
"name": {
"firstName": "John",
"lastName": "Doe"
},
"email": "john@example.com",
"phone": "+1234567890"
}
然后运行:
curl -s -X POST "https://api.twenty.com/rest/people" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
注意: 将
{companyId}和{personId}替换为从上述“列出公司”或“列出人员”端点获取的实际 ID(在响应中查找id字段)。
# 通过 ID 获取公司
curl -s -X GET "https://api.twenty.com/rest/companies/{companyId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
# 通过 ID 获取人员
curl -s -X GET "https://api.twenty.com/rest/people/{personId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
注意: 将
{companyId}替换为从上述“列出公司”端点获取的实际公司 ID。
写入 /tmp/twenty_request.json:
{
"name": "Acme Corporation",
"employees": 500
}
然后运行:
curl -s -X PATCH "https://api.twenty.com/rest/companies/{companyId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
注意: 将
{companyId}替换为从上述“列出公司”端点获取的实际公司 ID。
curl -s -X DELETE "https://api.twenty.com/rest/companies/{companyId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
curl -s -X GET "https://api.twenty.com/rest/notes" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.notes[:3]'
写入 /tmp/twenty_request.json:
{
"title": "Meeting Notes",
"body": "Discussed Q1 roadmap and budget allocation."
}
然后运行:
curl -s -X POST "https://api.twenty.com/rest/notes" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
curl -s -X GET "https://api.twenty.com/rest/tasks" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.tasks[:3]'
写入 /tmp/twenty_request.json:
{
"title": "Follow up with client",
"dueAt": "2025-01-15T10:00:00Z",
"status": "TODO"
}
然后运行:
curl -s -X POST "https://api.twenty.com/rest/tasks" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
列出所有对象类型及其字段:
curl -s -X GET "https://api.twenty.com/rest/metadata/objects" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.objects[] | {name: .nameSingular, fields: [.fields[].name]}'
获取特定对象的元数据:
curl -s -X GET "https://api.twenty.com/rest/metadata/objects/companies" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
写入 /tmp/twenty_request.json:
{
"query": "query { companies(first: 5) { edges { node { id name domainName } } } }"
}
然后运行:
curl -s -X POST "https://api.twenty.com/graphql" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json | jq '.data.companies.edges'
| 类别 | 端点 | 描述 |
|---|---|---|
| 核心对象 | /rest/companies | 管理公司 |
/rest/people | 管理联系人 | |
/rest/opportunities | 管理交易/商机 | |
/rest/notes | 管理笔记 | |
/rest/tasks | 管理任务 | |
/rest/activities | 活动时间线 | |
| 元数据 | /rest/metadata/objects | 列出所有对象模式 |
/rest/metadata/objects/{name} | 获取特定对象模式 | |
/rest/metadata/picklists | 获取下拉字段选项 | |
| GraphQL | /graphql | GraphQL 端点 |
| 参数 | 描述 |
|---|---|
limit | 要返回的记录数(默认:20) |
offset | 要跳过的记录数 |
filter | 过滤条件(JSON) |
orderBy | 排序顺序 |
带过滤器的示例:
curl -s -X GET "https://api.twenty.com/rest/companies?filter={\"name\":{\"like\":\"%Acme%\"}}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.companies'
{
"data": {
"companies": [
{
"id": "uuid",
"name": "Company Name",
"domainName": "example.com",
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z"
}
]
},
"pageInfo": {
"hasNextPage": true,
"endCursor": "cursor-string"
}
}
每周安装数
75
仓库
GitHub 星标数
51
首次出现
2026年1月24日
安全审计
安装于
gemini-cli65
opencode63
codex63
github-copilot61
amp60
kimi-cli59
Open-source modern CRM platform. Manage people, companies, opportunities, notes, and tasks via REST or GraphQL API.
Official docs: https://docs.twenty.com/developers/api-and-webhooks/api
Use this skill when you need to:
Set environment variables:
export TWENTY_TOKEN="your-api-key"
curl -s -X GET "https://api.twenty.com/rest/companies" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.companies[:3]'
With pagination:
curl -s -X GET "https://api.twenty.com/rest/companies?limit=10&offset=0" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.companies'
Write to /tmp/twenty_request.json:
{
"name": "Acme Corp",
"domainName": "acme.com",
"address": "123 Main St, San Francisco, CA"
}
Then run:
curl -s -X POST "https://api.twenty.com/rest/companies" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
curl -s -X GET "https://api.twenty.com/rest/people" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.people[:3]'
Write to /tmp/twenty_request.json:
{
"name": {
"firstName": "John",
"lastName": "Doe"
},
"email": "john@example.com",
"phone": "+1234567890"
}
Then run:
curl -s -X POST "https://api.twenty.com/rest/people" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
Note: Replace
{companyId}and{personId}with actual IDs obtained from the "List Companies" or "List People" endpoints above (look for theidfield in the response).
# Get company by ID
curl -s -X GET "https://api.twenty.com/rest/companies/{companyId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
# Get person by ID
curl -s -X GET "https://api.twenty.com/rest/people/{personId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
Note: Replace
{companyId}with an actual company ID from the "List Companies" endpoint above.
Write to /tmp/twenty_request.json:
{
"name": "Acme Corporation",
"employees": 500
}
Then run:
curl -s -X PATCH "https://api.twenty.com/rest/companies/{companyId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
Note: Replace
{companyId}with an actual company ID from the "List Companies" endpoint above.
curl -s -X DELETE "https://api.twenty.com/rest/companies/{companyId}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
curl -s -X GET "https://api.twenty.com/rest/notes" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.notes[:3]'
Write to /tmp/twenty_request.json:
{
"title": "Meeting Notes",
"body": "Discussed Q1 roadmap and budget allocation."
}
Then run:
curl -s -X POST "https://api.twenty.com/rest/notes" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
curl -s -X GET "https://api.twenty.com/rest/tasks" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.tasks[:3]'
Write to /tmp/twenty_request.json:
{
"title": "Follow up with client",
"dueAt": "2025-01-15T10:00:00Z",
"status": "TODO"
}
Then run:
curl -s -X POST "https://api.twenty.com/rest/tasks" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json
List all object types and their fields:
curl -s -X GET "https://api.twenty.com/rest/metadata/objects" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.objects[] | {name: .nameSingular, fields: [.fields[].name]}'
Get metadata for a specific object:
curl -s -X GET "https://api.twenty.com/rest/metadata/objects/companies" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)"
Write to /tmp/twenty_request.json:
{
"query": "query { companies(first: 5) { edges { node { id name domainName } } } }"
}
Then run:
curl -s -X POST "https://api.twenty.com/graphql" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" --header "Content-Type: application/json" -d @/tmp/twenty_request.json | jq '.data.companies.edges'
| Category | Endpoint | Description |
|---|---|---|
| Core Objects | /rest/companies | Manage companies |
/rest/people | Manage contacts | |
/rest/opportunities | Manage deals/opportunities | |
/rest/notes | Manage notes | |
/rest/tasks | Manage tasks |
| Parameter | Description |
|---|---|
limit | Number of records to return (default: 20) |
offset | Number of records to skip |
filter | Filter conditions (JSON) |
orderBy | Sort order |
Example with filters:
curl -s -X GET "https://api.twenty.com/rest/companies?filter={\"name\":{\"like\":\"%Acme%\"}}" --header "Authorization: Bearer $(printenv TWENTY_TOKEN)" | jq '.data.companies'
{
"data": {
"companies": [
{
"id": "uuid",
"name": "Company Name",
"domainName": "example.com",
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z"
}
]
},
"pageInfo": {
"hasNextPage": true,
"endCursor": "cursor-string"
}
}
Weekly Installs
75
Repository
GitHub Stars
51
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli65
opencode63
codex63
github-copilot61
amp60
kimi-cli59
lark-cli 共享规则:飞书资源操作指南与权限配置详解
39,000 周安装
PostgreSQL优化助手 - JSONB操作、性能调优、窗口函数、全文搜索实战指南
9,600 周安装
GitHub Copilot create-readme:AI自动生成专业README文档工具
9,600 周安装
React Native 最佳实践与性能优化指南 | 提升应用FPS、启动速度与包体积
9,600 周安装
Web无障碍性(a11y)指南:WCAG 2.1原则、Lighthouse审计与代码实践
10,500 周安装
Vue Router 最佳实践指南:导航守卫、路由生命周期与常见陷阱解决方案
9,900 周安装
SEO优化指南:技术性SEO、页面优化与结构化数据实践
10,700 周安装
/rest/activities | Activity timeline |
| Metadata | /rest/metadata/objects | List all object schemas |
/rest/metadata/objects/{name} | Get specific object schema |
/rest/metadata/picklists | Get dropdown field options |
| GraphQL | /graphql | GraphQL endpoint |