Endpoints

Introduction to flyflow endpoints

Introduction to Flyflow API Endpoints

The Flyflow API provides a set of endpoints that allow you to interact with the Flyflow platform programmatically. These endpoints enable you to manage agents, calls, and perform various operations related to voice-based interactions.

Base URL

The base URL for all Flyflow API endpoints is:

https://api.flyflow.dev/v1

Authentication

To authenticate your requests to the Flyflow API, you need to include an API key in the Authorization header of each request. The API key should be prefixed with Bearer. For example:

Authorization: Bearer your_api_key

You can obtain your API key from the Flyflow dashboard or by contacting the Flyflow support team.

Endpoints

The Flyflow API provides the following main endpoints:

Agent Endpoints

  • POST /agent: Create a new agent
  • GET /agent: Retrieve an agent by ID
  • PUT /agent: Update an existing agent
  • DELETE /agent: Delete an agent
  • GET /agents: List all agents

Call Endpoints

  • POST /call: Create a new call
  • GET /call: Retrieve a call by ID
  • POST /call/context: Set the context for a call
  • GET /calls: List all calls

Request and Response Format

The Flyflow API uses JSON as the request and response format. When making requests to the API, you should include the Content-Type: application/json header and provide the request payload in JSON format.

Responses from the API will also be in JSON format. The response will include relevant data based on the endpoint and the operation performed.

Error Handling

If an error occurs while processing your request, the Flyflow API will return an appropriate HTTP status code along with an error message in the response body. The error message will provide details about the specific error that occurred.

Some common error status codes include:

  • 400 Bad Request: The request was invalid or missing required parameters.
  • 401 Unauthorized: The API key is missing or invalid.
  • 404 Not Found: The requested resource was not found.
  • 500 Internal Server Error: An unexpected error occurred on the server side.

Pagination

For endpoints that return a list of resources (e.g., /agents or /calls), the Flyflow API supports pagination. You can use the cursor and limit query parameters to control the pagination behavior.

  • cursor: The cursor value to start the list from. This value is returned in the response of the previous request.
  • limit: The maximum number of items to return in the response. The default value is 10.

Rate Limiting

The Flyflow API implements rate limiting to prevent abuse and ensure fair usage. The rate limits are based on the API key and are enforced on a per-endpoint basis. If you exceed the rate limit, the API will return a 429 Too Many Requests error.

Please refer to the Flyflow API documentation for the specific rate limits applicable to each endpoint.

Conclusion

The Flyflow API provides a powerful way to integrate voice-based interactions into your applications. By leveraging the provided endpoints, you can easily manage agents, calls, and customize the behavior of your voice interactions. For more detailed information about each endpoint and their parameters, please refer to the Flyflow API documentation.