Skip to content
FeedbackDashboard

Create project

projects.create(ProjectCreateParams**kwargs) -> Project
post/v0/projects

Create a new project.

ParametersExpand Collapse
display_name: str

Human-readable project name

org: str

Organization name

revision: Dict[str, FileInput]

File contents to commit

Accepts one of the following:
class Content:
content: str

File content

class URL:
url: str

URL to fetch file content from

slug: str

Project name/slug

targets: List[Target]

Targets to generate for

Accepts one of the following:
"node"
"typescript"
"python"
"go"
"java"
"kotlin"
"ruby"
"terraform"
"cli"
"php"
"csharp"
ReturnsExpand Collapse
class Project:

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

config_repo: str
display_name: Optional[str]
object: Literal["project"]
org: str
slug: str
targets: List[Target]
Accepts one of the following:
"node"
"typescript"
"python"
"go"
"java"
"kotlin"
"ruby"
"terraform"
"cli"
"php"
"csharp"
Create project
import os
from stainless_v0 import Stainless

client = Stainless(
    api_key=os.environ.get("STAINLESS_API_KEY"),  # This is the default and can be omitted
)
project = client.projects.create(
    display_name="display_name",
    org="org",
    revision={
        "foo": {
            "content": "content"
        }
    },
    slug="slug",
    targets=["node"],
)
print(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"
  ]
}