Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 2.29 KB

index.md

File metadata and controls

46 lines (35 loc) · 2.29 KB
title API Reference
section api
sidebar true
description Endpoint reference for the Gitpay Git Worker.

Base URL (local default): http://localhost:3001

All repository endpoints require [authentication]({{ '/api/authentication/' | relative_url }}) and enforce creator ownership.

Prefer the product narrative in [How it works]({{ '/guides/how-it-works/' | relative_url }}) if you are new to the worker.

Endpoints

Method Path Description
GET [/health]({{ '/api/health/' relative_url }})
POST [/repositories/init]({{ '/api/init/' relative_url }})
PUT [/repositories/file]({{ '/api/save-file/' relative_url }})
POST [/repositories/files]({{ '/api/list-files/' relative_url }})
POST [/repositories/read-file]({{ '/api/read-file/' relative_url }})
DELETE [/repositories/file]({{ '/api/delete-file/' relative_url }})
POST [/repositories/versions]({{ '/api/versions/' relative_url }})
POST [/repositories/zip]({{ '/api/zip/' relative_url }})
POST [/repositories/download-file]({{ '/api/download-file/' relative_url }})

Auto-generated docs

FastAPI publishes:

URL Purpose
/docs Swagger UI
/redoc ReDoc
/openapi.json OpenAPI 3 schema

See [OpenAPI]({{ '/api/openapi/' | relative_url }}) for how this docs site relates to the live schema.

Conventions

  • JSON request bodies (Content-Type: application/json)
  • UTF-8 file content as strings on JSON endpoints (read-file, save-file)
  • Mutating responses include commit_sha and version_tag
  • Download endpoints (zip, download-file) return binary bodies with Content-Disposition: attachment and metadata in X-Commit-Sha / X-Version-Tag headers
  • Errors: { "detail": "..." } with HTTP 400 / 401 / 403