Skip to main content
POST
/
api
/
conversations
New Conversation
curl --request POST \
  --url https://app.all-hands.dev/api/conversations \
  --header 'Content-Type: application/json' \
  --header 'X-Session-API-Key: <api-key>' \
  --data '
{
  "repository": "<string>",
  "selected_branch": "<string>",
  "initial_user_msg": "<string>",
  "image_urls": [
    "<string>"
  ],
  "replay_json": "<string>",
  "suggested_task": {
    "repo": "<string>",
    "issue_number": 123,
    "title": "<string>"
  },
  "create_microagent": {
    "repo": "<string>",
    "title": "<string>"
  },
  "conversation_instructions": "<string>",
  "mcp_config": {
    "sse_servers": [
      {
        "url": "<string>",
        "api_key": "<string>"
      }
    ],
    "stdio_servers": [
      {
        "name": "<string>",
        "command": "<string>",
        "args": [
          "<string>"
        ],
        "env": {}
      }
    ],
    "shttp_servers": [
      {
        "url": "<string>",
        "api_key": "<string>"
      }
    ]
  },
  "conversation_id": "<string>"
}
'
import requests

url = "https://app.all-hands.dev/api/conversations"

payload = {
    "repository": "<string>",
    "selected_branch": "<string>",
    "initial_user_msg": "<string>",
    "image_urls": ["<string>"],
    "replay_json": "<string>",
    "suggested_task": {
        "repo": "<string>",
        "issue_number": 123,
        "title": "<string>"
    },
    "create_microagent": {
        "repo": "<string>",
        "title": "<string>"
    },
    "conversation_instructions": "<string>",
    "mcp_config": {
        "sse_servers": [
            {
                "url": "<string>",
                "api_key": "<string>"
            }
        ],
        "stdio_servers": [
            {
                "name": "<string>",
                "command": "<string>",
                "args": ["<string>"],
                "env": {}
            }
        ],
        "shttp_servers": [
            {
                "url": "<string>",
                "api_key": "<string>"
            }
        ]
    },
    "conversation_id": "<string>"
}
headers = {
    "X-Session-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {'X-Session-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    repository: '<string>',
    selected_branch: '<string>',
    initial_user_msg: '<string>',
    image_urls: ['<string>'],
    replay_json: '<string>',
    suggested_task: {repo: '<string>', issue_number: 123, title: '<string>'},
    create_microagent: {repo: '<string>', title: '<string>'},
    conversation_instructions: '<string>',
    mcp_config: {
      sse_servers: [{url: '<string>', api_key: '<string>'}],
      stdio_servers: [{name: '<string>', command: '<string>', args: ['<string>'], env: {}}],
      shttp_servers: [{url: '<string>', api_key: '<string>'}]
    },
    conversation_id: '<string>'
  })
};

fetch('https://app.all-hands.dev/api/conversations', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://app.all-hands.dev/api/conversations",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'repository' => '<string>',
    'selected_branch' => '<string>',
    'initial_user_msg' => '<string>',
    'image_urls' => [
        '<string>'
    ],
    'replay_json' => '<string>',
    'suggested_task' => [
        'repo' => '<string>',
        'issue_number' => 123,
        'title' => '<string>'
    ],
    'create_microagent' => [
        'repo' => '<string>',
        'title' => '<string>'
    ],
    'conversation_instructions' => '<string>',
    'mcp_config' => [
        'sse_servers' => [
                [
                                'url' => '<string>',
                                'api_key' => '<string>'
                ]
        ],
        'stdio_servers' => [
                [
                                'name' => '<string>',
                                'command' => '<string>',
                                'args' => [
                                                                '<string>'
                                ],
                                'env' => [
                                                                
                                ]
                ]
        ],
        'shttp_servers' => [
                [
                                'url' => '<string>',
                                'api_key' => '<string>'
                ]
        ]
    ],
    'conversation_id' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "X-Session-API-Key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

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

func main() {

	url := "https://app.all-hands.dev/api/conversations"

	payload := strings.NewReader("{\n  \"repository\": \"<string>\",\n  \"selected_branch\": \"<string>\",\n  \"initial_user_msg\": \"<string>\",\n  \"image_urls\": [\n    \"<string>\"\n  ],\n  \"replay_json\": \"<string>\",\n  \"suggested_task\": {\n    \"repo\": \"<string>\",\n    \"issue_number\": 123,\n    \"title\": \"<string>\"\n  },\n  \"create_microagent\": {\n    \"repo\": \"<string>\",\n    \"title\": \"<string>\"\n  },\n  \"conversation_instructions\": \"<string>\",\n  \"mcp_config\": {\n    \"sse_servers\": [\n      {\n        \"url\": \"<string>\",\n        \"api_key\": \"<string>\"\n      }\n    ],\n    \"stdio_servers\": [\n      {\n        \"name\": \"<string>\",\n        \"command\": \"<string>\",\n        \"args\": [\n          \"<string>\"\n        ],\n        \"env\": {}\n      }\n    ],\n    \"shttp_servers\": [\n      {\n        \"url\": \"<string>\",\n        \"api_key\": \"<string>\"\n      }\n    ]\n  },\n  \"conversation_id\": \"<string>\"\n}")

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

	req.Header.Add("X-Session-API-Key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://app.all-hands.dev/api/conversations")
  .header("X-Session-API-Key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"repository\": \"<string>\",\n  \"selected_branch\": \"<string>\",\n  \"initial_user_msg\": \"<string>\",\n  \"image_urls\": [\n    \"<string>\"\n  ],\n  \"replay_json\": \"<string>\",\n  \"suggested_task\": {\n    \"repo\": \"<string>\",\n    \"issue_number\": 123,\n    \"title\": \"<string>\"\n  },\n  \"create_microagent\": {\n    \"repo\": \"<string>\",\n    \"title\": \"<string>\"\n  },\n  \"conversation_instructions\": \"<string>\",\n  \"mcp_config\": {\n    \"sse_servers\": [\n      {\n        \"url\": \"<string>\",\n        \"api_key\": \"<string>\"\n      }\n    ],\n    \"stdio_servers\": [\n      {\n        \"name\": \"<string>\",\n        \"command\": \"<string>\",\n        \"args\": [\n          \"<string>\"\n        ],\n        \"env\": {}\n      }\n    ],\n    \"shttp_servers\": [\n      {\n        \"url\": \"<string>\",\n        \"api_key\": \"<string>\"\n      }\n    ]\n  },\n  \"conversation_id\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://app.all-hands.dev/api/conversations")

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

request = Net::HTTP::Post.new(url)
request["X-Session-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"repository\": \"<string>\",\n  \"selected_branch\": \"<string>\",\n  \"initial_user_msg\": \"<string>\",\n  \"image_urls\": [\n    \"<string>\"\n  ],\n  \"replay_json\": \"<string>\",\n  \"suggested_task\": {\n    \"repo\": \"<string>\",\n    \"issue_number\": 123,\n    \"title\": \"<string>\"\n  },\n  \"create_microagent\": {\n    \"repo\": \"<string>\",\n    \"title\": \"<string>\"\n  },\n  \"conversation_instructions\": \"<string>\",\n  \"mcp_config\": {\n    \"sse_servers\": [\n      {\n        \"url\": \"<string>\",\n        \"api_key\": \"<string>\"\n      }\n    ],\n    \"stdio_servers\": [\n      {\n        \"name\": \"<string>\",\n        \"command\": \"<string>\",\n        \"args\": [\n          \"<string>\"\n        ],\n        \"env\": {}\n      }\n    ],\n    \"shttp_servers\": [\n      {\n        \"url\": \"<string>\",\n        \"api_key\": \"<string>\"\n      }\n    ]\n  },\n  \"conversation_id\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "<string>",
  "conversation_id": "<string>",
  "message": "<string>"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

X-Session-API-Key
string
header
required

Body

application/json
repository
string | null
git_provider
enum<string> | null
Available options:
github,
gitlab,
bitbucket,
enterprise_sso
selected_branch
string | null
initial_user_msg
string | null
image_urls
string[] | null
replay_json
string | null
suggested_task
SuggestedTask · object | null
create_microagent
CreateMicroagent · object | null
conversation_instructions
string | null
mcp_config
MCPConfig · object | null

Configuration for MCP (Message Control Protocol) settings.

Attributes: sse_servers: List of MCP SSE server configs stdio_servers: List of MCP stdio server configs. These servers will be added to the MCP Router running inside runtime container. shttp_servers: List of MCP HTTP server configs.

conversation_id
string

Response

Successful Response

status
string
required
conversation_id
string
required
message
string | null
conversation_status
enum<string> | null
Available options:
STARTING,
RUNNING,
STOPPED