Authentication
How to authenticate with Vionlabs APIs using OAuth 2.0 Client Credentials via Stytch
All Vionlabs APIs use OAuth 2.0 Client Credentials (machine-to-machine) authentication via Stytch.
Getting started
-
Create API keys
Log in to app.vionlabs.com → Settings → API Keys. If your company doesn't use the Vionlabs app, contact support to obtain API credentials.
When creating an API key, copy your Client ID and Client Secret immediately — the secret is only shown once.
-
Get an access token
Exchange your Client ID and Client Secret for an access token using the Stytch OAuth2 endpoint:
curl -X POST "https://api.stytch.com/v1/public/project-live-ad1e793c-f32e-485c-b5a0-144d5cf64be7/oauth2/token" \ -H "Content-Type: application/json" \ -d '{ "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "grant_type": "client_credentials" }'Use the shared Stytch project ID shown above. Replace
YOUR_CLIENT_IDandYOUR_CLIENT_SECRETwith the credentials from Settings → API Keys, or those provided by support. For test projects, usehttps://test.stytch.cominstead ofhttps://api.stytch.com.Response:
{ "access_token": "eyJhbGci...", "expires_in": 3600, "token_type": "bearer" }Access tokens are short-lived and expire after one hour. Cache the token and request a new one shortly before the
expires_intime; a401 Unauthorizedresponse can indicate that a new token is needed sooner. -
Make API calls
Include the access token in the
Authorizationheader on every API request:curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ "https://apis.prod.vionlabs.com/smartlists"Catalog, Result, and Tasks APIs require the access token and a
catalogquery parameter. API keys are granted at the organization level, and an organization can have multiple catalogs. Thecatalogparameter identifies which catalog aninventory_idrefers to.curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ "https://apis.prod.vionlabs.com/catalog/assets?catalog=my_catalog"