> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.laposta.org/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.laposta.org/_mcp/server.

# Veld toevoegen

POST https://api.laposta.nl/v2/field
Content-Type: application/x-www-form-urlencoded

Voegt een veld toe aan een lijst. Bij `select_single` en `select_multiple` geef je de keuzemogelijkheden mee in `options`. Laposta leidt uit de naam een `custom_name` af, en dat is de sleutel die je bij relaties gebruikt.Adds a field to a list. For `select_single` and `select_multiple`, you pass the available choices in `options`. Laposta derives a `custom_name` from the name, which is the key you use for subscribers.Fügt einer Liste ein Feld hinzu. Bei `select_single` und `select_multiple` gibst du die Auswahlmöglichkeiten in `options` mit. Laposta leitet aus dem Namen einen `custom_name` ab, und das ist der Schlüssel, den du bei Abonnenten verwendest.Añade un campo a una lista. Con `select_single` y `select_multiple` envías las opciones de selección en `options`. Laposta deriva un `custom_name` del nombre, y esa es la clave que usas en los contactos.

Reference: https://docs.laposta.org/velden/veld-toevoegen

## Authentication

- `Authorization` header (basic auth, required) — Vul je API-sleutel in bij `api_key` en laat `leave_empty` leeg. De API gebruikt basic auth, waarbij je sleutel de plaats van de gebruikersnaam inneemt. In curl schrijf je dat als `-u JOUW_SLEUTEL:`, met een dubbele punt en niets erachter.Enter your API key at `api_key` and leave `leave_empty` empty. The API uses basic auth, with your key in place of the username. In curl that reads `-u YOUR_KEY:`, with a colon and nothing after it.Trage deinen API-Schlüssel bei `api_key` ein und lass `leave_empty` leer. Die API nutzt Basic Auth, wobei dein Schlüssel an die Stelle des Benutzernamens tritt. In curl schreibst du das als `-u DEIN_SCHLUESSEL:`, mit einem Doppelpunkt und nichts dahinter.Introduce tu clave API en `api_key` y deja `leave_empty` vacío. La API usa basic auth, con tu clave en lugar del nombre de usuario. En curl se escribe como `-u TU_CLAVE:`, con dos puntos y nada después.

## Request

### Body (application/x-www-form-urlencoded)

This endpoint expects an object.

- `list_id` (string, required) — Het id van de lijst. Dat vind je in het antwoord van [Alle lijsten opvragen](/lijsten/alle-lijsten-opvragen), en in de applicatie in de URL van de lijst.The id of the list. You find it in the response of [Get all lists](/lijsten/alle-lijsten-opvragen), and in the application in the URL of the list.Die ID der Liste. Du findest sie in der Antwort von [Alle Listen abrufen](/lijsten/alle-lijsten-opvragen) und in der Anwendung in der URL der Liste.El id de la lista. Lo encuentras en la respuesta de [Obtener todas las listas](/lijsten/alle-lijsten-opvragen) y en la aplicación, en la URL de la lista.
- `name` (string, required) — Een naam voor dit veld.A name for this fieldEin Name für dieses Feld.Un nombre para este campo.
- `datatype` (enum, required) — Het datatype: text, numeric, date, select_single of select_multiple.The data type: text, numeric, date, select_single or select_multipleDer Datentyp: text, numeric, date, select_single oder select_multiple.El tipo de dato: text, numeric, date, select_single o select_multiple.
  - Allowed values: `text`, `numeric`, `date`, `select_single`, `select_multiple`
- `required` (boolean, required) — Is dit een verplicht veld?Is this a mandatory field?Ist dies ein Pflichtfeld?¿Es este un campo obligatorio?
- `in_form` (boolean, required) — Is het veld te zien in het aanmeldformulier? (boolean)Does this field occur in the subscription form? (boolean)Ist das Feld im Anmeldeformular zu sehen? (boolean)¿El campo se ve en el formulario de registro? (boolean)
- `in_list` (boolean, required) — Is het veld te zien in het overzicht in Laposta? (boolean)Is this field visible in Laposta's overview? (boolean)Ist das Feld in der Übersicht in Laposta zu sehen? (boolean)¿El campo se ve en la vista general de Laposta? (boolean)
- `defaultvalue` (string, optional) — Een eventuele standaardwaarde.A potential default valueEin eventueller Standardwert.Un valor predeterminado, si lo hay.
- `datatype_display` (enum, optional) — Alleen voor select_single: de gewenste weergave (select, radio)Only applicable for select_single: the desired display (select, radio)Nur für select_single: die gewünschte Darstellung (select, radio)Solo para select_single: la visualización deseada (select, radio)
  - Allowed values: `select`, `radio`
