CloudFlow API

DoiT CloudFlow is a GenAI-powered FinOps and CloudOps automation platform. It provides the automation and intelligence you need to manage your FinOps and CloudOps processes at scale.

The CloudFlow API lets you do this programmatically: discover flows, manage cloud provider connections, browse templates, trigger published webhook flows, and build or refine flows from natural language.

This is a task-oriented guide, not a field-by-field specification. For every field, parameter, and status code, use the CloudFlow API reference. For CloudFlow in the DoiT console, see the CloudFlow help docs.

Permissions

CloudFlow Manager on the user or service account that owns the token. Every CloudFlow API endpoint requires Manager, including list and get. CloudFlow Editor is not sufficient. A failed check returns 403. See CloudFlow permissions.

📘

In the DoiT console, CloudFlow Editor and CloudFlow Manager are treated as equivalent for most flow actions. However, in the API, someone who builds and publishes flows in the console will still get 403 unless they have CloudFlow Manager.


For a personal API token, include CloudFlow Manager in the token's permission scope as well as on the user's role. A Manager user whose token uses Read-only or a custom scope that omits Manager still gets 403. Service account tokens inherit the service account's permissions, so grant Manager on the service account.

Automate and integrate

Use the table below to pick an integration pattern, then follow the linked example.

Use caseApproachExample
Inventory flowsPage through GET /cloudflow/v1/flows with maxResults and pageToken. Filter client-side on published, triggerType, or lastExecutionStatus.List CloudFlows
Event-driven remediationPublish a webhook-triggered flow in the console, then call POST /cloudflow/v1/trigger/{flowId} from alerts, ticketing, or CI with a JSON payload.Trigger a webhook flow
Provision AWS/GCP credentials for flowsCreate and update connections via the Connections API; keep secrets and role names in your secrets manager.Create a connection
AI-assisted flow authoringCall build or refine from an internal tool that can consume SSE; persist the resulting flowId and review in the console before publish.Build a CloudFlow and Refine a CloudFlow
Template discoveryList templates to drive an internal catalogue UI; create runnable flows in the console until a public create-from-template endpoint exists.Browse templates

API operations

OperationAPI endpointReference
List CloudFlowsGET /cloudflow/v1/flowslistCloudflows
Build a CloudFlow from scratchPOST /cloudflow/v1/flows/actions/buildbuildCloudFlow
Refine a CloudFlowPOST /cloudflow/v1/flows/{flowId}/actions/refinerefineCloudFlow
Trigger a webhook flowPOST /cloudflow/v1/trigger/{flowId}triggerCloudflowWebhook
List connectionsGET /cloudflow/v1/connectionslistCloudflowConnections
Create a connectionPOST /cloudflow/v1/connectionscreateCloudflowConnection
Retrieve a connectionGET /cloudflow/v1/connections/{connectionId}getCloudflowConnection
Update a connectionPATCH /cloudflow/v1/connections/{connectionId}updateCloudflowConnection
Delete a connectionDELETE /cloudflow/v1/connections/{connectionId}deleteCloudflowConnection
List templatesGET /cloudflow/v1/templateslistCloudflowTemplates
Retrieve a templateGET /cloudflow/v1/templates/{templateId}getCloudflowTemplate

The public CloudFlow API does not cover every console action (for example, publish/unpublish, stop execution, or full flow CRUD). Use the console for those steps, or watch the API changelog as more endpoints ship.

Schema

The CloudFlow API exposes three main resources: flows, connections, and templates.

ResourceDescriptionUsage
FlowsWorkflow definitions (draft or published)List; build from scratch; refine an existing flow; trigger a published webhook flow
ConnectionsAWS or GCP credentials CloudFlow nodes useCreate, list, get, update, and delete
TemplatesRead-only blueprintsList and get only
  • Build creates a new flow and streams the AI builder output. You do not supply a flowId.
  • Refine updates an existing flow identified by flowId and streams the same style of builder events.
  • Trigger starts an execution for a published flow whose first node is a webhook trigger. Draft flows and non-webhook triggers cannot be started with this endpoint.
  • Connections hold the AWS or GCP credentials that flow nodes use. Deleting a connection that is still referenced by a flow returns 409.
  • Templates are a read-only catalogue. Creating a runnable flow from a template is done in the DoiT console, not through a public create-flow API today.

CloudFlow object

Returned in the items array of GET /cloudflow/v1/flows.

PropertyTypeDescription
idstringCloudFlow ID.
namestringCloudFlow name.
descriptionstringOptional description.
instructionsstringOperator guidance for the flow. null when none have been authored.
publishedbooleanWhether the flow is published. Must be true to trigger.
triggerTypestringTrigger on the first node, when present. Typically webhook for the trigger endpoint. null if the flow has no trigger.
createTimestringISO 8601 (UTC) creation timestamp.
updateTimestringISO 8601 (UTC) last-modified timestamp. null if never modified.
lastExecutedTimestringISO 8601 (UTC) time of the last execution. null if never run.
lastExecutionStatusstringStatus of the last execution. Possible values: pending, running, complete, pending-approval, failed, sleeping, stopped. null if never run.
nextRunstringNext scheduled execution time. null when the CloudFlow has no active schedule.

