curl -X POST "https://api.signalmd.dev/v1/agents/6f1d2c3b-4a5e-4f60-8b7a-9c0d1e2f3a4b/drafts" \
-H "Authorization: Bearer $SIGNAL_API_KEY"import requests
url = "https://api.signalmd.dev/v1/agents/{agentId}/drafts"
payload = {
"title": "<string>",
"changes": [
{
"path": "<string>",
"text": "<string>",
"find": "<string>",
"replace": "<string>"
}
],
"rationale": "<string>",
"issueKey": "<string>",
"newCaseIds": ["3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"],
"goalId": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
changes: [{path: '<string>', text: '<string>', find: '<string>', replace: '<string>'}],
rationale: '<string>',
issueKey: '<string>',
newCaseIds: ['3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'],
goalId: '3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'
})
};
fetch('https://api.signalmd.dev/v1/agents/{agentId}/drafts', 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://api.signalmd.dev/v1/agents/{agentId}/drafts",
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([
'title' => '<string>',
'changes' => [
[
'path' => '<string>',
'text' => '<string>',
'find' => '<string>',
'replace' => '<string>'
]
],
'rationale' => '<string>',
'issueKey' => '<string>',
'newCaseIds' => [
'3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'
],
'goalId' => '3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.signalmd.dev/v1/agents/{agentId}/drafts"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"changes\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\",\n \"find\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"issueKey\": \"<string>\",\n \"newCaseIds\": [\n \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"goalId\": \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n}")
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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.signalmd.dev/v1/agents/{agentId}/drafts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"changes\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\",\n \"find\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"issueKey\": \"<string>\",\n \"newCaseIds\": [\n \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"goalId\": \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.signalmd.dev/v1/agents/{agentId}/drafts")
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 = "{\n \"title\": \"<string>\",\n \"changes\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\",\n \"find\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"issueKey\": \"<string>\",\n \"newCaseIds\": [\n \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"goalId\": \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n}"
response = http.request(request)
puts response.read_body{
"object": "draft",
"id": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"agentId": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"title": "<string>",
"rationale": "<string>",
"status": "draft",
"baseVersion": 123,
"baseHash": "<string>",
"draftHash": "<string>",
"revision": 123,
"stale": true,
"canPublish": true,
"publishBlockedReason": "<string>",
"newCaseIds": [
"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
],
"suiteGate": {
"mode": "ran",
"ok": true,
"reason": "no_suite_run",
"detail": "<string>",
"batchId": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}Create a draft
Saves a change to the live version’s prompt or flow text as a draft. Nothing reaches Retell. A draft for an issue whose cause is not established is refused with 409 cause_not_established.
curl -X POST "https://api.signalmd.dev/v1/agents/6f1d2c3b-4a5e-4f60-8b7a-9c0d1e2f3a4b/drafts" \
-H "Authorization: Bearer $SIGNAL_API_KEY"import requests
url = "https://api.signalmd.dev/v1/agents/{agentId}/drafts"
payload = {
"title": "<string>",
"changes": [
{
"path": "<string>",
"text": "<string>",
"find": "<string>",
"replace": "<string>"
}
],
"rationale": "<string>",
"issueKey": "<string>",
"newCaseIds": ["3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"],
"goalId": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
changes: [{path: '<string>', text: '<string>', find: '<string>', replace: '<string>'}],
rationale: '<string>',
issueKey: '<string>',
newCaseIds: ['3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'],
goalId: '3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'
})
};
fetch('https://api.signalmd.dev/v1/agents/{agentId}/drafts', 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://api.signalmd.dev/v1/agents/{agentId}/drafts",
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([
'title' => '<string>',
'changes' => [
[
'path' => '<string>',
'text' => '<string>',
'find' => '<string>',
'replace' => '<string>'
]
],
'rationale' => '<string>',
'issueKey' => '<string>',
'newCaseIds' => [
'3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'
],
'goalId' => '3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.signalmd.dev/v1/agents/{agentId}/drafts"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"changes\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\",\n \"find\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"issueKey\": \"<string>\",\n \"newCaseIds\": [\n \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"goalId\": \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n}")
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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.signalmd.dev/v1/agents/{agentId}/drafts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"changes\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\",\n \"find\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"issueKey\": \"<string>\",\n \"newCaseIds\": [\n \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"goalId\": \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.signalmd.dev/v1/agents/{agentId}/drafts")
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 = "{\n \"title\": \"<string>\",\n \"changes\": [\n {\n \"path\": \"<string>\",\n \"text\": \"<string>\",\n \"find\": \"<string>\",\n \"replace\": \"<string>\"\n }\n ],\n \"rationale\": \"<string>\",\n \"issueKey\": \"<string>\",\n \"newCaseIds\": [\n \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"goalId\": \"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f\"\n}"
response = http.request(request)
puts response.read_body{
"object": "draft",
"id": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"agentId": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"title": "<string>",
"rationale": "<string>",
"status": "draft",
"baseVersion": 123,
"baseHash": "<string>",
"draftHash": "<string>",
"revision": 123,
"stale": true,
"canPublish": true,
"publishBlockedReason": "<string>",
"newCaseIds": [
"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
],
"suiteGate": {
"mode": "ran",
"ok": true,
"reason": "no_suite_run",
"detail": "<string>",
"batchId": "3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}{
"error": {
"type": "not_found_error",
"code": "agent_not_found",
"message": "Agent not found.",
"param": null,
"requestId": "req_8c1f0e2b4a6d9e3f7a5c1b0d"
}
}Authorizations
An API key (sig_...), or a session token from the web app.
Path Parameters
The agent's id.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
Body
3 - 2001 - 20 elementsShow child attributes
Show child attributes
4000The id or key of the issue this draft fixes.
1 - 200The test cases written for this problem.
50^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
Response
The draft.
A draft, with its diff, its tests and why it can or cannot be published.
draft ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"3f1c2d4e-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
draft, testing, publishing, published, discarded The content hash of the draft's text: what a publish must confirm.
Bumped by every change to the text: what a publish must confirm.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Whether the whole accepted suite ran (and, for a key, passed) on this exact text.
Show child attributes
Show child attributes
Was this page helpful?