Back to Documentation

API Documentation

Comprehensive documentation for the CodeAdvocate API.

Getting Started

The CodeAdvocate API allows you to programmatically access and manage your snippets, repositories, teams, and more. All API requests require authentication.

Authentication
API requests can be authenticated using API keys or Bearer tokens. Generate an API key from your API Keys dashboard and include it in the X-API-Key header.

Base URL

All API requests should be made to: /api

Available Endpoints

Snippets
GET /api/snippets - List snippets
POST /api/snippets - Create snippet
GET /api/snippets/[id] - Get snippet
PUT /api/snippets/[id] - Update snippet
DELETE /api/snippets/[id] - Delete snippet
Repositories
GET /api/repositories - List repositories
POST /api/repositories - Create repository
GET /api/repositories/[id] - Get repository

Response Format

All API responses are returned in JSON format. Successful responses include the requested data, while errors include an error field with a descriptive message.