# Add a User to a Project Team

Add users to a project team using YouTrack REST API.

> **Note:**
> In YouTrack versions earlier than 2026.1, project team operations were performed with Hub REST API. Starting with YouTrack 2026.1, Hub REST API endpoints for project teams are no longer available for YouTrack project teams. Do not use `/hub/api/rest/projects/{project_id}/team/users` to update YouTrack project teams. Use YouTrack REST API endpoints instead. For details, see [Hub REST API Endpoints and Entities Deprecated in YouTrack 2026.1](hub-rest-api-deprecated-endpoints-2026-1.html).

## Summary

Starting with YouTrack 2026.1, you can add users to a project team with YouTrack REST API. Project teams are available as the `team` subresource of a project. Direct team members are managed with the `ownUsers` subresource.

When you have all necessary entity IDs, you can add the user as a direct member of the target project team by sending a POST request to the following endpoint:

```
<YouTrack_REST_API_URL>/admin/projects/{projectID}/team/ownUsers
```

## Step-by-Step

Procedure: To add a user to a project team:

1. Get the ID of the project whose team you want to update. For instructions, see [Get a Project ID](api-usecase-get-project-id.html). This example uses the project ID `0-0`.

2. Get the entity ID of the target YouTrack user.

To do so, send `GET` request to the `/api/users` endpoint, and in the `fields` request parameter, list `id`, `login`, and `name` to identify the user. If you know the login or name of the target user, you can specify it in the `query` parameter to narrow down the results returned from the server.

For example:

```CURL
curl -L -X GET 'https://example.youtrack.cloud/api/users?fields=id,name,login&query=Mad%20Max' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>'
```

In response, server returned the following data:

```JSON
[
    {
        "login": "Mad_Max",
        "name": "Mad Max",
        "id": "1-7",
        "$type": "User"
    }
]
```

Now that we have entity IDs for both target project and user, we can move to the last step.

3. Add the user to the project's team.

To do so, you need to send a `POST` request to the following YouTrack REST API endpoint:

```CURL
<YouTrack_REST_API_URL>/admin/projects/{projectID}/team/ownUsers
```

In the payload of the request, specify the user's entity `id`.

For example:

```CURL
curl -L -X POST 'https://example.youtrack.cloud/api/admin/projects/0-0/team/ownUsers?fields=id,login,name' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
--data-raw '{"id":"1-7"}'
```

In this sample request, we also specify the `fields` parameter to confirm the details of the user that was added to the team.

In response, server returned the following data:

```JSON
{
    "login": "Mad_Max",
    "name": "Mad Max",
    "id": "1-7",
    "$type": "User"
}
```

> **Tip:**
> The `/team/users` subresource returns all users in the project team, including users who are included through groups. This subresource is read-only. To add a user group to a project team, use `<YouTrack_REST_API_URL>/admin/projects/{projectID}/team/groups`.

