Youniton Docs

Quickstart

Make your first call in five minutes: create a token, read your projects, write a note into a project's memory and read it back.

You need an internal member account in a Youniton workspace with the right "Memory write" on one project. Client guests cannot create tokens.

  1. #Create a personal access token

    In Youniton, open Account › Sessions & apps › API tokens and select Create token. Youniton asks you to confirm who you are first.

    • Give the token a name, for example Quickstart.
    • Select the abilities projects:read, memory:read and memory:write.
    • Select an expiry: 30, 90 or 365 days, never above your workspace's maximum.

    Youniton shows the secret one time. Copy it now. It starts with kanso_pat_.

  2. #Keep the token in an environment variable

    Terminal
    export YOUNITON_TOKEN="kanso_pat_…"   # the secret from step 1
    export YOUNITON_API="https://app.youniton.example/api/v1"   # your workspace's app host + /api/v1
  3. #Make your first call

    Read the projects that you can see. The token names its tenant, so you do not send a tenant header.

    GET /projects
    curl -s "$YOUNITON_API/projects" \
      -H "Authorization: Bearer $YOUNITON_TOKEN" \
      -H "Accept: application/json"

    The answer is one page of projects in data, with the page totals in meta. Note the key of a project, for example ORB. Reference: GET/projects

  4. #Write a note into the project's memory

    Write a Markdown entry by its path. The first call creates it (201), with the missing directories. Youniton adds .md to the name.

    PUT /projects/{projectKey}/memory/entries/by-path
    curl -s -X PUT "$YOUNITON_API/projects/ORB/memory/entries/by-path?path=quickstart/hello" \
      -H "Authorization: Bearer $YOUNITON_TOKEN" \
      -H "Content-Type: application/json" \
      --data '{"body": "# Hello\n\nMy first entry from the API.", "source": {"kind": "agent", "name": "Quickstart script"}}'

    Send the same call again: the answer is 200 with meta.outcome unchanged. A new body gives updated. Reference: PUT/projects/{projectKey}/memory/entries/by-path

  5. #Read it back

    Read the entry by its path. This proves that the write is saved — never trust a "saved" message alone.

    GET /projects/{projectKey}/memory/entries/by-path
    curl -s "$YOUNITON_API/projects/ORB/memory/entries/by-path?path=quickstart/hello.md" \
      -H "Authorization: Bearer $YOUNITON_TOKEN"

    The answer holds the body, the path, the source and the version. The ETag header carries the same version for If-Match. Reference: GET/projects/{projectKey}/memory/entries/by-path

#Next steps

Was this helpful?