Skip to content
Get started

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"
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"
Accepts one of the following:
"project"
org: string
slug: string
targets: Array<Target>
Accepts one of the following:
"node"
"typescript"
"python"
"go"
"java"
"kotlin"
"ruby"
"terraform"
"cli"
"php"
"csharp"
Create project
IMPORT STAINLESS FROM '@STAINLESS-API/SDK';

CONST CLIENT = NEW STAINLESS({
  APIKEY: 'MY API KEY',
});

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"
  ]
}