- `options` (list of string, optional) — Welke selectiemogelijkheden zijn er? (Verplicht bij datatypes select_single of select_multiple). De opties kunnen als array worden meegegeven. Bij het antwoord worden de options herhaald, maar is er ook een extra veld options_full. Hierin staan ook de bij de options horende id's genoemd, die eventueel gebruikt kunnen worden om de options later te wijzigen.What selection options are available? (mandatory for the data types select_single of select_multiple). The options can be given as an array. In the answer the options are repeated, but there is also an extra field options_full. Also listed are the option IDs, which may eventually be used to change the options later.Welche Auswahlmöglichkeiten gibt es? (Pflicht bei den Datentypen select_single oder select_multiple). Die Optionen können als Array mitgegeben werden. In der Antwort werden die options wiederholt, es gibt dann aber auch ein zusätzliches Feld options_full. Darin stehen auch die zu den options gehörenden IDs, die eventuell verwendet werden können, um die options später zu ändern.¿Qué opciones de selección hay? (Obligatorio con los tipos de dato select_single o select_multiple). Las opciones se pueden enviar como array. En la respuesta se repiten las options, pero también hay un campo adicional options_full. Ahí se indican también los ID que corresponden a las options, que se pueden usar para modificar las options más adelante.

## Response

### 201

De aanvraag is gelukt.The request succeeded.Die Anfrage war erfolgreich.La solicitud se ha realizado correctamente.

- `field` (Field, optional) — Het field-objectThe field objectDas field-ObjektEl objeto field

## Errors

### 400 Bad Request Error

De aanvraag klopt niet. Het antwoord bevat een `type`, een `message` en meestal een `code` en de `parameter` die de fout veroorzaakte. Een object dat niet bestaat valt ook hieronder, met code 203.The request is not valid. The response contains a `type`, a `message` and usually a `code` plus the `parameter` that caused it. An object that does not exist also falls under this, with code 203.Die Anfrage stimmt nicht. Die Antwort enthält einen `type`, eine `message` und meistens einen `code` und den `parameter`, der den Fehler verursacht hat. Ein Objekt, das nicht existiert, fällt ebenfalls hierunter, mit Code 203.La solicitud no es correcta. La respuesta contiene un `type`, un `message` y normalmente un `code` y el `parameter` que ha causado el error. Un objeto que no existe también entra aquí, con el código 203.

- `error` (ErrorError, optional)

### 401 Unauthorized Error

Er is geen geldige API-sleutel meegestuurd, of dit endpoint staat niet aan voor dit account.No valid API key was provided, or this endpoint is not enabled for this account.Es wurde kein gültiger API-Schlüssel mitgeschickt, oder dieser Endpunkt ist für dieses Konto nicht aktiv.No se ha enviado una clave API válida, o este endpoint no está activado para esta cuenta.

- `error` (ErrorError, optional)

### 429 Too Many Requests Error

Je hebt te veel aanvragen in een minuut gedaan. De header `Retry-After` vertelt na hoeveel seconden het weer mag.Too many requests in one minute. The `Retry-After` header tells you how many seconds to wait.Du hast zu viele Anfragen in einer Minute gestellt. Der Header `Retry-After` sagt, nach wie vielen Sekunden es wieder erlaubt ist.Has hecho demasiadas solicitudes en un minuto. La cabecera `Retry-After` indica después de cuántos segundos puedes volver a intentarlo.

- `error` (ErrorError, optional)

## Types

### Field

Het field-objectThe field objectDas field-ObjektEl objeto field

