Import Identity Template
  • 06 Jan 2025
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Import Identity Template

  • Dark
    Light
  • PDF

Article summary

Post
/api/1.0/identity-templates/{envId}

This API is designed to support CREATE and UPDATE operations to the indicated Environment. An import operation occurs when a new identityAttributeId is used. An update operation occurs if the identityTemplateId already exists or templateId already in use.

Notice

Accessing the APIs is through a dedicated domain/URL, according to your PlainID Tenant Location
  • United States (US) - `https://api.us1.plainid.io`
  • Canada (CA) - `https://api.ca1.plainid.io`
  • Europe (EU) - `https://api.eu1.plainid.io`

  • Using HTML Encoded Special Characters

    Use HTML encoded patterns when working with values that contain special characters like spaces, dashes, etc. Refer to this HTML URL Encoding Reference for a full list.


    Important note about headers

    Refer to the headers below to modify your cURL sample. Check if the following headers are in the sample, if not, ensure you add it to your cURL sample before pasting into your API tool.

    Headers

    *Required
    HeaderValuecURL Line
    Accept`application/json``-H "Accept:application/json"`
    Content-Type`application/json``-H "Content-Type:application/json"`

    cURL Sample Guidelines

    In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right. They will then appear in the cURL sample on the bottom of the page in the correct format.

    Security
    HTTP
    Type bearer

    For more details about Administration API Authentication, check out the Authentication APIs documentation. Provide your bearer token in the Authorization header when making requests to protected resources. Example: Authorization: Bearer 123

    Path parameters
    envId
    string (uuid) Required

    The Environment ID can be found under the Details Tab in the Environment Settings.

    Query parameters
    idWsId
    string (uuid) Required

    Identity Workspace ID. This can be found in your Identity Workspace Settings under Workspace ID.

    Body parameters

    Identity Template to import.

    example
    {
      "templateId": "CaCIdentity",
      "attributes": [
        {
          "attributeId": "userAccount",
          "displayName": "userAccount",
          "description": "user account id",
          "type": "NUMERIC",
          "isAvailableForPolicies": true,
          "nameForRequest": "userAccount"
        },
        {
          "attributeId": "userRole",
          "displayName": "User Role",
          "description": "user role name",
          "type": "STRING",
          "isAvailableForPolicies": true,
          "nameForRequest": "userRole"
        }
      ]
    }
    Expand All
    object

    Identity Template

    templateId
    string Required

    A unique string for the Identity Template.

    Min length1
    Max length128
    attributes
    Array of object (IdentityAttribute)
    object

    Attribute

    displayName
    string Required

    A display name that acts as a label for your Attribute.

    Min length1
    Max length100
    description
    string

    Attribute description.

    Min length1
    Max length200
    attributeId
    string Required

    The Attribute ID. This can be found in Identity Settings.

    Min length1
    Max length128
    attributeType
    string

    Attribute Data Type

    Valid values[ "STRING", "NUMERIC" ]
    isAvailableForPolicies
    boolean

    Indicates if the Attribute is allowed for Policies.

    nameForRequest
    string Required

    The name of the Attribute as it should appear in an Authorization Request.

    Min length1
    Responses
    201

    Successful operation

    Headers
    x-request-id
    string
    The ID of the request
    example
    {
      "templateId": "CaCIdentity",
      "attributes": [
        {
          "attributeId": "userAccount",
          "displayName": "userAccount",
          "description": "user account id",
          "type": "NUMERIC",
          "isAvailableForPolicies": true,
          "nameForRequest": "userAccount"
        },
        {
          "attributeId": "userRole",
          "displayName": "User Role",
          "description": "user role name",
          "type": "STRING",
          "isAvailableForPolicies": true,
          "nameForRequest": "userRole"
        }
      ]
    }
    Expand All
    object

    Identity template

    data
    object (IdentityTemplate)

    Identity Template

    templateId
    string

    A unique string for the Identity Template.

    Min length1
    Max length128
    attributes
    Array of object (IdentityAttribute)
    object

    Attribute

    displayName
    string

    A display name that acts as a label for your Attribute.

    Min length1
    Max length100
    description
    string

    Attribute description.

    Min length1
    Max length200
    attributeId
    string

    The Attribute ID. This can be found in Identity Settings.

    Min length1
    Max length128
    attributeType
    string

    Attribute Data Type

    Valid values[ "STRING", "NUMERIC" ]
    isAvailableForPolicies
    boolean

    Indicates if the Attribute is allowed for Policies.

    nameForRequest
    string

    The name of the Attribute as it should appear in an Authorization Request.

    Min length1
    400

    Validation Error

    Headers
    x-request-id
    string
    The ID of the request
    validationError
    {
      "errors": [
        {
          "code": "EMIT-007",
          "id": "EQ7CMX",
          "status": "404",
          "name": "IdentityAttributeUserIdCannotBeEdited",
          "message": "Default Identity Template Attribute ID: [attribueKeyNew] Display name cannot be edited. Hint: Revert back to: [attribueKeyOld]"
        }
      ]
    }
    Expand All
    object

    Response object

    errors
    Array of object (Error)
    object
    code
    string
    id
    string
    status
    integer
    name
    string
    message
    string
    args
    object
    path
    string
    401

    Unauthorized

    Headers
    x-request-id
    string
    The ID of the request
    403

    Forbidden

    Headers
    x-request-id
    string
    The ID of the request
    404

    Object not found

    Headers
    x-request-id
    string
    The ID of the request
    422

    Payload Validation Error

    Headers
    x-request-id
    string
    The ID of the request
    500

    Internal Server Error

    Headers
    x-request-id
    string
    The ID of the request

    Was this article helpful?