---
title: "Benutzerdefiniertes Feld erstellen"
description: "Erstellt eine neue Definition für ein benutzerdefiniertes Feld."
---

`POST /api/custom-fields`

## Anfrage (Request Body)

| Feld | Typ | Erforderlich | Standard | Beschreibung |
|-------|------|----------|---------|-------------|
| `organizationId` | number | Ja | - | Organisations-ID |
| `name` | string | Ja | - | Anzeigename |
| `fieldKey` | string | Nein | auto aus name | Eindeutiger Schlüssel (automatisch normalisiert: Kleinbuchstaben, nicht-alphanumerisch → `_`) |
| `fieldType` | string | Nein | `text` | `text`, `select` oder `multiselect` |
| `isRequired` | boolean | Nein | false | Ob das Feld erforderlich ist |
| `displayOrder` | number | Nein | 0 | Sortierreihenfolge |
| `options` | array | Nein | `[]` | Optionen für die Typen select/multiselect |
| `placeholder` | string\|null | Nein | null | Platzhaltertext |
| `helpText` | string\|null | Nein | null | Hilfetext unterhalb des Feldes |
| `showInTable` | boolean | Nein | true | In Tabellenansichten anzeigen |

## Beispiel (cURL)

```bash
curl -X POST "$BASE_URL/api/custom-fields" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": 1,
    "name": "Environment",
    "fieldType": "select",
    "options": ["production", "staging", "development"],
    "isRequired": true,
    "showInTable": true
  }'
```

## Häufige Fehler

- `409 Conflict` wenn `fieldKey` für die Organisation bereits existiert

## Antwort (Response)

Gibt das erstellte benutzerdefinierte Feld-Objekt zurück. Siehe [Fehlercodes](/de/api/error-codes-and-known-pitfalls) für Fehlerantworten.
