---
title: "Invites a user by email and assigns them to a task."
method: POST
path: "/tasks/assignuserbyemail"
tags: ["tasks"]
---

# Invites a user by email and assigns them to a task.

`POST /tasks/assignuserbyemail`

<Check title="Required Permissions" icon="key">Any authenticated user.</Check>

## Headers

- `Authorization` string, required

## Request body

- AssignByEmailForm
  - `taskId` string, uuid, required — The id of the task.
  - `email` string, email, required — The email of the new user.
  - `roleId` string, uuid, required — The id of the role to which the new user should be added.
  - `firstName` string, nullable — The first name of the user to be invited.
  - `lastName` string, nullable — The last name of the user to be invited.
  - `gender` 'male' | 'female' | 'other' — The gender of the user to be invited. Could be 'male', 'female', 'other'

## Response `200`

OK

- TasksPostTasksAssignUserByEmailResponse200 — Empty response body

## Other responses

- `400` — Bad Request
- `404` — Not Found

## Changes

- **2026-08-21** `a13e7c704262` — 1 breaking
  - the `email` request property's minLength was increased from `0` to `1`

[Change history](https://skmtc.dev/awork-io/apis/api-v1-reference/changes/tasks/assignuserbyemail/post.md)

---

[API](https://skmtc.dev/awork-io/apis/api-v1-reference.md) · [All operations](https://skmtc.dev/awork-io/apis/api-v1-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/awork-io/api-v1-reference/revisions/a13e7c704262/schema)
