Projects API
A project groups your organization's sessions, profiles and API keys. These endpoints list your projects and get one of them. For the base URL and authentication, see API conventions. For the error codes, see Errors.
The first example is a complete program. The later examples use its client, and the ID of a project in PROJECT_ID (cURL), projectId (TypeScript), project_id (Python and Rust) or projectID (Go).
Endpoints
List projects
GET/v1/projects
Lists the projects that your API key reaches. An organization key gets every project in the organization, and a project key gets only its own project.
This endpoint takes no parameters.
Response
| Field | Type | Description |
|---|---|---|
projects | object[] | The projects. Each one is a project object, as in Get a project. |
See Projects.
curl https://api.steel.dev/v1/projects \
-H "steel-api-key: $STEEL_API_KEY"import Steel from "steel-sdk";
const client = new Steel();
const { projects } = await client.projects.list();
for (const project of projects) {
console.log(project.id, project.name);
}from steel import Steel
client = Steel()
response = client.projects.list()
for project in response.projects:
print(project.id, project.name)package main
import (
"context"
"fmt"
"log"
"github.com/steel-dev/sdk/go"
)
func main() {
if err := run(context.Background()); err != nil {
log.Fatal(err)
}
}
func run(ctx context.Context) error {
client := steel.NewClient()
response, err := client.Projects.List(ctx)
if err != nil {
return err
}
for _, project := range response.Projects {
fmt.Println(project.ID, project.Name)
}
return nil
}#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = steel_rs::Client::new();
let response = client.projects().list().await?;
for project in response.projects {
println!("{} {}", project.id, project.name);
}
Ok(())
}Get a project
GET/v1/projects/{id}
Returns one project.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) · path | Yes | The ID of the project. |
Response
| Field | Type | Description |
|---|---|---|
id | string (uuid) | The ID of the project. |
name | string | The name of the project. |
slug | string | Steel's short form of the name: lower-case letters, digits and hyphens, unique in the organization. |
isDefault | boolean | true for the organization's default project, which cannot be deleted. |
isProduction | boolean | true for a production project, false for a development project. |
promotedToProductionAt | string (date-time) or null | When the project became a production project. |
createdAt | string (date-time) | When the project was created. |
updatedAt | string (date-time) | When the project last changed. |
See Projects.
curl https://api.steel.dev/v1/projects/$PROJECT_ID \
-H "steel-api-key: $STEEL_API_KEY"const project = await client.projects.retrieve(projectId);
console.log(project.name, project.isDefault);project = client.projects.retrieve(project_id)
print(project.name, project.is_default)project, err := client.Projects.Get(ctx, projectID)
if err != nil {
return err
}
fmt.Println(project.Name, project.IsDefault)let project = client.projects().retrieve(&project_id).await?;
println!("{} {}", project.name, project.is_default);