3dd858c91e
Created by Github action Pulls the latest documentation translations from Crowdin for all supported languages: - French (fr) - Arabic (ar) - Czech (cs) - German (de) - Spanish (es) - Italian (it) - Japanese (ja) - Korean (ko) - Portuguese (pt) - Romanian (ro) - Russian (ru) - Turkish (tr) - Chinese (zh-CN) --------- Co-authored-by: github-actions <github-actions@twenty.com>
148 lines
5.0 KiB
Plaintext
148 lines
5.0 KiB
Plaintext
---
|
|
title: APIs
|
|
description: Query and modify your CRM data programmatically using REST or GraphQL.
|
|
---
|
|
|
|
import { VimeoEmbed } from '/snippets/vimeo-embed.mdx';
|
|
|
|
Twenty wurde so entwickelt, dass es entwicklerfreundlich ist und leistungsstarke APIs bietet, die sich an Ihr individuelles Datenmodell anpassen. Wir bieten vier verschiedene API-Typen, um unterschiedlichen Integrationsanforderungen gerecht zu werden.
|
|
|
|
## Entwickler-Erst-Ansatz
|
|
|
|
Twenty generates APIs specifically for your data model:
|
|
|
|
* **Keine langen IDs erforderlich**: Verwenden Sie Ihre Objekt- und Feldnamen direkt in Endpunkten
|
|
* **Standard- und benutzerdefinierte Objekte werden gleich behandelt**: Ihre benutzerdefinierten Objekte erhalten dieselbe API-Behandlung wie integrierte
|
|
* **Dedizierte Endpunkte**: Jedes Objekt und Feld erhält seinen eigenen API-Endpunkt
|
|
* **Benutzerdefinierte Dokumentation**: Speziell für das Datenmodell Ihres Arbeitsplatzes generiert
|
|
|
|
<Note>
|
|
Your personalized API documentation is available under **Settings → API & Webhooks** after creating an API key. Since Twenty generates APIs that match your custom data model, the documentation is unique to your workspace.
|
|
</Note>
|
|
|
|
## The Two API Types
|
|
|
|
### Core API
|
|
|
|
Zugriff auf `/rest/` oder `/graphql/`
|
|
|
|
Work with your actual **records** (the data):
|
|
|
|
* Create, read, update, delete People, Companies, Opportunities, etc.
|
|
* Query and filter data
|
|
* Verwalten von Datensatzbeziehungen
|
|
|
|
### Metadata API
|
|
|
|
Zugriff auf `/rest/metadata/` oder `/metadata/`
|
|
|
|
Manage your **workspace and data model**:
|
|
|
|
* Create, modify, or delete objects and fields
|
|
* Konfigurieren der Arbeitsbereichseinstellungen
|
|
* Define relationships between objects
|
|
|
|
## REST vs GraphQL
|
|
|
|
Both Core and Metadata APIs are available in REST and GraphQL formats:
|
|
|
|
| Format | Available Operations |
|
|
| ----------- | ---------------------------------------------------------- |
|
|
| **REST** | CRUD, batch operations, upserts |
|
|
| **GraphQL** | Same + **batch upserts**, relationship queries in one call |
|
|
|
|
Choose based on your needs — both formats access the same data.
|
|
|
|
## API-Endpunkte
|
|
|
|
| Environment | Base URL |
|
|
| --------------- | ------------------------- |
|
|
| **Cloud** | `https://api.twenty.com/` |
|
|
| **Self-Hosted** | `https://{your-domain}/` |
|
|
|
|
## Authentifizierung
|
|
|
|
Every API request requires an API key in the header:
|
|
|
|
```
|
|
Authorization: Bearer YOUR_API_KEY
|
|
```
|
|
|
|
### Create an API Key
|
|
|
|
1. Gehen Sie zu **Einstellungen → APIs & Webhooks**
|
|
2. Click **+ Create key**
|
|
3. Konfigurieren:
|
|
* **Name**: Descriptive name for the key
|
|
* **Expiration Date**: When the key expires
|
|
4. Klicken Sie auf **Speichern**
|
|
5. **Copy immediately** — the key is only shown once
|
|
|
|
<VimeoEmbed videoId="928786722" title="Creating API key" />
|
|
|
|
<Warning>
|
|
Your API key grants access to sensitive data. Don't share it with untrusted services. If compromised, disable it immediately and generate a new one.
|
|
</Warning>
|
|
|
|
### Assign a Role to an API Key
|
|
|
|
For better security, assign a specific role to limit access:
|
|
|
|
1. Gehen Sie zu **Einstellungen → Rollen**
|
|
2. Click on the role to assign
|
|
3. Öffnen Sie den Tab **Zuweisungen**
|
|
4. Under **API Keys**, click **+ Assign to API key**
|
|
5. Select the API key
|
|
|
|
The key will inherit that role's permissions. See [Permissions](/l/de/user-guide/permissions-access/capabilities/permissions) for details.
|
|
|
|
### API-Schlüssel verwalten
|
|
|
|
**Regenerate**: Settings → APIs & Webhooks → Click key → **Regenerate**
|
|
|
|
**Delete**: Settings → APIs & Webhooks → Click key → **Delete**
|
|
|
|
## API Playground
|
|
|
|
Test your APIs directly in the browser with our built-in playground — available for both **REST** and **GraphQL**.
|
|
|
|
### Access the Playground
|
|
|
|
1. Gehen Sie zu **Einstellungen → APIs & Webhooks**
|
|
2. Create an API key (required)
|
|
3. Click on **REST API** or **GraphQL API** to open the playground
|
|
|
|
### What You Get
|
|
|
|
* **Interactive documentation**: Generated for your specific data model
|
|
* **Live testing**: Execute real API calls against your workspace
|
|
* **Schema explorer**: Browse available objects, fields, and relationships
|
|
* **Request builder**: Construct queries with autocomplete
|
|
|
|
The playground reflects your custom objects and fields, so documentation is always accurate for your workspace.
|
|
|
|
## Batch-Vorgänge
|
|
|
|
Both REST and GraphQL support batch operations:
|
|
|
|
* **Batch-Größe**: Bis zu 60 Datensätze pro Anfrage
|
|
* **Operations**: Create, update, delete multiple records
|
|
|
|
**GraphQL-only features:**
|
|
|
|
* **Batch Upsert**: Create or update in one call
|
|
* Use plural object names (e.g., `CreateCompanies` instead of `CreateCompany`)
|
|
|
|
## Rate Limits
|
|
|
|
API requests are throttled to ensure platform stability:
|
|
|
|
| Limit | Wert |
|
|
| -------------- | -------------------- |
|
|
| **Requests** | 100 calls per minute |
|
|
| **Batch size** | 60 records per call |
|
|
|
|
<Tip>
|
|
Use batch operations to maximize throughput — process up to 60 records in a single API call instead of making individual requests.
|
|
</Tip>
|