Loading...
Loading...
Open-source CRM API for managing people, companies, notes, tasks and custom objects
npx skill4agent add vm0-ai/vm0-skills twentyOfficial docs: https://docs.twenty.com/developers/api-and-webhooks/api
# For Twenty Cloud
export TWENTY_API_KEY="your-api-key"
export TWENTY_API_URL="https://api.twenty.com"
# For self-hosted instances
export TWENTY_API_URL="https://your-domain.com"Important: When usingin a command that pipes to another command, wrap the command containing$VARin$VAR. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c '...'bashbash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/companies" --header "Authorization: Bearer ${TWENTY_API_KEY}"' | jq '.data.companies[:3]'bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/companies?limit=10&offset=0" --header "Authorization: Bearer ${TWENTY_API_KEY}"' | jq '.data.companies'/tmp/twenty_request.json{
"name": "Acme Corp",
"domainName": "acme.com",
"address": "123 Main St, San Francisco, CA"
}bash -c 'curl -s -X POST "${TWENTY_API_URL}/rest/companies" --header "Authorization: Bearer ${TWENTY_API_KEY}" --header "Content-Type: application/json" -d @/tmp/twenty_request.json'bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/people" --header "Authorization: Bearer ${TWENTY_API_KEY}"' | jq '.data.people[:3]'/tmp/twenty_request.json{
"name": {
"firstName": "John",
"lastName": "Doe"
},
"email": "john@example.com",
"phone": "+1234567890"
}bash -c 'curl -s -X POST "${TWENTY_API_URL}/rest/people" --header "Authorization: Bearer ${TWENTY_API_KEY}" --header "Content-Type: application/json" -d @/tmp/twenty_request.json'Note: Replaceand{companyId}with actual IDs obtained from the "List Companies" or "List People" endpoints above (look for the{personId}field in the response).id
# Get company by ID
bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/companies/{companyId}" --header "Authorization: Bearer ${TWENTY_API_KEY}"'
# Get person by ID
bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/people/{personId}" --header "Authorization: Bearer ${TWENTY_API_KEY}"'Note: Replacewith an actual company ID from the "List Companies" endpoint above.{companyId}
/tmp/twenty_request.json{
"name": "Acme Corporation",
"employees": 500
}bash -c 'curl -s -X PATCH "${TWENTY_API_URL}/rest/companies/{companyId}" --header "Authorization: Bearer ${TWENTY_API_KEY}" --header "Content-Type: application/json" -d @/tmp/twenty_request.json'Note: Replacewith an actual company ID from the "List Companies" endpoint above.{companyId}
curl -s -X DELETE "${TWENTY_API_URL}/rest/companies/{companyId}" --header "Authorization: Bearer ${TWENTY_API_KEY}"bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/notes" --header "Authorization: Bearer ${TWENTY_API_KEY}"' | jq '.data.notes[:3]'/tmp/twenty_request.json{
"title": "Meeting Notes",
"body": "Discussed Q1 roadmap and budget allocation."
}bash -c 'curl -s -X POST "${TWENTY_API_URL}/rest/notes" --header "Authorization: Bearer ${TWENTY_API_KEY}" --header "Content-Type: application/json" -d @/tmp/twenty_request.json'bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/tasks" --header "Authorization: Bearer ${TWENTY_API_KEY}"' | jq '.data.tasks[:3]'/tmp/twenty_request.json{
"title": "Follow up with client",
"dueAt": "2025-01-15T10:00:00Z",
"status": "TODO"
}bash -c 'curl -s -X POST "${TWENTY_API_URL}/rest/tasks" --header "Authorization: Bearer ${TWENTY_API_KEY}" --header "Content-Type: application/json" -d @/tmp/twenty_request.json'bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/metadata/objects" --header "Authorization: Bearer ${TWENTY_API_KEY}"' | jq '.data.objects[] | {name: .nameSingular, fields: [.fields[].name]}'bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/metadata/objects/companies" --header "Authorization: Bearer ${TWENTY_API_KEY}"'/tmp/twenty_request.json{
"query": "query { companies(first: 5) { edges { node { id name domainName } } } }"
}bash -c 'curl -s -X POST "${TWENTY_API_URL}/graphql" --header "Authorization: Bearer ${TWENTY_API_KEY}" --header "Content-Type: application/json" -d @/tmp/twenty_request.json' | jq '.data.companies.edges'| Category | Endpoint | Description |
|---|---|---|
| Core Objects | | Manage companies |
| Manage contacts | |
| Manage deals/opportunities | |
| Manage notes | |
| Manage tasks | |
| Activity timeline | |
| Metadata | | List all object schemas |
| Get specific object schema | |
| Get dropdown field options | |
| GraphQL | | GraphQL endpoint |
| Parameter | Description |
|---|---|
| Number of records to return (default: 20) |
| Number of records to skip |
| Filter conditions (JSON) |
| Sort order |
bash -c 'curl -s -X GET "${TWENTY_API_URL}/rest/companies?filter={\"name\":{\"like\":\"%Acme%\"}}" --header "Authorization: Bearer ${TWENTY_API_KEY}"' | 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"
}
}