Skip to content
FeedbackDashboard

Retrieve configuration files

client.Projects.Configs.Get(ctx, params) (*ProjectConfigGetResponse, error)
get/v0/projects/{project}/configs
Retrieve the configuration files for a given project.
ParametersExpand Collapse
params ProjectConfigGetParams
Project param.Field[string]optional

Path param:

Branch param.Field[string]optional

Query param: Branch name, defaults to "main".

Include param.Field[string]optional

Query param:

ReturnsExpand Collapse
type ProjectConfigGetResponse map[string, ProjectConfigGetResponseItem]

Config files contents

Content string

The file content

Retrieve configuration files
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"),
  )
  config, err := client.Projects.Configs.Get(context.TODO(), stainless.ProjectConfigGetParams{
    Project: stainless.String("project"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", config)
}
{
  "foo": {
    "content": "content"
  }
}
Returns Examples
{
  "foo": {
    "content": "content"
  }
}