Files
List Files and Directories
HTTP API
- Endpoints
- Namespaces
- Repository
- Branches
- Commits
- Files
- Data Frames
- Workspaces
- Evaluations
namespaces
repos
branches
workspaces
fork
API Reference
Files
List Files and Directories
List directory for resource
GET
/
api
/
repos
/
{namespace}
/
{repo_name}
/
dir
/
{resource}
curl --request GET \
--url https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/dir/{resource} \
--header 'Authorization: Bearer <token>'
{
"entries": [
{
"datatype": "dir",
"filename": "annotations",
"is_dir": true,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 526141
},
{
"datatype": "dir",
"filename": "images",
"is_dir": true,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 99653096
},
{
"datatype": "text",
"filename": "LICENSE",
"is_dir": false,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 20
},
{
"datatype": "markdown",
"filename": "README.md",
"is_dir": false,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 107
}
],
"page_number": 1,
"page_size": 10,
"resource": {
"path": "./",
"version": "main"
},
"status": "success",
"status_message": "resource_found",
"total_entries": 4,
"total_pages": 0
}
List files and directories in a repository at a given revision and path.
The resource
is the combination of the revision and the path to the directory to list. For example, main/images
would list the files and directories in the images
directory at the main
branch.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
(Required)
(Required) A combination of branch or commit ID plus a path.
Response
200 - application/json
OK
curl --request GET \
--url https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/dir/{resource} \
--header 'Authorization: Bearer <token>'
{
"entries": [
{
"datatype": "dir",
"filename": "annotations",
"is_dir": true,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 526141
},
{
"datatype": "dir",
"filename": "images",
"is_dir": true,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 99653096
},
{
"datatype": "text",
"filename": "LICENSE",
"is_dir": false,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 20
},
{
"datatype": "markdown",
"filename": "README.md",
"is_dir": false,
"latest_commit": {
"author": "Ox",
"email": "ox@oxen.ai",
"id": "952abd860ffa5635",
"message": "adding add data",
"parent_ids": [
"3c850d9296789f89"
],
"timestamp": "2023-01-06T23:12:59.160132Z"
},
"size": 107
}
],
"page_number": 1,
"page_size": 10,
"resource": {
"path": "./",
"version": "main"
},
"status": "success",
"status_message": "resource_found",
"total_entries": 4,
"total_pages": 0
}