Session-based Authentication Overview
Session-based authentication is the standard method for authenticating users in the Circularo system. It provides a secure way to access the API and perform operations on behalf of the authenticated user. Key features:- Simple username and password authentication
- Session tokens valid for 30 days by default
- Required for most API operations
- Support for Multi-Factor Authentication (MFA) when enabled
- Store session tokens securely and never expose them in client-side code
- Implement proper token management including logout when sessions are no longer needed
- For server-to-server integrations, consider using API tokens instead
Step 1 - Authenticate user with username and password
Authenticates a user with their credentials and creates a new session. This is the first step in any API workflow that requires authentication.- Provides a session token that must be included in subsequent API requests
- Session tokens are valid for 30 days by default
- For multi-factor authentication (MFA) enabled accounts, additional verification steps may be required
- Optional “tenant” parameter can be used to explicitly specify the target tenant, though usually not required as the system automatically selects the correct tenant based on the host header
If your account has Multi-Factor Authentication (MFA) enabled, the token will be returned in a locked state and must be unlocked using the appropriate authentication factor before it can be used.
- token - Located at
tokenin the response.- The authentication token that should be included in subsequent API requests. This token identifies your session and provides access to authorized resources.
- Example value:
Jf93lomzYdnv7AGeRZlEZbtNrRvd8vj0s3PWjhAXgLIkIxnOUmTqZi1tRz6352HV
- The token should be passed as a query parameter (?token=YOUR_TOKEN) in subsequent requests
- The token is valid for 30 days from creation
- For security reasons, store this token securely and do not expose it in client-side code
Step 2 - Test the session token by retrieving available documents (Optional)
This endpoint demonstrates how to use your session token to perform an actual operation - in this case, searching for available documents in the system.- The session token is passed in the query parameters
- The search operation returns documents the authenticated user has access to
- This pattern applies to all token protected API endpoints - include your session token in each request
This is a practical example of how to use your session token for API operations. Do not call this endpoint if you don’t wish to perform a search operation.
Step 3 - Terminate the session (Optional)
Invalidates the current session token, effectively logging the user out of the system. This is an important security practice to prevent unauthorized access after a session is no longer needed.- Invalidates the token provided in the request
- Prevents the token from being used for any future API requests
- Should be called when a session is no longer needed
- Does not affect other active sessions for the same user
This endpoint only invalidates the specific token provided in the request. Other active sessions for the same user will remain valid.
Session Authentication Summary
Session-based authentication provides a secure way to access the Circularo API:- Authentication is performed using username (email) and password credentials
- The resulting session token must be included in all subsequent token protected API requests
- Session tokens are valid for 30 days by default
- Always terminate sessions with the logout endpoint when they are no longer needed
- For server-to-server integrations, consider using API tokens instead
Example Authentication Flow
See our OpenAPI documentation to learn about the full set of API endpoints and parameters.
Please use proper exception handling and function decomposition in your own code. The code is provided for illustrative purposes only and is not intended for production use.