Twenty CRM
Scanned@JhumanJ
npx machina-cli add skill @JhumanJ/twenty-crm --openclawTwenty CRM
Interact with your self-hosted Twenty instance via REST and GraphQL.
Config
Create config/twenty.env (example at config/twenty.env.example):
TWENTY_BASE_URL(e.g.https://crm.example.comorhttp://localhost:3000)TWENTY_API_KEY(Bearer token)
Scripts load this file automatically.
Commands
Low-level helpers
-
REST GET:
skills/twenty-crm/scripts/twenty-rest-get.sh "/companies" 'filter={"name":{"ilike":"%acme%"}}&limit=10' -
REST POST:
skills/twenty-crm/scripts/twenty-rest-post.sh "/companies" '{"name":"Acme"}' -
REST PATCH:
skills/twenty-crm/scripts/twenty-rest-patch.sh "/companies/<id>" '{"employees":550}' -
REST DELETE:
skills/twenty-crm/scripts/twenty-rest-delete.sh "/companies/<id>" -
GraphQL:
skills/twenty-crm/scripts/twenty-graphql.sh 'query { companies(limit: 5) { totalCount } }'
Common objects (examples)
- Create company:
skills/twenty-crm/scripts/twenty-create-company.sh "Acme" "acme.com" 500 - Find companies by name:
skills/twenty-crm/scripts/twenty-find-companies.sh "acme" 10
Notes
- Twenty supports both REST (
/rest/...) and GraphQL (/graphql). - Object names/endpoints can differ depending on your workspace metadata and Twenty version.
- Auth tokens can be short-lived depending on your setup; refresh if you get
401.
Overview
Twenty CRM lets you interact with your self-hosted Twenty instance using REST and GraphQL. Configure a base URL and API key in config/twenty.env; scripts load this file automatically. You can create, find, update, and delete companies and other objects via the provided shell scripts.
How This Skill Works
Configure TWENTY_BASE_URL and TWENTY_API_KEY in config/twenty.env. Use REST scripts (twenty-rest-*.sh) for GET, POST, PATCH, and DELETE, or the GraphQL script (twenty-graphql.sh) for GraphQL queries. Endpoints and object names can vary by workspace metadata and Twenty version; tokens may expire and require refresh if you see 401.
When to Use It
- Automate retrieving companies with a REST GET call and filters.
- Create a new company record via REST POST.
- Update fields on a company (e.g., employees) via REST PATCH.
- Remove a company by ID using REST DELETE.
- Run GraphQL queries to fetch aggregated data (e.g., totalCount) in fewer requests.
Quick Start
- Step 1: Create config/twenty.env with TWENTY_BASE_URL and TWENTY_API_KEY
- Step 2: Run a REST GET example: skills/twenty-crm/scripts/twenty-rest-get.sh \"/companies\" 'filter={\"name\":{\"ilike\":\"%acme%\"}}&limit=10'
- Step 3: Run a GraphQL example: skills/twenty-crm/scripts/twenty-graphql.sh 'query { companies(limit: 5) { totalCount } }'
Best Practices
- Keep TWENTY_API_KEY secure and rotate tokens as recommended.
- Prefer GraphQL when you need related fields in a single request.
- Verify workspace metadata and Twenty version to align endpoint names.
- Handle REST paging and filters (e.g., limit, ilike) to control results.
- Monitor for 401 responses and refresh tokens promptly.
Example Use Cases
- Create a company with the script: skills/twenty-crm/scripts/twenty-create-company.sh \"Acme\" \"acme.com\" 500
- Find companies by name: skills/twenty-crm/scripts/twenty-find-companies.sh \"acme\" 10
- Update employees: skills/twenty-crm/scripts/twenty-rest-patch.sh \"/companies/<id>\" '{\"employees\":550}'
- Delete a company: skills/twenty-crm/scripts/twenty-rest-delete.sh \"/companies/<id>\"
- GraphQL totalCount: skills/twenty-crm/scripts/twenty-graphql.sh 'query { companies(limit: 5) { totalCount } }'