Read a sandbox file
curl --request GET \
--url https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content \
--header 'Authorization: Bearer <token>'import requests
url = "https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content', 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://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"base": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
},
"binary": true,
"editable": false,
"editReason": "<string>",
"head": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
},
"path": "<string>",
"previousPath": "<string>",
"reviewHead": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
},
"size": 4503599627370495,
"status": "added",
"working": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Read a sandbox file
Returns read-only working-tree and comparison versions. Protected files such as .env and opencode.json are never accessible.
GET
/
api
/
public
/
v1
/
sandboxes
/
{sandboxId}
/
files
/
content
Read a sandbox file
curl --request GET \
--url https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content \
--header 'Authorization: Bearer <token>'import requests
url = "https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content', 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://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sparkles.dev/api/public/v1/sandboxes/{sandboxId}/files/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"base": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
},
"binary": true,
"editable": false,
"editReason": "<string>",
"head": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
},
"path": "<string>",
"previousPath": "<string>",
"reviewHead": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
},
"size": 4503599627370495,
"status": "added",
"working": {
"content": "<string>",
"hash": "<string>",
"ref": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Long-lived opaque API key minted by an approved user at /api. The secret is shown once, stored only as a SHA-256 digest, and disabled immediately when either the key or its API access grant is revoked.
Path Parameters
Pattern:
^c_[a-z2-9]{12}$Query Parameters
Required string length:
1 - 1000Maximum string length:
201Pattern:
^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$Response
The requested read-only file document
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
0 <= x <= 9007199254740991Available options:
added, deleted, modified, renamed, untracked Show child attributes
Show child attributes