External API
Learn how to programmatically create and manage Devin sessions, upload files, and retrieve results using our REST API
Overview
The Devin External API enables you to programmatically create and interact with Devin sessions. This RESTful API allows you to integrate Devin into your own applications, automate workflows, and build powerful tools on top of Devin.
The External API is currently in alpha. While we strive to maintain backward compatibility, some endpoints may change as we improve the API.
Authentication
All API requests require authentication using an API key. You can obtain an API key from your settings page.
Keep your API keys secure and never share them in publicly accessible areas such as GitHub repositories or client-side code.
API keys should be included in the Authorization
header of your requests:
API Endpoints
Idempotency
The Devin API supports idempotent operations to safely handle retries and prevent duplicate operations. When an endpoint supports idempotency, you can set the idempotent
parameter to true
in your request. The response will include an is_new_session
field indicating whether a new resource was created.
For example, when creating sessions with idempotency enabled, retrying the same request will return the existing session instead of creating a duplicate one. This is particularly useful in unreliable network conditions or when implementing retry logic in your applications.
Complete Example: GitHub Repository Analysis
Here’s a complete example that demonstrates how to use the Devin API to analyze GitHub repositories. This example shows:
- Authentication and error handling
- Creating and monitoring sessions
- Processing structured output
- Proper resource management with async/await
Support
Need Help?
For questions about the API or to report issues, email support@cognition.ai