Trigger Deployed Crew API
Using your deployed crew’s API on CrewAI Enterprise
Once you have deployed your crew to CrewAI Enterprise, it automatically becomes available as a REST API. This guide explains how to interact with your crew programmatically.
API Basics
Your deployed crew exposes several endpoints that allow you to:
- Discover required inputs
- Start crew executions
- Monitor execution status
- Receive results
Authentication
All API requests require a bearer token for authentication, which is generated when you deploy your crew:
You can find your bearer token in the Status tab of your crew’s detail page in the CrewAI Enterprise dashboard.
Available Endpoints
Your crew API provides three main endpoints:
Endpoint | Method | Description |
---|---|---|
/inputs | GET | Lists all required inputs for crew execution |
/kickoff | POST | Starts a crew execution with provided inputs |
/status/{kickoff_id} | GET | Retrieves the status and results of an execution |
GET /inputs
The inputs endpoint allows you to discover what parameters your crew requires:
Response
This response indicates that your crew expects four input parameters: budget
, interests
, duration
, and age
.
POST /kickoff
The kickoff endpoint starts a new crew execution:
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
inputs | Object | Yes | Key-value pairs of all required inputs |
meta | Object | No | Additional metadata to pass to the crew |
taskWebhookUrl | String | No | Callback URL executed after each task |
stepWebhookUrl | String | No | Callback URL executed after each agent thought |
crewWebhookUrl | String | No | Callback URL executed when the crew finishes |
Example with Webhooks
Response
The kickoff_id
is used to track and retrieve the execution results.
GET /status/
The status endpoint allows you to check the progress and results of a crew execution:
Response Structure
The response structure will vary depending on the execution state:
In Progress
Completed
Webhook Integration
When you provide webhook URLs in your kickoff request, the system will make POST requests to those URLs at specific points in the execution:
taskWebhookUrl
Called when each task completes:
stepWebhookUrl
Called after each agent thought or action:
crewWebhookUrl
Called when the entire crew execution completes:
Best Practices
Handling Long-Running Executions
Crew executions can take anywhere from seconds to minutes depending on their complexity. Consider these approaches:
- Webhooks (Recommended): Set up webhook endpoints to receive notifications when the execution completes
- Polling: Implement a polling mechanism with exponential backoff
- Client-Side Timeout: Set appropriate timeouts for your API requests
Error Handling
The API may return various error codes:
Code | Description | Recommended Action |
---|---|---|
401 | Unauthorized | Check your bearer token |
404 | Not Found | Verify your crew URL and kickoff_id |
422 | Validation Error | Ensure all required inputs are provided |
500 | Server Error | Contact support with the error details |
Sample Code
Here’s a complete Python example for interacting with your crew API:
Need Help?
Contact our support team for assistance with API integration or troubleshooting.
Was this page helpful?