@nimblebrain/api-spec v0.4.2
NimbleBrain API Specification
This repository contains the OpenAPI specification for the NimbleBrain API, generated from TypeScript and Zod schemas. It provides a comprehensive documentation of all available endpoints, request/response schemas, and authentication requirements.
š Features
- OpenAPI 3.0.0 specification
- Type-safe schema definitions using Zod
- Automatic SwaggerUI generation
- Bearer token authentication
- Detailed request/response examples
- Built with TypeScript
- Pagination support
- Error handling standardization
š API Documentation
The API documentation is available at: https://developer.nimblebrain.ai/
š Authentication
All endpoints require authentication using a Bearer token. To authenticate:
- Include an
Authorization
header with your requests - Format:
Authorization: Bearer [your_jwt_token]
š ļø Available Endpoints
Conversations
Agents
GET /agents
- List all agents (paginated)GET /agents/:agentId
- Get a specific agent
Conversations
GET /agents/:agentId/conversations
- List agent conversations (paginated)POST /agents/:agentId/conversations
- Create a new conversationGET /agents/:agentId/conversations/:conversationId
- Get conversation detailsDELETE /agents/:agentId/conversations/:conversationId
- Delete a conversation
Messages
GET /agents/:agentId/conversations/:conversationId/messages
- List conversation messages (paginated)POST /agents/:agentId/conversations/:conversationId/messages
- Add a message to a conversation
Response formats
All API endpoints follow a consistent response format:
š ļø Standard Response
{
"data": T | null,
"error": {
"id": string,
"errorCode": string,
"message": string,
"details"?: object,
"timestamp": string
} | null
}
Paginated Response
{
"data": {
"items": T[],
"page": number,
"limit": number,
"total": number
} | null,
"error": {
"id": string,
"errorCode": string,
"message": string,
"details"?: object,
"timestamp": string
} | null
}
š» Local Development
Prerequisites
- Node.js (v20 or later)
- npm (or yarn)
Setup
- Clone the repository:
git clone https://github.com/NimbleBrainInc/nimblebrain-api-spec.git
cd nimblebrain-api-spec
- Install dependencies:
npm install
- Generate documentation:
npm run generate-docs
- Start local server:
npm start
The SwaggerUI will be available at http://localhost:9000
Project Structure
src/
āāā schemas/ # Zod schema definitions
ā āāā zodSetup.ts # Zod configuration
ā āāā agent.schema.ts # Agent schemas
ā āāā conversation.schema.ts
ā āāā message.schema.ts
ā āāā pagination.schema.ts
ā āāā responses.schema.ts # API response schemas
ā āāā route-params.schema.ts
āāā routes/ # API route definitions
ā āāā agents/
ā ā āāā index.ts
ā āāā conversations/
ā ā āāā index.ts
ā āāā common.ts # Common route types & error responses
āāā generateDocs.ts # Documentation generator
š Publishing Updates
- Make changes to the schemas or routes
- Run
npm run generate-docs
to regenerate the documentation - Run
npm start
and confirm your changes are correct - Release new version
npm run release:patch # For bug fixes
npm run release:minor # For new features
npm run release:major # For breaking changes
š¤ Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š® Support
For support, please reach out to our team at support@nimblebrain.ai
5 months ago
5 months ago
5 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago