update_identity
Update an existing identity's attributes such as employee status, type, name, email, department, job title, custom fields, or manager using the identity ID.
Instructions
Update an existing identity. Pass identityId and any fields to update (employeeStatus, employeeType, displayName, primaryEmail, department, jobTitle, customFields, manager, etc.).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identityId | Yes | The ID of the identity to update | |
| employeeStatus | No | Extended status of the employee | |
| employeeType | No | Type of the employee | |
| managementType | No | Management type of the employee | |
| displayName | No | Display name of the employee | |
| firstName | No | First name of the employee | |
| lastName | No | Last name of the employee | |
| primaryEmail | No | Primary email of the employee | |
| secondaryEmails | No | Secondary emails of the employee | |
| companyName | No | Company name of the employee | |
| workLocation | No | Work location of the employee | |
| department | No | Department of the employee | |
| jobTitle | No | Job title of the employee | |
| employeeId | No | Employee ID of the employee | |
| lifecycle | No | Lifecycle of the employee | |
| note | No | Notes of the employee | |
| customFields | No | Custom fields of the employee | |
| manager | No | Manager of the employee |
Implementation Reference
- src/tools/updateIdentity.ts:57-61 (handler)The main handler function for 'update_identity'. Calls `client.makePutApiCall('/identity/{identityId}', ...)` with the body built by the toBody helper.
export async function updateIdentity(params: UpdateIdentityParams) { const client = getClient(); const { identityId, ...rest } = params; return client.makePutApiCall(`/identity/${identityId}`, toBody(rest)); } - src/tools/updateIdentity.ts:35-55 (helper)Helper function `toBody` that extracts all updatable fields from input params (excluding identityId) and returns them as a Record for the PUT request body.
function toBody(params: Omit<UpdateIdentityParams, "identityId">): Record<string, unknown> { const body: Record<string, unknown> = {}; if (params.employeeStatus !== undefined) body.employeeStatus = params.employeeStatus; if (params.employeeType !== undefined) body.employeeType = params.employeeType; if (params.managementType !== undefined) body.managementType = params.managementType; if (params.displayName !== undefined) body.displayName = params.displayName; if (params.firstName !== undefined) body.firstName = params.firstName; if (params.lastName !== undefined) body.lastName = params.lastName; if (params.primaryEmail !== undefined) body.primaryEmail = params.primaryEmail; if (params.secondaryEmails !== undefined) body.secondaryEmails = params.secondaryEmails; if (params.companyName !== undefined) body.companyName = params.companyName; if (params.workLocation !== undefined) body.workLocation = params.workLocation; if (params.department !== undefined) body.department = params.department; if (params.jobTitle !== undefined) body.jobTitle = params.jobTitle; if (params.employeeId !== undefined) body.employeeId = params.employeeId; if (params.lifecycle !== undefined) body.lifecycle = params.lifecycle; if (params.note !== undefined) body.note = params.note; if (params.customFields !== undefined) body.customFields = params.customFields; if (params.manager !== undefined) body.manager = params.manager; return body; } - src/tools/updateIdentity.ts:12-31 (schema)Zod schema `UpdateIdentitySchema` defining all input fields: identityId (required), employeeStatus, employeeType, managementType, displayName, firstName, lastName, primaryEmail, secondaryEmails, companyName, workLocation, department, jobTitle, employeeId, lifecycle, note, customFields, manager.
export const UpdateIdentitySchema = z.object({ identityId: z.string().describe("The ID of the identity to update"), employeeStatus: EmployeeStatusEnum.optional().describe("Extended status of the employee"), employeeType: EmployeeTypeEnum.optional().describe("Type of the employee"), managementType: ManagementTypeEnum.nullable().optional().describe("Management type of the employee"), displayName: z.string().nullable().optional().describe("Display name of the employee"), firstName: z.string().optional().describe("First name of the employee"), lastName: z.string().optional().describe("Last name of the employee"), primaryEmail: z.string().nullable().optional().describe("Primary email of the employee"), secondaryEmails: z.array(z.string()).nullable().optional().describe("Secondary emails of the employee"), companyName: z.string().nullable().optional().describe("Company name of the employee"), workLocation: z.string().nullable().optional().describe("Work location of the employee"), department: DepartmentSchema.nullable().optional().describe("Department of the employee"), jobTitle: z.string().nullable().optional().describe("Job title of the employee"), employeeId: z.string().nullable().optional().describe("Employee ID of the employee"), lifecycle: LifecycleSchema.optional().describe("Lifecycle of the employee"), note: z.string().nullable().optional().describe("Notes of the employee"), customFields: z.record(z.string(), z.unknown()).optional().describe("Custom fields of the employee"), manager: ManagerSchema.optional().describe("Manager of the employee"), }); - src/index.ts:177-182 (registration)Registers the 'update_identity' tool with its description and inputSchema in the list of tools.
{ name: "update_identity", description: "Update an existing identity. Pass identityId and any fields to update (employeeStatus, employeeType, displayName, primaryEmail, department, jobTitle, customFields, manager, etc.).", inputSchema: zodToJsonSchema(UpdateIdentitySchema), }, - src/index.ts:310-310 (registration)Maps the 'update_identity' tool name to the handler function, parsing input with UpdateIdentitySchema.
update_identity: async (input) => updateIdentity(UpdateIdentitySchema.parse(input)),