Skip to main content

Overview

This quickstart guide shows you two ways to create your first backend with Sutro:
  • Studio: Use the visual interface to create backends without writing code
  • SLang: Write your backend definition in SLang and upload it to Sutro
Choose the approach that works best for you.

Before you begin

Tools

  • jq and curl

Security bundle

Download security-bundle.zip from the Sutro Console during onboarding. Extract it and run all commands from that directory. The bundle includes your API client credentials (apiClient.id, mtls.key, mtls.crt), the Sutro CA certificate (ca.crt), and a pre-generated Builder JWT (builder.jwt) valid for 7 days.
The test bundle creates a test builder for quick API testing, not for production. See How to Secure Connections for production setup.

Verify your connection

Test that your credentials work by calling the hello endpoint:
curl -H "Authorization: Bearer $(cat builder.jwt)" \
     -H "x-sutro-api-client: $(cat apiClient.id)" \
     --cacert ca.crt \
     --key mtls.key \
     --cert mtls.crt \
     "https://sapi.withsutro.com/hello"
You should see a response confirming your API client, Builder, and organization.

Option 1: Using Studio

Studio is the simplest way to get started. You can create and edit backends visually without writing any code.
1

Access Studio

Visit the Sutro Console and navigate to Studio. You’ll see an intuitive interface for building your backend.
2

Create your backend

Use Studio’s visual interface to:
  • Define entities and their relationships
  • Add actions and business logic
  • Configure security rules
  • See changes take effect immediately
3

Deploy

Once you’re satisfied with your backend, deploy it directly from Studio. Your backend will be generated and deployed automatically.

Option 2: Using SLang

If you prefer to define your backend in code, you can write it in SLang and upload it to Sutro.
1

Create a Project

Start by creating a Project to hold your SLang definition and application.Call POST /projects
curl -H "Content-Type: application/json" \
     -H "Authorization: Bearer $(cat builder.jwt)" \
     -H "x-sutro-api-client: $(cat apiClient.id)" \
     --cacert ca.crt \
     --key mtls.key \
     --cert mtls.crt \
     -X POST \
     -o project.json \
     -d '{
       "name": "My SLang Backend"
     }' \
     "https://sapi.withsutro.com/projects"
The project details are stored in project.json; refer to that file in upcoming steps.
2

Write your SLang definition

Create a SLang file that defines your backend. Here’s a simple example for a todo app:
entity User {
  name: text
  email: text
  todos: ToDo[]
}

entity ToDo {
  title: text
  description: text
  deadline: datetime
  status: text
  user: User
}

action createToDo(title: text, description: text, deadline: datetime, user: User) -> ToDo {
  create ToDo {
    title: title
    description: description
    deadline: deadline
    user: user
    status: "pending"
  }
}
Save this as backend.slang.
3

Create an Application

Create an Application within your project to hold your SLang definition.Call POST /projects/{projectId}/applications
curl -H "Content-Type: application/json" \
     -H "Authorization: Bearer $(cat builder.jwt)" \
     -H "x-sutro-api-client: $(cat apiClient.id)" \
     --cacert ca.crt \
     --key mtls.key \
     --cert mtls.crt \
     -X POST \
     -o application.json \
     -d '{
       "scode": {}
     }' \
     "https://sapi.withsutro.com/projects/$(jq -r '.id' < project.json)/applications"
The application details are stored in application.json.
4

Upload your SLang definition

Upload your SLang file to the application.Call PUT /applications/{applicationId}/scode
curl -H "Content-Type: text/plain" \
     -H "Authorization: Bearer $(cat builder.jwt)" \
     -H "x-sutro-api-client: $(cat apiClient.id)" \
     --cacert ca.crt \
     --key mtls.key \
     --cert mtls.crt \
     -X PUT \
     --data-binary @backend.slang \
     "https://sapi.withsutro.com/applications/$(jq -r '.id' < application.json)/scode"
Your SLang definition is now uploaded and ready to generate.
5

Generate and deploy

Generate your backend from the SLang definition and deploy it.Call POST /applications/{applicationId}/generate to generate, then POST /applications/{applicationId}/deployment to deploy.
# Generate
curl -H "Authorization: Bearer $(cat builder.jwt)" \
     -H "x-sutro-api-client: $(cat apiClient.id)" \
     --cacert ca.crt \
     --key mtls.key \
     --cert mtls.crt \
     -X POST \
     "https://sapi.withsutro.com/applications/$(jq -r '.id' < application.json)/generate"

# Wait for generation to complete, then deploy
curl -H "Authorization: Bearer $(cat builder.jwt)" \
     -H "x-sutro-api-client: $(cat apiClient.id)" \
     --cacert ca.crt \
     --key mtls.key \
     --cert mtls.crt \
     -X POST \
     -o deployment.json \
     "https://sapi.withsutro.com/applications/$(jq -r '.id' < application.json)/deployment"
Your backend is now generated and deployed!
Congratulations! You’ve created your first backend. Your backend is now running and ready to use.

Next steps