/entityType.addAttribute

Adds an attribute to an entity type; this includes adding the new attribute to all existing user profiles.

Refer to the Registration Error Codes section for details on error codes. Use this link for a video demo in Postman.

This endpoint supports the following methods:

  • POST


POST

Authentication

This endpoint supports both Basic authentication (recommended) and janrain-signed authentication.

How to Create an Authentication String

Base URL

The base URL for this endpoint is your Identity Cloud Capture domain; for example:

https://educationcenter.us-dev.janraincapture.com

Your Capture domains (also known as Registration domains) can be found in the Console on the Manage Application page:

Examples

Example Requests

This command adds a 50-character string attribute (fullName) to the user entity type:


curl -X POST \
  -H "Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg"\
  --data-urlencode type_name=user \
  --data-urlencode attr_def='{"name":"fullName","type":"string","length":50}' \
  https://my-app.janraincapture.com/entityType.addAttribute
          
      Running this command in Postman

Example 1 Response


{
  "schema": {
    "attr_def": [
      {
        "description": "simple identifier for this entity",
        "name": "id",
        "type": "id"
      },
      {
        "description": "globally unique identifier for this entity",
        "name": "uuid",
        "type": "uuid"
      },
      {
        "description": "when this entity was created",
        "name": "created",
        "type": "dateTime"
      },
      {
        "description": "when this entity was last updated",
        "name": "lastUpdated",
        "type": "dateTime"
      },
      {
        "case-sensitive": false,
        "length": 1000,
        "name": "Description",
        "type": "string"
      },
      {
        "case-sensitive": false,
        "length": null,
        "name": "Name",
        "type": "string"
      },
      {
        "case-sensitive": true,
        "length": 50,
        "name": "fullName",
        "type": "string"
      }
    ],
    "name": "user"
  },
  "stat": "ok"
}
          

The following command adds a new object attribute (testObject) to the user entity type. The new object contains two child attributes (testOne and testTwo), both 256-character string attributes.


curl -X POST \
  -H "Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg" \
  --data-urlencode type_name=user \
  --data-urlencode attr_def='{"name":"testObject","type":"object","attr_defs":[{"name":"testOne","type":"string","length":256},{"name":"testTwo","type":"string","length": 256}]}' \
  https://my-app.janraincapture.com/entityType.addAttribute
          
      Running this command in Postman

Example 2 Response


{
  "schema": {
    "attr_def": [
      {
        "description": "simple identifier for this entity",
        "name": "id",
        "type": "id"
      },
      {
        "description": "globally unique identifier for this entity",
        "name": "uuid",
        "type": "uuid"
      },
      {
        "description": "when this entity was created",
        "name": "created",
        "type": "dateTime"
      },
      {
        "description": "when this entity was last updated",
        "name": "lastUpdated",
        "type": "dateTime"
      },
      {
        "case-sensitive": false,
        "length": 1000,
        "name": "Description",
        "type": "string"
      },
      {
        "case-sensitive": false,
        "length": null,
        "name": "Name",
        "type": "string"
      },
      {
        "attr_defs":[
        {
          "length":256,
          "name":"testOne",
          "type":"string",
          "case-sensitive":true
        },
        {
          "length":256,
          "name":"testTwo",
          "type":"string",
          "case-sensitive":true
        }
        ],
        "name":"testObject",
        "type":"object"
      }
      ],
    "name": "user"
  },
  "stat": "ok"
}
          

The following command adds a new plural attribute (testObject) to the user entity type. The new plural contains two child attributes (testOne and testTwo), both 256-character string attributes.


curl -X POST \
    -H "Authorization: Basic dXQ0YmdycmE3dzI4MmpjZm15cGZxeDlwemhxaGpqMmI6dW5qemU5bndrZnV5NmpwdzgzOHFwYTdhZDNoZG55YTY"\
    --data-urlencode type_name=user \
    --data-urlencode attr_def='{"name":"testPlural","type":"plural","attr_defs":[{"name":"testPOne","type":"string","length":256},{"name":"testPTwo","type":"string","length": 256}]}'\
    https://my-app.janraincapture.com/entityType.addAttribute
          
      Running this command in Postman

Example 3 Response


{
  "schema": {
    "attr_def": [
      {
        "description": "simple identifier for this entity",
        "name": "id",
        "type": "id"
      },
      {
        "description": "globally unique identifier for this entity",
        "name": "uuid",
        "type": "uuid"
      },
      {
        "description": "when this entity was created",
        "name": "created",
        "type": "dateTime"
      },
      {
        "description": "when this entity was last updated",
        "name": "lastUpdated",
        "type": "dateTime"
      },
      {
        "case-sensitive": false,
        "length": 1000,
        "name": "Description",
        "type": "string"
      },
      {
        "case-sensitive": false,
        "length": null,
        "name": "Name",
        "type": "string"
      },
      {
        "attr_defs":[
        {
          "length":256,
          "name":"testPOne",
          "type":"string",
          "case-sensitive":true
        },
        {
          "length":256,
          "name":"testPTwo",
          "type":"string",
          "case-sensitive":true
        }
        ],
        "name":"testPlural",
        "type":"plural"
      }
      ],
    "name": "user"
  },
  "stat": "ok"
}
          

Example 4

The following command adds a new dateTime attribute (emailPreVerified) to the user entity type:


curl -X POST \
    -H "Authorization: Basic dXQ0YmdycmE3dzI4MmpjZm15cGZxeDlwemhxaGpqMmI6dW5qemU5bndrZnV5NmpwdzgzOHFwYTdhZDNoZG55YTY"\
    --data-urlencode type_name=user \
    --data-urlencodeattr_def='{"name":"emailPreVerified","type":"dateTime"}' \
    https://my-app.janraincapture.com/entityType.addAttribute
          
      Running this command in Postman

Example 4 Response


{
  "schema": {
    "attr_def": [
      {
        "description": "simple identifier for this entity",
        "name": "id",
        "type": "id"
      },
      {
        "description": "globally unique identifier for this entity",
        "name": "uuid",
        "type": "uuid"
      },
      {
        "description": "when this entity was created",
        "name": "created",
        "type": "dateTime"
      },
      {
        "description": "when this entity was last updated",
        "name": "lastUpdated",
        "type": "dateTime"
      },
      {
        "case-sensitive": false,
        "length": 1000,
        "name": "Description",
        "type": "string"
      },
      {
        "case-sensitive": false,
        "length": null,
        "name": "Name",
        "type": "string"
      },
      {
        "name":"emailPreVerified",
        "type":"dateTime"
      }
      ],
    "name": "user"
  },
  "stat": "ok"
}
          

Authorized Clients

  • owner

Query Parameters

Parameter Type Required Description
type_name string Yes Name of the entityType.
 
attr_def string Yes Attribute (formatted as a JSON object) to be added to the entityType. For example:

 
{"name":"fullName","type":"string","length":50}