Import Identity Mapper Set

Prev Next
Post
/api/1.0/identity-templates/{envId}/{identityTemplateId}/mapper-sets

Import Mapper Set for a specific Template in the indicated Environment. This API is designed to support CREATE and UPDATE operations for Mapper Set.

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 API tool.

    Headers

    *Required
    Header Value cURL 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 in the Try It or Code Sample tabs. You can then copy the cURL sample from the Code Sample tab 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.

    identityTemplateId
    stringRequired

    The Identity Template ID. This can be found in your Identity Workspace Settings.

    Body parameters

    Mapper Set to import.

    example
    {
      "mapperSetId": "ms_123",
      "displayName": "User Mapper Set",
      "description": "Mapper set for user identities",
      "linkedSources": [
        {
          "sourceId": "REQUEST_INPUT",
          "sourceUsedAs": "BASE",
          "mappers": [
            {
              "type": "IDENTITY_ATTRIBUTES",
              "mappings": [
                {
                  "origin": "uid",
                  "target": "uid"
                },
                {
                  "origin": "assignmentId",
                  "target": "assignmentId"
                },
                {
                  "origin": "assignmentName",
                  "target": "assignmentName"
                }
              ]
            }
          ]
        },
        {
          "sourceId": "REQUEST_MAPPERS",
          "sourceUsedAs": "BASE",
          "mappers": [
            {
              "type": "IDENTITY_ATTRIBUTES",
              "mappings": [
                {
                  "origin": "$.JWT.a.claim",
                  "target": "userAssignment"
                }
              ]
            }
          ]
        },
        {
          "sourceId": "ds_users",
          "sourceUsedAs": "MAIN",
          "additionalProps": {
            "isValidateUser": true
          },
          "mappers": [
            {
              "type": "IDENTITY_ATTRIBUTES",
              "mappings": [
                {
                  "origin": "userID",
                  "target": "uid"
                }
              ]
            }
          ]
        },
        {
          "sourceId": "ds_classes",
          "sourceUsedAs": "AUX",
          "additionalProps": {
            "cacheDuration": 0
          },
          "mappers": [
            {
              "type": "CORRELATION",
              "mappings": [
                {
                  "origin": "userIdentifier",
                  "target": "uid",
                  "operator": "EQUALS"
                }
              ]
            },
            {
              "type": "IDENTITY_ATTRIBUTES",
              "mappings": [
                {
                  "origin": "assignmentId",
                  "target": "userAssignmentId"
                },
                {
                  "origin": "assignmentName",
                  "target": "userAssignmentName"
                }
              ]
            }
          ]
        },
        {
          "sourceId": "ds_classes",
          "sourceUsedAs": "CONTEXT",
          "additionalProps": {},
          "mappers": [
            {
              "type": "CORRELATION",
              "mappings": [
                {
                  "origin": "userIdentifier",
                  "target": "uid",
                  "operator": "EQUALS"
                }
              ]
            },
            {
              "type": "CONTEXT_FILTERS",
              "mappings": [
                {
                  "origin": "class",
                  "target": "classification",
                  "originMapper": "$.JWT.a.claim",
                  "isRequired": true,
                  "isExcludedFromCache": false
                }
              ]
            },
            {
              "type": "IDENTITY_ATTRIBUTES",
              "mappings": [
                {
                  "origin": "assignmentId",
                  "target": "userAssignmentId"
                },
                {
                  "origin": "assignmentName",
                  "target": "userAssignmentName"
                }
              ]
            }
          ]
        },
        {
          "sourceId": "CALCULATED",
          "sourceUsedAs": "AUX",
          "mappers": [
            {
              "type": "IDENTITY_ATTRIBUTES",
              "mappings": [
                {
                  "origin": "SUBSTRING({{assignmentName}},0,5)",
                  "target": "userAssignmentPrefix"
                }
              ]
            }
          ]
        }
      ]
    }
    Expand All
    object

    Mapper Set

    mapperSetId
    string Required

    Unique identifier for the Mapper Set

    displayName
    string Required

    Display name for the Mapper Set

    description
    string

    Description of the Mapper Set

    Max length200
    linkedSources
    Array of object Required

    List of linked sources for the Mapper Set

    object
    sourceId
    string Required

    Source identifier. This can be found in the relevant Source in your Identity Workspace Settings.

    sourceUsedAs
    string Required

    How the source is used in the mapping

    Valid values[ "BASE", "MAIN", "AUX", "CONTEXT" ]
    additionalProps
    object

    Additional properties for the source

    cacheDuration
    integer

    Cache duration in minutes

    isValidateUser
    boolean

    Whether to validate the user in MAIN source only

    mappers
    Array of object Required

    List of Mappers for the Source

    object
    type
    string Required

    Type of mapper

    Valid values[ "IDENTITY_ATTRIBUTES", "CORRELATION", "CONTEXT_FILTERS" ]
    mappings
    Array of object Required

    List of Attribute mappings

    object
    origin
    string

    Origin Attribute or expression

    target
    string

    Target Attribute

    operator
    string

    Operator for correlation (for correlation mappers)

    originMapper
    string

    Origin mapper expression (for context filters mappers)

    isRequired
    boolean

    If the Mapping is required (for context filters mappers)

    isExcludedFromCache
    boolean

    Exclude from cache (for context filters mappers)

    Responses
    201

    Successful operation

    Headers
    x-request-id
    string
    The ID of the request
    example
    {
      "data": {
        "mapperSetId": "ms_123",
        "displayName": "User Mapper Set",
        "description": "Mapper set for user identities",
        "linkedSources": [
          {
            "sourceId": "REQUEST_INPUT",
            "sourceUsedAs": "BASE",
            "mappers": [
              {
                "type": "IDENTITY_ATTRIBUTES",
                "mappings": [
                  {
                    "origin": "uid",
                    "target": "uid"
                  },
                  {
                    "origin": "assignmentId",
                    "target": "assignmentId"
                  },
                  {
                    "origin": "assignmentName",
                    "target": "assignmentName"
                  }
                ]
              }
            ]
          },
          {
            "sourceId": "REQUEST_MAPPERS",
            "sourceUsedAs": "BASE",
            "mappers": [
              {
                "type": "IDENTITY_ATTRIBUTES",
                "mappings": [
                  {
                    "origin": "$.JWT.a.claim",
                    "target": "userAssignment"
                  }
                ]
              }
            ]
          },
          {
            "sourceId": "ds_users",
            "sourceUsedAs": "MAIN",
            "additionalProps": {
              "isValidateUser": true
            },
            "mappers": [
              {
                "type": "IDENTITY_ATTRIBUTES",
                "mappings": [
                  {
                    "origin": "userID",
                    "target": "uid"
                  }
                ]
              }
            ]
          },
          {
            "sourceId": "ds_classes",
            "sourceUsedAs": "AUX",
            "additionalProps": {
              "cacheDuration": 0
            },
            "mappers": [
              {
                "type": "CORRELATION",
                "mappings": [
                  {
                    "origin": "userIdentifier",
                    "target": "uid",
                    "operator": "EQUALS"
                  }
                ]
              },
              {
                "type": "IDENTITY_ATTRIBUTES",
                "mappings": [
                  {
                    "origin": "assignmentId",
                    "target": "userAssignmentId"
                  },
                  {
                    "origin": "assignmentName",
                    "target": "userAssignmentName"
                  }
                ]
              }
            ]
          },
          {
            "sourceId": "ds_classes",
            "sourceUsedAs": "CONTEXT",
            "additionalProps": {},
            "mappers": [
              {
                "type": "CORRELATION",
                "mappings": [
                  {
                    "origin": "userIdentifier",
                    "target": "uid",
                    "operator": "EQUALS"
                  }
                ]
              },
              {
                "type": "CONTEXT_FILTERS",
                "mappings": [
                  {
                    "origin": "class",
                    "target": "classification",
                    "originMapper": "$.JWT.a.claim",
                    "isRequired": true,
                    "isExcludedFromCache": false
                  }
                ]
              },
              {
                "type": "IDENTITY_ATTRIBUTES",
                "mappings": [
                  {
                    "origin": "assignmentId",
                    "target": "userAssignmentId"
                  },
                  {
                    "origin": "assignmentName",
                    "target": "userAssignmentName"
                  }
                ]
              }
            ]
          },
          {
            "sourceId": "CALCULATED",
            "sourceUsedAs": "AUX",
            "mappers": [
              {
                "type": "IDENTITY_ATTRIBUTES",
                "mappings": [
                  {
                    "origin": "SUBSTRING({{assignmentName}},0,5)",
                    "target": "userAssignmentPrefix"
                  }
                ]
              }
            ]
          }
        ]
      }
    }
    Expand All
    object

    Response payload for a Mapper Set

    data
    object (MapperSet)

    Mapper Set

    mapperSetId
    string

    Unique identifier for the Mapper Set

    displayName
    string

    Display name for the Mapper Set

    description
    string

    Description of the Mapper Set

    Max length200
    linkedSources
    Array of object

    List of linked sources for the Mapper Set

    object
    sourceId
    string

    Source identifier. This can be found in the relevant Source in your Identity Workspace Settings.

    sourceUsedAs
    string

    How the source is used in the mapping

    Valid values[ "BASE", "MAIN", "AUX", "CONTEXT" ]
    additionalProps
    object

    Additional properties for the source

    cacheDuration
    integer

    Cache duration in minutes

    isValidateUser
    boolean

    Whether to validate the user in MAIN source only

    mappers
    Array of object

    List of Mappers for the Source

    object
    type
    string

    Type of mapper

    Valid values[ "IDENTITY_ATTRIBUTES", "CORRELATION", "CONTEXT_FILTERS" ]
    mappings
    Array of object

    List of Attribute mappings

    object
    origin
    string

    Origin Attribute or expression

    target
    string

    Target Attribute

    operator
    string

    Operator for correlation (for correlation mappers)

    originMapper
    string

    Origin mapper expression (for context filters mappers)

    isRequired
    boolean

    If the Mapping is required (for context filters mappers)

    isExcludedFromCache
    boolean

    Exclude from cache (for context filters mappers)

    400

    Validation Error

    Headers
    x-request-id
    string
    The ID of the request
    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
    validationError
    {
      "errors": [
        {
          "code": "EMTMS-001",
          "id": "EQ7CMX",
          "status": "404",
          "name": "TemplateMapperSetNotFoundError",
          "message": "Template Mapper Set: [TMS] not found, Hint: did you mean [User, Target]"
        }
      ]
    }
    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
    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