Delete Agent
Delete an Agent
The Flyflow API allows you to delete an agent by making a DELETE request to the /agent
endpoint. This endpoint permanently removes the specified agent from your account.
Request
Endpoint
DELETE /agent
Headers
Authorization
: The API key prefixed withBearer
. Example:Bearer your_api_key
.
Query Parameters
id
(string, required): The unique identifier of the agent you want to delete.
cURL Example
curl -X DELETE \
-H "Authorization: Bearer your_api_key" \
"https://api.flyflow.dev/v1/agent?id=agent_id"
Replace agent_id
with the actual ID of the agent you want to delete.
Python Client Example
from flyflowclient import Flyflow
client = Flyflow(api_key='your_api_key')
agent_id = 'agent_id'
client.delete_agent(agent_id=agent_id)
Replace agent_id
with the actual ID of the agent you want to delete.
Response
Status Codes
204 No Content
: The agent was successfully deleted.400 Bad Request
: The request is missing the requiredid
query parameter.401 Unauthorized
: The API key is missing or invalid.404 Not Found
: The specified agent ID does not exist.500 Internal Server Error
: An unexpected error occurred on the server side.
Response Body
If the agent is successfully deleted, the response body will be empty (no content).
Error Handling
If an error occurs while deleting the agent, the API will return an appropriate error response with a corresponding status code and error message in the response body.
For example, if the specified agent ID does not exist:
{
"error": "Not Found",
"message": "Agent not found"
}
Make sure to handle errors appropriately in your application and provide the correct agent ID in the request.
Considerations
Before deleting an agent, please note the following:
- Deleting an agent is a permanent action and cannot be undone.
- All associated data, including calls and interactions, related to the deleted agent will also be permanently removed.
- Ensure that you have the necessary permissions and authority to delete the agent.
- Use caution when deleting agents and double-check the agent ID before making the request.
Conclusion
Deleting an agent using the Flyflow API is a straightforward process. By making a DELETE request to the /agent
endpoint with the required id
query parameter, you can permanently remove the specified agent from your account. The API will return a success status code (204 No Content) upon successful deletion. Remember to handle errors and provide the necessary authentication and agent ID to ensure a smooth integration with the Flyflow platform. Exercise caution when deleting agents, as it is a permanent action that cannot be undone.
Updated 6 months ago