Skip to content

API Reference

Endpoints

Root

GET /

Returns basic API information.

Response:

{
  "name": "Blacklake API",
  "version": "0.1.0",
  "status": "operational"
}

Health Check

GET /health

Health check endpoint for monitoring.

Response:

{
  "status": "healthy"
}

Repositories

Create Repository

POST /repositories

Create a new repository.

Request:

{
  "name": "my-repo",
  "description": "My data repository"
}

Response:

{
  "id": 1,
  "name": "my-repo",
  "description": "My data repository"
}

List Repositories

GET /repositories

List all repositories.

Response:

[
  {
    "id": 1,
    "name": "my-repo",
    "description": "My data repository"
  }
]

Get Repository

GET /repositories/{repo_id}

Get a specific repository by ID.

Response:

{
  "id": 1,
  "name": "my-repo",
  "description": "My data repository"
}

Commits

Create Commit

POST /commits

Create a new commit.

Request:

{
  "message": "Initial commit",
  "author": "John Doe",
  "repository_id": 1,
  "parent_sha": null
}

Response:

{
  "id": 1,
  "sha": "abc123...",
  "message": "Initial commit",
  "author": "John Doe",
  "repository_id": 1,
  "parent_sha": null
}

List Commits

GET /commits?repository_id={repo_id}

List commits, optionally filtered by repository.

Response:

[
  {
    "id": 1,
    "sha": "abc123...",
    "message": "Initial commit",
    "author": "John Doe",
    "repository_id": 1,
    "parent_sha": null
  }
]

Error Responses

All endpoints may return error responses:

{
  "detail": "Error message"
}

Common status codes: - 200: Success - 404: Not found - 422: Validation error - 500: Internal server error