Postman Collection
Test the API using the provided Postman collection.
A pre-configured Postman collection is included for quick testing of all endpoints.
Import
- Open Postman
- Click Import
- Drag in both files from the
docs/postman/directory:ek-hub-headless-chat-api.postman_collection.jsonek-hub-headless-chat-api.postman_environment.json
Configure
After importing, set the environment variables:
| Variable | Value |
|---|---|
baseUrl | http://localhost:3002 |
apiKey | Your API key (e.g. api_a1b2c3d4...) |
Run
The collection includes requests in the recommended order:
- List Agents —
GET /agents - Get Agent Details —
GET /agents/{agentId} - Create Session —
POST /agents/{agentId}/sessions - List Sessions —
GET /agents/{agentId}/sessions - Send Message —
POST /agents/{agentId}/sessions/{sessionId}/messages - Get Messages —
GET /agents/{agentId}/sessions/{sessionId}/messages - Get Session Details —
GET /agents/{agentId}/sessions/{sessionId} - Update Session —
PATCH /agents/{agentId}/sessions/{sessionId} - Delete Session —
DELETE /agents/{agentId}/sessions/{sessionId}
The collection includes auto-set scripts that automatically save agentId and sessionId from responses into environment variables, so subsequent requests use them automatically.
Tips
- Run requests in order — later requests depend on IDs from earlier ones
- Check the environment variables tab to see saved IDs
- Use the Tests tab to see auto-set variable scripts