n8n_add_user_to_project
Assign a user to a project with a specific role to manage access and permissions within n8n workflows.
Instructions
Add a user to a project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID | |
| userId | Yes | User ID | |
| role | Yes | User role in project |
Implementation Reference
- src/index.ts:365-373 (handler)The handler case that processes the 'n8n_add_user_to_project' tool, performs input validation, and calls the N8nClient.
case 'n8n_add_user_to_project': { if (!args?.projectId || !args?.userId || !args?.role) { throw new Error('projectId, userId, and role are required'); } const result = await n8nClient.addUserToProject(args.projectId as string, args.userId as string, args.role as string); return { content: [{ type: 'text', text: formatResponse(result) }], }; } - src/n8n-client.ts:257-260 (handler)The underlying API client method that makes the POST request to add a user to a project in n8n.
async addUserToProject(projectId: string, userId: string, role: string): Promise<any> { const response = await this.client.post(`/projects/${projectId}/users`, { userId, role }); return response.data; } - src/index.ts:864-874 (registration)The registration definition for the 'n8n_add_user_to_project' tool, including its schema and description.
name: 'n8n_add_user_to_project', description: 'Add a user to a project', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project ID' }, userId: { type: 'string', description: 'User ID' }, role: { type: 'string', description: 'User role in project' }, }, required: ['projectId', 'userId', 'role'], },