{"record":{"id":"908a570381ca4a3b","repo":"flowable/flowable-engine","slug":"type-is-required-908a57","errorCode":null,"errorMessage":"Type is required.","messagePattern":"Type is required\\.","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskIdentityLinkResource.java","lineNumber":103,"sourceCode":"            restApiInterceptor.deleteTaskIdentityLink(task, link);\n        }\n\n        if (CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS.equals(family)) {\n            taskService.deleteUserIdentityLink(task.getId(), identityId, type);\n        } else {\n            taskService.deleteGroupIdentityLink(task.getId(), identityId, type);\n        }\n    }\n\n    protected void validateIdentityLinkArguments(String family, String identityId, String type) {\n        if (family == null || (!CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_GROUPS.equals(family) && !CmmnRestUrls.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 family, String identityId, String type, String taskId) {\n        boolean isUser = family.equals(CmmnRestUrls.SEGMENT_IDENTITYLINKS_FAMILY_USERS);\n\n        // Perhaps it would be better to offer getting a single identitylink\n        // from the API\n        List<IdentityLink> allLinks = taskService.getIdentityLinksForTask(taskId);\n        for (IdentityLink link : allLinks) {\n            boolean rightIdentity = false;\n            if (isUser) {\n                rightIdentity = identityId.equals(link.getUserId());\n            } else {\n                rightIdentity = identityId.equals(link.getGroupId());\n            }\n\n            if (rightIdentity && link.getType().equals(type)) {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskIdentityLinkResource.java#L85-L121","documentation":"The {type} path variable (the identity link type such as 'candidate') is mandatory when addressing a single identity link, since a user can hold multiple link types on one task. A null type makes the target link ambiguous and triggers FlowableIllegalArgumentException.","triggerScenarios":"GET/DELETE /cmmn-runtime/tasks/{taskId}/identitylinks/{family}/{identityId}/{type} with an empty or missing {type} segment.","commonSituations":"URL built from a stored identity link object whose 'type' field was never set; templated paths that omit the last segment; confusing this endpoint with the collection POST where type is also required.","solutions":["Include the link type in the URL, e.g. /cmmn-runtime/tasks/123/identitylinks/users/john/candidate","Ensure the client object's type field is populated before constructing the URL","Use the family-level listing endpoint if the type is unknown and needs discovery"],"exampleFix":"// before\nDELETE /cmmn-runtime/tasks/123/identitylinks/users/john\n// after\nDELETE /cmmn-runtime/tasks/123/identitylinks/users/john/candidate","handlingStrategy":"validation","validationCode":"function canAddressIdentityLink(family, identityId, type) {\n  return !!identityId && !!type && ['users','groups'].includes(family);\n}","typeGuard":"function hasType(a) {\n  return typeof a.type === 'string' && a.type.length > 0;\n}","tryCatchPattern":"try {\n  await del(url);\n} catch (e) {\n  if (e.status === 400 && /Type is required/.test(e.body.message)) {\n    throw new Error('type path variable missing');\n  }\n  throw e;\n}","preventionTips":["Always append the link type segment to single-link URLs","If type is unknown, list family links first to discover it","Validate stored link objects have type before reusing them in URLs"],"tags":["rest-api","missing-parameter","identity-link"],"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-18T11:17:12.947Z"}