POST /fields

Create a new field to be used for training. This endpoint will return the field_id for your new field. You can then use the field_id to train your smart field using the POST/ Train Field endpoint.

You have two options for field creation:

  • Create a brand new field and train from scratch, or
  • Create a copy of an out of the box Field, and train on top of the copy.

Regardless of the option, the workflow remains the same.

Create the Field

  • To create a brand new field, run POST /fields and provide the field_name and description.
  • To create a copy of an existing Field, run POST /fields and provide a from_field_id set to the out of the box Field’s field_id, as well as the name and description of the new field.

Headers

Authorization (required) - Requires the standard authentication header used in the system.

Parameters

  • field_name Body Required

    the name of your new field

  • description Body Required

    the description of what this smart field will be trained to identify

  • from_field_id body Optional

    provide the field_id of the field you’d like to create a copy of

Code Sample
curl -X POST -H "Accept: application/json"  
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"
-d "{
      "field_name": ["<field_name>"], 
      "description": ["<description>"]
    }" 
    https://<base_url>/api/v2/fields
fieldID, _ = zdai.fields.create(field_name=’field name’, description=’field description’, from_field_id=’field ID’)
Response Codes
  • 201 Created
    Field has been created successfully.
  • 400 Bad Request
    Malformed request body, or field_name/description are missing.
  • 403 Forbidden
    Invalid or missing authentication token.
  • 500 Internal Server Error
    Something went wrong unrelated to the users request.

Response Data

  • field_id

    the field identifier. This can be used in other endpoints

Response
{
    "field_id": "ffc67f474-f27d-4598-9425-f95f7dea2805"
}

Need Help?

Couldn’t find the information you were looking for or need more assistance?

Contact Support