Create attribute definition

Examples

Let's establish some of our data that will be used in the following examples:

  • Workspace ID: a1405560-c8d3-4b1a-877d-3f449ad95352

  • AccessKey: abcd

Create an attribute definition

In this example, we're creating a basic attribute definition.

curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/attribute-definitions" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "type": "string",
  "key": "countryCode",
  "displayName": "countryCode", 
  "description": "Country code",
  "pii": false,
  "cardinality": "one",
  "readOnly": false
}'

Create an attribute definition with a format

In this example, we're creating an attribute definition and prodivding a format in order to validate the value.

curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/attribute-definitions" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "type": "string",
  "key": "countryCode",
  "displayName": "countryCode", 
  "description": "Country code",
  "pii": false,
  "cardinality": "one",
  "readOnly": false
  "format": {
    "type": "select",
    "select": {
      "options": [
        {
          "label": "US",
          "value": "US"
        },
        {
          "label": "BR", 
          "value": "BR"
        }
      ]
    }
  }
}'

Last updated