TrainFog Developers
Traits

Crea definizione trait

POST
/traits
AuthorizationBearer <token>

In: header

Request Body

application/json

workspace?string
targetEntities*array<>
namespace?string
group?string
key?string
slug?string
label*string
dataType*string
Value in"text" | "number" | "date" | "boolean" | "select" | "json" | "reference" | "textarea" | "html"
options?array<>
validation?
visibility?string
Value in"public" | "internal" | "sensitive"

Response Body

application/json

application/json

application/json

curl -X POST "https://api.trainfog.com/developers/v1.0/traits" \  -H "Content-Type: application/json" \  -d '{    "targetEntities": [      "Person"    ],    "label": "string",    "dataType": "text"  }'
{
  "id": "688893ebd804d8588b1afbe0",
  "workspace": "688893ebd804d8588b1afbe0",
  "targetEntities": [
    "Person"
  ],
  "namespace": "custom",
  "group": "string",
  "key": "lifetime_value",
  "slug": "lifetime-value",
  "label": "Lifetime Value",
  "dataType": "number",
  "options": [
    "string"
  ],
  "validation": {
    "required": false,
    "min": 0,
    "max": 0,
    "regex": "string"
  },
  "visibility": "public",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Bad request"
}
{
  "error": "Unauthorized"
}