Skip to main content
Every request to the WeCareRemote AI agent API requires an Authorization header with a Bearer token. You obtain this token by logging in to the platform or via the JWT token endpoint. Without a valid token, the API returns a 401 Unauthorized response. The token is the only credential the API uses. There is no separate API key, no client secret, and no signature step — once you have a valid JWT, you are authenticated.

Getting your token

You have two options for obtaining a Bearer token. Option 1: Log in through the WeCareRemote web interface. After logging in, your session token is available in the platform settings. Copy it and use it in your API requests. Option 2: Call the JWT token endpoint directly.
The endpoint returns a token you can use immediately:
See the Auth API reference for full details on the token endpoints.

Passing your token

Add the Authorization header to every request to the AI agent API. Use the Bearer scheme followed by your token.
The following example shows a complete authenticated request:

Authentication errors

If your request is rejected due to an authentication problem, the API returns one of the following status codes. When you receive a 401, obtain a new token and retry your request.
Never hardcode your Bearer token directly in source code. Store it in an environment variable and read it at runtime to avoid accidentally exposing credentials in version control.
JWT tokens expire after a set period. If your requests start returning 401 errors after previously succeeding, your token has likely expired. Re-authenticate through the web interface or call the token endpoint again to get a fresh token.