API і вебхукиAPI and webhooks
REST API для задач, проєктів і коментарів та вебхуки на зміну задачі. Працює для організацій на нашому сервері; адреса — https://api.sklyk.com/api/v1.A REST API for tasks, projects and comments, and webhooks for task changes. For organizations on our server; the address is https://api.sklyk.com/api/v1.
КлючA key
Ключ створює власник або адміністратор: Налаштування → API і вебхуки. Його показують один раз. Ключ діє від імені людини, яка його створила, в одній організації: бачить і змінює рівно те, що може вона сама. Відкликаний ключ перестає працювати за пів хвилини.An owner or an admin makes a key: Settings → API and webhooks. It is shown once. A key acts as the person who made it, in one organization: it reads and changes exactly what that person can. A revoked key stops working within half a minute.
curl https://api.sklyk.com/api/v1/me \
-H "Authorization: Bearer sk_..."Відповіді й тіла запитів — JSON. Не більше 120 запитів на хвилину на один ключ; далі — 429.Responses and request bodies are JSON. At most 120 requests a minute for one key; after that, 429.
Що єEndpoints
GET | /me | Чий це ключ і в якій організації.Whose key this is, and in which organization. |
GET | /members | Люди організації: id, ім’я, роль.The organization’s people: id, name, role. |
GET | /projects | Проєкти з їхніми статусами.Projects with their statuses. |
GET | /tasks | Задачі; фільтри нижче.Tasks; filters below. |
POST | /tasks | Створити задачу.Create a task. |
GET | /tasks/{key} | Одна задача за ключем, як-от WEB-12.One task by its key, like WEB-12. |
PATCH | /tasks/{key} | Змінити задачу.Change a task. |
GET | /tasks/{key}/comments | Коментарі задачі, найновіші спершу.A task’s comments, newest first. |
POST | /tasks/{key}/comments | Написати коментар.Write a comment. |
GET | /webhooks | Вебхуки організації.The organization’s webhooks. |
POST | /webhooks | Додати вебхук; секрет показують один раз.Add a webhook; the secret is shown once. |
DELETE | /webhooks/{id} | Прибрати вебхук.Remove a webhook. |
ЗадачіTasks
Фільтри GET /tasks: project (ключ проєкту), status (id статусу), assignee (id людини), updated_since (дата ISO 8601), archived (true або any; без нього архівних немає), limit (до 100) і offset. У відповіді next_offset — звідки брати наступну сторінку, або null.Filters of GET /tasks: project (a project key), status (a status id), assignee (a member id), updated_since (an ISO 8601 date), archived (true or any; without it archived tasks are left out), limit (up to 100) and offset. The answer’s next_offset is where the next page starts, or null.
curl -X POST https://api.sklyk.com/api/v1/tasks \
-H "Authorization: Bearer sk_..." -H "Content-Type: application/json" \
-d '{"project": "WEB", "title": "Check the invoice", "priority": "high",
"assignees": ["<member id>"], "due": "2026-12-24T10:00:00Z", "labels": ["billing"]}'{
"id": "0b7c…", "key": "WEB-12", "project": "WEB",
"title": "Check the invoice", "description": "",
"status": "todo", "priority": "high",
"reporter": "<member id>", "assignees": ["<member id>"],
"parent": null, "due": "2026-12-24T10:00:00+00:00", "labels": ["billing"],
"created_at": "…", "updated_at": "…", "completed_at": null, "archived_at": null
}POST /tasks приймає project і title (обов’язкові), description, status, priority (urgent, high, normal, low), assignees, start, due, estimate_minutes, labels, fields, parent (ключ батьківської задачі). PATCH приймає будь-що з title, description, status, priority, assignees, start, due, estimate_minutes, labels, fields, archived. Статус — id або назва з дошки цього проєкту. fields — власні поля проєкту за назвою: {"Клієнт": "Acme", "Оплачувана": true}; варіант зі списку — його назва, кілька — список назв, дата — РРРР-ММ-ДД, null прибирає значення. Які поля має проєкт — у GET /projects. estimate_minutes — оцінка в хвилинах. Видалення задач немає: задачу архівують.POST /tasks takes project and title (required), description, status, priority (urgent, high, normal, low), assignees, start, due, estimate_minutes, labels, fields, parent (the parent task’s key). PATCH takes any of title, description, status, priority, assignees, start, due, estimate_minutes, labels, fields, archived. A status is an id or a name from that project’s board. fields are the project’s own fields, by name: {"Client": "Acme", "Billable": true}; one of a list is its name, several a list of names, a date YYYY-MM-DD, and null clears a value. GET /projects says which fields a project has. estimate_minutes is the estimate, in minutes. There is no deleting a task: a task is archived.
ПомилкиErrors
{ "error": { "code": "invalid", "message": "That board has no status “nope”. It has: todo, prog, review, done." } }401 — ключа немає або він недійсний; 403 — людині, чий це ключ, цього не можна; 404 — немає такого або ключ цього не бачить; 422 — запит не можна застосувати; 429 — забагато запитів.401 — no key, or not a valid one; 403 — the key’s owner may not do that; 404 — no such thing, or this key cannot see it; 422 — the request cannot be applied; 429 — too many requests.
ВебхукиWebhooks
Вебхук — https-адреса, на яку ми надсилаємо POST, коли задачу створено (task.created), змінено (task.updated) або видалено разом із проєктом (task.deleted). Архівування — це task.updated зі зміною archived_at. Додає власник або адміністратор, до п’яти на організацію. Вебхук чує всі задачі організації.A webhook is an https address we POST to when a task is created (task.created), changed (task.updated) or deleted with its project (task.deleted). Archiving is a task.updated whose archived_at changed. An owner or an admin adds one, up to five an organization. A webhook hears every task of the organization.
{
"id": "evt_1042",
"event": "task.updated",
"organization_id": "…",
"occurred_at": "2026-11-28T09:14:03.120+00:00",
"changed": ["status", "assignees"],
"task": { "key": "WEB-12", "status": "done", "…": "the same object the API answers with" }
}Відповідайте 2xx протягом 10 секунд. Інакше ми повторимо: шість спроб приблизно за добу. Тридцять невдач поспіль вимикають вебхук; «Надіслати тест» у налаштуваннях вмикає його знову. Та сама подія може прийти двічі — розрізняйте за id.Answer 2xx within 10 seconds. Otherwise we try again: six attempts over about a day. Thirty failures in a row switch a webhook off; “Send a test” in Settings switches it back on. The same event may arrive twice — tell them apart by id.
Як перевірити підписVerifying the signature
Кожен запит несе X-Sklyk-Timestamp і X-Sklyk-Signature: sha256=… — HMAC-SHA256 від рядка timestamp.тіло із секретом вебхука. Порахуйте те саме над сирим тілом запиту й порівняйте; відхиляйте запити зі старим часом.Every request carries X-Sklyk-Timestamp and X-Sklyk-Signature: sha256=… — the HMAC-SHA256 of the string timestamp.body with the webhook’s secret. Compute the same over the raw request body and compare; refuse requests with an old timestamp.
import { createHmac, timingSafeEqual } from 'node:crypto';
function verified(rawBody, headers, secret) {
const timestamp = headers['x-sklyk-timestamp'];
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const expected = 'sha256=' + createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
const given = String(headers['x-sklyk-signature'] || '');
return given.length === expected.length && timingSafeEqual(Buffer.from(given), Buffer.from(expected));
}