# Get Project and Organization Data

Use the YouTrack REST API to retrieve project and organization data.

## Summary

To get project data, send a `GET` request to [/api/admin/projects](resource-api-admin-projects.html). To get organization data, send a `GET` request to [/api/admin/organizations](resource-api-admin-organizations.html).

Use the `fields` request parameter to specify which attributes to return. For organizations, request `projects(id,name,shortName)` when you need to see which projects belong to each organization.

## Step-by-Step

Procedure: To retrieve project and organization data

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

2. Get data for a specific project using its database entity ID.

```CURL
curl -X GET \
'https://example.youtrack.cloud/api/admin/projects/0-6?fields=id,name,timeTrackingEnabled,shortName,leader(login,name,id),description,createdBy(login,name,id)' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YouTrack_token>'
```

In response, the server returns data for the requested project:

```JSON
{
  "description": "A project created using REST API",
  "leader": {
    "login": "root",
    "name": "John Smith",
    "id": "1-1",
    "$type": "User"
  },
  "shortName": "RP",
  "createdBy": {
    "login": "john.doe",
    "name": "John Doe",
    "id": "1-2",
    "$type": "User"
  },
  "name": "Rest Project",
  "id": "0-6",
  "$type": "Project"
}
```

3. Get a list of organizations and the projects that belong to them.

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

In response, the server returns organization data with the nested project data requested in `projects(id,name,shortName)`:

```JSON
[
  {
    "id": "120-1",
    "key": "92da6595-c398-481d-9071-c821ff49772b",
    "name": "JetBrains",
    "projects": [
      {
        "id": "0-0",
        "name": "Sample Project",
        "shortName": "SP",
        "$type": "Project"
      }
    ],
    "$type": "Organization"
  },
  {
    "id": "120-2",
    "key": "V2x9UNmH_L-5PHQ71qd0S",
    "name": "Acme Corp",
    "projects": [],
    "$type": "Organization"
  }
]
```

4. Optional. Get data for a specific organization.

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

In response, the server returns data for the requested organization:

```JSON
{
  "id": "120-1",
  "key": "92da6595-c398-481d-9071-c821ff49772b",
  "name": "JetBrains",
  "projects": [
    {
      "id": "0-0",
      "name": "Sample Project",
      "shortName": "SP",
      "$type": "Project"
    }
  ],
  "$type": "Organization"
}
```

> **Tip:**
> For the full list of project and organization attributes, see the [Projects](resource-api-admin-projects.html) and [Organizations](resource-api-admin-organizations.html) resource references.

