DEVELOPER DOCUMENTATION / API v1
Planning projects and calendars
Create full programmes, configure resources and availability, retrieve calculated schedules and coordinate safe external execution.
Configure clients
An administrator opens **Agents & API**, creates an **Integration** client with no associated resource for planning, selects only needed scopes, then creates its first credential. Store the once-displayed credential in the caller's secret store, never a script, repository, URL or browser bundle. Credential rotation/revocation uses the existing administration UI. Scope changes affect all that client's credentials.
| Scope | Authority |
| planning:read | Projects, complete programme plans, schedule and existing team/timeline reads |
| planning:write | Create/update projects and unstarted tasks, project/stage prerequisites, briefs, sequencing and duration |
| resources:read | One authoritative human/AI directory with type and effective availability mode |
| resources:assign | Replace task resource IDs/mode; also required when task creation/update includes those fields |
| resources:write | Administrator-sponsored human/AI creation and rename, without creating accounts/credentials |
| resource-calendars:read | Working patterns, manual/automatic exceptions, commitments and organisation closures |
| resource-calendars:write | Administrator-sponsored pattern/AI-mode changes and manual exceptions |
| tasks:read / tasks:update | Worker assigned discovery/detail and status/progress, claims, result links and existing Incoming actions |
| tasks:time / tasks:notes | Worker factual intervals / append-only notes |
| human-requests:create / human-requests:read | Worker assistance request creation / replies |
Planning scopes do not grant execution. A worker client must be linked to an active AI resource and separately granted the execution scopes it needs. Create/configure AI resources with the planning client or existing administrator UI, then create each resource-bound worker client in Agents & API. An unbound planning client cannot impersonate a worker. Resource/calendar writes also require the sponsor to remain an active administrator.
HTTP endpoints
All below are relative to /api/v1. All are Bearer-authenticated except public OpenAPI/docs. Resource directory aliases /organisation/resources and /team-members are replaced by /resources. Existing worker routes remain, but worker PATCH rejects planning-only fields, including titles/briefs, dependencies, sequencing, durations, resource modes and planning dates.
| Method | Path | Purpose |
| GET | /projects?includeArchived=false | Project list; ETag supplies initial plan version |
| GET | /projects/{id} | Project detail and project prerequisite IDs |
| POST / PATCH | /projects / /projects/{id} | Create / update project |
| GET | /projects/{id}/plan?planFrom=2026-11-29 | All tasks/briefs, assignments, prerequisites, links, execution state and calculated schedule |
| POST / PATCH | /projects/{projectId}/tasks / /projects/{projectId}/tasks/{id} | Create / update existing WorkStage entity |
| PUT | /projects/{projectId}/tasks/{id}/assignments | Explicit replacement {resourceIds,resourceMode} |
| GET | /schedule?projectId={id}&planFrom=2026-11-29 | Whole-organisation calculation, optional project filtering |
| GET / POST | /resources | Typed directory / create human or AI |
| PATCH | /resources/{id} | Rename only; complex lifecycle remains in administration UI |
| GET | /resources/{id}/calendar | Effective mode, weekly intervals, closures, exceptions and commitments |
| PUT | /resources/{id}/working-pattern | Replace intervals and optionally AI availability mode |
| POST | /resources/{id}/availability-exceptions | Manual absence/holiday/non-working interval |
| PATCH / DELETE | /resources/{resourceId}/availability-exceptions/{id} | Edit/remove a manual resource exception |
New PATCH operations preserve omitted values. Explicit null clears nullable fields; arrays replace only when supplied. IDs are positive integers scoped to the authenticated organisation. Unknown/duplicate fields are rejected. A task belongs to its route project; moving it between projects is not supported. Resource type is immutable through PATCH. No hard deletion, lifecycle conversion or credential creation is exposed by the planning API.
Planning contracts and limits
Projects accept name (1–200), optional description (20,000), priorityName (critical|high|normal|low), nullable date-only targetDate, hardDeadline, optional deadlineReason (500), dependencyProjectIds, isActive, and links, and nullable plannedFrom (London planning timestamp). Omitted planning origins are preserved; explicit values update or clear them. All project prerequisites use existing cross-project validation.
Tasks accept title (1–200), nullable description (**100,000 UTF-16 code units**, preserving Unicode/newlines), estimatedMinutes (0–1,000,000), sequence (0–100,000), nullable earliestStart/releaseDate, isWaiting, dependencyIds, optional resourceIds/resourceMode and links. New tasks default Ready. Status, claims, actual intervals and execution progress cannot be supplied to a planning endpoint. Assignments support Independent and Collaboration using existing CYJ rules; existing per-resource contribution values are preserved unless those rules require recalculation. Read responses include stored contributions and actuals; no new per-resource effort editing contract is introduced.
Links are arrays of {title,url}: at most 50, title up to 200, absolute HTTP(S) URL up to 2,048 without embedded credentials. URLs are stored, not fetched. Dependencies/resources are unique arrays of at most 1,000 positive IDs. No truncation: complete project plans are bounded to **1,000 tasks and 5 million aggregate description code units**, returning 422 plan_too_large if exceeded. Write-body protection is **1 MiB**, including chunked JSON. Unrelated note/assistance/calendar-description limits remain unchanged.
Resource create: {displayName,type:"human"|"ai",intervals?}. Human creation requires at least one initial interval; AI creation defaults continuous. Rename uses {displayName} only. Each independent resource ID represents independent capacity: use one resource per actual simultaneous execution lane or non-overlapping calendars when sharing compute. No shared-capacity pool exists.
Pattern replacement: {availabilityMode:"continuous"|"workingCalendar",intervals:[{day:1,start:"09:00",end:"13:00",fullDay:false},...]}. Day is Sunday=0 … Saturday=6. Multiple non-overlapping same-day intervals represent breaks. Full-day uses start/end 00:00 and fullDay:true; [] explicitly gives no weekly capacity. Human resources always use workingCalendar. Active AI resources default continuous, bypassing weekly patterns and human organisation closures while respecting explicit resource exceptions and commitments; opt into workingCalendar to apply the same calculation as humans, including organisation closures. Pattern changes and mode changes are atomic. Existing pattern editor notices reflect the effective AI mode.
Exception create/update: {start,end,kind,description}; end is exclusive, kind up to 50 and description up to 500. Manual exceptions only; automatic bank-holiday rows cannot be changed here. GET calendar includes their source metadata and relevant commitments. Holiday policy and recurring commitment administration remain in existing UI/database mechanisms.
Planning timestamps use existing **Europe/London wall time**, with seconds and no offset in responses. Offset/Z input is converted to London. Nonexistent DST wall times are rejected. UTC metadata/lease timestamps include Z. Project targets/deadlines accept yyyy-MM-dd and follow existing end-of-date deadline rules.
Concurrency, retries and active work
Every planning write requires If-Match: "plan-{version}" and Idempotency-Key (1–100 letters/digits/./_/:/-). GET projects/resources/calendars exposes that ETag. Successful writes return {id,planVersion} and the recorded ETag; create uses 201, updates/deletes 200. Creation replay returns the original ID/version/Location even with an old precondition. Same key with a different operation/body is 409. Persist create keys in the caller so a lost response never causes a new key to be invented.
Creation receipts survive beyond 24 hours for the lifetime of the API client/organisation; ordinary mutation/worker receipts keep the existing one-day window. After later deletion, replay still refers to the original identity, never implicit recreation. Authentication and scope checks precede replay. Entity changes, history/audit attribution and receipt are in the existing locked transaction. Current credential/sponsor/scope/revision checks are repeated under that lock. Revocation prevents replay too.
Claimed or InProgress tasks reject direct changes to execution-critical planning fields, assignments or mode. Calendar edits affecting their assigned resource and scheduling-relevant project edits affecting their project return 409. Completed execution is preserved. Planning writes do not force-release claims, overwrite actuals or change statuses; metadata-only edits can stale a worker ETag, requiring reread, without destroying its claim. **Indirect forecast movement from changes elsewhere is not exhaustively compared**; it may change predicted allocation, but does not revoke a claim or overwrite execution state. Coordinate work normally before disruptive changes; no planner force-cancel endpoint exists.
Schedules report planVersion, calculatedAtUtc, asOf (London), planFrom, timeZone, horizonDays (730), project risk/headroom/predicted lateness, per-stage start/finish, allocations (staffMemberId,start,end), waiting intervals, dependency waits, reasons and warnings. Calculate across the whole organisation before filtering. Compare the returned version with the last mutation; reread on a later concurrent version. Null finish means unknown/blocked/unscheduled, not on-time. Deadline risk comes from existing ForecastHistoryCalculator; no second engine or diagnostics framework is added. Claims remain per stage, not per shared machine or multi-client collaboration session.
Relevant errors: 400 invalid JSON/typed input; 401 invalid/revoked credential; 403 missing scope/sponsor authority or worker planning field; 404 missing/foreign entity; 409 dependency/idempotency/active-work conflict; 412 stale ETag; 413 oversized write; 422 validation/plan bound; 428 missing If-Match; 429 rate limit with Retry-After. Error bodies use existing application/problem+json {type,title,status,code,traceId}. Never log tokens, complete briefs, private absence notes or request bodies.
Practical HTTP lifecycle (Windows or Linux)
Use curl.exe on Windows and curl on Linux. Set $CYJ_TOKEN from a secret store and $BASE=https://canyoujust.work/api/v1. These examples show shell-style variables; in PowerShell use $env:CYJ_TOKEN if using environment storage. Replace illustrative IDs and ETags with responses. Every mutation needs a fresh precondition except an exact keyed retry.
curl -i "$BASE/projects" -H "Authorization: Bearer $CYJ_TOKEN"
curl "$BASE/resources" -H "Authorization: Bearer $CYJ_TOKEN"
curl "$BASE/resources/11/calendar" -H "Authorization: Bearer $CYJ_TOKEN"
curl -X PUT "$BASE/resources/11/working-pattern" -H "Authorization: Bearer $CYJ_TOKEN" -H 'If-Match: "plan-10"' -H 'Idempotency-Key: ai-hours-1' -H 'Content-Type: application/json' --data '{"availabilityMode":"workingCalendar","intervals":[{"day":1,"start":"09:00","end":"17:00","fullDay":false}]}'
curl -X POST "$BASE/projects" -H "Authorization: Bearer $CYJ_TOKEN" -H 'If-Match: "plan-11"' -H 'Idempotency-Key: release-programme-1' -H 'Content-Type: application/json' --data '{"name":"Commercial release","priorityName":"high","targetDate":"2026-12-15","hardDeadline":"2026-12-18"}'
Write a UTF-8 task.json containing the complete brief, including escaped newlines:
{"title":"Build packaging","description":"Requirements:\n...\nTechnical instructions:\n...\nAcceptance criteria:\n...","estimatedMinutes":240,"sequence":10,"dependencyIds":[],"resourceIds":[11],"resourceMode":"Independent","links":[]}
curl -X POST "$BASE/projects/21/tasks" -H "Authorization: Bearer $CYJ_TOKEN" -H 'If-Match: "plan-12"' -H 'Idempotency-Key: packaging-task-1' -H 'Content-Type: application/json' --data-binary @task.json
curl -X PATCH "$BASE/projects/21/tasks/31" -H "Authorization: Bearer $CYJ_TOKEN" -H 'If-Match: "plan-13"' -H 'Idempotency-Key: packaging-deps-1' -H 'Content-Type: application/json' --data '{"dependencyIds":[30]}'
curl -X PUT "$BASE/projects/21/tasks/31/assignments" -H "Authorization: Bearer $CYJ_TOKEN" -H 'If-Match: "plan-14"' -H 'Idempotency-Key: packaging-assignees-1' -H 'Content-Type: application/json' --data '{"resourceIds":[11],"resourceMode":"Independent"}'
curl "$BASE/projects/21/plan" -H "Authorization: Bearer $CYJ_TOKEN"
curl "$BASE/schedule?projectId=21" -H "Authorization: Bearer $CYJ_TOKEN"
Switch to a resource-bound $WORKER_TOKEN. Discover/detail before claiming; available and waiting lists explain blockers. Replace the task ETag after each successful worker write, and retain claim token/expiry from the claim response.
curl "$BASE/identity" -H "Authorization: Bearer $WORKER_TOKEN"
curl "$BASE/tasks/available" -H "Authorization: Bearer $WORKER_TOKEN"
curl -i "$BASE/tasks/31" -H "Authorization: Bearer $WORKER_TOKEN"
curl -X POST "$BASE/tasks/31/claim" -H "Authorization: Bearer $WORKER_TOKEN" -H 'If-Match: "task-31-plan-15"' -H 'Idempotency-Key: claim-31-1' -H 'Content-Type: application/json' --data '{}'
curl -X PATCH "$BASE/tasks/31" -H "Authorization: Bearer $WORKER_TOKEN" -H 'If-Match: "task-31-plan-16"' -H 'X-Task-Claim: CLAIM_UUID' -H 'Idempotency-Key: start-31-1' -H 'Content-Type: application/json' --data '{"status":"InProgress"}'
curl -X POST "$BASE/tasks/31/human-requests" -H "Authorization: Bearer $WORKER_TOKEN" -H 'If-Match: "task-31-plan-17"' -H 'X-Task-Claim: CLAIM_UUID' -H 'Idempotency-Key: review-31-1' -H 'Content-Type: application/json' --data '{"humanAssigneeId":1,"title":"Review packaging","details":"Confirm release criteria","estimatedMinutes":30,"isBlocking":true,"publishExternally":false}'
Read /human-requests/{returnedStageId} with the worker token. The human responds through Incoming; if the request needs evaluation use /tasks/31/external-evaluation with the existing resolve/keepwaiting/followup contract, then reread blockers before resuming. Append notes at /tasks/31/notes. Record factual work and a result link before completion:
curl -X PUT "$BASE/tasks/31/actual-effort" -H "Authorization: Bearer $WORKER_TOKEN" -H 'If-Match: "task-31-plan-18"' -H 'X-Task-Claim: CLAIM_UUID' -H 'Idempotency-Key: actual-31-1' -H 'Content-Type: application/json' --data '{"actualIntervals":[{"staffMemberId":11,"start":"2026-11-29T09:00:00","end":"2026-11-29T10:00:00"}]}'
curl -X PUT "$BASE/tasks/31/result-link" -H "Authorization: Bearer $WORKER_TOKEN" -H 'If-Match: "task-31-plan-19"' -H 'X-Task-Claim: CLAIM_UUID' -H 'Idempotency-Key: result-31-1' -H 'Content-Type: application/json' --data '{"title":"Release output","url":"https://example.invalid/release"}'
curl -X PATCH "$BASE/tasks/31" -H "Authorization: Bearer $WORKER_TOKEN" -H 'If-Match: "task-31-plan-20"' -H 'X-Task-Claim: CLAIM_UUID' -H 'Idempotency-Key: done-31-1' -H 'Content-Type: application/json' --data '{"status":"Done"}'
Completion releases the matching claim. To release without completing, POST /tasks/31/claim/release with {token:"CLAIM_UUID"}, current task If-Match and a key. Renew via /claim/renew before expiry. Reconcile a lost response using the same key and payload. Never replay external deployment/payment/business side effects merely because a lease was reacquired.
Clara ChatGPT project management
The private OAuth MCP endpoint composes these same planning services into atomic complete-project creation and amendment with temporary stage references. It also exposes resource calendars, forecasts, management progress/worker findings and integration-attributed assistance responses. It grants no worker execution authority. See Clara project management Help for connection scopes, complete JSON examples, safe retries and forecasting limitations.
Live schedules distinguish allocations (outstanding forecast), originalPlannedAllocations and recordedActualAllocations. Unfinished demand starts at the current London planning time or next eligible availability. Recorded actual work reduces demand; passing time does not complete a task. If remainingEffortUncertain is true, allocations are explicitly provisional capacity and finish is null. Review the estimate; do not treat the compatibility remaining number as reliable. Original origins, actuals and saved historical snapshots are preserved.