POST
/
environments
/
{environmentId}
/
custom
/
fields
curl --request POST \
  --url https://app.dynamicauth.com/api/v0/environments/{environmentId}/custom/fields \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "An example name",
  "enabled": true,
  "required": true,
  "fieldType": "text",
  "validationRules": {
    "unique": true,
    "regex": "^0x",
    "validOptions": [
      {
        "label": "small"
      },
      {
        "label": "medium"
      },
      {
        "label": "large"
      }
    ],
    "checkboxText": "Agree to the terms and conditions"
  },
  "position": 123
}'
{
  "id": "95b11417-f18f-457f-8804-68e361f9164f",
  "key": "An example name",
  "name": "An example name",
  "enabled": true,
  "required": true,
  "fieldType": "text",
  "validationRules": {
    "unique": true,
    "regex": "^0x",
    "validOptions": [
      {
        "label": "small"
      },
      {
        "label": "medium"
      },
      {
        "label": "large"
      }
    ],
    "checkboxText": "Agree to the terms and conditions"
  },
  "position": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

environmentId
string
required

ID of the environment

Required string length: 36

Body

application/json
name
string
required
Maximum length: 255
enabled
boolean
required
required
boolean
required
fieldType
enum<string>
required
Available options:
text,
checkbox,
select
position
number
required
validationRules
object

Optional validation rules for the custom field

Response

201
application/json
Custom field created successfully
id
string
required
Required string length: 36
key
string
required
Maximum length: 255
name
string
required
Maximum length: 255
enabled
boolean
required

A flag indicating whether the custom field is active.

required
boolean
required

A flag indicating whether the custom field is required.

fieldType
enum<string>
required
Available options:
text,
checkbox,
select
position
number
required
validationRules
object

Optional validation rules for the custom field