{"record":{"id":"ea1c35c01361ddc9","repo":"flowable/flowable-engine","slug":"type-is-required-ea1c35","errorCode":null,"errorMessage":"Type is required.","messagePattern":"Type is required\\.","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceIdentityLinkResource.java","lineNumber":106,"sourceCode":"        }\n\n        if (RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family)) {\n            runtimeService.deleteGroupIdentityLink(processInstance.getId(), identityId, type);\n            \n        } else {\n            runtimeService.deleteUserIdentityLink(processInstance.getId(), identityId, type);\n        }\n    }\n\n    protected void validateIdentityLinkArguments(String family, String identityId, String type) {\n        if (family == null || (!RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family) && !RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family))) {\n            throw new FlowableIllegalArgumentException(\"Identity link family should be 'users' or 'groups'.\");\n        }\n        if (identityId == null) {\n            throw new FlowableIllegalArgumentException(\"IdentityId is required.\");\n        }\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 processInstanceId) {\n        // Perhaps it would be better to offer getting a single identity link\n        // from the API\n        List<IdentityLink> allLinks = runtimeService.getIdentityLinksForProcessInstance(processInstanceId);\n        for (IdentityLink link : allLinks) {\n            if (RestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family) && identityId.equals(link.getUserId()) && link.getType().equals(type)) {\n                return link;\n            \n            } else if (RestUrls.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}","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceIdentityLinkResource.java#L88-L124","documentation":"Flowable REST throws FlowableIllegalArgumentException when the identity link 'type' path segment is null while validating arguments in validateIdentityLinkArguments. The type (e.g. 'participant', 'starter') is mandatory to identify the specific identity link.","triggerScenarios":"DELETE to /runtime/process-instances/{id}/identitylinks/users/{identityId}/ with an empty {type} segment; deleting a link without appending the type part of the URL.","commonSituations":"Client omits the third path segment when deleting an identity link; assumes type is optional because the REST docs list only family and identityId in some examples; wrong number of segments after URL rewriting.","solutions":["Append the identity link type to the URL, e.g. /identitylinks/users/{identityId}/participant.","Check the identity link's type via the identity link collection endpoint before deleting.","Ensure proxy/rewrite rules do not strip the trailing path segment."],"exampleFix":"// before\ndelete(\"/runtime/process-instances/\" + pid + \"/identitylinks/users/\" + userId);\n// after\ndelete(\"/runtime/process-instances/\" + pid + \"/identitylinks/users/\" + userId + \"/participant\");","handlingStrategy":"validation","validationCode":"if (!linkType) throw new Error('identity link type required, e.g. participant');","typeGuard":"const hasType = (s) => typeof s === 'string' && s.length > 0;","tryCatchPattern":null,"preventionTips":["Always include the {type} segment when deleting identity links","Fetch the link first to learn its exact type","Centralize identity-link URL construction in one helper"],"tags":["rest-api","validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:17:23.245Z"}