create_user
Add users to Zendesk by specifying name, email, role, phone, organization ID, tags, and notes. Streamline user management within Zendesk Support, Talk, Chat, and Guide products.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | User's email address | ||
| name | Yes | User's full name | |
| notes | No | Notes about the user | |
| organization_id | No | ID of the user's organization | |
| phone | No | User's phone number | |
| role | No | User's role | |
| tags | No | Tags for the user |
Implementation Reference
- src/tools/users.js:66-91 (handler)The main handler function for the create_user tool. It constructs userData from inputs and calls zendeskClient.createUser, returning a formatted response or error.handler: async ({ name, email, role, phone, organization_id, tags, notes }) => { try { const userData = { name, email, role, phone, organization_id, tags, notes }; const result = await zendeskClient.createUser(userData); return { content: [{ type: "text", text: `User created successfully!\n\n${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating user: ${error.message}` }], isError: true }; } }
- src/tools/users.js:57-65 (schema)Input schema using Zod for validating parameters like name, email, role, phone, organization_id, tags, and notes.schema: { name: z.string().describe("User's full name"), email: z.string().email().describe("User's email address"), role: z.enum(["end-user", "agent", "admin"]).optional().describe("User's role"), phone: z.string().optional().describe("User's phone number"), organization_id: z.number().optional().describe("ID of the user's organization"), tags: z.array(z.string()).optional().describe("Tags for the user"), notes: z.string().optional().describe("Notes about the user") },
- src/server.js:31-52 (registration)Tool registration block where usersTools (containing create_user) is spread into allTools and each tool is registered via server.tool().const allTools = [ ...ticketsTools, ...usersTools, ...organizationsTools, ...groupsTools, ...macrosTools, ...viewsTools, ...triggersTools, ...automationsTools, ...searchTools, ...helpCenterTools, ...supportTools, ...talkTools, ...chatTools, ]; // Register each tool with the server allTools.forEach((tool) => { server.tool(tool.name, tool.schema, tool.handler, { description: tool.description, }); });
- src/zendesk-client.js:109-111 (helper)Helper method in ZendeskClient that sends POST request to create a user via the Zendesk API.async createUser(data) { return this.request("POST", "/users.json", { user: data }); }