Twenty was built to be developer-friendly, offering powerful APIs that adapt to your custom data model. We provide four distinct API types to meet different integration needs.
Twenty generates APIs specifically for your data model, meaning:
- No long IDs required: Use your object and field names directly in endpoints
- Standard and custom objects treated equally: Your custom objects get the same API treatment as built-in ones
- Dedicated endpoints: Each object and field gets its own API endpoint
- Custom documentation: Generated specifically for your workspace's data model
Your custom API generates personalized documentation accessible via Settings → API & Webhooks after creating an API key. This documentation reflects your exact data model and field configurations.
Twenty offers APIs in both REST and GraphQL formats:
- Purpose: Manage your workspace and data model structure
- Use cases:
- Create, modify, or delete objects and fields
- Configure workspace settings
- Manage data model relationships
- Access: Available through REST endpoints
- Purpose: Manage your actual data records
- Use cases:
- Create, read, update, delete records
- Query specific data
- Manage record relationships
- Access: Available through REST endpoints
- Purpose: Same as REST Metadata API but with GraphQL benefits
- Use cases: Same workspace and data model management
- Additional benefits:
- Query multiple metadata types in one request
- Precise field selection
- Better performance for complex queries
- Purpose: Same as REST Core API but with GraphQL advantages
- Use cases: Same data record management
- Additional benefits:
- Batch operations: Available for all operations
- Upsert operations: Create or update records in one call
- Query relationships in single requests
- Precise data fetching
Both REST and GraphQL APIs support batch operations for most actions:
- Batch size: Up to 60 records per request
- Available operations: Create, update, delete multiple records
- Performance: Significantly faster than individual API calls
- Batch Upsert: Only available in GraphQL APIs
- Usage: Use plural object names (e.g.,
CreateCompanies instead of CreateCompany)
- Requirement: This is why singular and plural object names must be distinct
- Go to Settings → API & Webhooks
- Create an API key (required for documentation access)
- Access your custom documentation and playground
- Test APIs with your actual data model
Your documentation is unique to your workspace because it reflects your custom objects, fields, and relationships.
- Setting up your data model
- Creating custom objects or fields
- Configuring workspace settings
- Managing day-to-day data (People, Companies, Opportunities)
- Integrating with external systems
- Building custom applications
- Automating data workflows
- You need batch operations
- You want to minimize API calls
- You need upsert functionality
- You're building complex integrations
- You prefer simpler API structure
- You're building basic integrations
- Your team is more familiar with REST
- You need straightforward CRUD operations
- API & Webhooks Setup: Learn how to create API keys and webhooks
- Custom Documentation: Access your personalized API docs via Settings → API & Webhooks
Noticed something to change?
As an open-source company, we welcome contributions through Github. Help us keep it up-to-date, accurate, and easy to understand by getting involved and sharing your ideas!