Youniton Docs

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.

  1. #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:read and tickets:read — read projects, tickets, boards and backlogs;
    • comments:write — post a comment on a ticket;
    • memory:read and memory: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.

  2. #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
  3. #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.
  4. #Try it

    A smoke test
    curl -s "$YOUNITON_API/projects" -H "Authorization: Bearer $YOUNITON_TOKEN" | head -c 400

    A 401 means that the token is wrong, expired or revoked. A 404 route.not_found on a call means that a personal token cannot call that operation. A 403 access.forbidden means that you can see the record but your role may not do the action.

#The operations the prompt uses

#A small CLI

youniton-note
#!/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'

Was this helpful?