Skip to content
Product Docs

List Projects By User

client.Organizations.Users.ListProjects(ctx, userID, query) (*[]OrganizationUserListProjectsResponse, error)
GET/api/v1/organizations/{organization_id}/users/{user_id}/projects

List all projects for a user in an organization.

ParametersExpand Collapse
userID string
query OrganizationUserListProjectsParams
OrganizationID param.Field[string]
ReturnsExpand Collapse
type OrganizationUserListProjectsResponse []OrganizationUserListProjectsResponse
ID string

Unique identifier

formatuuid
Name string
OrganizationID string

The Organization ID the project is under.

formatuuid
CreatedAt TimeOptional

Creation datetime

formatdate-time
IsDefault boolOptional

Whether this project is the default project for the user.

UpdatedAt TimeOptional

Update datetime

formatdate-time

List Projects By User

package main

import (
  "context"
  "fmt"

  "github.com/run-llama/llamacloud-admin-go"
  "github.com/run-llama/llamacloud-admin-go/option"
)

func main() {
  client := llamacloudadmin.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Organizations.Users.ListProjects(
    context.TODO(),
    "user_id",
    llamacloudadmin.OrganizationUserListProjectsParams{
      OrganizationID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "name": "x",
    "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "created_at": "2019-12-27T18:11:19.117Z",
    "is_default": true,
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
Returns Examples
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "name": "x",
    "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "created_at": "2019-12-27T18:11:19.117Z",
    "is_default": true,
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]