Attach a file
curl --request POST \
--url https://sapi.withsutro.com/applications/{applicationId}/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-sutro-api-client: <api-key>' \
--data '
{
"projectLink": "<string>",
"pat": "<string>",
"type": "<string>"
}
'import requests
url = "https://sapi.withsutro.com/applications/{applicationId}/attachments"
payload = {
"projectLink": "<string>",
"pat": "<string>",
"type": "<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({projectLink: '<string>', pat: '<string>', type: '<string>'})
};
fetch('https://sapi.withsutro.com/applications/{applicationId}/attachments', 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}/attachments",
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([
'projectLink' => '<string>',
'pat' => '<string>',
'type' => '<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}/attachments"
payload := strings.NewReader("{\n \"projectLink\": \"<string>\",\n \"pat\": \"<string>\",\n \"type\": \"<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}/attachments")
.header("Authorization", "Bearer <token>")
.header("x-sutro-api-client", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectLink\": \"<string>\",\n \"pat\": \"<string>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sapi.withsutro.com/applications/{applicationId}/attachments")
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 \"projectLink\": \"<string>\",\n \"pat\": \"<string>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"attachmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}attachments
Attach a file
Attach a file
curl --request POST \
--url https://sapi.withsutro.com/applications/{applicationId}/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-sutro-api-client: <api-key>' \
--data '
{
"projectLink": "<string>",
"pat": "<string>",
"type": "<string>"
}
'import requests
url = "https://sapi.withsutro.com/applications/{applicationId}/attachments"
payload = {
"projectLink": "<string>",
"pat": "<string>",
"type": "<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({projectLink: '<string>', pat: '<string>', type: '<string>'})
};
fetch('https://sapi.withsutro.com/applications/{applicationId}/attachments', 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}/attachments",
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([
'projectLink' => '<string>',
'pat' => '<string>',
'type' => '<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}/attachments"
payload := strings.NewReader("{\n \"projectLink\": \"<string>\",\n \"pat\": \"<string>\",\n \"type\": \"<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}/attachments")
.header("Authorization", "Bearer <token>")
.header("x-sutro-api-client", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectLink\": \"<string>\",\n \"pat\": \"<string>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sapi.withsutro.com/applications/{applicationId}/attachments")
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 \"projectLink\": \"<string>\",\n \"pat\": \"<string>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"attachmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Builder authentication and authorization
A unique identifier for the API Client making a request
Path Parameters
Body
application/json
Sutro supports a wide range of attachments that can be used to help design and generate an application:
- Figma project (via file key or URL)
- LLM Prompts
- OpenAPI documents
- Other files
- Figma (URL)
- Figma (File key)
- OpenAPI Document
- LLM Prompt
A URL pointing to a Figma project
Example:
"https://figma.example.com/12345"
A Personal Access Token that has permission to access the given Figma project.
This will require the following scopes:
file_content:readfile_variables:readfile_metadata:read
Example:
"b08631ad-a4ec-4c27-9995-01287e83d565"
Allowed value:
"FIGMA"Response
The ID of the generated attachment
Example:
"b08631ad-a4ec-4c27-9995-01287e83d565"
Was this page helpful?
⌘I