{"record":{"id":"5ce56ef37f1d2c43","repo":"flowable/flowable-engine","slug":"could-not-find-the-requested-identity-link-5ce56e","errorCode":null,"errorMessage":"Could not find the requested identity link.","messagePattern":"Could not find the requested identity link\\.","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceIdentityLinkResource.java","lineNumber":124,"sourceCode":"        }\n        if (type == null) {\n            throw new FlowableIllegalArgumentException(\"Type is required.\");\n        }\n    }\n\n    protected IdentityLink getIdentityLink(String identityId, String family, String type, String caseInstanceId) {\n        // Perhaps it would be better to offer getting a single identity link\n        // from the API\n        List<IdentityLink> allLinks = runtimeService.getIdentityLinksForCaseInstance(caseInstanceId);\n        for (IdentityLink link : allLinks) {\n            if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family) && identityId.equals(link.getUserId()) && link.getType().equals(type)) {\n                return link;\n            \n            } else if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family) && identityId.equals(link.getGroupId()) && link.getType().equals(type)) {\n                return link;\n            }\n        }\n        throw new FlowableObjectNotFoundException(\"Could not find the requested identity link.\", IdentityLink.class);\n    }\n}\n","sourceCodeStart":106,"sourceCodeEnd":127,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceIdentityLinkResource.java#L106-L127","documentation":"Thrown by getIdentityLink when the requested identity link (user or group membership on a case instance) cannot be matched among the case instance's existing identity links. Flowable throws FlowableObjectNotFoundException with IdentityLink.class to signal that the specific identity link resource the URL refers to does not exist. The lookup matches on identityId, link type (user/group family), and permission type, so any mismatch means no link is returned.","triggerScenarios":"GET to a case instance identity link URL (CmmnRestUrls URL containing /identitylinks/) where the family segment says 'users' but the link is a group link (or vice versa), the identityId in the URL doesn't match any link's userId/groupId, or the 'type' query/segment (e.g. assignee, candidate, owner) doesn't equal the stored link type.","commonSituations":"Requesting an identity link after it was deleted; typos in the userId/groupId in the URL; using the wrong family segment (users vs groups); wrong link type (e.g. asking for 'assignee' when the link was added as 'candidate'); case sensitivity differences in identity IDs between the identity store and the URL.","solutions":["List the case instance's identity links first (GET /cmmn-runtime/case-instances/{id}/identitylinks) and confirm the exact family, identityId and type, then retry with the corrected URL.","Fix the family segment in the URL: use SEGMENT_IDENTITYLINKS_FAMILY_USERS for user links and SEGMENT_IDENTITYLINKS_FAMILY_GROUPS for group links.","Verify the identityId in the URL exactly matches the userId or groupId on the link (case-sensitive).","If the link should exist, re-add it via POST to the case instance identitylinks collection endpoint before querying it."],"exampleFix":"// before: wrong family/type mismatch\nGET /cmmn-runtime/case-instances/case1/identitylinks/groups/kermit/assignee\n// after: match the actual link (user link, correct type)\nGET /cmmn-runtime/case-instances/case1/identitylinks/users/kermit/candidate","handlingStrategy":"try-catch","validationCode":"// Fetch and verify the identity link exists before requesting it\nconst links = await fetch(`/cmmn-runtime/case-instances/${caseId}/identitylinks`).then(r => r.json());\nconst exists = links.some(l =>\n  (family === 'users' ? l.userId : l.groupId) === identityId && l.type === type);\nif (!exists) throw new Error(`Identity link ${family}/${identityId}/${type} not on case ${caseId}`);","typeGuard":null,"tryCatchPattern":"try {\n  const link = await getIdentityLink(caseId, family, identityId, type);\n} catch (e) {\n  if (e.status === 404) { /* link absent: refresh list or re-create it */ }\n  else throw e;\n}","preventionTips":["List identity links first and use the exact family/identityId/type from the list in the URL.","Remember ids are matched case-sensitively.","Handle deletion races: another client may have removed the link between listing and fetching."],"tags":["rest-api","identity-link","resource-not-found","flowable"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}