Add Index
POST/api/v1/developer/add-index
Add a new index with a source URL for indexing SDK, CLI, or API documentation. This endpoint creates a new index and starts the indexing process automatically. Once indexed, you can use the get-context endpoint to retrieve relevant documentation.
Request
Headers
Body Parameters
Name or title of the index to create. This should be a descriptive name for the service you’re indexing (e.g., “Stripe API”, “AWS CLI”, “Python Requests Library”).
Source URL to index. This should be the main documentation page or starting point for the service. The system will crawl and index related pages automatically.
Optional notes about the index. Use this to add context about what this index contains or any special considerations.
Example Request
Response
Success Response (200)
Indicates if the request was successful
Error message if the request failed, null otherwise
Contains the response data
Index Status
After creating an index, it goes through several states:PENDING
PENDING
The index has been created and is queued for processing. Indexing will begin shortly.
IN_PROGRESS
IN_PROGRESS
The system is actively crawling and indexing the documentation from the provided URL.
INDEXED
INDEXED
The index is complete and ready to use. You can now query it with the get-context endpoint.
FAILED
FAILED
The indexing process encountered an error. Check that the URL is valid and accessible.
Error Responses
400 - Invalid URL
400 - Invalid URL
403 - Subscription Required
403 - Subscription Required
409 - URL Already Indexed
409 - URL Already Indexed
409 - Indexing In Progress
409 - Indexing In Progress
401 - Missing API key
401 - Missing API key
401 - Invalid API key
401 - Invalid API key
404 - User account missing
404 - User account missing
Best Practices
Choose the Right Starting URL: Select a documentation home page or API reference as your starting URL. The system will automatically discover and index related pages.
Descriptive Names: Use clear, descriptive names for your indexes to make them easy to identify when using list-indexes.
Indexing Time: The indexing process can take several minutes to hours depending on the size of the documentation. Monitor the status using list-indexes.
Subscription Limits: The number of indexes you can create depends on your subscription plan. Check your account settings for details.
Common Use Cases
Internal Documentation
Index your company’s internal API documentation and developer guides
Third-Party APIs
Add frequently-used third-party service documentation for quick reference
Open Source Libraries
Index open source library documentation for your development stack
CLI Tools
Create indexes for command-line tools and their documentation
Workflow Example
Here’s a typical workflow for adding and using a new index:- Add Index: Call
add-index
with your documentation URL - Wait for Completion: Indexing begins automatically (status:
PENDING
→IN_PROGRESS
) - Verify: Use list-indexes to check when status changes to
INDEXED
- Query: Once indexed, use get-context to retrieve relevant documentation
Example Workflow