Projects

Connect a project to a GitHub repository

Legacy alias of /v1/projects/{projectId}/repository. Projects were previously called apps. Connects the project to a repository in the organization's GitHub account, through the organization's Spice Cloud GitHub App installation. The next deployment reads spicepod.yaml (or spicepod.yml) from root_directory on production_branch. Connecting sets the project description to the repository description. Connecting again replaces the repository, root directory and production branch. Requires apps:write.

put/v1/apps/{appId}/repository

Request

  • Base URL
    https://api.spice.ai
  • Auth
    HTTP bearer

Path parameters

appIdinteger required

The ID of the project to connect

Headers

X-Org-Namestring

The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but GET /v1/orgs (400 org_assertion_required otherwise).

Request body

repositorystring required

Repository in the organization's GitHub account, as name or owner/name. The owner must be the organization's GitHub account.

root_directorystring nullable

Directory inside the repository that contains spicepod.yaml. Omit it, or send null or an empty string, for the repository root.

production_branchstring

Branch that deployments read. Defaults to the repository's default branch. A branch that GitHub renamed is stored under its new name.

Example request

{
  "repository": "cookbook",
  "root_directory": "cayenne",
  "production_branch": "trunk"
}

Response

Project connected

project_idinteger required

The project ID

repositorystring required

The repository as owner/name

repository_idinteger required

The GitHub repository ID

root_directorystring nullable required

The stored root directory. Null is the repository root.

production_branchstring required

The branch that deployments read

connected_atstring date-time required

When the project was connected

has_spicepodboolean required

True when spicepod.yaml or spicepod.yml exists in the root directory on the production branch. A deployment fails until it does.

Changes

No recorded changes to this operation across all 1 revision of this API.