Skip to main content
Edit an application using natural language
curl --request POST \
  --url https://sapi.withsutro.com/applications/{applicationId}/slang-edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-sutro-api-client: <api-key>' \
  --data '
{
  "prompt": "<string>"
}
'
import requests

url = "https://sapi.withsutro.com/applications/{applicationId}/slang-edit"

payload = { "prompt": "<string>" }
headers = {
    "Authorization": "Bearer <token>",
    "x-sutro-api-client": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'x-sutro-api-client': '<api-key>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({prompt: '<string>'})
};

fetch('https://sapi.withsutro.com/applications/{applicationId}/slang-edit', 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://sapi.withsutro.com/applications/{applicationId}/slang-edit",
  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([
    'prompt' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "x-sutro-api-client: <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://sapi.withsutro.com/applications/{applicationId}/slang-edit"

	payload := strings.NewReader("{\n  \"prompt\": \"<string>\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("x-sutro-api-client", "<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://sapi.withsutro.com/applications/{applicationId}/slang-edit")
  .header("Authorization", "Bearer <token>")
  .header("x-sutro-api-client", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"prompt\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://sapi.withsutro.com/applications/{applicationId}/slang-edit")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-sutro-api-client"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"prompt\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "implementationJobId": "<string>",
  "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {},
  "errorMessage": "<string>",
  "errorStack": "<string>",
  "startedAt": "<string>",
  "completedAt": "<string>"
}

Authorizations

Authorization
string
header
required

Builder authentication and authorization

x-sutro-api-client
string
header
required

A unique identifier for the API Client making a request

Path Parameters

applicationId
string<uuid>
required

Body

application/json
prompt
string
required

The natural language edit instruction

Response

Edit job accepted and queued for processing

id
string<uuid>
required

The job ID

implementationJobId
string
required

The implementation job ID

jobType
enum<string>
required

The type of job

Available options:
figma_code_generation,
application_generation,
follow_up_change,
slang_edit,
test
status
enum<string>
required

The current status of the job

Available options:
queued,
active,
completed,
failed,
cancelled
customerId
string<uuid>
required

The customer ID

projectId
string<uuid>
required

The project ID

metadata
object

Job-specific metadata (structure depends on jobType)

errorMessage
string | null

Error message if the job failed

errorStack
string | null

Error stack trace if the job failed

startedAt
string | null

When the job started

completedAt
string | null

When the job completed