# Get a Project ID

Use the REST API to get the entity ID of a project. You need this ID for requests that create issues or update project-specific settings.

## Summary

To get the entity ID of a project, send a `GET` request to the `/api/admin/projects` endpoint. You can request the full list of available projects or use the `query` parameter to filter the list by project name or short name.

## Step-by-Step

Procedure: To get a project ID

1. Get a list of available projects.

```CURL
curl -X GET \
'https://example.youtrack.cloud/api/admin/projects?fields=id,name,shortName' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Content-Type: application/json'
```

In the `fields` request parameter, you instruct the server to return the `id`, `name`, and `shortName` attributes of each project.

For such request, you get response from the server with the following body:

```JSON
[
    {
        "shortName": "GRP",
        "name": "GRA Project",
        "id": "0-7",
        "$type": "Project"
    },
    {
        "shortName": "RAP",
        "name": "Rest Api Project",
        "id": "0-2",
        "$type": "Project"
    },
    {
        "shortName": "RP",
        "name": "Rest Project",
        "id": "0-6",
        "$type": "Project"
    },
    {
        "shortName": "SP",
        "name": "Sample Project",
        "id": "0-0",
        "$type": "Project"
    },
    {
        "shortName": "SNBX",
        "name": "Sandbox",
        "id": "0-3",
        "$type": "Project"
    }
]
```

2. Optional. Filter the list of projects by the project `name` or `shortName`.

Sample request with the filter by a project's `name`:

```CURL
curl -X GET \
'https://example.youtrack.cloud/api/admin/projects?fields=id,name,shortName&query=Sample+Project' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Content-Type: application/json'
```

Sample request with the filter by a project's `shortName`:

```CURL
curl -X GET \
'https://example.youtrack.cloud/api/admin/projects?fields=id,name,shortName&query=sp' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>' \
-H 'Content-Type: application/json'
```

To the sample request with the `query` parameter, the response body contains data only for the matching project:

```JSON
[
    {
        "shortName": "SP",
        "name": "Sample Project",
        "id": "0-0",
        "$type": "Project"
    }
]
```

3. In the response from the server, locate the `id` of the target project.

In this example, the project entity ID is `0-0`.

