/
Create custom field defin...
Create a new custom field for the tenant. Key must be unique within tenant+entityType.
Security
authJWT
Entity type this field applies to
Enum:"user""business""campaign""redemption"
Field type: text, email, phone, number, date, boolean, url, select, multiselect
Default:"text"
Enum:"text""email""phone""number""date""boolean""url""select""multiselect"
- Mock serverhttps://docs.pers.ninja/_mock/swagger/custom-field-definitions
- https://api.pers.ninja/v2https://api.pers.ninja/v2/custom-field-definitions
curl -i -X POST \
https://docs.pers.ninja/_mock/swagger/custom-field-definitions \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"entityType": "user",
"key": "string",
"label": "string",
"description": {},
"fieldType": "text",
"selectOptions": [
{
"value": "string",
"label": "string"
}
],
"selectOptionsSource": {},
"validation": {},
"sortOrder": 0,
"translations": {
"de": {
"label": "..."
},
"fr": null
}
}'Field created
Entity type this field applies to
Enum:"user""business""campaign""redemption"
Field type: text, email, phone, number, date, boolean, url, select, multiselect
Default:"text"
Enum:"text""email""phone""number""date""boolean""url""select""multiselect"
Per-locale translations of label, description and select option labels (option.<value>), keyed by locale. Only returned with include=translations.
Marker to distinguish from built-in fields. Custom fields are stored in user.customData
Default:true
Response
{ "id": "string", "tenantId": "string", "entityType": "user", "key": "string", "label": "string", "description": {}, "fieldType": "text", "selectOptions": [ { … } ], "selectOptionsSource": {}, "validation": {}, "translations": { "property1": { … }, "property2": { … } }, "sortOrder": 0, "isCustom": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }