> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://ref.scoutos.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ref.scoutos.com/_mcp/server.

# Create a new workflow revision

POST https://api.scoutos.com/v2/workflows/revisions
Content-Type: application/json

Reference: https://ref.scoutos.com/api-sdk/endpoints/workflows/create-revision

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `workflow_id` (string, optional, nullable)
- `workflow_key` (string, optional, nullable)

### Body (application/json)

This endpoint expects a WorkflowConfig-Input.

- `workflow_display_name` (string, optional, default: Untitled)
- `workflow_schema_version` (string, optional, default: 1.0)
- `workflow_img_url` (string, optional, nullable)
- `workflow_description` (string, optional, nullable)
- `blocks` (list of Block-Input, optional)
- `notes` (list of WorkflowNote-Input, optional)
- `placeholders` (list of Placeholder-Input, optional)
- `tags` (list of string, optional)
- `is_tool` (boolean, optional, default: false)

## Response

### 200

Successful Response

- `data` (Workflow, optional, nullable)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### Block-Input

- `block_archetype_id` (string, required)
- `block_display_name` (string, required)
- `block_id` (string, required)
- `block_inputs` (BlockInputBlockInputs, optional)
- `is_output` (boolean, optional, default: false)
- `dependencies` (list of Dependency, optional)
- `input_schema` (BlockInputInputSchema, optional)
- `ui` (NodeUI, optional)
- `trigger_config` (BlockInputTriggerConfig, optional, nullable)
- `ignore_error` (boolean, optional, default: false) — If true, will continue down the branch of the failed block
- `block_config` (list of BlockInputBlockConfigItems, optional, deprecated)
- `output_schema` (list of any, optional, deprecated)

### WorkflowNote-Input

- `id` (string, required)
- `bgColor` (string, required)
- `content` (string, optional, default: )
- `author` (string, optional, default: Your name)
- `ui` (NodeUI, optional)

### Placeholder-Input

- `block_id` (string, required)
- `type` (enum, required)
  - Allowed values: `triggerPlaceholder`, `blockPlaceholder`
- `ui` (NodeUI, optional)
- `dependencies` (list of Dependency, optional)

### Workflow

- `workflow_config` (WorkflowConfig-Output, required)
- `last_updated_at` (datetime, required)
- `created_at` (datetime, required)
- `created_by` (Identity, required)
- `last_updated_by` (Identity, required)
- `revision_id` (string, required)
- `workflow_id` (string, required)
- `workflow_key` (string, optional, nullable)
- `is_draft` (boolean, optional, default: false)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### BlockInputBlockInputs

### Dependency

- `block_id` (string, required)
- `ui` (EdgeUI, optional)

### BlockInputInputSchema

### NodeUI

- `dimensions` (Dimensions, optional, nullable)
- `position` (Position, optional, nullable)

### BlockInputTriggerConfig

### BlockInputBlockConfigItems

### WorkflowConfig-Output

- `workflow_display_name` (string, optional, default: Untitled)
- `workflow_schema_version` (string, optional, default: 1.0)
- `workflow_img_url` (string, optional, nullable)
- `workflow_description` (string, optional, nullable)
- `blocks` (list of Block-Output, optional)
- `notes` (list of WorkflowNote-Output, optional)
- `placeholders` (list of Placeholder-Output, optional)
- `tags` (list of string, optional)
- `is_tool` (boolean, optional, default: false)

### Identity

- `type` (enum, required)
  - Allowed values: `user`, `api_key`, `system`
- `details` (IdentityDetails, required)

### ValidationErrorLocItems

### EdgeUI

- `edge_type` (string, optional, default: plusSign)

### Dimensions

- `width` (integer, required)
- `height` (integer, required)

### Position

- `x` (integer, required)
- `y` (integer, required)

### BlockConfigItemBoolean

- `id` (string, required)
- `display_name` (string, required)
- `type` (enum, optional, default: boolean)
  - Allowed values: `boolean`
- `default_value` (boolean, optional, nullable)
- `value` (boolean, optional, nullable)

### BlockConfigItemJson

- `id` (string, required)
- `display_name` (string, required)
- `type` (enum, optional, default: json)
  - Allowed values: `json`
- `default_value` (string, optional, nullable)
- `value` (string, optional, nullable)

### BlockConfigItemNumber

- `id` (string, required)
- `display_name` (string, required)
- `type` (enum, optional, default: number)
  - Allowed values: `number`
- `default_value` (BlockConfigItemNumberDefaultValue, optional, nullable)
- `minimum_value` (BlockConfigItemNumberMinimumValue, optional, nullable)
- `maximum_value` (BlockConfigItemNumberMaximumValue, optional, nullable)
- `value` (BlockConfigItemNumberValue, optional, nullable)

### BlockConfigItemSelect

- `id` (string, required)
- `display_name` (string, required)
- `options` (list of SelectOptionItem, required)
- `type` (enum, optional, default: select)
  - Allowed values: `select`
- `selected_option` (integer, optional, nullable)
- `value` (string, optional, nullable)

### BlockConfigItemTextShort

- `id` (string, required)
- `display_name` (string, required)
- `type` (enum, optional, default: text-short)
  - Allowed values: `text-short`
- `default_value` (string, optional, nullable)
- `value` (string, optional, nullable)

### BlockConfigItemTextLong

- `id` (string, required)
- `display_name` (string, required)
- `type` (enum, optional, default: text-long)
  - Allowed values: `text-long`
