API Reference List Templates
List Templates
The starter templates for a project written in Syntext, with their preset and pages.
Session token
The starters you can create a project written in Syntext from. Pass a template's id as template to Create Project.
Note
Any signed-in user, with a session JWT. The response is the same for everyone and may be cached for 5 minutes.
Templates
| id | Name | Preset | Pages |
|---|---|---|---|
help-center | Help center | Paper | Create your account, first steps, billing and plans, common issues, contact support |
product-guides | Product guides | Orbit | Quickstart, core concepts, integrations, invite your team, changelog |
handbook | Handbook | Margin | Mission and values, how we work, onboarding, time off, communication |
developer-docs | Developer docs | Workbench | Quickstart, authentication, errors, pagination, changelog |
blank | Blank | Plain | Write your first page, organize the sidebar, publish your site |
Each also has a home page (index.mdx) and a syntext.json with your project's name.
Response — 200 OK
pages lists every page but the home page, with its title. preset is the preset the site starts on.
Was this page helpful? Yes No
Previous
Next
Request
bashJavaScriptPythonGoRubyPHPJavaC#bash
curl https://api.syntext.dev/v1/projects/templates \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
const response = await fetch('https://api.syntext.dev/v1/projects/templates', {
method: 'GET',
headers: {
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIs...',
},
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.syntext.dev/v1/projects/templates"
headers = {
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIs...",
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.syntext.dev/v1/projects/templates", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzI1NiIs...")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.syntext.dev/v1/projects/templates")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer eyJhbGciOiJIUzI1NiIs..."
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.syntext.dev/v1/projects/templates',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer eyJhbGciOiJIUzI1NiIs...',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.syntext.dev/v1/projects/templates"))
.header("Authorization", "Bearer eyJhbGciOiJIUzI1NiIs...")
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.syntext.dev/v1/projects/templates");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer eyJhbGciOiJIUzI1NiIs...");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200OK
{
"data": [
{
"id": "help-center",
"label": "Help center",
"description": "Answers and how-tos for your customers, with search and a support panel.",
"preset": "paper",
"pages": [
{ "path": "account/billing-and-plans.mdx", "title": "Billing and plans" },
{ "path": "contact-support.mdx", "title": "Contact support" }
]
}
]
}