> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phinite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Execution Mode 1: API (Single Endpoint)

### Overview

The single endpoint API mode provides **synchronous execution** of autonomous flows. The API call waits for the flow to complete and returns the final result in the response.

**Limitations:**

* Maximum execution time: **120-150 seconds**
* Not recommended for complex or multi-step flows
* Best suited for simple, fast operations

### Endpoint

```text theme={null}
POST https://app.phinite.ai/api/v1/ai/trigger/{workspace_id}/{trigger_id}/{environment}
```

### Request Payload

The API accepts the following JSON payload:

```json theme={null}
{
  "message": "",
  "user_variables": {"key1":"value1", "key2":"value2"}
}
```

#### Field Descriptions

| Field            | Type   | Description                                                                                                   |
| :--------------- | :----- | :------------------------------------------------------------------------------------------------------------ |
| `message`        | String | The first message sent to the flow when the session starts. Can be empty if not required.                     |
| `user_variables` | Object | Session variables to initialize the conversation with. These variables will be available throughout the flow. |

### Response Format

The API directly returns the completed or failed status:

**Success Response (200 OK):**

```json theme={null}
{
  "workflow_id": "workflowid-uuid",
  "response": {
    "key1": "value1",
    "key2": "value2"
  },
  "status": "completed",
  "logs": [...],
  "requires_input": false,
  "error": null
}
```

**Failed Response (200 OK):**

```json theme={null}
{
  "workflow_id": "workflowid-uuid",
  "response": {},
  "status": "failed",
  "logs": [...],
  "requires_input": false,
  "error": "Error details here"
}
```
