Procedures
Store a sequence of queries under a name and run it in one call, with parameters.
Background and examples: Custom queries and procedures
List procedures
/v1/procedures
Lists the procedures of a project.
Parameters
-
projectuuid query required The GUID of the project.
Responses
- 200 Success
Request
curl -X GET 'https://api.stellards.io/v1/procedures?project=PROJECT_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/v1/procedures?project=PROJECT_ID", {
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.get(
"https://api.stellards.io/v1/procedures?project=PROJECT_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.GetAsync("https://api.stellards.io/v1/procedures?project=PROJECT_ID");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Get('https://api.stellards.io/v1/procedures?project=PROJECT_ID');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": [
{
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
]
}
Create a procedure
/v1/procedures
Creates a procedure. Every step is compiled first; the response lists every problem.
Parameters
-
projectuuid query required The GUID of the project.
Request body application/json
The procedure.
-
namestring required The procedure's name, unique in the project; you call it by this name.
-
descriptionstring A description for your own reference.
-
parametersobject[] The parameters callers pass, each with a name, a SQL type, whether it is required and an optional default value.
-
stepsobject[] The SELECT statements to run in order, each with a name; the result has one entry per step.
-
versioninteger On a replace: the version you edited, so you are told when someone saved a newer one.
Responses
- 201 The procedure was created.
- 400 The procedure isn't valid, the name is taken or the tier's limit is reached.
- 403 The caller can't create tables, or the tier doesn't include procedures.
Request
curl -X POST 'https://api.stellards.io/v1/procedures?project=PROJECT_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
]
}'
const response = await fetch("https://api.stellards.io/v1/procedures?project=PROJECT_ID", {
method: "POST",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
]
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.post(
"https://api.stellards.io/v1/procedures?project=PROJECT_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": True,
},
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer",
},
],
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
]
}
""", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.stellards.io/v1/procedures?project=PROJECT_ID", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "OrdersOfCustomer",' +
' "parameters": [' +
' {' +
' "name": "customer",' +
' "type": "bigint",' +
' "required": true' +
' }' +
' ],' +
' "steps": [' +
' {' +
' "name": "orders",' +
' "sql": "select id, Total from Orders where CustomerId = @customer"' +
' }' +
' ]' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Post('https://api.stellards.io/v1/procedures?project=PROJECT_ID', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 201
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
}
Get a procedure
/v1/procedures/{name}
Gets one procedure.
Parameters
-
projectuuid query required The GUID of the project.
-
namestring path required The name of the procedure.
Responses
- 200 Success
- 404 Not Found
Request
curl -X GET 'https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID", {
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.get(
"https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.GetAsync("https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Get('https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
}
Replace a procedure
/v1/procedures/{name}
Replaces a procedure and increases its version.
Parameters
-
projectuuid query required The GUID of the project.
-
namestring path required The current name of the procedure.
Request body application/json
The new procedure. Pass the version you edited to be told when someone saved a newer one.
-
namestring required The procedure's name, unique in the project; you call it by this name.
-
descriptionstring A description for your own reference.
-
parametersobject[] The parameters callers pass, each with a name, a SQL type, whether it is required and an optional default value.
-
stepsobject[] The SELECT statements to run in order, each with a name; the result has one entry per step.
-
versioninteger On a replace: the version you edited, so you are told when someone saved a newer one.
Responses
- 200 Success
- 400 Bad Request
- 409 Someone saved a newer version after the one in the request.
Request
curl -X PUT 'https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"version": 1
}'
const response = await fetch("https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID", {
method: "PUT",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"version": 1
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.put(
"https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": True,
},
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer",
},
],
"version": 1,
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"version": 1
}
""", Encoding.UTF8, "application/json");
var response = await client.PutAsync("https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "OrdersOfCustomer",' +
' "description": "Every order of one customer",' +
' "parameters": [' +
' {' +
' "name": "customer",' +
' "type": "bigint",' +
' "required": true' +
' }' +
' ],' +
' "steps": [' +
' {' +
' "name": "orders",' +
' "sql": "select id, Total from Orders where CustomerId = @customer"' +
' }' +
' ],' +
' "version": 1' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Put('https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
}
Delete a procedure
/v1/procedures/{name}
Deletes a procedure.
Parameters
-
projectuuid query required The GUID of the project.
-
namestring path required The name of the procedure.
Responses
- 200 Success
- 404 Not Found
Request
curl -X DELETE 'https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID", {
method: "DELETE",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.delete(
"https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.DeleteAsync("https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Delete('https://api.stellards.io/v1/procedures/PROCEDURE_NAME?project=PROJECT_ID');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true
}
Run a procedure
/v1/procedures/{name}/execute
Runs a procedure and returns one result per step.
Parameters
-
projectuuid query required The GUID of the project.
-
namestring path required The name of the procedure.
Request body application/json
The parameter values, for example { "parameters": { "customer": 42 } }.
-
parametersobject The parameter values, by name.
Responses
- 200 Success
- 400 A parameter is missing or has the wrong type, a step no longer compiles, or a step failed or took too long.
- 403 The tier doesn't include custom queries or the caller can't read a table a step uses.
- 429 Too many custom queries are running for the project.
Request
curl -X POST 'https://api.stellards.io/v1/procedures/PROCEDURE_NAME/execute?project=PROJECT_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"parameters": {
"customer": 42
}
}'
const response = await fetch("https://api.stellards.io/v1/procedures/PROCEDURE_NAME/execute?project=PROJECT_ID", {
method: "POST",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"parameters": {
"customer": 42
}
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.post(
"https://api.stellards.io/v1/procedures/PROCEDURE_NAME/execute?project=PROJECT_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"parameters": {
"customer": 42,
},
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"parameters": {
"customer": 42
}
}
""", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.stellards.io/v1/procedures/PROCEDURE_NAME/execute?project=PROJECT_ID", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "parameters": {' +
' "customer": 42' +
' }' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Post('https://api.stellards.io/v1/procedures/PROCEDURE_NAME/execute?project=PROJECT_ID', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"version": 1,
"results": [
{
"columns": [
{
"name": null,
"type": null
}
],
"rows": [
{}
],
"count": 1,
"truncated": false,
"durationMs": 38,
"step": "orders"
}
],
"durationMs": 38
}
}
List procedures Path-style route
/project/{project}/procedures
Lists the procedures of a project.
Parameters
-
projectuuid path required The GUID of the project. Provided as a route parameter.
Responses
- 200 Success
Request
curl -X GET 'https://api.stellards.io/project/PROJECT_ID/procedures' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/procedures", {
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.get(
"https://api.stellards.io/project/PROJECT_ID/procedures",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.GetAsync("https://api.stellards.io/project/PROJECT_ID/procedures");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Get('https://api.stellards.io/project/PROJECT_ID/procedures');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": [
{
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
]
}
Create a procedure Path-style route
/project/{project}/procedures
Creates a procedure. Every step is compiled first; the response lists every problem.
Parameters
-
projectuuid path required The GUID of the project. Provided as a route parameter.
Request body application/json
The procedure.
-
namestring required The procedure's name, unique in the project; you call it by this name.
-
descriptionstring A description for your own reference.
-
parametersobject[] The parameters callers pass, each with a name, a SQL type, whether it is required and an optional default value.
-
stepsobject[] The SELECT statements to run in order, each with a name; the result has one entry per step.
-
versioninteger On a replace: the version you edited, so you are told when someone saved a newer one.
Responses
- 201 The procedure was created.
- 400 The procedure isn't valid, the name is taken or the tier's limit is reached.
- 403 The caller can't create tables, or the tier doesn't include procedures.
Request
curl -X POST 'https://api.stellards.io/project/PROJECT_ID/procedures' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
]
}'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/procedures", {
method: "POST",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
]
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.post(
"https://api.stellards.io/project/PROJECT_ID/procedures",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": True,
},
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer",
},
],
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "OrdersOfCustomer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
]
}
""", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.stellards.io/project/PROJECT_ID/procedures", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "OrdersOfCustomer",' +
' "parameters": [' +
' {' +
' "name": "customer",' +
' "type": "bigint",' +
' "required": true' +
' }' +
' ],' +
' "steps": [' +
' {' +
' "name": "orders",' +
' "sql": "select id, Total from Orders where CustomerId = @customer"' +
' }' +
' ]' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Post('https://api.stellards.io/project/PROJECT_ID/procedures', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 201
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
}
Get a procedure Path-style route
/project/{project}/procedures/{name}
Gets one procedure.
Parameters
-
projectuuid path required The GUID of the project. Provided as a route parameter.
-
namestring path required The name of the procedure.
Responses
- 200 Success
- 404 Not Found
Request
curl -X GET 'https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME", {
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.get(
"https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.GetAsync("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Get('https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
}
Replace a procedure Path-style route
/project/{project}/procedures/{name}
Replaces a procedure and increases its version.
Parameters
-
projectuuid path required The GUID of the project. Provided as a route parameter.
-
namestring path required The current name of the procedure.
Request body application/json
The new procedure. Pass the version you edited to be told when someone saved a newer one.
-
namestring required The procedure's name, unique in the project; you call it by this name.
-
descriptionstring A description for your own reference.
-
parametersobject[] The parameters callers pass, each with a name, a SQL type, whether it is required and an optional default value.
-
stepsobject[] The SELECT statements to run in order, each with a name; the result has one entry per step.
-
versioninteger On a replace: the version you edited, so you are told when someone saved a newer one.
Responses
- 200 Success
- 400 Bad Request
- 409 Someone saved a newer version after the one in the request.
Request
curl -X PUT 'https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"version": 1
}'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME", {
method: "PUT",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"version": 1
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.put(
"https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": True,
},
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer",
},
],
"version": 1,
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "OrdersOfCustomer",
"description": "Every order of one customer",
"parameters": [
{
"name": "customer",
"type": "bigint",
"required": true
}
],
"steps": [
{
"name": "orders",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"version": 1
}
""", Encoding.UTF8, "application/json");
var response = await client.PutAsync("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "OrdersOfCustomer",' +
' "description": "Every order of one customer",' +
' "parameters": [' +
' {' +
' "name": "customer",' +
' "type": "bigint",' +
' "required": true' +
' }' +
' ],' +
' "steps": [' +
' {' +
' "name": "orders",' +
' "sql": "select id, Total from Orders where CustomerId = @customer"' +
' }' +
' ],' +
' "version": 1' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Put('https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"description": "Everyone who placed an order",
"version": 1,
"createdAt": "2026-11-02T09:30:00Z",
"updatedAt": "2026-11-02T09:30:00Z",
"parameters": [
{
"name": "Customers",
"type": "NVarChar(255)",
"required": true,
"defaultValue": null
}
],
"steps": [
{
"name": "Customers",
"sql": "select id, Total from Orders where CustomerId = @customer"
}
],
"problems": []
}
}
Delete a procedure Path-style route
/project/{project}/procedures/{name}
Deletes a procedure.
Parameters
-
projectuuid path required The GUID of the project. Provided as a route parameter.
-
namestring path required The name of the procedure.
Responses
- 200 Success
- 404 Not Found
Request
curl -X DELETE 'https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME", {
method: "DELETE",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.delete(
"https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.DeleteAsync("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Delete('https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true
}
Run a procedure Path-style route
/project/{project}/procedures/{name}/execute
Runs a procedure and returns one result per step.
Parameters
-
projectuuid path required The GUID of the project. Provided as a route parameter.
-
namestring path required The name of the procedure.
Request body application/json
The parameter values, for example { "parameters": { "customer": 42 } }.
-
parametersobject The parameter values, by name.
Responses
- 200 Success
- 400 A parameter is missing or has the wrong type, a step no longer compiles, or a step failed or took too long.
- 403 The tier doesn't include custom queries or the caller can't read a table a step uses.
- 429 Too many custom queries are running for the project.
Request
curl -X POST 'https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME/execute' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"parameters": {
"customer": 42
}
}'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME/execute", {
method: "POST",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"parameters": {
"customer": 42
}
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.post(
"https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME/execute",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"parameters": {
"customer": 42,
},
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"parameters": {
"customer": 42
}
}
""", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME/execute", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "parameters": {' +
' "customer": 42' +
' }' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Post('https://api.stellards.io/project/PROJECT_ID/procedures/PROCEDURE_NAME/execute', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"name": "Customers",
"version": 1,
"results": [
{
"columns": [
{
"name": null,
"type": null
}
],
"rows": [
{}
],
"count": 1,
"truncated": false,
"durationMs": 38,
"step": "orders"
}
],
"durationMs": 38
}
}