# List resource files

`GET https://api.lingohub.com/v1/{workspaceUrl}/projects/{projectUrl}/resources`

LingoHub API V1 · [Resources](https://developers.lingohub.com/reference/v1/operations/tags/resources.md) · operation `v1ResourceGetResourceInfoList`

Returns the list of resource files belonging to the specified project. Each entry includes the file name, its associated locale, and a HATEOAS link for downloading the resource file. Use the localeInFileName parameter to control whether locale information is rendered in file names.

## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `workspaceUrl` | path | yes | string | workspaceUrl |
| `projectUrl` | path | yes | string | projectUrl |
| `localeInFileName` | query | no | LocaleInFileName | determines if the locale info should be rendered in the file name: ALL(default), TARGETS, NONE |
| `addIso2Slug` | query | no | boolean | if true the iso2_slug parameter will be always added to the rendered resource file URLs |
| `branch` | query | no | string | Name of the project branch. If omitted, the project's default branch is used. Returns 422 if the branch name does not exist in the project. |

## Example request

```sh
curl --request GET \
  --url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Responses

- `200`: Successfully returns the list of the project's resource files.
- `401`: Unauthorized: Authentication credentials are missing or invalid.
- `403`: Forbidden: The authenticated user does not have resource view permission on this project.
- `404`: Not Found: The specified workspace or project does not exist.
- `422`: Unprocessable Entity: The specified branch name does not exist in the project.

## OpenAPI definition

The complete definition of this operation, with every schema it references:

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "LingoHub API V1",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.lingohub.com",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "Resources",
      "description": "Endpoints for the operations that can be performed on the resource files"
    }
  ],
  "paths": {
    "/v1/{workspaceUrl}/projects/{projectUrl}/resources": {
      "get": {
        "tags": [
          "Resources"
        ],
        "summary": "List resource files",
        "description": "Returns the list of resource files belonging to the specified project. Each entry includes the file name, its associated locale, and a HATEOAS link for downloading the resource file. Use the localeInFileName parameter to control whether locale information is rendered in file names.",
        "operationId": "v1ResourceGetResourceInfoList",
        "parameters": [
          {
            "name": "workspaceUrl",
            "in": "path",
            "description": "workspaceUrl",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectUrl",
            "in": "path",
            "description": "projectUrl",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "localeInFileName",
            "in": "query",
            "description": "determines if the locale info should be rendered in the file name: ALL(default), TARGETS, NONE",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/LocaleInFileName"
            }
          },
          {
            "name": "addIso2Slug",
            "in": "query",
            "description": "if true the iso2_slug parameter will be always added to the rendered resource file URLs",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "branch",
            "in": "query",
            "description": "Name of the project branch. If omitted, the project's default branch is used. Returns 422 if the branch name does not exist in the project.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returns the list of the project's resource files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceInfoList"
                },
                "examples": {
                  "resourceFileList": {
                    "summary": "Project with English and French JSON files",
                    "description": "resourceFileList",
                    "value": {
                      "members": [
                        {
                          "name": "src/app/translations/lang/en.json",
                          "links": [
                            {
                              "rel": "self",
                              "href": "https://api.lingohub.com/v1/lingohub/projects/lh-frontend/resources/en.json?path=src%2Fapp%2Ftranslations%2Flang",
                              "type": "text/json"
                            }
                          ],
                          "project_locale": "en"
                        },
                        {
                          "name": "src/app/translations/lang/fr.json",
                          "links": [
                            {
                              "rel": "self",
                              "href": "https://api.lingohub.com/v1/lingohub/projects/lh-frontend/resources/fr.json?path=src%2Fapp%2Ftranslations%2Flang",
                              "type": "text/json"
                            }
                          ],
                          "project_locale": "fr"
                        }
                      ],
                      "links": [
                        {
                          "rel": "self",
                          "href": "https://api.lingohub.com/v1/lingohub/projects/lh-frontend/resources?localeInFileName=ALL"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: The authenticated user does not have resource view permission on this project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "404": {
            "description": "Not Found: The specified workspace or project does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity: The specified branch name does not exist in the project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "LocaleInFileName": {
        "type": "string",
        "enum": [
          "ALL",
          "TARGETS",
          "NONE"
        ]
      },
      "ResourceInfoList": {
        "type": "object",
        "description": "A list of resource files belonging to a project, with HATEOAS navigation links.",
        "properties": {
          "members": {
            "type": "array",
            "description": "The list of resource files in the project.",
            "items": {
              "$ref": "#/components/schemas/ResourceInfo"
            }
          },
          "links": {
            "type": "array",
            "description": "HATEOAS links for navigating the resource list (e.g. self).",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          }
        }
      },
      "ResourceInfo": {
        "type": "object",
        "description": "Information about a single resource file within a project, including its locale and HATEOAS links.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the resource file including its extension.",
            "example": "messages_en.properties"
          },
          "links": {
            "type": "array",
            "description": "HATEOAS links for the resource (e.g. self, download).",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          },
          "project_locale": {
            "type": "string",
            "description": "The locale (language code) of the resource file.",
            "example": "en"
          }
        }
      },
      "Link": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string"
          },
          "hreflang": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "deprecation": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "templated": {
            "type": "boolean"
          }
        }
      },
      "V1ErrorInfo": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "API key authentication. Create API keys in your LingoHub workspace settings. Keys use the `lh-api_` prefix. Pass the full key as the Bearer token.",
        "scheme": "bearer"
      }
    }
  }
}
````