- `field_id` (string, optional) — Het id van dit veld.The ID of the field in questionDie ID dieses Feldes.El ID de este campo.
- `list_id` (string, optional) — Het id van de lijst waartoe het veld behoort.The ID of the list to which the field belongsDie ID der Liste, zu der das Feld gehört.El ID de la lista a la que pertenece el campo.
- `timezone` (string, optional) — De tijdzone van het account voor datum- en tijdvelden.The account timezone used for datetime fieldsDie Zeitzone des Kontos für Datums- und Zeitfelder.La zona horaria de la cuenta para los campos de fecha y hora.
- `created` (string, optional) — Moment van aanmaken.Date and time of creationZeitpunkt der Erstellung.Momento de creación.
- `created_iso` (string, optional, nullable) — Moment van aanmaken in ISO-formaat.Date and time of creation in ISO formatZeitpunkt der Erstellung im ISO-Format.Momento de creación en formato ISO.
- `modified` (string, optional, nullable) — Altijd leeg. Laposta bewaart geen wijzigingsmomenten van velden.Always null. Field modification times are not stored and this field is kept for backwards compatibility.Immer leer. Laposta speichert keine Änderungszeitpunkte von Feldern.Siempre vacío. Laposta no guarda los momentos de modificación de los campos.
- `state` (enum, optional) — De status van dit veld: active of deleted.The status of the field in question: either active or deletedDer Status dieses Feldes: active oder deleted.El estado de este campo: active o deleted.
  - Allowed values: `active`, `deleted`
- `name` (string, optional) — Naam van het veld (voor weergave)Name of the field (for displaying purposes)Name des Feldes (für die Anzeige)Nombre del campo (para la visualización)
- `tag` (string, optional) — De relatievariabele waarmee je dit veld in een campagne gebruikt. Deze is niet te wijzigen.The subscriber variable for usage in campaigns (not modifyable)Die Abonnentenvariable, mit der du dieses Feld in einer Kampagne verwendest. Sie lässt sich nicht ändern.La variable de contacto con la que usas este campo en una campaña. No se puede modificar.
- `custom_name` (string, optional) — De sleutel waarmee je dit veld bij relaties meegeeft in `custom_fields`.Name of the field (for use in member API calls)Der Schlüssel, mit dem du dieses Feld bei Abonnenten in `custom_fields` mitgibst.La clave con la que envías este campo en `custom_fields` para los contactos.
- `defaultvalue` (string, optional) — De waarde die geldt als je dit veld niet meestuurt.The default value (will be used in the absence of this field)Der Wert, der gilt, wenn du dieses Feld nicht mitschickst.El valor que se aplica si no envías este campo.
- `datatype` (enum, optional) — Het datatype van dit veld (text, numeric, date, select_single, select_multiple of labels). Het type labels hoort bij het veld Labels, dat vanzelf ontstaat zodra je lijst minstens een label heeft; dat veld maak je niet zelf aan.The data type of the field in question (text, numeric, date, select_single, select_multiple or labels). The labels type belongs to the Labels field, which comes into being by itself as soon as your list has at least one label; you do not create that field yourself.Der Datentyp dieses Feldes (text, numeric, date, select_single, select_multiple oder labels). Der Typ labels gehört zum Feld Labels, das von selbst entsteht, sobald die Liste mindestens ein Label hat; dieses Feld legt man nicht selbst an.El tipo de dato de este campo (text, numeric, date, select_single, select_multiple o labels). El tipo labels corresponde al campo Etiquetas, que aparece por sí solo en cuanto tu lista tiene al menos una etiqueta; ese campo no lo creas tú.
  - Allowed values: `text`, `numeric`, `date`, `select_single`, `select_multiple`, `labels`
- `datatype_display` (enum, optional) — Alleen voor select_single: de gewenste weergave (select, radio)Only applicable for select_single: the desired display (select, radio)Nur für select_single: die gewünschte Darstellung (select, radio)Solo para select_single: la visualización deseada (select, radio)
  - Allowed values: `select`, `radio`
