Yenio

Authentication

User JWTs and yk_live_ / yk_test_ API keys.

api checks callers in this order.

User JWT

Send Authorization: Bearer <jwt>. The token is a user session. The row scope comes from X-Yenio-Environment with value sandbox or production. When the header is omitted, the scope is sandbox. A user JWT may use either environment. The header selects it.

API keys

Send X-Api-Key: yk_live_… or X-Api-Key: yk_test_…. The prefix is the environment. yk_live_ is production and yk_test_ is sandbox. X-Yenio-Environment is ignored. If that header is present and names the other environment, the response is HTTP 400.

The server uses a bearer JWT when Authorization is present. It reads X-Api-Key only when there is no bearer token.

Service accounts use ysa_live_ / ysa_test_. Portal links use ypl_. Those prefixes are not API keys.