> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oxen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create repository

> Create a new repository, optionally with initial files via JSON or multipart form.



## OpenAPI

````yaml https://dev.hub.oxen.ai/api/_spec/oxen_server_openapi.json post /api/repos
openapi: 3.1.0
info:
  description: >-
    Oxen is a fast, unstructured data version control, to help version large
    machine learning datasets written in Rust.
  license:
    name: ''
  title: oxen-server
  version: 0.50.0
servers:
  - description: Production API
    url: https://hub.oxen.ai
  - description: Local Development
    url: http://localhost:3000
security:
  - api_key: []
tags:
  - description: Namespace management endpoints
    name: Namespaces
  - description: Repository management endpoints.
    name: Repositories
paths:
  /api/repos:
    post:
      tags:
        - Repositories
      summary: Create repository
      description: >-
        Create a new repository, optionally with initial files via JSON or
        multipart form.
      operationId: create
      requestBody:
        content:
          application/json:
            example:
              description: A repository for image classification
              name: Cat-Dog-Classifier
              namespace: ox
              user:
                email: bessie@oxen.ai
                name: bessie
            schema:
              $ref: '#/components/schemas/RepoNew'
        description: Repository creation payload (JSON or Multipart)
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryCreationResponse'
          description: Repository created
        '400':
          description: Invalid payload
        '409':
          description: Repository already exists
