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.

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 Studio and 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

Publish

Once you’re satisfied with your backend, publish it directly from Studio. Your backend will be published 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.

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.

Steps

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 Todo
  fields
    title: TEXT?
    description: TEXT?
    deadline: DATE_TIME?
    status: TEXT?

action CreateTodoServerAction(title: TEXT, description: TEXT, deadline: DATE_TIME, status: TEXT): Todo
  description "Create a new Todo."
  body
    todo := create Todo {
      title := title
      description := description
      deadline := deadline
      status := status
    }
    return todo

action GetTodoServerAction(id: TEXT): Todo
  description "Get a Todo by ID."
  body
    todo := single Todo where @id == id
    return todo

trigger CreateTodoServerAction on HttpRequest
  description "POST endpoint to create a new Todo."
  endpoint POST /todos
  arguments
    title := @request.body.title
    description := @request.body.description
    deadline := @request.body.deadline
    status := @request.body.status

trigger GetTodoServerAction on HttpRequest
  description "GET endpoint to retrieve a single Todo."
  endpoint GET /todos/{id}
  arguments
    id := @request.path.id
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 publish.
5

Publish

Publish your backend from the SLang definition.
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)/publish"
Your backend is now published! Once publishing completes, your API will be accessible at:
https://{applicationId}.app.withsutro.com/api/v{version}/
Replace {applicationId} with your application ID (from application.json) and {version} with the published version number in full semver format (e.g., v1.0.1 for the first publish).
Congratulations! You’ve created your first backend. Your backend is now running and ready to use.

Next steps