Skip to content
FLORA DocsGo to app

List workspace projects

client.Projects.List(ctx, query) (*ProjectsCursorPage[ProjectListResponse], error)
GET/projects

Returns projects in the requested workspace that are accessible to the authenticated public API key, ordered by recent activity.

ParametersExpand Collapse
query ProjectListParams
WorkspaceID param.Field[string]

Workspace identifier

Cursor param.Field[string]Optional

Opaque cursor for fetching the next page

Limit param.Field[int64]Optional

Maximum number of results to return

minimum1
maximum100
Query param.Field[string]Optional

Search query

ReturnsExpand Collapse
type ProjectListResponse struct{…}
CreatedAt float64
LastModified float64
Name string

Project name

Origin string

Project origin

ProjectID string

Project identifier

WorkspaceID string

Workspace identifier

List workspace projects

package main

import (
  "context"
  "fmt"

  "github.com/florafauna-ai/flora-go"
  "github.com/florafauna-ai/flora-go/option"
)

func main() {
  client := flora.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Projects.List(context.TODO(), flora.ProjectListParams{
    WorkspaceID: "ws_abc123",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "meta": {
    "next_cursor": "eyJvZmZzZXQiOjIwfQ",
    "total_estimate": 0
  },
  "projects": [
    {
      "created_at": 0,
      "last_modified": 0,
      "name": "Spring Campaign",
      "origin": "api",
      "project_id": "prj_abc123",
      "workspace_id": "ws_abc123"
    }
  ]
}
{
  "error": {
    "code": "input_validation_error",
    "message": "prompt: Required",
    "fields": [
      {
        "field": "prompt",
        "message": "Required"
      }
    ]
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key."
  }
}
{
  "error": {
    "code": "insufficient_credits",
    "message": "Insufficient credits."
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "Forbidden."
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Not found."
  }
}
{
  "error": {
    "code": "idempotency_duplicate",
    "message": "Duplicate idempotency key."
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded."
  }
}
{
  "error": {
    "code": "unknown_error",
    "message": "An unknown error occurred."
  }
}
Returns Examples
{
  "meta": {
    "next_cursor": "eyJvZmZzZXQiOjIwfQ",
    "total_estimate": 0
  },
  "projects": [
    {
      "created_at": 0,
      "last_modified": 0,
      "name": "Spring Campaign",
      "origin": "api",
      "project_id": "prj_abc123",
      "workspace_id": "ws_abc123"
    }
  ]
}
{
  "error": {
    "code": "input_validation_error",
    "message": "prompt: Required",
    "fields": [
      {
        "field": "prompt",
        "message": "Required"
      }
    ]
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key."
  }
}
{
  "error": {
    "code": "insufficient_credits",
    "message": "Insufficient credits."
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "Forbidden."
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Not found."
  }
}
{
  "error": {
    "code": "idempotency_duplicate",
    "message": "Duplicate idempotency key."
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded."
  }
}
{
  "error": {
    "code": "unknown_error",
    "message": "An unknown error occurred."
  }
}