List responses also include:

PropertyTypeDescription
itemsarray of CloudFlow objectsCloudFlows on this page.
pageTokenstringOpaque cursor for the next page. null when there are no more CloudFlows.
rowCountintegerAlways null. Row count is not computed for this endpoint.

Connection object

Returned by the Connections operations. Exactly one of gcpConfig or awsConfig is set on create.

PropertyTypeDescription
connectionIdstringUnique identifier for the connection.
namestringHuman-readable connection name.
descriptionstringOptional description.
gcpConfigobjectGCP configuration. Request fields include level (organization, folder, or project), projectId, organizationId, folderId, and serviceAccountName. Responses add server-managed status and deploymentCommand.
awsConfigobjectAWS configuration. Request fields include roleName and context (array of accountId and regions). Responses add server-managed per-account status.
collaboratorsarray of objectsOptional sharing entries. Each entry has email and role (owner, editor, or user).
enabledbooleanfalse when the connection is disabled.
statusstringOverall connection status (server-managed).
createdAtstringISO 8601 (UTC) creation timestamp.
updatedAtstringISO 8601 (UTC) last-modified timestamp.

Template object

Returned by GET /cloudflow/v1/templates and GET /cloudflow/v1/templates/{templateId}.

PropertyTypeDescription
idstringUnique identifier of the template.
namestringHuman-readable display name.
descriptionstringShort summary of the template and its use case.
instructionsstringStep-by-step operator guidance. null when none have been authored.
createTimestringISO 8601 (UTC) creation timestamp.
updateTimestringISO 8601 (UTC) last-modified timestamp. null if never modified.

Build and refine request

Used by POST /cloudflow/v1/flows/actions/build and POST /cloudflow/v1/flows/{flowId}/actions/refine.

Both operations are SSE-only. Send Accept: text/event-stream. If the header does not includetext/event-stream, the API returns 406.

PropertyTypeDescription
questionstringRequired. Natural-language description of the flow to create (build) or change (refine).
conversationIdstringOptional. ID of an existing builder conversation to continue. When omitted, a new conversation is started.

Trigger response

Returned by POST /cloudflow/v1/trigger/{flowId} with status 202.

The request body is arbitrary JSON. Properties become the webhook payload for the flow.

PropertyTypeDescription
executionLinkstringConsole URL for the started CloudFlow execution history entry.

Examples

📘

YOUR_API_KEY

Replace YOUR_API_KEY with your actual API token as explained at Get Started.

List CloudFlows

The List CloudFlows method returns a cursor-paginated list of CloudFlows.

ParameterTypeDescription
maxResultsintegerMaximum number of flows to return (1–500). Defaults to 50.
pageTokenstringOpaque cursor for the next page, taken from pageToken in the previous response. Omit to start from the beginning.

Sample request:

curl -G "https://api.doit.com/cloudflow/v1/flows" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  --data-urlencode "maxResults=5"

Sample response:

{
  "items": [
    {
      "id": "abc123",
      "name": "Weekly tagging check",
      "published": true,
      "triggerType": "webhook",
      "createTime": "2026-06-01T12:00:00Z",
      "lastExecutionStatus": "complete"
    }
  ],
  "pageToken": null,
  "rowCount": null
}

Use pageToken from the response as the pageToken query parameter to fetch the next page. rowCount is always null for this endpoint.

Build a CloudFlow

The Build a CloudFlow method creates a new flow from a natural-language description and streams incremental build events, including the ID of the newly created flow.

Use an HTTP client that supports streaming responses (curl -N, or an SSE-capable library). Do not buffer the entire response as a single JSON object.

  • Treat 406 as a client bug: the Accept header did not include text/event-stream.
  • Treat 502 as an upstream builder failure. Retry with backoff when appropriate; do not assume the flow was fully created.
  • After the build completes, confirm the flow with List CloudFlows before automating further steps.

Sample request:

curl -N -X POST "https://api.doit.com/cloudflow/v1/flows/actions/build" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "question": "Create a flow that lists untagged EC2 instances and posts a Slack summary"
  }'

The response is a text/event-stream of incremental build events. Keep the connection open until the stream ends, then note the new flow ID from the events.

To continue the same build conversation (for example, to adjust the draft), call build or refine again with the same conversationId from the session.

Find the new id in a subsequent list response. Open the flow in the DoiT console to review nodes, publish it, or attach a webhook trigger before you call the trigger endpoint.

