{ "swagger": "2.0", "info": { "description": "API for CCSync - Web Interface + Sync Server for Taskwarrior 3.0 and Higher\nA self-hosted solution for syncing and managing your tasks anywhere, anytime.", "title": "CCSync API", "contact": { "name": "API Support", "url": "https://github.com/CCExtractor/ccsync" }, "license": { "name": "MIT", "url": "https://github.com/CCExtractor/ccsync/blob/main/LICENSE" }, "version": "1.0" }, "host": "localhost:8000", "basePath": "/", "paths": { "/add-task": { "post": { "description": "Add a new task to Taskwarrior for a specific user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Add a new task", "parameters": [ { "description": "Task details", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.AddTaskRequestBody" } } ], "responses": { "202": { "description": "Task accepted for processing", "schema": { "type": "string" } }, "400": { "description": "Bad request - invalid input or missing required fields", "schema": { "type": "string" } }, "405": { "description": "Method not allowed", "schema": { "type": "string" } } } } }, "/api/user": { "get": { "description": "Retrieve user information from the session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Get user information", "responses": { "200": { "description": "User information including email, id, uuid, and encryption_secret", "schema": { "type": "object", "additionalProperties": true } }, "401": { "description": "No user info available - user not authenticated", "schema": { "type": "string" } } } } }, "/auth/callback": { "get": { "description": "Handles the OAuth callback and creates user session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "OAuth callback handler", "parameters": [ { "type": "string", "description": "OAuth authorization code", "name": "code", "in": "query", "required": true } ], "responses": { "303": { "description": "Redirect to frontend home page", "schema": { "type": "string" } }, "400": { "description": "Bad request", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/auth/logout": { "get": { "description": "Logout user and delete session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Logout user", "responses": { "200": { "description": "Successfully logged out", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/auth/oauth": { "get": { "description": "Redirects user to Google OAuth login page", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Initiate OAuth login", "responses": { "307": { "description": "Redirect to OAuth provider", "schema": { "type": "string" } } } } }, "/complete-task": { "post": { "description": "Mark a task as completed in Taskwarrior", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Complete a task", "parameters": [ { "description": "Task completion details", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.CompleteTaskRequestBody" } } ], "responses": { "202": { "description": "Task completion accepted for processing", "schema": { "type": "string" } }, "400": { "description": "Bad request - invalid input or missing taskuuid", "schema": { "type": "string" } }, "405": { "description": "Method not allowed", "schema": { "type": "string" } } } } }, "/complete-tasks": { "post": { "description": "Mark multiple tasks as completed in Taskwarrior", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Bulk complete tasks", "parameters": [ { "description": "Bulk task completion details", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BulkCompleteTaskRequestBody" } } ], "responses": { "202": { "description": "Bulk task completion accepted for processing", "schema": { "type": "string" } }, "400": { "description": "Invalid request - missing or empty taskuuids", "schema": { "type": "string" } }, "405": { "description": "Method not allowed", "schema": { "type": "string" } } } } }, "/delete-task": { "post": { "description": "Delete a task from Taskwarrior", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Delete a task", "parameters": [ { "description": "Task deletion details", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.DeleteTaskRequestBody" } } ], "responses": { "202": { "description": "Task deletion accepted for processing", "schema": { "type": "string" } }, "400": { "description": "Bad request - invalid input or missing taskuuid", "schema": { "type": "string" } }, "405": { "description": "Method not allowed", "schema": { "type": "string" } } } } }, "/delete-tasks": { "post": { "description": "Delete multiple tasks in Taskwarrior", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Bulk delete tasks", "parameters": [ { "description": "Bulk task deletion details", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.BulkDeleteTaskRequestBody" } } ], "responses": { "202": { "description": "Bulk task deletion accepted for processing", "schema": { "type": "string" } }, "400": { "description": "Invalid request - missing or empty taskuuids", "schema": { "type": "string" } }, "405": { "description": "Method not allowed", "schema": { "type": "string" } } } } }, "/edit-task": { "post": { "description": "Edit task description and tags in Taskwarrior", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Edit a task", "parameters": [ { "description": "Task edit details", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.EditTaskRequestBody" } } ], "responses": { "202": { "description": "Task edit accepted for processing", "schema": { "type": "string" } }, "400": { "description": "Bad request - invalid input or missing taskID", "schema": { "type": "string" } }, "405": { "description": "Method not allowed", "schema": { "type": "string" } } } } }, "/modify-task": { "post": { "description": "Modify task properties including description, project, priority, status, due date, and tags", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Modify a task", "parameters": [ { "description": "Task modification details", "name": "task", "in": "body", "required": true, "schema": { "$ref": "#/definitions/models.ModifyTaskRequestBody" } } ], "responses": { "202": { "description": "Task modification accepted for processing", "schema": { "type": "string" } }, "400": { "description": "Bad request - invalid input or missing required fields", "schema": { "type": "string" } }, "405": { "description": "Method not allowed", "schema": { "type": "string" } } } } }, "/sync/logs": { "get": { "description": "Fetch the latest sync operation logs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Logs" ], "summary": "Get sync logs", "parameters": [ { "type": "integer", "description": "Number of latest log entries to return (default: 100)", "name": "last", "in": "query" } ], "responses": { "200": { "description": "List of log entries", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.LogEntry" } } }, "400": { "description": "Invalid last parameter", "schema": { "type": "string" } } } } }, "/tasks": { "get": { "description": "Fetch all tasks from Taskwarrior for a specific user via Headers", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Tasks" ], "summary": "Get all tasks", "parameters": [ { "type": "string", "description": "User email", "name": "X-User-Email", "in": "header", "required": true }, { "type": "string", "description": "Encryption secret", "name": "X-Encryption-Secret", "in": "header", "required": true }, { "type": "string", "description": "User UUID", "name": "X-User-UUID", "in": "header", "required": true } ], "responses": { "200": { "description": "List of tasks", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Task" } } }, "400": { "description": "Missing required headers", "schema": { "type": "string" } }, "500": { "description": "Failed to fetch tasks at backend", "schema": { "type": "string" } } } } } }, "definitions": { "models.AddTaskRequestBody": { "type": "object", "properties": { "UUID": { "type": "string" }, "annotations": { "type": "array", "items": { "$ref": "#/definitions/models.Annotation" } }, "depends": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" }, "due": { "type": "string" }, "email": { "type": "string" }, "encryptionSecret": { "type": "string" }, "end": { "type": "string" }, "entry": { "type": "string" }, "priority": { "type": "string" }, "project": { "type": "string" }, "recur": { "type": "string" }, "start": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "wait": { "type": "string" } } }, "models.Annotation": { "type": "object", "properties": { "description": { "type": "string" }, "entry": { "type": "string" } } }, "models.BulkCompleteTaskRequestBody": { "type": "object", "properties": { "UUID": { "type": "string" }, "email": { "type": "string" }, "encryptionSecret": { "type": "string" }, "taskuuids": { "type": "array", "items": { "type": "string" } } } }, "models.BulkDeleteTaskRequestBody": { "type": "object", "properties": { "UUID": { "type": "string" }, "email": { "type": "string" }, "encryptionSecret": { "type": "string" }, "taskuuids": { "type": "array", "items": { "type": "string" } } } }, "models.CompleteTaskRequestBody": { "type": "object", "properties": { "UUID": { "type": "string" }, "email": { "type": "string" }, "encryptionSecret": { "type": "string" }, "taskuuid": { "type": "string" } } }, "models.DeleteTaskRequestBody": { "type": "object", "properties": { "UUID": { "type": "string" }, "email": { "type": "string" }, "encryptionSecret": { "type": "string" }, "taskuuid": { "type": "string" } } }, "models.EditTaskRequestBody": { "type": "object", "properties": { "UUID": { "type": "string" }, "annotations": { "type": "array", "items": { "$ref": "#/definitions/models.Annotation" } }, "depends": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" }, "due": { "type": "string" }, "email": { "type": "string" }, "encryptionSecret": { "type": "string" }, "end": { "type": "string" }, "entry": { "type": "string" }, "project": { "type": "string" }, "recur": { "type": "string" }, "start": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "taskuuid": { "type": "string" }, "wait": { "type": "string" } } }, "models.LogEntry": { "type": "object", "properties": { "level": { "description": "INFO, WARN, ERROR", "type": "string" }, "message": { "type": "string" }, "operation": { "type": "string" }, "syncId": { "type": "string" }, "timestamp": { "type": "string" } } }, "models.ModifyTaskRequestBody": { "type": "object", "properties": { "UUID": { "type": "string" }, "depends": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" }, "due": { "type": "string" }, "email": { "type": "string" }, "encryptionSecret": { "type": "string" }, "priority": { "type": "string" }, "project": { "type": "string" }, "status": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "taskuuid": { "type": "string" } } }, "models.Task": { "type": "object", "properties": { "annotations": { "type": "array", "items": { "$ref": "#/definitions/models.Annotation" } }, "depends": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" }, "due": { "type": "string" }, "end": { "type": "string" }, "entry": { "type": "string" }, "id": { "type": "integer" }, "modified": { "type": "string" }, "priority": { "type": "string" }, "project": { "type": "string" }, "recur": { "type": "string" }, "rtype": { "type": "string" }, "start": { "type": "string" }, "status": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "urgency": { "type": "number" }, "uuid": { "type": "string" }, "wait": { "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } }, "tags": [ { "description": "Task management operations", "name": "Tasks" }, { "description": "Authentication and authorization endpoints", "name": "Auth" } ] }