---
agentTools:
  projectIndex: https://docs.cancergenomicscloud.org/llms.txt
---

# List files (secondary method)

projects/{project_owner}/{project_name}/files

This call lists the files in the specified project. It is an alias for the call [GET /files](http://docs.cancergenomicscloud.org/v1.0/docs/list-files-in-a-project) and redirects to that path.

[block:callout]
{
  "type": "danger",
  "title": "Alias call",
  "body": "Note that since this is an alias for another call, the call cannot be made straightforwardly from all applications. In particular, to send the call using cURL, use the [cURL option `-L`](http://curl.haxx.se/docs/manpage.html#-L) to redirect the path of this call to `https://cgc-api.sbgenomics.com/v2/files?{project_owner}/{project}. \n\nAlternatively, to list all files, you can simply use the call [GET /files](http://docs.cancergenomicscloud.org/v1.0/docs/list-files-in-a-project)."
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "https://cgc-api.sbgenomics.com/v2/projects/{project_owner}/{project}/files",
      "language": "text",
      "name": "Path"
    }
  ]
}
[/block]

\##Request

\###Example request

[block:callout]
{
  "type": "success",
  "title": "Referring to your project",
  "body": "Note that `project_owner` is always case-sensitive, and that `project` is not the project's name but its ID, or short name. For full details of identifying objects using the API, please see the [API overview](http://docs.cancergenomicscloud.org/v1.0/docs/the-cgc-api#section-identifying-projects-users-apps-files-and-tasks)."
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "GET /v2/projects/rfranklin/my-project/files HTTP/1.1\nHost: cgc-api.sbgenomics.com\nX-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74",
      "language": "http",
      "name": null
    },
    {
      "code": " curl -L \"https://cgc-api.sbgenomics.com/v2/files?RFranklin/my-project\"  -s -H \"X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74\" -H \"content-type: application/json\" -X GET \"https://cgc-api.sbgenomics.com/v2/projects/RFranklin/my-project/files\"",
      "language": "curl",
      "name": "cURL"
    }
  ],
  "sidebar": true
}
[/block]

\###Header Fields

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Description",
    "0-0": "`X-SBG-Auth-Token`\n_required_",
    "0-1": "Your CGC [authentication token](https://docs.cancergenomicscloud.org/docs/get-your-authentication-token).",
    "h-2": ""
  },
  "cols": 2,
  "rows": 1
}
[/block]

\###Path parameters

[block:parameters]
{
  "data": {
    "0-0": "`project`",
    "1-0": "`project_owner`",
    "h-0": "Name",
    "h-1": "Description",
    "0-1": "The short name of the project you are querying.",
    "1-1": "The owner of the project you are querying."
  },
  "cols": 2,
  "rows": 2
}
[/block]

\###Query parameters

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Data type",
    "h-2": "Description",
    "0-0": "`fields`",
    "0-1": "string",
    "0-2": "Selector specifying a subset of fields to include in the response."
  },
  "cols": 3,
  "rows": 1
}
[/block]

\##Response

[See a list of CGC-specific response codes that may be contained in the body of the response.](https://docs.cancergenomicscloud.org/docs/api-status-codes)

\###Example response body

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"href\": \"https://cgc-api.sbgenomics.com/v2/files/?offset=0&limit=25&project=RFranklin/my-project\",\n  \"items\": [\n    {\n      \"href\": \"https://cgc-api.sbgenomics.com/v2/files/568cf5dce3b0307bc0462060\",\n      \"id\": \"568cf5dce3b0307bc0462060\",\n      \"name\": \"my_reference.vcf\",\n      \"project\": \"RFranklin/my-project\"\n    },\n    {\n      \"href\": \"https://cgc-api.sbgenomics.com/v2/files/566aad1de4b0c560b469ea90\",\n      \"id\": \"566aad1de4b0c560b469ea90\",\n      \"name\": \"_1_unsorted.bam\",\n      \"project\": \"RFranklin/my-project\"\n    },\n    {\n      \"href\": \"https://cgc-api.sbgenomics.com/v2/files/568cf5f4e4b0307b30462062\",\n      \"id\": \"568cf5f4e4b0307b30462062\",\n      \"name\": \"unsorted.bam\",\n      \"project\": \"RFranklin/my-project\"\n    }\n  ],\n  \"links\": []\n}",
      "language": "json"
    }
  ],
  "sidebar": true
}
[/block]