Field types and validations

date

String in format YYYY-MM-DD. Eg. 2020-01-30

textbox

String

integer

Integer

textarea

String

rich_text

Simple HTML formatting. Allowed tags: p strong em ins ul ol li h1 h2 h3 h4 h5 h6. Everything else is parsed out.

dropdown

String

boolean

Boolean, true/false

datetime

String in format yyyy-mm-ddThh:mm:ss.mmm. Eg. 2021-08-01T00:00:00.000Z

Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
asset_id
required

Asset ID

Validations:

  • Must be a String

field_group_id
required

Field group ID

Validations:

  • Must be a String

custom_fields
required

Custom fields

Validations:

  • Must be an array of any type

Examples

// If asset is not found
POST /api/v2/assets/not-found-id/custom_fields/4
{
  "custom_fields": {
    "3": "Updated value"
  }
}
404
{
  "error": "asset not found"
}
// If custom field group is not found
POST /api/v2/assets/STG2uBU-hv9iWwY2iEr1/custom_fields/not-found-id
{
  "custom_fields": {
    "5": "Updated value"
  }
}
404
{
  "error": "Couldn't find FieldGroup with 'id'=not-found-id"
}
// Adding new custom field values for default custom field group
POST /api/v2/assets/CaCU-jrv366OJ5K8qC8H/custom_fields/6
{
  "custom_fields": {
    "6": "New value"
  }
}
200
{
  "custom_fields": {
    "6": {
      "6": "New value"
    }
  },
  "errors": []
}
// Updating existing custom field values for default custom field group
POST /api/v2/assets/c94pPvilr4wZiZiAf8jf/custom_fields/7
{
  "custom_fields": {
    "7": "Updated value"
  }
}
200
{
  "custom_fields": {
    "7": {
      "7": "Updated value"
    }
  },
  "errors": []
}
// Adding new custom field values to one complex custom field group
POST /api/v2/assets/j_BMbWA7Qxp_nWSTMiSq/custom_fields/8
{
  "custom_fields": {
    "8": "New value"
  }
}
200
{
  "custom_fields": {
    "8": [
      {
        "cfg_id": 3,
        "8": "New value"
      }
    ]
  },
  "errors": []
}
// Adding new custom field values to multiple complex custom field groups
POST /api/v2/assets/UtioF7MfB7zOeRShaZ84/custom_fields/9
{
  "custom_fields": [
    {
      "9": "New value"
    },
    {
      "10": "New value 2"
    }
  ]
}
200
{
  "custom_fields": {
    "9": [
      {
        "cfg_id": 4,
        "9": "New value"
      }
    ]
  },
  "errors": []
}
// Updating existing custom field values to one complex custom field group
POST /api/v2/assets/VgbWezAjtjpuHv4Hfs9U/custom_fields/11
{
  "custom_fields": {
    "11": "Updated value",
    "cfg_id": 6
  }
}
200
{
  "custom_fields": {
    "11": [
      {
        "cfg_id": 6,
        "11": "Updated value"
      }
    ]
  },
  "errors": []
}
// Updating existing custom field values to multiple complex custom field groups
POST /api/v2/assets/ysuqLPeo2freJ6KcVXeY/custom_fields/12
{
  "custom_fields": [
    {
      "12": "Updated value",
      "cfg_id": 7
    },
    {
      "12": "Updated value 2",
      "cfg_id": 8
    }
  ]
}
200
{
  "custom_fields": {
    "12": [
      {
        "cfg_id": 7,
        "12": "Updated value"
      },
      {
        "cfg_id": 8,
        "12": "Updated value 2"
      }
    ]
  },
  "errors": []
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters