Manage template type data fields

You can create, update, or remove data fields in a template type via the API or the Oneflow application.



  • Only admin users can manage data fields.
  • Text values in a data field are limited 1024 characters.

When you set data fields for a template type using the PUT endpoint, the existing set of data fields is overwritten according to the following rules:

Data field is in requestData field is in template typeResult
βœ…βœ…The data will be updated.
βœ…βŒThe data will be created in the template type.
βŒβœ…The data will be removed from the template type.



Be careful when performing operations with template type data fields. When you delete data fields from a template type, these data fields will be also removed from all the templates that use this template type.

However, changing a data field's value in a template type will not affect the data field's value already present in a template. If you also want that change reflected in the template, you must manually change the template's value.

Please see [Building a partner system integration] for additional considerations when managing data fields. For partner system integrations, please see Building a partner system integration.

Step 1. Obtain necessary information

To run the script described in this tutorial, you'll need the following data:

Path and body parameters
TEMPLATE_TYPE_ID To list all of the data fields that belong to a template type, you will first need to get the template type ID. You can find a unique template type ID using the GET/templates endpoint.
data_fields The list of data fields that belong to the given template type.
x-oneflow-api-token You will only be able to run the script by using a valid API token. You can create an API token in the Oneflow web application. Find out more in the Authentication section.
x-oneflow-user-email Your Oneflow user account email. You can find all user-related information using the users endpoint.
data_fields All data fields of the given template type you want to create, update or remove.

Step 2. Run the code

curl --request PUT \
  --url \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'x-oneflow-api-token: API_TOKEN' \
  --header 'x-oneflow-user-email: USER_EMAIL' \
  --data '{"data_fields":[{"custom_id":"participant_last_name","description":"The last name of a participant in a contract.","name":"Participant Last Name","placeholder":"Last Name","value":"Smith"},{"custom_id":"company_address","name":"Company address","value":"1234 Main Street"},{"custom_id":"participant_position","name":"Participant'\''s position in company."}]}'
import requests

headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'x-oneflow-api-token': API_TOKEN,
    'x-oneflow-user-email': USER_EMAIL,

payload = {
    'data_fields': [
            'custom_id': 'participant_last_name',
            'description': 'The last name of a participant in a contract.',
            'name': 'Participant Last Name',
            'placeholder': 'Last Name',
            'value': 'Smith',
          'custom_id': 'company_address', 
          'name': 'Company address', 
          'value': '1234 Main Street'
          'custom_id': 'participant_position', 
          'name': 'Participant\'s position in company.'

response = requests.put('', 
                        json=payload, headers=headers)


Expected response

The above call will result in output similar to the following:

  "data_fields": [
      "_links": {
        "template_type": {
          "href": ""
      "active": true,
      "custom_id": "first_name",
      "description": "First name of the customer.",
      "id": 1,
      "name": "Customer First Name",
      "placeholder": "firstname",
      "source": "user",
      "value": "Bob"
      "_links": {
        "template_type": {
          "href": ""
      "active": false,
      "custom_id": "last_name",
      "description": "Last name of the customer.",
      "id": 2,
      "name": "Customer Last Name",
      "placeholder": "lastname",
      "source": "system",
      "value": "Ross"

Please see the Data field section in the Data model category for more information about the output.

Response codes

200OKReturns the created data field information.
400Bad RequestInvalid format or content of the request.
401UnauthorizedThe API token or the user email is invalid.
404Not FoundA required entity is missing.
409ConflictA conflict occurred with the current state of the target resource.