Create a custom profile field

POST /api/custom-profile-fields

Create a custom profile field.

application/json

Body object Required

One of:

Responses

  • 201 application/json

    Created

    Hide response attributes Show response attributes object
    • tenantId string Required

      Maximum length is 21.

    • id string Required

      Minimum length is 1, maximum length is 21.

    • name string Required

      Minimum length is 1, maximum length is 128.

    • type string Required

      Values are Text, Number, Date, Checkbox, Select, Url, Regex, Address, or Fullname.

    • label string Required

      Maximum length is 128.

    • description string | null Required

      Maximum length is 256.

    • required boolean Required
    • config object Required
      Hide config attributes Show config attributes object
      • placeholder string

        Maximum length is 256.

      • minLength number
      • maxLength number
      • minValue number
      • maxValue number
      • format string

        Maximum length is 128.

      • customFormat string

        Maximum length is 128.

      • options array[object]
        Hide options attributes Show options attributes object
        • label string
        • value string Required
      • defaultValue string
      • parts array[object]
        Hide parts attributes Show parts attributes object
        • enabled boolean Required
        • name string Required
        • type string Required

          Values are Text, Number, Date, Checkbox, Select, Url, Regex, Address, or Fullname.

        • label string

          Minimum length is 1.

        • description string
        • required boolean Required
        • config object
          Hide config attributes Show config attributes object
          • placeholder string

            Maximum length is 256.

          • minLength number
          • maxLength number
          • minValue number
          • maxValue number
          • format string

            Maximum length is 128.

          • customFormat string

            Maximum length is 128.

          • options array[object]
            Hide options attributes Show options attributes object
            • label string
            • value string Required
          • defaultValue string
    • createdAt number Required
    • sieOrder number Required
  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

POST /api/custom-profile-fields
curl \
 --request POST 'https://[tenant_id].logto.app/api/custom-profile-fields' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"string","type":"string","label":"string","description":"string","required":true,"config":{"placeholder":"string","minLength":42.0,"maxLength":42.0}}'
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "placeholder": "string",
    "minLength": 42.0,
    "maxLength": 42.0
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "placeholder": "string",
    "minValue": 42.0,
    "maxValue": 42.0
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "placeholder": "string",
    "format": "string",
    "customFormat": "string"
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "required": true,
  "config": {
    "defaultValue": "string"
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "placeholder": "string",
    "options": [
      {
        "label": "string",
        "value": "string"
      }
    ]
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "placeholder": "string"
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "placeholder": "string",
    "format": "string"
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "parts": [
      {
        "enabled": true,
        "type": "Text",
        "label": "string",
        "description": "string",
        "required": true,
        "config": {
          "placeholder": "string",
          "minLength": 42.0,
          "maxLength": 42.0,
          "minValue": 42.0,
          "maxValue": 42.0,
          "format": "string",
          "customFormat": "string",
          "options": [
            {
              "label": "string",
              "value": "string"
            }
          ],
          "defaultValue": "string"
        },
        "name": "formatted"
      }
    ]
  }
}
{
  "name": "string",
  "type": "string",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "parts": [
      {
        "enabled": true,
        "type": "Text",
        "label": "string",
        "description": "string",
        "required": true,
        "config": {
          "placeholder": "string",
          "minLength": 42.0,
          "maxLength": 42.0,
          "minValue": 42.0,
          "maxValue": 42.0,
          "format": "string",
          "customFormat": "string",
          "options": [
            {
              "label": "string",
              "value": "string"
            }
          ],
          "defaultValue": "string"
        },
        "name": "givenName"
      }
    ]
  }
}
Response examples (201)
{
  "tenantId": "string",
  "id": "string",
  "name": "string",
  "type": "Text",
  "label": "string",
  "description": "string",
  "required": true,
  "config": {
    "placeholder": "string",
    "minLength": 42.0,
    "maxLength": 42.0,
    "minValue": 42.0,
    "maxValue": 42.0,
    "format": "string",
    "customFormat": "string",
    "options": [
      {
        "label": "string",
        "value": "string"
      }
    ],
    "defaultValue": "string",
    "parts": [
      {
        "enabled": true,
        "name": "string",
        "type": "Text",
        "label": "string",
        "description": "string",
        "required": true,
        "config": {
          "placeholder": "string",
          "minLength": 42.0,
          "maxLength": 42.0,
          "minValue": 42.0,
          "maxValue": 42.0,
          "format": "string",
          "customFormat": "string",
          "options": [
            {
              "label": "string",
              "value": "string"
            }
          ],
          "defaultValue": "string"
        }
      }
    ]
  },
  "createdAt": 42.0,
  "sieOrder": 42.0
}