{ "swagger": "2.0", "info": {}, "paths": { "/item/{itemID}": { "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Updates a list item", "operationId": "updateListItem", "parameters": [ { "type": "string", "description": "ID of the item to update", "name": "itemID", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/ListItem" } } ], "responses": { "200": { "$ref": "#/responses/ListItem" }, "400": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Deletes a list item", "operationId": "deleteListItem", "parameters": [ { "type": "string", "description": "ID of the list item to delete", "name": "itemID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Message" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" }, "404": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } } }, "/lists": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Gets all lists owned by the current user", "operationId": "getLists", "responses": { "200": { "$ref": "#/responses/List" }, "500": { "$ref": "#/responses/Message" } } } }, "/lists/{listID}": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "gets one list with all todo items", "operationId": "getList", "parameters": [ { "type": "string", "description": "ID of the list to show", "name": "listID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/List" }, "400": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Adds an item to a list", "operationId": "addListItem", "parameters": [ { "type": "string", "description": "ID of the list to use", "name": "listID", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/ListItem" } } ], "responses": { "200": { "$ref": "#/responses/ListItem" }, "400": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Updates a list", "operationId": "upadteList", "parameters": [ { "type": "string", "description": "ID of the list to update", "name": "listID", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/List" } } ], "responses": { "200": { "$ref": "#/responses/List" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Deletes a list with all items on it", "operationId": "deleteList", "parameters": [ { "type": "string", "description": "ID of the list to delete", "name": "listID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Message" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" }, "404": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } } }, "/login": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Logs a user in. Returns a JWT-Token to authenticate requests", "operationId": "login", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/UserLogin" } } ], "responses": { "200": { "$ref": "#/responses/Token" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" } } } }, "/namespaces": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "namespaces" ], "summary": "Get all namespaces the currently logged in user has at least read access", "operationId": "getNamespaces", "responses": { "200": { "$ref": "#/responses/Namespace" }, "500": { "$ref": "#/responses/Message" } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "namespaces" ], "summary": "Creates a new namespace owned by the currently logged in user", "operationId": "addNamespace", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/Namespace" } } ], "responses": { "200": { "$ref": "#/responses/Namespace" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } } }, "/namespaces/{namespaceID}": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "namespaces" ], "summary": "gets one namespace with all todo items", "operationId": "getNamespace", "parameters": [ { "type": "string", "description": "ID of the namespace to show", "name": "namespaceID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Namespace" }, "400": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "namespaces" ], "summary": "Updates a namespace", "operationId": "upadteNamespace", "parameters": [ { "type": "string", "description": "ID of the namespace to update", "name": "namespaceID", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/Namespace" } } ], "responses": { "200": { "$ref": "#/responses/Namespace" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "namespaces" ], "summary": "Deletes a namespace with all lists", "operationId": "deleteNamespace", "parameters": [ { "type": "string", "description": "ID of the namespace to delete", "name": "namespaceID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Message" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" }, "404": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } } }, "/namespaces/{namespaceID}/lists": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "namespaces" ], "summary": "gets all lists belonging to that namespace", "operationId": "getListsByNamespace", "parameters": [ { "type": "string", "description": "ID of the namespace", "name": "namespaceID", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Namespace" }, "400": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "lists" ], "summary": "Creates a new list owned by the currently logged in user in that namespace", "operationId": "addList", "parameters": [ { "type": "string", "description": "ID of the namespace that list should belong to", "name": "namespaceID", "in": "path", "required": true }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/List" } } ], "responses": { "200": { "$ref": "#/responses/List" }, "400": { "$ref": "#/responses/Message" }, "403": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } } }, "/register": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Creates a new user account", "operationId": "register", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/APIUserPassword" } } ], "responses": { "200": { "$ref": "#/responses/User" }, "400": { "$ref": "#/responses/Message" }, "500": { "$ref": "#/responses/Message" } } } } }, "definitions": { "APIUserPassword": { "type": "object", "title": "APIUserPassword represents a user object without timestamps and a json password field.", "properties": { "email": { "type": "string", "x-go-name": "Email" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "password": { "type": "string", "x-go-name": "Password" }, "username": { "type": "string", "x-go-name": "Username" } }, "x-go-package": "code.vikunja.io/api/models" }, "List": { "description": "List represents a list of items", "type": "object", "properties": { "created": { "type": "integer", "format": "int64", "x-go-name": "Created" }, "description": { "type": "string", "x-go-name": "Description" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "items": { "type": "array", "items": { "$ref": "#/definitions/ListItem" }, "x-go-name": "Items" }, "owner": { "$ref": "#/definitions/User" }, "title": { "type": "string", "x-go-name": "Title" }, "updated": { "type": "integer", "format": "int64", "x-go-name": "Updated" } }, "x-go-package": "code.vikunja.io/api/models" }, "ListItem": { "description": "ListItem represents an item in a todolist", "type": "object", "properties": { "created": { "type": "integer", "format": "int64", "x-go-name": "Created" }, "createdBy": { "$ref": "#/definitions/User" }, "description": { "type": "string", "x-go-name": "Description" }, "done": { "type": "boolean", "x-go-name": "Done" }, "dueDate": { "type": "integer", "format": "int64", "x-go-name": "DueDateUnix" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "listID": { "type": "integer", "format": "int64", "x-go-name": "ListID" }, "reminderDate": { "type": "integer", "format": "int64", "x-go-name": "ReminderUnix" }, "text": { "type": "string", "x-go-name": "Text" }, "updated": { "type": "integer", "format": "int64", "x-go-name": "Updated" } }, "x-go-package": "code.vikunja.io/api/models" }, "Message": { "description": "Message is a standard message", "type": "object", "properties": { "message": { "type": "string", "x-go-name": "Message" } }, "x-go-package": "code.vikunja.io/api/models" }, "Namespace": { "description": "Namespace holds informations about a namespace", "type": "object", "properties": { "created": { "type": "integer", "format": "int64", "x-go-name": "Created" }, "description": { "type": "string", "x-go-name": "Description" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "name": { "type": "string", "x-go-name": "Name" }, "owner": { "$ref": "#/definitions/User" }, "updated": { "type": "integer", "format": "int64", "x-go-name": "Updated" } }, "x-go-package": "code.vikunja.io/api/models" }, "User": { "description": "User holds information about an user", "type": "object", "properties": { "email": { "type": "string", "x-go-name": "Email" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "username": { "type": "string", "x-go-name": "Username" } }, "x-go-package": "code.vikunja.io/api/models" }, "UserLogin": { "description": "UserLogin Object to recive user credentials in JSON format", "type": "object", "properties": { "password": { "type": "string", "x-go-name": "Password" }, "username": { "type": "string", "x-go-name": "Username" } }, "x-go-package": "code.vikunja.io/api/models" } }, "responses": { "List": { "description": "List", "schema": { "$ref": "#/definitions/List" } }, "ListItem": { "description": "ListItem", "schema": { "$ref": "#/definitions/ListItem" } }, "Message": { "description": "Message", "schema": { "$ref": "#/definitions/Message" } }, "Namespace": { "description": "Namespace", "schema": { "$ref": "#/definitions/Namespace" } }, "Token": { "description": "Token", "schema": { "type": "object", "required": [ "token" ], "properties": { "token": { "description": "The token", "type": "string", "x-go-name": "Token" } } } }, "User": { "description": "User Object", "schema": { "$ref": "#/definitions/User" } }, "parameterBodies": { "description": "parameterBodies", "schema": { "$ref": "#/definitions/Namespace" } } } }