Developers
ENPT

Authentication

Every API call carries a secret token that identifies your account.

The API identifies who is calling through a token, a long secret string. Treat it like a password: never put it in a website, an app sent to customers or a public repository.

Token types

TokenGives access toWho uses it
Host tokenOne account (host) and its avatars.Companies integrating their own systems.
Domain tokenAll accounts in a domain, plus creating new accounts.Partners that manage several customers.

Your token is issued by Tolky. Ask your Tolky contact for the host token of your account, or the domain token if you are a partner.

AdvancedTechnical details

Send the token in the Authorization header of every request:

curl -X POST "https://api.tolky.to/api/externalAPIs/public/tolkyReasoning/conversations/create" \
  -H "Authorization: Bearer $TOLKY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
  • The account is resolved from the token. A hostId sent in the body must belong to that token, otherwise the call is rejected.
  • 401 means the token is missing or invalid. 403 means it is valid but has no access to the requested resource.

Partners: list the accounts of a domain

With a domain token, list the hosts in your domain and their host tokens:

curl "https://api.tolky.to/api/externalAPIs/public/domainAccess/getAccessTokens" \
  -H "Authorization: Bearer $TOLKY_DOMAIN_TOKEN"

Use the returned host token for calls that act on a single account.

Keep tokens on the server

Calls must come from your backend. A token in browser or mobile code can be copied by anyone.

Previous

Tolky API

Next

Quickstart