{
"openapi": "3.1.0",
"info": {
"title": "Pathbase API",
"description": "",
"license": {
"name": ""
},
"version": "1.0.0"
},
"paths": {
"/api/v1/anon/paths": {
"post": {
"tags": [
"Anon"
],
"operationId": "create_anon_path",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnonUploadBody"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "New anon path created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnonUploadResponse"
}
}
}
},
"400": {
"description": "Invalid document / unsupported variant / empty path"
},
"413": {
"description": "Request body exceeds 5 MB"
},
"429": {
"description": "Rate limit exceeded"
}
}
}
},
"/api/v1/auth/logout": {
"post": {
"tags": [
"Auth"
],
"operationId": "logout",
"responses": {
"204": {
"description": "Logged out"
}
}
}
},
"/api/v1/auth/me": {
"get": {
"tags": [
"Auth"
],
"operationId": "me",
"responses": {
"200": {
"description": "Current authenticated user",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"401": {
"description": "Not authenticated"
}
}
}
},
"/api/v1/health": {
"get": {
"tags": [
"Health"
],
"operationId": "health",
"responses": {
"200": {
"description": "Service is healthy",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HealthResponse"
}
}
}
},
"503": {
"description": "Service is degraded",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HealthResponse"
}
}
}
}
}
}
},
"/api/v1/repos": {
"post": {
"tags": [
"Repos"
],
"operationId": "create_repo",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateRepoBody"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Created repository",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Repo"
}
}
}
},
"401": {
"description": "Not authenticated"
}
}
}
},
"/api/v1/repos/{owner}/{repo}": {
"get": {
"tags": [
"Repos"
],
"operationId": "get_repo",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Repository details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Repo"
}
}
}
},
"404": {
"description": "Not found"
}
}
},
"delete": {
"tags": [
"Repos"
],
"operationId": "delete_repo",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "Deleted"
},
"401": {
"description": "Not authorized"
},
"404": {
"description": "Not found"
}
}
},
"patch": {
"tags": [
"Repos"
],
"operationId": "update_repo",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateRepoBody"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Updated repository",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Repo"
}
}
}
},
"401": {
"description": "Not authorized"
},
"404": {
"description": "Not found"
}
}
}
},
"/api/v1/repos/{owner}/{repo}/graphs": {
"get": {
"tags": [
"Graphs"
],
"operationId": "list_graphs",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of graphs",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Graph"
}
}
}
}
},
"404": {
"description": "Not found"
}
}
},
"post": {
"tags": [
"Graphs"
],
"operationId": "create_graph",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadGraphBody"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Created graph",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Graph"
}
}
}
},
"400": {
"description": "Invalid document"
},
"401": {
"description": "Not authorized"
}
}
}
},
"/api/v1/repos/{owner}/{repo}/graphs/{slug}": {
"get": {
"tags": [
"Graphs"
],
"operationId": "get_graph",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "slug",
"in": "path",
"description": "Graph slug",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Graph details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Graph"
}
}
}
},
"404": {
"description": "Not found"
}
}
},
"delete": {
"tags": [
"Graphs"
],
"operationId": "delete_graph",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "slug",
"in": "path",
"description": "Graph slug",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "Deleted"
},
"401": {
"description": "Not authorized"
},
"404": {
"description": "Not found"
}
}
}
},
"/api/v1/repos/{owner}/{repo}/paths": {
"get": {
"tags": [
"Paths"
],
"operationId": "list_paths",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of paths",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TracePath"
}
}
}
}
},
"404": {
"description": "Not found"
}
}
},
"post": {
"tags": [
"Paths"
],
"operationId": "create_path",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadPathBody"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Created path",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TracePath"
}
}
}
},
"400": {
"description": "Invalid document"
},
"401": {
"description": "Not authorized"
}
}
}
},
"/api/v1/repos/{owner}/{repo}/paths/{slug}": {
"get": {
"tags": [
"Paths"
],
"operationId": "get_path",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "slug",
"in": "path",
"description": "Path slug",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Path details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TracePath"
}
}
}
},
"404": {
"description": "Not found"
}
}
},
"delete": {
"tags": [
"Paths"
],
"operationId": "delete_path",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "slug",
"in": "path",
"description": "Path slug",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "Deleted"
},
"401": {
"description": "Not authorized"
},
"404": {
"description": "Not found"
}
}
},
"patch": {
"tags": [
"Paths"
],
"operationId": "update_path",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "slug",
"in": "path",
"description": "Path slug",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdatePathBody"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Updated path",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TracePath"
}
}
}
},
"401": {
"description": "Not authorized"
},
"404": {
"description": "Not found"
}
}
}
},
"/api/v1/repos/{owner}/{repo}/paths/{slug}/download": {
"get": {
"tags": [
"Paths"
],
"operationId": "download_path",
"parameters": [
{
"name": "owner",
"in": "path",
"description": "Owner username",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "repo",
"in": "path",
"description": "Repository name",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "slug",
"in": "path",
"description": "Path slug",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Toolpath JSON file download",
"content": {
"application/json": {}
}
},
"404": {
"description": "Not found"
}
}
}
},
"/api/v1/settings/profile": {
"get": {
"tags": [
"Settings"
],
"operationId": "get_profile",
"responses": {
"200": {
"description": "Current user profile",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"401": {
"description": "Not authenticated"
}
}
},
"patch": {
"tags": [
"Settings"
],
"operationId": "update_profile",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateProfileBody"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Updated profile",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"401": {
"description": "Not authenticated"
}
}
}
},
"/api/v1/users/{username}": {
"get": {
"tags": [
"Users"
],
"operationId": "get_user",
"parameters": [
{
"name": "username",
"in": "path",
"description": "Username",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "User profile",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"404": {
"description": "User not found"
}
}
}
},
"/api/v1/users/{username}/repos": {
"get": {
"tags": [
"Users"
],
"operationId": "list_repos",
"parameters": [
{
"name": "username",
"in": "path",
"description": "Username",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "User's repositories",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Repo"
}
}
}
}
},
"404": {
"description": "User not found"
}
}
}
}
},
"components": {
"schemas": {
"AnonUploadBody": {
"type": "object",
"required": [
"document"
],
"properties": {
"document": {
"type": "object"
}
}
},
"AnonUploadResponse": {
"type": "object",
"required": [
"url",
"id"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"CreateRepoBody": {
"type": "object",
"required": [
"name"
],
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
}
}
},
"Graph": {
"type": "object",
"required": [
"id",
"repo_id",
"slug",
"toolpath_id",
"document",
"created_at",
"updated_at"
],
"properties": {
"created_at": {
"type": "string",
"format": "date-time"
},
"document": {
"type": "object"
},
"id": {
"type": "string",
"format": "uuid"
},
"repo_id": {
"type": "string",
"format": "uuid"
},
"slug": {
"type": "string"
},
"title": {
"type": [
"string",
"null"
]
},
"toolpath_id": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
},
"HealthResponse": {
"type": "object",
"required": [
"status"
],
"properties": {
"reason": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string"
}
}
},
"Repo": {
"type": "object",
"required": [
"id",
"owner_id",
"name",
"is_public",
"created_at",
"updated_at"
],
"properties": {
"created_at": {
"type": "string",
"format": "date-time"
},
"description": {
"type": [
"string",
"null"
]
},
"id": {
"type": "string",
"format": "uuid"
},
"is_public": {
"type": "boolean"
},
"name": {
"type": "string"
},
"owner_id": {
"type": "string",
"format": "uuid"
},
"readme": {
"type": [
"string",
"null"
]
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
},
"TracePath": {
"type": "object",
"required": [
"id",
"repo_id",
"slug",
"toolpath_id",
"document",
"step_count",
"is_public",
"created_at",
"updated_at"
],
"properties": {
"created_at": {
"type": "string",
"format": "date-time"
},
"document": {
"type": "object"
},
"id": {
"type": "string",
"format": "uuid"
},
"is_public": {
"type": "boolean"
},
"repo_id": {
"type": "string",
"format": "uuid"
},
"slug": {
"type": "string"
},
"step_count": {
"type": "integer",
"format": "int32"
},
"title": {
"type": [
"string",
"null"
]
},
"toolpath_id": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
},
"UpdatePathBody": {
"type": "object",
"properties": {
"is_public": {
"type": [
"boolean",
"null"
]
}
}
},
"UpdateProfileBody": {
"type": "object",
"properties": {
"bio": {
"type": [
"string",
"null"
]
},
"display_name": {
"type": [
"string",
"null"
]
}
}
},
"UpdateRepoBody": {
"type": "object",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"readme": {
"type": [
"string",
"null"
]
}
}
},
"UploadGraphBody": {
"type": "object",
"required": [
"slug",
"document"
],
"properties": {
"document": {
"type": "object"
},
"slug": {
"type": "string"
}
}
},
"UploadPathBody": {
"type": "object",
"required": [
"slug",
"document"
],
"properties": {
"document": {
"type": "object"
},
"is_public": {
"type": "boolean",
"description": "Defaults to true. Set false for secret/unlisted paths (e.g. pathstash)."
},
"slug": {
"type": "string"
}
}
},
"User": {
"type": "object",
"required": [
"id",
"username",
"created_at",
"updated_at"
],
"properties": {
"avatar_url": {
"type": [
"string",
"null"
]
},
"bio": {
"type": [
"string",
"null"
]
},
"created_at": {
"type": "string",
"format": "date-time"
},
"display_name": {
"type": [
"string",
"null"
]
},
"email": {
"type": [
"string",
"null"
]
},
"id": {
"type": "string",
"format": "uuid"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"username": {
"type": "string"
}
}
}
}
},
"tags": [
{
"name": "Health",
"description": "Liveness/readiness"
},
{
"name": "Auth",
"description": "Authentication"
},
{
"name": "Users",
"description": "User profiles"
},
{
"name": "Repos",
"description": "Repositories"
},
{
"name": "Paths",
"description": "Trace paths"
},
{
"name": "Graphs",
"description": "Computation graphs"
},
{
"name": "Settings",
"description": "User settings"
},
{
"name": "Anon",
"description": "Anonymous uploads"
}
]
}