Skip to content

List Directories

client.Beta.Directories.List(ctx, query) (*PaginatedCursor[BetaDirectoryListResponse], error)
GET/api/v1/beta/directories

List Directories

ParametersExpand Collapse
query BetaDirectoryListParams
DataSourceID param.Field[string]optional
IncludeDeleted param.Field[bool]optional
Name param.Field[string]optional
OrganizationID param.Field[string]optional
PageSize param.Field[int64]optional
PageToken param.Field[string]optional
ProjectID param.Field[string]optional
Type param.Field[BetaDirectoryListParamsType]optional
const BetaDirectoryListParamsTypeUser BetaDirectoryListParamsType = "user"
const BetaDirectoryListParamsTypeIndex BetaDirectoryListParamsType = "index"
ReturnsExpand Collapse
type BetaDirectoryListResponse struct{…}

API response schema for a directory.

ID string

Unique identifier for the directory.

Name string

Human-readable name for the directory.

minLength1
ProjectID string

Project the directory belongs to.

CreatedAt Timeoptional

Creation datetime

formatdate-time
DataSourceID stringoptional

Optional data source id the directory syncs from. Null if just manual uploads.

DeletedAt Timeoptional

Optional timestamp of when the directory was deleted. Null if not deleted.

formatdate-time
Description stringoptional

Optional description shown to users.

UpdatedAt Timeoptional

Update datetime

formatdate-time

List Directories

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/llamacloud-prod-go"
  "github.com/stainless-sdks/llamacloud-prod-go/option"
)

func main() {
  client := llamacloudprod.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Beta.Directories.List(context.TODO(), llamacloudprod.BetaDirectoryListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "items": [
    {
      "id": "id",
      "name": "x",
      "project_id": "project_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "data_source_id": "data_source_id",
      "deleted_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "name": "x",
      "project_id": "project_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "data_source_id": "data_source_id",
      "deleted_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}