Skip to main content
POST
/
api
/
repos
Create repository
curl --request POST \
  --url https://hub.oxen.ai/api/repos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "description": "A repository for image classification",
  "name": "Cat-Dog-Classifier",
  "namespace": "ox",
  "user": {
    "email": "bessie@oxen.ai",
    "name": "bessie"
  }
}
'
{
  "metadata_entries": [
    {
      "content_hash": "a1b2c3d4e5f678902e41",
      "data_type": "image",
      "file_size": 1024000,
      "path": "data/images/cow.jpg"
    }
  ],
  "repository": {
    "latest_commit": {
      "author": "ox",
      "email": "ox@example.com",
      "id": "a1b2c3d4e5f678902e41",
      "message": "Initial dataset import.",
      "parent_ids": [
        "f1e2d3c4b5a67890fedc"
      ],
      "timestamp": "2025-01-01T10:00:00Z"
    },
    "name": "ImageNet-1k",
    "namespace": "ox"
  },
  "status": "success",
  "status_message": "resource_created"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Repository creation payload (JSON or Multipart)

Only used between client and server for creating a new remote repository.

name
string
required

The name of the repository. When cloned locally, this is the name of the directory. This name uniquely identifies it in the namespace.

namespace
string
required

The namespace that the repository lives in: dictates application-level repository ownership. A namespace can be e.g. a user, a team, or an entire organization. Namespaces must be unique.

description
string | null
files
object[] | null
host
string | null
is_public
boolean | null
root_commit
object
Example:
{
"author": "ox",
"email": "ox@example.com",
"id": "a1b2c3d4e5f67890abcdef1234567890",
"message": "Refactor data loading pipeline.",
"parent_ids": ["f1e2d3c4b5a67890fedcba9876543210"],
"timestamp": "2025-01-01T10:00:00Z"
}
scheme
string | null
storage_kind
null | enum<string>

Which storage backend the server should use for this repo (e.g. "local", "s3").

Available options:
local,
s3

Response

Repository created

repository
object
required
Example:
{
"latest_commit": {
"author": "ox",
"email": "ox@example.com",
"id": "a1b2c3d4e5f67890abcdef1234567890",
"message": "Initial dataset import.",
"parent_ids": ["f1e2d3c4b5a67890fedcba9876543210"],
"timestamp": "2025-01-01T10:00:00Z"
},
"name": "ImageNet-1k",
"namespace": "ox"
}
status
string
required
status_message
string
required
metadata_entries
object[] | null