components:
  schemas:
    RepoNew:
      properties:
        description:
          type:
            - string
            - 'null'
        files:
          items:
            $ref: '#/components/schemas/FileNew'
          type:
            - array
            - 'null'
        host:
          type:
            - string
            - 'null'
        is_public:
          type:
            - boolean
            - 'null'
        name:
          type: string
        namespace:
          type: string
        root_commit:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Commit'
        scheme:
          type:
            - string
            - 'null'
        storage_opts:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/StorageOpts'
      required:
        - namespace
        - name
      type: object
    RepositoryCreationResponse:
      example:
        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
      properties:
        metadata_entries:
          items:
            $ref: '#/components/schemas/MetadataEntry'
          type:
            - array
            - 'null'
        repository:
          $ref: '#/components/schemas/RepositoryCreationView'
        status:
          type: string
        status_message:
          type: string
      required:
        - status
        - status_message
        - repository
      type: object
    FileNew:
      properties:
        contents:
          $ref: '#/components/schemas/FileContents'
        path:
          type: string
        user:
          $ref: '#/components/schemas/User'
      required:
        - path
        - contents
        - user
      type: object
    Commit:
      example:
        author: ox
        email: ox@example.com
        id: a1b2c3d4e5f67890abcdef1234567890
        message: Refactor data loading pipeline.
        parent_ids:
          - f1e2d3c4b5a67890fedcba9876543210
        timestamp: '2025-01-01T10:00:00Z'
      properties:
        author:
          type: string
        email:
          type: string
        id:
          type: string
        message:
          type: string
        parent_ids:
          items:
            type: string
          type: array
        timestamp:
          format: date-time
          type: string
      required:
        - id
        - parent_ids
        - message
        - author
        - email
        - timestamp
      type: object
    StorageOpts:
      properties:
        kind:
          type: string
        local_storage_opts:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/LocalStorageOpts'
        s3_opts:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/S3Opts'
      required:
        - kind
      type: object
    MetadataEntry:
      properties:
        children:
          items:
            $ref: '#/components/schemas/MetadataEntry'
          type:
            - array
            - 'null'
        data_type:
          $ref: '#/components/schemas/EntryDataType'
        extension:
          type: string
        filename:
          type: string
        hash:
          type: string
        is_dir:
          type: boolean
        is_queryable:
          type:
            - boolean
            - 'null'
        latest_commit:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Commit'
        metadata:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/GenericMetadata'
        mime_type:
          type: string
        resource:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ParsedResource'
        size:
          format: int64
          minimum: 0
          type: integer
      required:
        - filename
        - hash
        - is_dir
        - size
        - data_type
        - mime_type
        - extension
      type: object
    RepositoryCreationView:
      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
      properties:
        latest_commit:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Commit'
        min_version:
          type:
            - string
            - 'null'
        name:
          type: string
        namespace:
          type: string
      required:
        - namespace
        - name
      type: object
    FileContents:
      oneOf:
        - properties:
            Text:
              type: string
          required:
            - Text
          type: object
        - properties:
            Binary:
              items:
                format: int32
                minimum: 0
                type: integer
              type: array
          required:
            - Binary
          type: object
    User:
      properties:
        email:
          type: string
        name:
          type: string
      required:
        - email
        - name
      type: object
    LocalStorageOpts:
      properties:
        path:
          type:
            - string
            - 'null'
      type: object
    S3Opts:
      properties:
        bucket:
          type: string
        prefix:
          type:
            - string
            - 'null'
      required:
        - bucket
      type: object
    EntryDataType:
      enum:
        - dir
        - text
        - image
        - video
        - audio
        - tabular
        - binary
      type: string
    GenericMetadata:
      oneOf:
        - $ref: '#/components/schemas/MetadataDir'
        - $ref: '#/components/schemas/MetadataText'
        - $ref: '#/components/schemas/MetadataImage'
        - $ref: '#/components/schemas/MetadataVideo'
        - $ref: '#/components/schemas/MetadataAudio'
        - $ref: '#/components/schemas/MetadataTabular'
    ParsedResource:
      description: Internal model
      properties:
        branch:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Branch'
        commit:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Commit'
        path:
          type: string
        resource:
          type: string
        version:
          type: string
        workspace:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Workspace'
      required:
        - path
        - version
        - resource
      type: object
    MetadataDir:
      properties:
        dir:
          $ref: '#/components/schemas/MetadataDirImpl'
      required:
        - dir
      type: object
    MetadataText:
      properties:
        text:
          $ref: '#/components/schemas/MetadataTextImpl'
      required:
        - text
      type: object
    MetadataImage:
      properties:
        image:
          $ref: '#/components/schemas/MetadataImageImpl'
      required:
        - image
      type: object
    MetadataVideo:
      properties:
        video:
          $ref: '#/components/schemas/MetadataVideoImpl'
      required:
        - video
      type: object
    MetadataAudio:
      properties:
        audio:
          $ref: '#/components/schemas/MetadataAudioImpl'
      required:
        - audio
      type: object
    MetadataTabular:
      properties:
        tabular:
          $ref: '#/components/schemas/MetadataTabularImpl'
      required:
        - tabular
      type: object
    Branch:
      properties:
        commit_id:
          type: string
        name:
          type: string
      required:
        - name
        - commit_id
      type: object
    Workspace:
      properties:
        base_repo:
          $ref: '#/components/schemas/LocalRepository'
        commit:
          $ref: '#/components/schemas/Commit'
        id:
          type: string
        is_editable:
          type: boolean
        name:
          type:
            - string
            - 'null'
        workspace_repo:
          $ref: '#/components/schemas/LocalRepository'
      required:
        - id
        - base_repo
        - workspace_repo
        - is_editable
        - commit
      type: object
    MetadataDirImpl:
      properties:
        data_types:
          items:
            $ref: '#/components/schemas/DataTypeCount'
          type: array
      required:
        - data_types
      type: object
    MetadataTextImpl:
      properties:
        num_chars:
          minimum: 0
          type: integer
        num_lines:
          minimum: 0
          type: integer
      required:
        - num_lines
        - num_chars
      type: object
    MetadataImageImpl:
      properties:
        color_space:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ImgColorSpace'
        height:
          format: int32
          minimum: 0
          type: integer
        width:
          format: int32
          minimum: 0
          type: integer
      required:
        - width
        - height
      type: object
    MetadataVideoImpl:
      properties:
        height:
          minimum: 0
          type: integer
        num_seconds:
          format: double
          type: number
        width:
          minimum: 0
          type: integer
      required:
        - num_seconds
        - width
        - height
      type: object
    MetadataAudioImpl:
      properties:
        num_channels:
          minimum: 0
          type: integer
        num_seconds:
          format: double
          type: number
        sample_rate:
          minimum: 0
          type: integer
      required:
        - num_seconds
        - num_channels
        - sample_rate
      type: object
    MetadataTabularImpl:
      properties:
        height:
          minimum: 0
          type: integer
        schema:
          $ref: '#/components/schemas/Schema'
        width:
          minimum: 0
          type: integer
      required:
        - width
        - height
        - schema
      type: object
    LocalRepository:
      properties:
        depth:
          format: int32
          type:
            - integer
            - 'null'
        min_version:
          type:
            - string
            - 'null'
        path:
          type: string
        remote_mode:
          type:
            - boolean
            - 'null'
        remote_name:
          type:
            - string
            - 'null'
        remotes:
          items:
            $ref: '#/components/schemas/Remote'
          type: array
        subtree_paths:
          items:
            type: string
          type:
            - array
            - 'null'
        vfs:
          type:
            - boolean
            - 'null'
        vnode_size:
          format: int64
          minimum: 0
          type:
            - integer
            - 'null'
        workspace_name:
          type:
            - string
            - 'null'
        workspaces:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - path
        - remotes
      type: object
    DataTypeCount:
      properties:
        count:
          minimum: 0
          type: integer
        data_type:
          type: string
      required:
        - count
        - data_type
      type: object
    ImgColorSpace:
      enum:
        - RGB
        - RGBA
        - Grayscale
        - GrayscaleAlpha
        - Rgb16
        - Rgba16
        - Grayscale16
        - GrayscaleAlpha16
        - Rgb32F
        - Rgba32F
        - Unknown
      type: string
    Schema:
      properties:
        fields:
          items:
            $ref: '#/components/schemas/Field'
          type: array
        hash:
          type: string
        metadata: {}
      required:
        - hash
        - fields
      type: object
    Remote:
      properties:
        name:
          type: string
        url:
          type: string
      required:
        - name
        - url
      type: object
    Field:
      properties:
        changes:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Changes'
        dtype:
          type: string
        metadata: {}
        name:
          type: string
      required:
        - name
        - dtype
      type: object
    Changes:
      properties:
        previous:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PreviousField'
        status:
          type: string
      required:
        - status
      type: object
    PreviousField:
      properties:
        dtype:
          type: string
        metadata: {}
        name:
          type: string
      required:
        - name
        - dtype
      type: object
  securitySchemes:
    api_key:
      bearerFormat: JWT
      scheme: bearer
      type: http

````