Documentația API TaskLeef

API REST pentru gestionarea sarcinilor, proiectelor și panourilor Kanban

Ultima actualizare:

Autentificare

API-ul acceptă două metode de autentificare:

1. Autentificare cu cheie API (recomandat)

Generate an API key from your Settings page and include it in the X-API-Key header:

curl -H "X-API-Key: your-api-key" \
  https://taskleef.com/api/todos

2. Token Bearer JWT

Pentru aplicații bazate pe browser, autentifică-te prin endpointul de login:

curl -X POST https://taskleef.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "your-username", "password": "your-password"}'

Apoi include tokenul în cererile ulterioare:

curl -H "Authorization: Bearer your-jwt-token" \
  https://taskleef.com/api/todos

Sarcini

GET/api/todos

Obține toate sarcinile pentru utilizatorul autentificat.

curl -H "X-API-Key: your-api-key" \
  https://taskleef.com/api/todos
GET/api/todos/{id}

Obține o anumită sarcină după ID.

GET/api/inbox

Obține sarcinile care nu sunt atribuite niciunui proiect.

POST/api/todos

Creează o sarcină nouă.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Buy groceries", "description": "Milk, eggs, bread"}' \
  https://taskleef.com/api/todos

Corpul cererii

CâmpTipObligatoriuDescriere
titlestringYesTodo title
descriptionstringNoDetailed description
dueDateISO 8601NoDue date/time
prioritystringNoLow, Medium, High, or Urgent
projectIdUUIDNoAssign to a project
PUT/api/todos/{id}

Actualizează o sarcină existentă.

PATCH/api/todos/{id}/complete

Comută starea de finalizare a sarcinii.

curl -X PATCH -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"isCompleted": true}' \
  https://taskleef.com/api/todos/{id}/complete
DELETE/api/todos/{id}

Șterge o sarcină.

POST/api/todos/{parentId}/subtasks

Creează o subsarcină sub o sarcină părinte.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Subtask title"}' \
  https://taskleef.com/api/todos/{parentId}/subtasks

Proiecte

GET/api/projects

Listează toate proiectele pentru utilizatorul autentificat.

POST/api/projects

Creează un proiect nou.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Work Tasks", "description": "Tasks for work"}' \
  https://taskleef.com/api/projects
GET/api/projects/{id}

Obține un anumit proiect cu sarcinile sale.

PUT/api/projects/{id}

Actualizează un proiect.

DELETE/api/projects/{id}

Șterge un proiect (sarcinile sunt mutate în inbox).

Panouri Kanban

GET/api/boards

Listează toate panourile la care utilizatorul are acces.

POST/api/boards

Creează un panou nou.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Sprint Board", "projectId": "project-uuid"}' \
  https://taskleef.com/api/boards
GET/api/boards/{id}

Obține un anumit panou.

GET/api/boards/{boardId}/columns

Obține toate coloanele unui panou.

GET/api/boards/{boardId}/todos

Obține toate sarcinile care au carduri pe acest panou.

Coloane

POST/api/boards/{boardId}/columns

Creează o coloană nouă pe un panou.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "In Progress", "wipLimit": 3}' \
  https://taskleef.com/api/boards/{boardId}/columns
PUT/api/columns/{id}

Actualizează o coloană (titlu, limită WIP, criterii de finalizare).

GET/api/columns/{columnId}/cards

Obține toate cardurile dintr-o coloană.

DELETE/api/columns/{id}

Șterge o coloană.

Carduri

Cardurile reprezintă sarcini pe un panou Kanban. O sarcină poate avea carduri pe mai multe panouri.

POST/api/columns/{columnId}/cards

Creează un card pentru o sarcină într-o coloană.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"todoId": "todo-uuid"}' \
  https://taskleef.com/api/columns/{columnId}/cards
PUT/api/cards/{id}

Actualizează un card (mută în altă coloană sau subcoloană).

# Move card to a different column
curl -X PUT -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"columnId": "new-column-uuid", "subColumn": "Inbox"}' \
  https://taskleef.com/api/cards/{id}

# Move card to Done subColumn
curl -X PUT -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"subColumn": "Done"}' \
  https://taskleef.com/api/cards/{id}

Valori pentru subcoloană

  • Inbox - Active items in the column
  • Done - Completed items within the column
  • Blocked - Items waiting on external dependencies
DELETE/api/cards/{id}

Elimină un card de pe panou (nu șterge sarcina).

Etichete

GET/api/tags

Listează toate etichetele pentru utilizatorul autentificat.

POST/api/tags

Creează o etichetă nouă.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"name": "urgent"}' \
  https://taskleef.com/api/tags
PUT/api/tags/{id}

Actualizează o etichetă.

DELETE/api/tags/{id}

Șterge o etichetă.

Comentarii

GET/api/todos/{todoId}/comments

Obține toate comentariile de la o sarcină.

POST/api/todos/{todoId}/comments

Adaugă un comentariu la o sarcină.

curl -X POST -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"text": "This is my comment"}' \
  https://taskleef.com/api/todos/{todoId}/comments
PUT/api/comments/{id}

Actualizează un comentariu.

DELETE/api/comments/{id}

Șterge un comentariu.

Format răspuns

Răspunsuri de succes

Cererile reușite returnează JSON cu datele solicitate:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Buy groceries",
  "description": "Milk, eggs, bread",
  "isCompleted": false,
  "createdAt": "2024-01-15T10:30:00Z"
}

Răspunsuri de eroare

Erorile returnează coduri de stare HTTP corespunzătoare:

  • 400 - Bad Request (invalid input)
  • 401 - Unauthorized (missing or invalid authentication)
  • 403 - Forbidden (insufficient permissions)
  • 404 - Not Found
  • 500 - Internal Server Error

Need help? Check your Settings to manage API keys.