/entityType.setAttributeConstraints

Sets the list of constraints for an attribute. The available constraints are: requireduniquelocally-uniquealphabeticalphanumericunicode-lettersunicode-printable, and email-address.

Warning. This is not an additive operation, you must pass in the entire set of constraints.

Removing Constraints

Instead of removing a constraint, use this endpoint to overwrite the existing constraint with a new constraint. For example, suppose an attribute currently has the unique and required constraints, and you want to drop the required constraint. In that case, you would pass in constraints=["unique"]. Note that the constraints argument must be a valid JSON array; however you can pass in an empty array, which is the equivalent of no constraints at all.

Refer to the Registration Error Codes section for details on error codes.

This command includes 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 Request

This command assigns the required constraint to the givenName attribute in the user entity type. Among other things, this means that users must specify their given name when registering or when editing their user profile.


curl -X POST \
  -H "Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg"\
  --data-urlencode type_name=user \
  --data-urlencode attribute_name=givenName \
  --data-urlencode constraints=["required"] \
  https://my-app.janraincapture.com/entityType.setAttributeConstraints
          
      Running this command in Postman

Example Response


{
  "schema": {
    "attr_defs": [
      {
        "name": "id",
        "description": "simple identifier for this entity",
        "type": "id"
      },
      {
        "name": "uuid",
        "description": "globally unique identifier for this entity",
        "type": "uuid"
      },
      {
        "name": "created",
        "description": "when this entity was created",
        "type": "dateTime"
      },
      {
        "name": "lastUpdated",
        "description": "when this entity was last updated",
        "type": "dateTime"
      },
      {
      "length": null,
        "name": "aboutMe",
        "type": "string",
        "case-sensitive": false
      },
      {
        "length": 1000,
        "constraints": [
          "required"
        ],
        "name": "givenName",
        "type": "string",
        "case-sensitive": false
      },
      {
        "name": "lastLogin",
        "type": "dateTime"
      }
    ],
    "name": "user"
  },
  "stat": "ok"
}
          

Authorized Clients

  • owner

Security

  •  janrain-signed
  •  basic-auth

Query Parameters

Parameter Type Required Description
type_name string Yes Name of the entityType.
 
attribute_name string Yes Case-sensitive name of the attribute to be modified.
 
constraints string Yes JSON-formatted list of constraints for the attribute.