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
| 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 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"email": {
"description": "User's email address",
"format": "email",
"type": "string"
},
"name": {
"description": "User's full name",
"type": "string"
},
"notes": {
"description": "Notes about the user",
"type": "string"
},
"organization_id": {
"description": "ID of the user's organization",
"type": "number"
},
"phone": {
"description": "User's phone number",
"type": "string"
},
"role": {
"description": "User's role",
"enum": [
"end-user",
"agent",
"admin"
],
"type": "string"
},
"tags": {
"description": "Tags for the user",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"name",
"email"
],
"type": "object"
}
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 }); }