Authentication
The Agentix API uses session-based authentication. Every API request requires two credentials:- A session cookie — proves your identity (set automatically on sign-in)
- An
x-tenant-idheader — specifies which workspace you are accessing
Step 1: Sign In
Obtain a session cookie by sending your email and password to the sign-in endpoint:cURL
Node.js
session_token cookie. The cURL -c cookies.txt flag saves this cookie to a file for use in subsequent requests.
Step 2: Find Your Workspace ID
Your workspace (tenant) ID is a UUID that identifies which workspace your API calls target. You can find it in the Agentix dashboard URL:Step 3: Make Authenticated Requests
Include both the session cookie andx-tenant-id header on every API call:
cURL
Node.js
Session Lifecycle
| Property | Value |
|---|---|
| Session duration | 7 days (absolute timeout) |
| Sliding renewal | Session token refreshes every 24 hours of activity |
| Cookie name | session_token |
| Cookie flags | httpOnly, Secure, SameSite=Lax |
Missing or Invalid Credentials
| Scenario | Status | Response |
|---|---|---|
| No session cookie | 401 | {"error": "Unauthorized"} |
| Expired session | 401 | {"error": "Unauthorized"} |
Missing x-tenant-id header | 401 | {"error": "Unauthorized"} |
| Invalid workspace UUID | 403 | {"error": "Forbidden"} |
| User not a member of workspace | 403 | {"error": "Forbidden"} |
Brute Force Protection
The sign-in endpoint has built-in brute force protection:- 5 failed attempts per email+IP combination triggers a lockout
- Lockout duration: 15 minutes
- During lockout, the endpoint returns
429 Too Many Requests - The counter resets on successful sign-in
Rate Limits on Auth Endpoints
| Endpoint | Limit |
|---|---|
POST /api/auth/sign-in/email | 5 requests per 60 seconds |
POST /api/auth/sign-up/email | 3 requests per 5 minutes |
POST /api/auth/forget-password | 3 requests per hour |
POST /api/auth/reset-password | 3 requests per hour |
All other /api/auth/* | 10 requests per minute |
The API playground in these docs may not work with cookie-based authentication due to cross-domain restrictions. Use cURL or your own code to test API calls.