Skip to content
FeedbackDashboard

Create project

client.projects.create(ProjectCreateParams { display_name, org, revision, 2 more } body, RequestOptionsoptions?): Project { config_repo, display_name, object, 3 more }
post/v0/projects

Create a new project.

ParametersExpand Collapse
body: ProjectCreateParams { display_name, org, revision, 2 more }
display_name: string

Human-readable project name

org: string

Organization name

revision: Record<string, FileInput>

File contents to commit

Accepts one of the following:
Content { content }
content: string

File content

URL { url }
url: string

URL to fetch file content from

slug: string

Project name/slug

targets: Array<Target>

Targets to generate for

Accepts one of the following:
"node"
"typescript"
"python"
"go"
"java"
"kotlin"
"ruby"
"terraform"
"cli"
"php"
"csharp"
"openapi"
ReturnsExpand Collapse
Project { config_repo, display_name, object, 3 more }

A project is a collection of SDKs generated from the same set of config files.

config_repo: string
display_name: string | null
object: "project"
org: string
slug: string
targets: Array<Target>
Accepts one of the following:
"node"
"typescript"
"python"
"go"
"java"
"kotlin"
"ruby"
"terraform"
"cli"
"php"
"csharp"
"openapi"
Create project
import Stainless from '@stainless-api/sdk';

const client = new Stainless({
  apiKey: process.env['STAINLESS_API_KEY'], // This is the default and can be omitted
});

const project = await client.projects.create({
  display_name: 'display_name',
  org: 'org',
  revision: { foo: { content: 'content' } },
  slug: 'slug',
  targets: ['node'],
});

console.log(project.config_repo);
{
  "config_repo": "config_repo",
  "display_name": "display_name",
  "object": "project",
  "org": "org",
  "slug": "slug",
  "targets": [
    "node"
  ]
}
Returns Examples
{
  "config_repo": "config_repo",
  "display_name": "display_name",
  "object": "project",
  "org": "org",
  "slug": "slug",
  "targets": [
    "node"
  ]
}