packages/twenty-docs/user-guide/data-migration/how-tos/import-data-via-api.mdx
Twenty provides both GraphQL and REST APIs for programmatic data import. Use the API when CSV import isn't practical for your data volume or when you need automated, recurring imports.
| Scenario | Recommended Method |
|---|---|
| Under 10,000 records | CSV Import |
| 10,000 - 50,000 records | CSV Import (split into files) |
| 50,000+ records | API Import |
| One-time migration | Either (based on volume) |
| Recurring imports | API Import |
| Real-time sync | API Import |
| Integration with other systems | API Import |
<Note>For datasets in the hundreds of thousands, the API is significantly faster and more reliable than multiple CSV imports.</Note>
Twenty enforces rate limits to ensure system stability:
| Limit | Value |
|---|---|
| Requests per minute | 100 |
| Records per batch call | 60 |
| Maximum throughput | ~6,000 records/minute |
For 100,000 records at maximum throughput, expect approximately 17 minutes of import time. Add buffer time for error handling and retries. </Warning>
Anyone with your API key can access and modify your workspace data. Never commit it to code repositories or share it publicly. </Warning>
Twenty supports two API types:
| API | Best For | Documentation |
|---|---|---|
| GraphQL | Flexible queries, fetching related data, complex operations | API Docs |
| REST | Simple CRUD operations, familiar REST patterns | API Docs |
Both APIs support:
For imports, use batch operations to maximize throughput within rate limits.
Just like CSV imports, order matters for relations:
The GraphQL API supports batch upsert — update if the record exists, create if not. This prevents duplicates when re-running imports.
To see available objects and fields:
The documentation shows all standard and custom objects, their fields, and the expected data types.
For complex API migrations, our partners can help:
| Service | What's Included |
|---|---|
| Data Model Design | design your optimal data structure |
| Migration Scripts | write and run the import scripts |
| Data Transformation | handle complex mapping and cleanup |
| Validation & QA | verify the migration is complete |
Best for:
Contact us at [email protected] or explore our Implementation Services.
For full implementation details, code examples, and schema reference: