{
  "info": {
    "_postman_id": "actionflows-api-collection",
    "name": "ActionFlows API",
    "description": "ActionFlows REST API: discover flows and agents, trigger runs, manage the run queue, and chat with agents. Design graphs and Studio config in the app.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "actionflows"
  },
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Validate Authentication",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/auth/validate",
              "host": ["{{base_url}}"],
              "path": ["api", "auth", "validate"]
            },
            "description": "Verify that your API key is valid and get information about the authenticated user and session."
          },
          "response": []
        }
      ],
      "description": "Authentication endpoints for API key validation"
    },
    {
      "name": "ActionFlows",
      "item": [
        {
          "name": "List Flows",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/actionflows?organizationId={{organization_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "actionflows"],
              "query": [
                {
                  "key": "organizationId",
                  "value": "{{organization_id}}",
                  "description": "Optional: Filter flows by organization ID",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve all ActionFlows for your organization(s). You can optionally filter by a specific organization."
          },
          "response": []
        },
        {
          "name": "Get Flow",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/actionflows/{{action_flow_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "actionflows", "{{action_flow_id}}"]
            },
            "description": "Retrieve detailed information about a specific ActionFlow."
          },
          "response": []
        },
        {
          "name": "List Flow Runs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/actionflows/{{action_flow_id}}/runs?filter[status]=COMPLETED&filter[isTest]=false&page[size]=20",
              "host": ["{{base_url}}"],
              "path": ["api", "actionflows", "{{action_flow_id}}", "runs"],
              "query": [
                {
                  "key": "filter[status]",
                  "value": "COMPLETED",
                  "description": "Filter by status (comma-separated)",
                  "disabled": true
                },
                {
                  "key": "filter[isTest]",
                  "value": "false",
                  "description": "Filter test runs",
                  "disabled": true
                },
                {
                  "key": "page[size]",
                  "value": "20",
                  "description": "Number of results per page",
                  "disabled": true
                },
                {
                  "key": "page[after]",
                  "value": "",
                  "description": "Cursor for pagination",
                  "disabled": true
                },
                {
                  "key": "page[before]",
                  "value": "",
                  "description": "Cursor for pagination",
                  "disabled": true
                },
                {
                  "key": "filter[tag]",
                  "value": "",
                  "description": "Filter by tags (comma-separated)",
                  "disabled": true
                },
                {
                  "key": "filter[createdAt][from]",
                  "value": "",
                  "description": "Filter runs created after this date (ISO 8601)",
                  "disabled": true
                },
                {
                  "key": "filter[createdAt][to]",
                  "value": "",
                  "description": "Filter runs created before this date (ISO 8601)",
                  "disabled": true
                },
                {
                  "key": "filter[createdAt][period]",
                  "value": "",
                  "description": "Filter by time period (today, week, month)",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve all runs for a specific ActionFlow with optional filtering and pagination."
          },
          "response": []
        }
      ],
      "description": "Endpoints for managing and querying ActionFlows"
    },
    {
      "name": "Runs",
      "item": [
        {
          "name": "List Runs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/runs?filter[status]=COMPLETED&filter[isTest]=false&page[size]=20",
              "host": ["{{base_url}}"],
              "path": ["api", "runs"],
              "query": [
                {
                  "key": "filter[status]",
                  "value": "COMPLETED",
                  "description": "Filter by status (comma-separated)",
                  "disabled": true
                },
                {
                  "key": "filter[taskIdentifier]",
                  "value": "",
                  "description": "Filter by task identifier (comma-separated)",
                  "disabled": true
                },
                {
                  "key": "filter[version]",
                  "value": "",
                  "description": "Filter by version (comma-separated)",
                  "disabled": true
                },
                {
                  "key": "filter[tag]",
                  "value": "",
                  "description": "Filter by tags (comma-separated)",
                  "disabled": true
                },
                {
                  "key": "filter[isTest]",
                  "value": "false",
                  "description": "Filter test runs",
                  "disabled": true
                },
                {
                  "key": "filter[createdAt][from]",
                  "value": "",
                  "description": "Filter runs created after this date (ISO 8601)",
                  "disabled": true
                },
                {
                  "key": "filter[createdAt][to]",
                  "value": "",
                  "description": "Filter runs created before this date (ISO 8601)",
                  "disabled": true
                },
                {
                  "key": "filter[createdAt][period]",
                  "value": "",
                  "description": "Filter by time period (today, week, month)",
                  "disabled": true
                },
                {
                  "key": "page[size]",
                  "value": "20",
                  "description": "Number of results per page",
                  "disabled": true
                },
                {
                  "key": "page[after]",
                  "value": "",
                  "description": "Cursor for pagination",
                  "disabled": true
                },
                {
                  "key": "page[before]",
                  "value": "",
                  "description": "Cursor for pagination",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve all runs across all your flows with optional filtering and pagination."
          },
          "response": []
        },
        {
          "name": "Trigger Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"payload\": {\n    \"organizationId\": \"{{organization_id}}\",\n    \"actionFlowId\": \"{{flow_id}}\",\n    \"data\": {\n      \"customerEmail\": \"customer@example.com\",\n      \"message\": \"Hello, I need help\"\n    },\n    \"metadata\": {}\n  },\n  \"idempotencyKey\": \"unique-key-{{$timestamp}}\",\n  \"tags\": [\"production\", \"api\"],\n  \"maxAttempts\": 3,\n  \"maxDuration\": 3600\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/runs",
              "host": ["{{base_url}}"],
              "path": ["api", "runs"]
            },
            "description": "Start a new flow execution by triggering a run with a payload."
          },
          "response": []
        },
        {
          "name": "Get Run",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/runs/{{run_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "runs", "{{run_id}}"]
            },
            "description": "Retrieve detailed information about a specific run."
          },
          "response": []
        },
        {
          "name": "Cancel Run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/runs/{{run_id}}/cancel",
              "host": ["{{base_url}}"],
              "path": ["api", "runs", "{{run_id}}", "cancel"]
            },
            "description": "Cancel a running or waiting flow execution."
          },
          "response": []
        },
        {
          "name": "Stream Run",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Accept",
                "value": "text/event-stream",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/runs/{{run_id}}/stream",
              "host": ["{{base_url}}"],
              "path": ["api", "runs", "{{run_id}}", "stream"]
            },
            "description": "Stream real-time updates for a running flow execution using Server-Sent Events (SSE). Note: This endpoint returns a stream, not JSON. Use EventSource or similar for proper handling."
          },
          "response": []
        }
      ],
      "description": "Endpoints for managing and monitoring flow runs"
    },
    {
      "name": "Queue",
      "description": "Inspect and cancel queued flow runs when the organization run queue is enabled.",
      "item": [
        {
          "name": "List Queued Runs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/runs/queue?filter[organizationId]={{organization_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "runs", "queue"],
              "query": [
                {
                  "key": "filter[organizationId]",
                  "value": "{{organization_id}}",
                  "description": "Organization that owns the queue"
                }
              ]
            },
            "description": "List waiting or dispatching queue items for the organization."
          },
          "response": []
        },
        {
          "name": "Get Queued Run",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/runs/queue/{{queue_id}}?filter[organizationId]={{organization_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "runs", "queue", "{{queue_id}}"],
              "query": [
                {
                  "key": "filter[organizationId]",
                  "value": "{{organization_id}}",
                  "description": "Organization that owns the queue item"
                }
              ]
            },
            "description": "Get a queued flow run by queue item ID."
          },
          "response": []
        },
        {
          "name": "Cancel Queued Run",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/runs/queue/{{queue_id}}?filter[organizationId]={{organization_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "runs", "queue", "{{queue_id}}"],
              "query": [
                {
                  "key": "filter[organizationId]",
                  "value": "{{organization_id}}",
                  "description": "Organization that owns the queue item"
                }
              ]
            },
            "description": "Cancel a waiting queued run and release any credit hold."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Action Agents",
      "description": "Discover agents and chat. Design agents in Studio. The API does not create, update, or delete agents and does not return Studio config.",
      "item": [
        {
          "name": "List Agents",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/action-agents?organizationId={{organization_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "action-agents"],
              "query": [
                {
                  "key": "organizationId",
                  "value": "{{organization_id}}",
                  "description": "Filter agents by organization"
                }
              ]
            },
            "description": "List agent discovery metadata for the organization."
          },
          "response": []
        },
        {
          "name": "Get Agent",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/action-agents/{{action_agent_id}}?organizationId={{organization_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "action-agents", "{{action_agent_id}}"],
              "query": [
                {
                  "key": "organizationId",
                  "value": "{{organization_id}}",
                  "description": "Optional organization scope"
                }
              ]
            },
            "description": "Get discovery metadata for one agent (no Studio fields)."
          },
          "response": []
        },
        {
          "name": "Start Agent Session",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/action-agents/{{action_agent_id}}/sessions",
              "host": ["{{base_url}}"],
              "path": [
                "api",
                "action-agents",
                "{{action_agent_id}}",
                "sessions"
              ]
            },
            "description": "Start an isolated chat session. Store sessionId for later turns.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"organizationId\": \"{{organization_id}}\",\n  \"endUserId\": \"user_abc\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Send Agent Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/action-agents/{{action_agent_id}}/sessions/{{session_id}}/messages",
              "host": ["{{base_url}}"],
              "path": [
                "api",
                "action-agents",
                "{{action_agent_id}}",
                "sessions",
                "{{session_id}}",
                "messages"
              ]
            },
            "description": "Send a message and wait for the full reply.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"organizationId\": \"{{organization_id}}\",\n  \"message\": \"Hello\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Stream Agent Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Accept",
                "value": "text/event-stream",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/action-agents/{{action_agent_id}}/sessions/{{session_id}}/messages",
              "host": ["{{base_url}}"],
              "path": [
                "api",
                "action-agents",
                "{{action_agent_id}}",
                "sessions",
                "{{session_id}}",
                "messages"
              ]
            },
            "description": "Send a message and stream SSE text-delta events.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"organizationId\": \"{{organization_id}}\",\n  \"message\": \"Hello\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Resume Agent Session Stream",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "X-Locale",
                "value": "en",
                "type": "text",
                "disabled": true
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}",
                "type": "text"
              },
              {
                "key": "Accept",
                "value": "text/event-stream",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/action-agents/{{action_agent_id}}/sessions/{{session_id}}/stream?organizationId={{organization_id}}",
              "host": ["{{base_url}}"],
              "path": [
                "api",
                "action-agents",
                "{{action_agent_id}}",
                "sessions",
                "{{session_id}}",
                "stream"
              ],
              "query": [
                {
                  "key": "organizationId",
                  "value": "{{organization_id}}"
                },
                {
                  "key": "lastEventId",
                  "value": "",
                  "disabled": true,
                  "description": "Optional resume cursor"
                }
              ]
            },
            "description": "Reconnect to an agent session SSE stream."
          },
          "response": []
        }
      ]
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [""]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [""]
      }
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.actionflows.ai",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "",
      "type": "string",
      "description": "Your ActionFlows API key. Get it from your organization settings."
    },
    {
      "key": "organization_id",
      "value": "",
      "type": "string",
      "description": "Your organization ID"
    },
    {
      "key": "action_flow_id",
      "value": "",
      "type": "string",
      "description": "Flow ID for testing"
    },
    {
      "key": "run_id",
      "value": "",
      "type": "string",
      "description": "Run ID for testing"
    },
    {
      "key": "queue_id",
      "value": "",
      "type": "string",
      "description": "Queued run ID for testing"
    },
    {
      "key": "action_agent_id",
      "value": "",
      "type": "string",
      "description": "Agent ID for testing"
    },
    {
      "key": "session_id",
      "value": "",
      "type": "string",
      "description": "Agent session ID for testing"
    }
  ]
}
