# List Files

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"List Files"}
>
</Heading>

<MethodEndpoint
  method={"get"}
  path={"/api/v1/workspaces/{workspace_name}/files"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Lists files in a workspace. This endpoint supports pagination and filtering by name and metadata.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"Type the name of the workspace.","in":"path","name":"workspace_name","required":true,"schema":{"description":"Type the name of the workspace.","title":"Workspace Name","type":"string"}},{"description":"The name of the file you want to view.","in":"query","name":"name","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The name of the file you want to view.","title":"Name"}},{"description":"The contents of the file you want to view.","in":"query","name":"content","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The contents of the file you want to view.","title":"Content"}},{"deprecated":true,"description":"Type the metadata key by which you want to filter the files.","in":"query","name":"meta_key","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"deprecated":true,"description":"Type the metadata key by which you want to filter the files.","title":"Meta Key"}},{"deprecated":true,"description":"Type the metadata value by which you want to filter the files.","in":"query","name":"meta_value","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"deprecated":true,"description":"Type the metadata value by which you want to filter the files.","title":"Meta Value"}},{"description":"The OData filter you want to use to in your query. It supports exact match and `AND` operations. For example, to filter for a metadata `category:news` and `published_date` greater than or equal to January 1 2025, here's what the URL could look like: 'url = \"https://api.cloud.deepset.ai/api/v1/workspaces/production/files?limit=10&filter=category eq 'news' and published_date ge '2025-01-01' \"'. OData filters only work with cursor-based pagination (leave the `page_number` field blank to enable it).To learn more about the OData filter syntax, see: [Querying Data](https://www.odata.org/getting-started/basic-tutorial/#queryData).","in":"query","name":"filter","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The OData filter you want to use to in your query. It supports exact match and `AND` operations. For example, to filter for a metadata `category:news` and `published_date` greater than or equal to January 1 2025, here's what the URL could look like: 'url = \"https://api.cloud.deepset.ai/api/v1/workspaces/production/files?limit=10&filter=category eq 'news' and published_date ge '2025-01-01' \"'. OData filters only work with cursor-based pagination (leave the `page_number` field blank to enable it).To learn more about the OData filter syntax, see: [Querying Data](https://www.odata.org/getting-started/basic-tutorial/#queryData).","title":"Filter"}},{"description":"The number of entries to display. Leaving this field empty keeps the default, and max 10 results are returned.","in":"query","name":"limit","required":false,"schema":{"default":10,"description":"The number of entries to display. Leaving this field empty keeps the default, and max 10 results are returned.","maximum":100,"title":"Limit","type":"integer"}},{"description":"Enter a value if you want to see all files that are sorted after this value and a file ID defined in the 'after_file_id' parameter. This value must match the type of the field you want to sort by. You can only use this parameter in combination with the 'after_file_id' parameter. If you are using the default sorting by 'created_at', you can set this value to an URL-encoded datetime in the ISO format. For example: Use '2023-04-25T07%3A37%3A58.326042%2B00%3A00' to filter for files created after '2023-04-25T07:37:58.326042+00:00'.","in":"query","name":"after_value","required":false,"schema":{"anyOf":[{},{"type":"null"}],"description":"Enter a value if you want to see all files that are sorted after this value and a file ID defined in the 'after_file_id' parameter. This value must match the type of the field you want to sort by. You can only use this parameter in combination with the 'after_file_id' parameter. If you are using the default sorting by 'created_at', you can set this value to an URL-encoded datetime in the ISO format. For example: Use '2023-04-25T07%3A37%3A58.326042%2B00%3A00' to filter for files created after '2023-04-25T07:37:58.326042+00:00'.","title":"After Value"}},{"description":"Enter a file ID if you want to see all files after this file ID.You can only use this parameter in combination with the 'after_value' parameter.","in":"query","name":"after_file_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"Enter a file ID if you want to see all files after this file ID.You can only use this parameter in combination with the 'after_value' parameter.","title":"After File Id"}},{"description":"The name of the entity you want to sort by.","in":"query","name":"field","required":false,"schema":{"default":"created_at","description":"The name of the entity you want to sort by.","enum":["created_at","name"],"title":"Field","type":"string"}},{"description":"Choose how you want to sort the results.","in":"query","name":"order","required":false,"schema":{"default":"ASC","description":"Choose how you want to sort the results.","enum":["ASC","DESC"],"title":"Order","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={undefined}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"characters":{"description":"The total number of characters in this file.","title":"Number of characters","type":"integer"},"created_at":{"description":"Datetime object, specifies when the file was created.","format":"date-time","title":"File Creation","type":"string"},"file_id":{"description":"Unique identifier of a file.","format":"uuid","title":"File ID","type":"string"},"languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"List of languages in that file.","title":"Languages"},"meta":{"additionalProperties":true,"description":"Metadata of a file.","title":"Metadata of file","type":"object"},"name":{"description":"Name of the file.","title":"File name","type":"string"},"size":{"description":"Size of the file in bytes.","title":"File size","type":"integer"},"url":{"description":"The URL of the file.","title":"File URL","type":"string"}},"required":["file_id","url","name","size","characters","meta","created_at"],"title":"File","type":"object"},"title":"Data","type":"array"},"has_more":{"description":"Indicates if there are more results to show.","title":"Has more results","type":"boolean"},"total":{"description":"The total number of results matching your query.","title":"Total number of results","type":"integer"}},"required":["data","has_more","total"],"title":"PaginatedResult[File]","type":"object"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
