Initiate parsing of a repository or directory to build Potpie’s knowledge graph. This analyzes your codebase structure, relationships, and creates the foundational data that enables AI agents to understand and work with your code.
Either repo_name or repo_path must be provided. In development mode, when both are provided, repo_path takes precedence. In production, repo_path is not accepted.
Local Repository in ProductionThe endpoint rejects local repository paths when the application runs in production mode. Local parsing is restricted to development environments for security.
Copy
{ "detail": "Parsing local repositories is only supported in development mode"}
How to fix: Use repo_name to parse remote repositories in production. For local development, enable development mode in your environment configuration.
401 Unauthorized
Missing API KeyThe endpoint requires API key authentication for all requests. The request fails when no x-api-key header is provided.
Copy
{ "detail": "API key is required"}
How to fix: Include a valid API key in the request header:
Copy
x-api-key: YOUR_API_KEY
Invalid API KeyThe endpoint validates all API keys. The request fails when the API key is invalid or has expired.
Copy
{ "detail": "Invalid API key"}
Common causes:
API key has expired
API key is malformed or corrupted
API key has been revoked
API key does not belong to your account
How to fix: Generate a new API key from your account settings and update your application configuration.
500 Internal Server Error
The endpoint returns this error when unexpected exceptions occur during parsing operations.
Copy
{ "detail": "Internal server error"}
Common causes:
Database connection failures
File system errors during parsing
Memory errors with very large repositories
Network failures when cloning remote repositories
Third-party service unavailability
How to fix: Retry the request with exponential backoff. If the issue persists, contact support with your project_id for debugging assistance.