Propose a new version of a Library widget for review instead of publishing it (agents use this). Requires --execute.
curl --request POST \
--url http://localhost:3000/api/v1/widgets/propose \
--header 'Content-Type: application/json' \
--data '
{
"dir": "<string>",
"draft": true,
"execute": true,
"name": "<string>",
"note": "<string>",
"rebase": true,
"scope": "<string>",
"slug": "<string>",
"update": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/widgets/propose"
payload = {
"dir": "<string>",
"draft": True,
"execute": True,
"name": "<string>",
"note": "<string>",
"rebase": True,
"scope": "<string>",
"slug": "<string>",
"update": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dir: '<string>',
draft: true,
execute: true,
name: '<string>',
note: '<string>',
rebase: true,
scope: '<string>',
slug: '<string>',
update: '<string>'
})
};
fetch('http://localhost:3000/api/v1/widgets/propose', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/widgets/propose",
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([
'dir' => '<string>',
'draft' => true,
'execute' => true,
'name' => '<string>',
'note' => '<string>',
'rebase' => true,
'scope' => '<string>',
'slug' => '<string>',
'update' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/v1/widgets/propose"
payload := strings.NewReader("{\n \"dir\": \"<string>\",\n \"draft\": true,\n \"execute\": true,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"rebase\": true,\n \"scope\": \"<string>\",\n \"slug\": \"<string>\",\n \"update\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/v1/widgets/propose")
.header("Content-Type", "application/json")
.body("{\n \"dir\": \"<string>\",\n \"draft\": true,\n \"execute\": true,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"rebase\": true,\n \"scope\": \"<string>\",\n \"slug\": \"<string>\",\n \"update\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/widgets/propose")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dir\": \"<string>\",\n \"draft\": true,\n \"execute\": true,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"rebase\": true,\n \"scope\": \"<string>\",\n \"slug\": \"<string>\",\n \"update\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"baseVersion": 123,
"created": true,
"currentVersion": 123,
"diagnostics": [
{
"code": "<string>",
"column": 123,
"file": "<string>",
"line": 123,
"message": "<string>",
"severity": "error"
}
],
"next": "<string>",
"number": 123,
"proposal": {
"author": {
"agentId": "<string>",
"name": "<string>",
"self": true
},
"baseVersion": 123,
"can": {
"edit": true,
"publish": true,
"reject": true,
"submit": true,
"withdraw": true
},
"contentHash": "<string>",
"createdAt": "<string>",
"currentVersion": 123,
"decidedAt": "<string>",
"decidedBy": {
"name": "<string>"
},
"decisionReason": "<string>",
"description": "<string>",
"externalAllowed": true,
"fileCount": 123,
"name": "<string>",
"note": "<string>",
"number": 123,
"openComments": 123,
"proposedAt": "<string>",
"publishedVersion": 123,
"ref": "<string>",
"reviewUrl": "<string>",
"round": 123,
"stale": true,
"status": "draft",
"totalBytes": 123,
"updatedAt": "<string>"
},
"ref": "<string>",
"round": 123,
"stale": true,
"status": "draft",
"success": true
}widgets
Propose a new version of a Library widget for review instead of publishing it (agents use this). Requires --execute.
POST
/
api
/
v1
/
widgets
/
propose
Propose a new version of a Library widget for review instead of publishing it (agents use this). Requires --execute.
curl --request POST \
--url http://localhost:3000/api/v1/widgets/propose \
--header 'Content-Type: application/json' \
--data '
{
"dir": "<string>",
"draft": true,
"execute": true,
"name": "<string>",
"note": "<string>",
"rebase": true,
"scope": "<string>",
"slug": "<string>",
"update": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/widgets/propose"
payload = {
"dir": "<string>",
"draft": True,
"execute": True,
"name": "<string>",
"note": "<string>",
"rebase": True,
"scope": "<string>",
"slug": "<string>",
"update": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dir: '<string>',
draft: true,
execute: true,
name: '<string>',
note: '<string>',
rebase: true,
scope: '<string>',
slug: '<string>',
update: '<string>'
})
};
fetch('http://localhost:3000/api/v1/widgets/propose', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/widgets/propose",
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([
'dir' => '<string>',
'draft' => true,
'execute' => true,
'name' => '<string>',
'note' => '<string>',
'rebase' => true,
'scope' => '<string>',
'slug' => '<string>',
'update' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/v1/widgets/propose"
payload := strings.NewReader("{\n \"dir\": \"<string>\",\n \"draft\": true,\n \"execute\": true,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"rebase\": true,\n \"scope\": \"<string>\",\n \"slug\": \"<string>\",\n \"update\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/v1/widgets/propose")
.header("Content-Type", "application/json")
.body("{\n \"dir\": \"<string>\",\n \"draft\": true,\n \"execute\": true,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"rebase\": true,\n \"scope\": \"<string>\",\n \"slug\": \"<string>\",\n \"update\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/widgets/propose")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dir\": \"<string>\",\n \"draft\": true,\n \"execute\": true,\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"rebase\": true,\n \"scope\": \"<string>\",\n \"slug\": \"<string>\",\n \"update\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"baseVersion": 123,
"created": true,
"currentVersion": 123,
"diagnostics": [
{
"code": "<string>",
"column": 123,
"file": "<string>",
"line": 123,
"message": "<string>",
"severity": "error"
}
],
"next": "<string>",
"number": 123,
"proposal": {
"author": {
"agentId": "<string>",
"name": "<string>",
"self": true
},
"baseVersion": 123,
"can": {
"edit": true,
"publish": true,
"reject": true,
"submit": true,
"withdraw": true
},
"contentHash": "<string>",
"createdAt": "<string>",
"currentVersion": 123,
"decidedAt": "<string>",
"decidedBy": {
"name": "<string>"
},
"decisionReason": "<string>",
"description": "<string>",
"externalAllowed": true,
"fileCount": 123,
"name": "<string>",
"note": "<string>",
"number": 123,
"openComments": 123,
"proposedAt": "<string>",
"publishedVersion": 123,
"ref": "<string>",
"reviewUrl": "<string>",
"round": 123,
"stale": true,
"status": "draft",
"totalBytes": 123,
"updatedAt": "<string>"
},
"ref": "<string>",
"round": 123,
"stale": true,
"status": "draft",
"success": true
}Body
application/json
Widget folder holding widget.html (relative to your current directory)
Save a draft only you and the scope's reviewers see; do not submit
Confirm the proposal (without it, print the plan and exit 3)
Display name (default: widget.json name, else the slug)
Note for the reviewers, at most 500 characters
With --update: move the proposal onto the version published now (read it first)
org, or a Console project slug (default: the known project)
Library slug (default: the folder name)
Replace the content of your open proposal with this number
Response
Success — body conforms to the @Returns schema.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
draft, proposed, published, superseded, rejected, withdrawn