DMP Segment Users

DMP Segment Users is a sub-resource of DMP segments and lets you add users to a DMP Segment.

The use of this API is restricted to those developers approved by LinkedIn and subject to applicable data restrictions in their agreements.

Note

After you create a DMP segment, you must wait ~10-15 seconds for the segment to be available to add users.

Add or Remove a User

Add or remove a single user from a DMP Segment.

Schema

Field Name Sub-Field Type Description
action string The action to take on this entity. ADD or REMOVE.
userId
idType IdType Type of this ID. All IDs of a given type must use the same format/encoding.
idValue string An opaque ID in type-specific format.

IdTypes

The following idType values are supported.

Symbol Description
BIZO_ID e.g. 7b125f04-6fac-464c-b830-411a6d75d2ec
SHA256_EMAIL A HEX encoded string with length = 64. 692682111bc191d915ac7009d118a78bc496cf7a2ba8c2d0134ade012ac1234
SHA512_EMAIL A HEX encoded string with length = 128. 09d118a78b692682111bc15ac70c496cf7a9e0502ba8c2d016f2f496cf7a2ba8c1....

Sample Request

POST https://api.linkedin.com/v2/dmpSegments/10804/users
{
    "action": "ADD",
    "userId": {
        "idType": "SHA256_EMAIL",
        "idValue": "09d118a78b69261bc191d915ac70c496cf7a9e0502ba8c2d016f2f134ade"
    }
}

Note

A 201 Created HTTP status code is returned if you add the same ID again or remove an already deleted ID. This is by design.

Add or Remove Multiple Users

Add or remove multiple users from a DMP Segment by passing the X-RestLi-Method: BATCH_CREATE header.

Sample Request

POST https://api.linkedin.com/v2/dmpSegments/10804/users
{
    "elements": [
        {
            "action": "ADD",
            "userId": {
                "idType": "SHA256_EMAIL",
                "idValue": "692682111bc191d915ac7009d118a78bc496cf7a2ba8c2d0134ade012ac1234"
            }
        },
        {
            "action": "ADD",
            "userId": {
                "idType": "SHA256_EMAIL",
                "idValue": "09d118a78b692682111bc15ac70c496cf7a9e0502ba8c2d016f2f1f7a2ba8c2"
            }
        }
    ]
}

A 400 Bad Request is returned if the request is incorrect. The error message contains a reference to batchIndex, with the index of the element that caused the error.

400 Bad Request
{
  "serviceErrorCode": 10007,
  "message": "Validation failed because [{field=userId, batchIndex=1, type=MISSING_REQUIRED_FIELD, message=ERROR :: /userId/idType :: \"GOOGLE\" is not an enum symbol}]",
  "status": 400
}