- `default_value` (string, optional, nullable)
- `value` (BlockConfigItemTextLongValue, optional, nullable)

### BlockConfigItemLlm

- `id` (string, required)
- `display_name` (string, required)
- `type` (enum, optional, default: prompt)
  - Allowed values: `prompt`
- `value` (list of Prompt, optional, nullable)

### Block-Output

- `block_archetype_id` (string, required)
- `block_display_name` (string, required)
- `block_id` (string, required)
- `block_inputs` (BlockOutputBlockInputs, optional)
- `is_output` (boolean, optional, default: false)
- `dependencies` (list of Dependency, optional)
- `input_schema` (BlockOutputInputSchema, optional)
- `ui` (NodeUI, optional)
- `trigger_config` (BlockOutputTriggerConfig, optional, nullable)
- `ignore_error` (boolean, optional, default: false) — If true, will continue down the branch of the failed block
- `block_config` (list of BlockOutputBlockConfigItems, optional, deprecated)
- `output_schema` (list of any, optional, deprecated)

### WorkflowNote-Output

- `id` (string, required)
- `bgColor` (string, required)
- `content` (string, optional, default: )
- `author` (string, optional, default: Your name)
- `ui` (NodeUI, optional)

### Placeholder-Output

- `block_id` (string, required)
- `type` (enum, required)
  - Allowed values: `triggerPlaceholder`, `blockPlaceholder`
- `ui` (NodeUI, optional)
- `dependencies` (list of Dependency, optional)

### IdentityDetails

### BlockConfigItemNumberDefaultValue

### BlockConfigItemNumberMinimumValue

### BlockConfigItemNumberMaximumValue

### BlockConfigItemNumberValue

### SelectOptionItem

- `name` (string, required)
- `id` (string, optional)
- `color_hex` (string, optional, nullable)

### BlockConfigItemTextLongValue

### Prompt

- `id` (string, required)
- `role` (enum, required)
  - Allowed values: `assistant`, `user`, `system`
- `content` (string, required)

### BlockOutputBlockInputs

### BlockOutputInputSchema

### BlockOutputTriggerConfig

### BlockOutputBlockConfigItems

### UserIdentity

- `user_id` (string, required)
- `org_id` (string, required)
- `scout_organization_id` (string, required)
- `email` (UserIdentityEmail, required)

### ApiKeyIdentity

- `api_key` (ApiKeyIdentityApiKey, optional)

### UserIdentityEmail

### ApiKeyIdentityApiKey

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "workflow_config": {
      "workflow_display_name": "Customer Onboarding Workflow",
      "workflow_schema_version": "1.0",
      "workflow_img_url": "https://cdn.scoutos.com/workflows/onboarding.png",
      "workflow_description": "Automated workflow for onboarding new customers efficiently.",
      "blocks": [
        {
          "block_archetype_id": "email_sender_v2",
          "block_display_name": "Welcome Email Sender",
          "block_id": "block_001",
          "block_inputs": {},
          "is_output": false,
          "dependencies": [
            {
              "block_id": "block_000",
              "ui": {
                "edge_type": "plusSign"
              }
            }
          ],
          "input_schema": {},
          "ui": {
            "dimensions": {
              "width": 300,
              "height": 150
            },
            "position": {
              "x": 100,
              "y": 200
            }
          },
          "trigger_config": {},
          "ignore_error": false,
          "block_config": [
            {
              "id": "send_welcome_email",
              "display_name": "Send Welcome Email",
              "type": "boolean",
              "default_value": true,
              "value": true
            }
          ],
          "output_schema": [
            null
          ]
        }
      ],
      "notes": [
        {
          "id": "note_001",
          "bgColor": "#FFFACD",
          "content": "Ensure all customer data is verified before sending emails.",
          "author": "Jane Doe",
          "ui": {
            "dimensions": {
              "width": 250,
              "height": 100
            },
            "position": {
              "x": 50,
              "y": 50
            }
          }
        }
      ],
      "placeholders": [
        {
          "block_id": "block_002",
          "type": "triggerPlaceholder",
          "ui": {
            "dimensions": {
              "width": 100,
              "height": 100
            },
            "position": {
              "x": 400,
              "y": 300
            }
          },
          "dependencies": [
            {
              "block_id": "block_001",
              "ui": {
                "edge_type": "plusSign"
              }
            }
          ]
        }
      ],
      "tags": [
        "onboarding",
        "automation",
        "email"
      ],
      "is_tool": false
    },
    "last_updated_at": "2024-01-15T09:30:00Z",
    "created_at": "2024-01-15T09:30:00Z",
    "created_by": {
      "type": "user",
      "details": {
        "api_key": {}
      }
    },
    "last_updated_by": {
      "type": "user",
      "details": {
        "api_key": {}
      }
    },
    "revision_id": "rev_20240115_001",
    "workflow_id": "wf_20240115_001",
    "workflow_key": "onboarding_workflow_v2",
    "is_draft": false
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.scoutos.com/v2/workflows/revisions"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```typescript
import { ScoutClient } from "scoutos";

const client = new ScoutClient({ apiKey: "YOUR_API_KEY" });
await client.workflows.createRevision({
    workflow_id: "workflow_id",
    workflow_key: "workflow_key",
    body: {}
});

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.scoutos.com/v2/workflows/revisions"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.scoutos.com/v2/workflows/revisions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.scoutos.com/v2/workflows/revisions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.scoutos.com/v2/workflows/revisions', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.scoutos.com/v2/workflows/revisions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.scoutos.com/v2/workflows/revisions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```