Skip to content
FeedbackDashboard

List projects

client.Projects.List(ctx, query) (*Page[Project], error)
get/v0/projects

List projects in an organization, from oldest to newest.

ParametersExpand Collapse
query ProjectListParams
Cursor param.Field[string]optional

Pagination cursor from a previous response

Limit param.Field[float64]optional

Maximum number of projects to return, defaults to 10 (maximum: 100).

exclusiveMinimum0
maximum100
Org param.Field[string]optional
ReturnsExpand Collapse
type Project struct{…}

A project is a collection of SDKs generated from the same set of config files.

ConfigRepo string
DisplayName string
Object ProjectObject
Org string
Slug string
Targets []Target
Accepts one of the following:
const TargetNode Target = "node"
const TargetTypescript Target = "typescript"
const TargetPython Target = "python"
const TargetGo Target = "go"
const TargetJava Target = "java"
const TargetKotlin Target = "kotlin"
const TargetRuby Target = "ruby"
const TargetTerraform Target = "terraform"
const TargetCli Target = "cli"
const TargetPhp Target = "php"
const TargetCsharp Target = "csharp"
const TargetOpenAPI Target = "openapi"
List projects
package main

import (
  "context"
  "fmt"

  "github.com/stainless-api/stainless-api-go"
  "github.com/stainless-api/stainless-api-go/option"
)

func main() {
  client := stainless.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Projects.List(context.TODO(), stainless.ProjectListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "data": [
    {
      "config_repo": "config_repo",
      "display_name": "display_name",
      "object": "project",
      "org": "org",
      "slug": "slug",
      "targets": [
        "node"
      ]
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}
Returns Examples
{
  "data": [
    {
      "config_repo": "config_repo",
      "display_name": "display_name",
      "object": "project",
      "org": "org",
      "slug": "slug",
      "targets": [
        "node"
      ]
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}