- `options` (list of string, optional) — Een array van de beschikbare opties (bij select_single, select_multiple of labels). Bij een labels-veld staan hier de labels van deze lijst.An array of the available options (for select_single, select_multiple or labels). For a labels field, these are the labels of this list.Ein Array der verfügbaren Optionen (bei select_single, select_multiple oder labels). Bei einem labels-Feld stehen hier die Labels dieser Liste.Un array de las opciones disponibles (con select_single, select_multiple o labels). En un campo labels aquí están las etiquetas de esta lista.
- `options_full` (list of string, optional) — Een array van de beschikbare opties, inclusief id's (bij select_single, select_multiple of labels).An array of the available options, including IDs (for select_single, select_multiple or labels).Ein Array der verfügbaren Optionen, inklusive IDs (bei select_single, select_multiple oder labels).Un array de las opciones disponibles, incluidos los ID (con select_single, select_multiple o labels).
- `required` (boolean, optional) — Is dit een verplicht veld? (true of false)Is this a mandatory field? (true or false)Ist dies ein Pflichtfeld? (true oder false)¿Es este un campo obligatorio? (true o false)
- `in_form` (boolean, optional) — Komt dit veld voor in het aanmeldformulier? (true of false)Does this field occur in the subscription form? (true or false)Kommt dieses Feld im Anmeldeformular vor? (true oder false)¿Este campo aparece en el formulario de registro? (true o false)
- `in_list` (boolean, optional) — Komt dit veld voor bij het bladeren in de lijst? (true of false)Does this field occur while browsing the list? (true or false)Kommt dieses Feld beim Blättern in der Liste vor? (true oder false)¿Este campo aparece al navegar por la lista? (true o false)
- `autocomplete` (string, optional) — De waarde voor het autocomplete-attribuut in het aanmeldformulier.The value for the html autocomplete attribute (string)Der Wert für das autocomplete-Attribut im Anmeldeformular.El valor del atributo autocomplete en el formulario de registro.
- `pos` (string, optional) — De positie van dit veld in de lijst, als tekst met een getal erin.The position of this field in the list, as a string containing a number.Die Position dieses Feldes in der Liste, als Text mit einer Zahl darin.La posición de este campo en la lista, como texto con un número.
- `is_email` (boolean, optional) — Of dit het e-mailadresveld van de lijst is.Whether this is the email field of the list.Ob dies das E-Mail-Adressfeld der Liste ist.Si este es el campo de dirección de correo electrónico de la lista.

### ErrorError

- `type` (enum, required)
  - Allowed values: `invalid_request`, `invalid_input`, `internal`
- `message` (string, required)
- `code` (integer, optional)
- `parameter` (string, optional)

## Examples

**Request**

```json
{
  "list_id": "BaImMu3JZA",
  "name": "Nieuwsbrief",
  "datatype": "text",
  "required": "false",
  "in_form": "true",
  "in_list": "true"
}
```

**Response**

```json
{
  "field": {
    "field_id": "Z87ysHha9A",
    "list_id": "BaImMu3JZA",
    "timezone": "Europe/Amsterdam",
    "created": "string",
    "created_iso": "string",
    "modified": "string",
    "state": "active",
    "name": "Nieuwsbrief",
    "tag": "string",
    "custom_name": "string",
    "defaultvalue": "string",
    "datatype": "text",
    "datatype_display": "select",
    "options": [
      "string"
    ],
    "options_full": [
      "string"
    ],
    "required": true,
    "in_form": true,
    "in_list": true,
    "autocomplete": "string",
    "pos": "string",
    "is_email": true
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.laposta.nl/v2/field"

payload = ""
headers = {
    "Content-Type": "application/x-www-form-urlencoded"
}

response = requests.post(url, data=payload, headers=headers, auth=("<api_key>", "<leave_empty>"))

print(response.json())
```

```javascript
const url = 'https://api.laposta.nl/v2/field';
const credentials = btoa("<api_key>:<leave_empty>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.laposta.nl/v2/field"

	req, _ := http.NewRequest("POST", url, nil)

	req.SetBasicAuth("<api_key>", "<leave_empty>")
	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.laposta.nl/v2/field")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<api_key>", "<leave_empty>")
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.laposta.nl/v2/field")
  .basicAuth("<api_key>", "<leave_empty>")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.laposta.nl/v2/field', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
    'auth' => ['<api_key>', '<leave_empty>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.laposta.nl/v2/field");
client.Authenticator = new HttpBasicAuthenticator("<api_key>", "<leave_empty>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<api_key>:<leave_empty>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/x-www-form-urlencoded"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.laposta.nl/v2/field")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```