PgBeam Docs
Projects

CreateProject

Create a project

Creates a new project within the specified organization.

Usage

result, err := client.Projects.CreateProject(ctx, &pgbeam.CreateProjectRequest{
    Name: "...",
    OrgID: "...",
    Database: pgbeam.CreateDatabaseRequest{ /* ... */ },
  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
req*pgbeam.CreateProjectRequestYesRequest body
req.NamestringYesHuman-readable project name.
req.OrgIDstringYesBetter Auth organization ID.
req.Description*stringNoOptional project description.
req.Tags*[]stringNoUser-defined labels to attach to the project.
req.Cloud*stringNoCloud provider for the project.
req.Databasepgbeam.CreateDatabaseRequestYesPrimary database. Created atomically with the project.

Response

(*pgbeam.CreateProjectResponse, error) — project created.

Example

import pgbeam "github.com/pgbeam/pgbeam-go"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Projects.CreateProject(ctx, &pgbeam.CreateProjectRequest{
    Name: "...",
    OrgID: "...",
    Description: "...",
    Tags: nil,
    Cloud: "...",
    Database: pgbeam.CreateDatabaseRequest{ /* ... */ },
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
409Resource already exists or conflicts with current state.
429Rate limited. Try again later.

On this page