Refine a CloudFlow

The Refine a CloudFlow method updates an existing flow from a natural-language description. It uses the same SSE contract as build: Content-Type: application/json and Accept: text/event-stream.

Sample request:

curl -N -X POST "https://api.doit.com/cloudflow/v1/flows/{flowId}/actions/refine" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "question": "Add a Slack notification when the check fails",
    "conversationId": "OPTIONAL_EXISTING_CONVERSATION_ID"
  }'

Trigger a webhook flow

The Trigger a webhook flow method starts a published CloudFlow and passes a JSON payload into the webhook trigger node.

Requirements:

  • The flow must be published (published: true on list).
  • The flow’s first node must be a webhook trigger (triggerType is typically webhook when listed).
  • The request body must be valid JSON. Properties are arbitrary; they become the webhook payload for the flow.

Sample request:

curl -X POST "https://api.doit.com/cloudflow/v1/trigger/{flowId}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "alertId": "7jyrczd6CSh3M8TuQ6Qq",
    "severity": "critical"
  }'

Sample response (202):

{
  "executionLink": "https://console.doit.com/customers/customer-id/cloudflow/history/execution-id"
}

If the flow already has an active execution, the API returns 409. Wait for that run to finish (or stop it in the console) before triggering again.

See CloudFlow triggers in the Help Center.

Create a connection

The Create a connection method stores AWS or GCP credentials that CloudFlow nodes use. Exactly one of gcpConfig or awsConfig is required. Sending both or neither returns 400 with code invalid_connection_config.

For console setup details, see CloudFlow connections.

Minimal GCP example (project-level):

curl -X POST "https://api.doit.com/cloudflow/v1/connections" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Prod GCP project",
    "description": "Billing and ops automation",
    "enabled": true,
    "gcpConfig": {
      "level": "project",
      "projectId": "my-gcp-project",
      "serviceAccountName": "cloudflow-runner"
    }
  }'

Minimal AWS example:

curl -X POST "https://api.doit.com/cloudflow/v1/connections" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Prod AWS accounts",
    "enabled": true,
    "awsConfig": {
      "roleName": "DoiTCloudFlowRole",
      "context": [
        {
          "accountId": "123456789012",
          "regions": ["us-east-1", "eu-west-1"]
        }
      ]
    }
  }'

A successful create returns 201 and a Connection object, including connectionId and server-managed status fields.

Optional collaborators entries use email plus role (owner, editor, or user).

List, get, update, or delete a connection

# List
curl -G "https://api.doit.com/cloudflow/v1/connections" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "maxResults=50"

# Get
curl "https://api.doit.com/cloudflow/v1/connections/{connectionId}" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Partial update (at most one of gcpConfig or awsConfig)
curl -X PATCH "https://api.doit.com/cloudflow/v1/connections/{connectionId}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'

# Delete
curl -X DELETE "https://api.doit.com/cloudflow/v1/connections/{connectionId}" \
  -H "Authorization: Bearer YOUR_API_KEY"

Delete returns 204 on success. If any flow still references the connection, Delete returns 409.

Browse templates

The List templates and Retrieve a template methods return read-only blueprints. Use them to discover supported patterns and configuration guidance.

curl -G "https://api.doit.com/cloudflow/v1/templates" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "maxResults=50"

curl "https://api.doit.com/cloudflow/v1/templates/{templateId}" \
  -H "Authorization: Bearer YOUR_API_KEY"

Each template includes id, name, optional description andinstructions, and timestamps.

Creating a flow from a template is not available on the public API today. Use the CloudFlow templates experience in the console, or build a new flow with POST /cloudflow/v1/flows/actions/build.

Troubleshooting

SymptomLikely causeWhat to do
406 on build or refineMissing Accept: text/event-stream (and not */*)Set the Accept header; use a streaming HTTP client.
403 on any CloudFlow routeMissing DoiT API entitlement or CloudFlow Manager permissionCheck subscription and role; see Get Started and CloudFlow permissions.
400 with tenant_id_required / tenant_id_mismatchMulti-tenant credential without a valid X-Tenant-IdSend X-Tenant-Id with the correct customer ID.
400 invalid_connection_configBoth or neither of gcpConfig / awsConfig on createSend exactly one provider config.
409 on triggerFlow already has an active executionWait for completion or stop the run in the console, then retry.
409 on connection deleteConnection still referenced by one or more flowsRemove or re-point those flows in the console, then delete.
502 on build or refineUpstream builder errorRetry later; verify the flow state with list afterward.
Trigger returns 404 / fails for a known flowFlow not published, or first node is not a webhook triggerPublish the flow and use a webhook trigger; confirm with list fields.
Cannot create a flow from a template via APINo public create-from-template endpointUse the console templates UI or POST .../actions/build.

Related docs


Did this page help you?