---
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

---

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