Skip to main content
POST
/
v2
/
entity-types
/
{entity_type_id}
/
fields
Add Entity Type Field
curl --request POST \
  --url https://public.api.serval.com/v2/entity-types/{entity_type_id}/fields \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "field": {
    "key": "<string>",
    "name": "<string>",
    "dataType": "DATA_TYPE_UNSPECIFIED",
    "enumOptions": [
      {
        "value": "<string>",
        "displayName": "<string>",
        "displayOrder": 123
      }
    ],
    "isKeyField": true,
    "isNameField": true,
    "refEntityTypeId": "<string>"
  }
}
'
{
  "data": {
    "id": "<string>",
    "teamId": "<string>",
    "key": "<string>",
    "name": "<string>",
    "parentEntityTypeId": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "createdByUserId": "<string>",
    "updatedByUserId": "<string>",
    "fields": [
      {
        "id": "<string>",
        "entityTypeId": "<string>",
        "key": "<string>",
        "name": "<string>",
        "dataType": "DATA_TYPE_UNSPECIFIED",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "createdByUserId": "<string>",
        "updatedByUserId": "<string>",
        "enumOptions": [
          {
            "id": "<string>",
            "value": "<string>",
            "displayName": "<string>",
            "displayOrder": 123
          }
        ],
        "isKeyField": true,
        "isNameField": true,
        "refEntityTypeId": "<string>",
        "description": "<string>",
        "sourceEntityTypeId": "<string>"
      }
    ],
    "color": "<string>",
    "iconSlug": "<string>",
    "entitySchemaId": "<string>",
    "helpAgentVisibility": "HELP_AGENT_ENTITY_VISIBILITY_UNSPECIFIED"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

entity_type_id
string
required

The ID of the entity type to add the field to.

Body

application/json
field
field · object

The field to add.

Response

Success

data
data · object

The complete entity type with all fields after the addition.