Connect a coding agent / CLI
Let a coding agent or a command-line script read your tickets, comment on them and keep its notes in the project's memory — with a personal token.
#Create a token for the agent
In Account › Sessions & apps › API tokens, create a token named after the agent. Select only what it needs, for example:
projects:readandtickets:read— read projects, tickets, boards and backlogs;comments:write— post a comment on a ticket;memory:readandmemory:write— keep notes in the project's memory.
Select a short expiry. Give each agent its own token, so that you can revoke one without the others.
#Give the agent the token
Shell profile or the agent's secret store export YOUNITON_API="https://app.youniton.example/api/v1" export YOUNITON_TOKEN="kanso_pat_…" # never commit this value#Paste the setup prompt
Set up Youniton in your agent
Paste this prompt into your coding agent.
You can use the Youniton REST API. Follow these rules. Connection - Base URL: $YOUNITON_API (for example https://app.youniton.example/api/v1). - Send "Authorization: Bearer $YOUNITON_TOKEN" and "Accept: application/json" on every call. - Never print, log or commit the token. - Responses are JSON: {data, meta, links}. Errors are application/problem+json; branch on "code". - On 429, wait for the Retry-After seconds. On 412 stale-version, read the record again before you write. What you may do - GET /projects — find the project key (for example ORB). - GET /projects/{projectKey}/tickets and GET /tickets/{ticketKey} — read the work. - GET /tickets/{ticketKey}/comments — read the discussion. - POST /tickets/{ticketKey}/comments with an Idempotency-Key header (a new UUID per comment) — report progress. - PUT /projects/{projectKey}/memory/entries/by-path?path=agents/<your-name>/<topic> with {"body": "<Markdown>", "source": {"kind": "agent", "name": "<your-name>"}} — keep your notes. The same body again changes nothing; read meta.outcome. - GET /projects/{projectKey}/memory/entries?q=<words> — find notes before you start a task. Rules - Only do what the user asked. Do not change tickets unless the user asks you to. - After each write, read the record back to confirm it.#Try it
A smoke test curl -s "$YOUNITON_API/projects" -H "Authorization: Bearer $YOUNITON_TOKEN" | head -c 400A
401means that the token is wrong, expired or revoked. A404 route.not_foundon a call means that a personal token cannot call that operation. A403 access.forbiddenmeans that you can see the record but your role may not do the action.
#The operations the prompt uses
- GET
/projectsThe project catalogue — the member's visible projects, filtered, segmented and paged with totals - GET
/projects/{projectKey}/ticketsThe generic ticket list of a project — filters, q, whitelisted sort, cursor (the Calendar uses the due-date range) - GET
/tickets/{ticketKey}The ticket through the caller's mask, with can (the side panel's document) - GET
/tickets/{ticketKey}/commentsComments of both threads (filter[thread]) oldest first - POST
/tickets/{ticketKey}/commentsPost a comment in the internal or the client thread, with files that follow the thread - PUT
/projects/{projectKey}/memory/entries/by-pathCreate the entry at the path, or replace its body (for automations and agents) - GET
/projects/{projectKey}/memory/entriesList or search the project's memory entries
#A small CLI
#!/usr/bin/env bash
# youniton-note <projectKey> <path> < notes.md — write stdin as a memory entry
set -euo pipefail
body=$(jq -Rs . )
curl -sf -X PUT "$YOUNITON_API/projects/$1/memory/entries/by-path?path=$(jq -rn --arg p "$2" '$p|@uri')" \
-H "Authorization: Bearer $YOUNITON_TOKEN" -H "Content-Type: application/json" \
--data "{\"body\": $body, \"source\": {\"kind\": \"agent\", \"name\": \"youniton-note CLI\"}}" \
| jq -r '.meta.outcome + " " + .data.path'#!/usr/bin/env node
// youniton-note <projectKey> <path> < notes.md
const [projectKey, path] = process.argv.slice(2);
const body = await new Response(process.stdin).text();
const url = new URL(`${process.env.YOUNITON_API}/projects/${projectKey}/memory/entries/by-path`);
url.searchParams.set("path", path);
const res = await fetch(url, {
method: "PUT",
headers: { Authorization: `Bearer ${process.env.YOUNITON_TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify({ body, source: { kind: "agent", name: "youniton-note CLI" } }),
});
const json = await res.json();
if (!res.ok) { console.error(json.code); process.exit(1); }
console.log(json.meta.outcome, json.data.path);Was this helpful?