Skip to content
FeedbackDashboard

Create project

$client->projects->create(string displayName, string org, array<string,FileInput> revision, string slug, list<Target> targets): Project
POST/v0/projects

Create a new project.

ParametersExpand Collapse
displayName: string

Human-readable project name

org: string

Organization name

revision: array<string,FileInput>

File contents to commit

slug: string

Project name/slug

targets: list<Target>

Targets to generate for

ReturnsExpand Collapse
string configRepo
?string displayName
Object_ object
string org
string slug
list<Target> targets

Create project

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'My API Key', environment: 'staging');

$project = $client->projects->create(
  displayName: 'display_name',
  org: 'org',
  revision: ['foo' => ['content' => 'content']],
  slug: 'slug',
  targets: [Target::NODE],
);

var_dump($project);
{
  "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"
  ]
}