/ api reference
Projects
A project is one app: a repository or a directory, built and deployed by Hiraiship. Creating one also creates its production environment and its default domain, <slug>.hiraiship.app.
Build settings set the commands every deployment of the project uses, unless a deployment sets its own.
- get/projectsList projects
- get/projects/by-slug/{slug}Get a project by slug
- get/projects/{projectId}Get a project
- post/projectsCreate a project
- patch/projects/{projectId}Update a project
- delete/projects/{projectId}Delete a project
- patch/projects/{projectId}/build-settingsUpdate build settings
- put/projects/{projectId}/gitConnect a Git repository
- delete/projects/{projectId}/gitDisconnect the Git repository
List projects
/api/v1/projectsThe workspace's projects, most recently created first, each with its default domain and its latest deployment (null for a project never deployed). search matches the name or the slug. limit is 20 by default, 50 at most; pass nextCursor back as cursor for the next page, until it is null.
Requires Viewer key or above (workspace.read)
Parameters
searchstringin querycursorstringin querylimitintegerin query
Responses
200A page of projects.Response fields
itemsobject[]required14 fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
defaultDomainstring | nullrequiredlatestDeploymentobject | nullrequired28 fields
idstringrequiredenvironmentIdstringrequiredworkerScriptRefstring | nullrequiredassetsManifestRefstring | nullrequiredstatus"queued" | "pending" | "success" | "failed"requiredtriggerSource"cli" | "upload"requiredtriggeredByUserIdstringrequiredgitShastring | nullrequiredgitRefstring | nullrequiredframework"rasengan" | "astro" | "react-router" | "vinext" | "tanstack-start" | "futon" | "hono" | "vite" | "static" | nullrequiredcommitMessagestring | nullrequiredcommitAuthorstring | nullrequiredrepoUrlstring | nullrequireddeployedUrlstring | nullrequirederrorstring | nullrequiredcreatedAtstringrequiredfinishedAtstring | nullrequireddispatchStatus"not_applicable" | "pending" | "live" | "error"requireddispatchErrorstring | nullrequiredlogsDeletedAtstring | nullrequiredpublishStartedAtstring | nullrequiredpublishPlannedbooleanbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredstartedAtstring | nullrequiredqueuePositioninteger | nullqueueReason"plan_limit" | "capacity" | nullrequiredmachineReadyAtstring | nullrequiredbuildEnvKeysstring[]requiredThe environment variables the build received (keys only): system variables, the project's build variables and this deployment's own. Empty until the build starts.
nextCursorstring | nullrequired
400Thecursoris not one this route returned.
Get a project by slug
/api/v1/projects/by-slug/{slug}The project and its production environment, found by slug instead of id.
Requires Viewer key or above (workspace.read)
Parameters
slugstringin pathrequired
Responses
200The project and its production environment.Response fields
projectobjectrequired12 fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
environmentobjectrequired11 fields
idstringrequiredprojectIdstringrequirednamestringrequiredworkerNamestringrequiredactiveDeploymentIdstring | nullrequiredsuspendedReason"inactive" | "hibernated" | nullrequiredsuspendedAtstring | nullrequiredneverHibernatebooleanrequiredgitBranchstring | nullrequiredvariablesobject[]required2 shapes
One of:
secret: false
keystringrequiredsecretfalserequiredvaluestringrequirednotestring | nullrequiredupdatedAtstringrequired
secret: true
keystringrequiredsecrettruerequirednotestring | nullrequiredupdatedAtstringrequired
createdAtstringrequired
404No project with that slug in this workspace.
Get a project
/api/v1/projects/{projectId}Requires Viewer key or above (workspace.read)
Parameters
projectIdstringin pathrequired
Responses
200The project.Response fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
404No such project in this workspace.
Create a project
/api/v1/projectsCreates the project with its production environment and its default domain, <slug>.hiraiship.app. Nothing is deployed yet: start a deployment on the returned environment. The slug is unique across Hiraiship and can never change. With git, the project is connected to that GitHub repository (seen through one of the workspace's GitHub installations), and every push to the repository's default branch deploys to production.
Requires Developer key or above (project.create)
Body
namestringrequiredslugstringrequiredrootDirectorystring | nullat most 1000 characters
gitobject3 fields
installationIdstringrequiredownerstringrequiredat most 100 characters
repostringrequiredat most 100 characters
Responses
201The project, its production environment and its default domain.Response fields
projectobjectrequired12 fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
environmentobjectrequired11 fields
idstringrequiredprojectIdstringrequirednamestringrequiredworkerNamestringrequiredactiveDeploymentIdstring | nullrequiredsuspendedReason"inactive" | "hibernated" | nullrequiredsuspendedAtstring | nullrequiredneverHibernatebooleanrequiredgitBranchstring | nullrequiredvariablesobject[]required2 shapes
One of:
secret: false
keystringrequiredsecretfalserequiredvaluestringrequirednotestring | nullrequiredupdatedAtstringrequired
secret: true
keystringrequiredsecrettruerequirednotestring | nullrequiredupdatedAtstringrequired
createdAtstringrequired
domainobjectrequired11 fields
idstringrequiredenvironmentIdstringrequiredhostnamestringrequiredisDefaultbooleanrequiredstatus"pending" | "active" | "error"requiredcloudflareHostnameIdstring | nullrequiredcloudflareVerificationobject | nullrequired2 fields
recordsobject[]required4 fields
type"CNAME" | "ALIAS" | "TXT"requirednamestringrequiredvaluestringrequiredpurpose"routing" | "ownership" | "certificate"required
errorsstring[]required
lastCheckedAtstring | nullrequiredredirectToDomainIdstring | nullrequiredredirectStatusCode301 | 302 | 307 | 308 | object | nullrequiredcreatedAtstringrequired
400The name is empty; the slug has characters other than lowercase letters, digits and hyphens, is longer than 63 characters, starts or ends with a hyphen, or is reserved (www,api,app,admin, …); orrootDirectorycould leave the repository.404gitnames an installation that isn't the workspace's (code: installation_not_found), or a repository it can't see (code: repository_not_found).409That slug is taken: by a project, or by one deleted less than 30 days ago in another workspace.429Too many projects created in the last hour for your plan. Retry after theRetry-Afterheader's seconds.Body: see Errors
Update a project
/api/v1/projects/{projectId}Changes the project's display name, whether pushes to its repository deploy (gitAutoDeploy), or both. The slug, and with it the default hostname, never changes.
Requires Developer key or above (project.update)
Parameters
projectIdstringin pathrequired
Body
namestringat most 64 characters
gitAutoDeployboolean
Responses
200The updated project.Response fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
400No field set, an empty name or one over 64 characters, or a body with any other field (the slug can't be changed).404No such project in this workspace.409gitAutoDeployon a project with no repository connected (code: not_connected).
Delete a project
/api/v1/projects/{projectId}Takes every environment of the project offline and deletes its domains, environment variables and queued builds. confirm must be the project's slug. This can't be undone; the slug can be used by a new project afterwards. Usage already recorded this month stays on the workspace's bill.
Requires Admin key or above (project.delete)
Parameters
projectIdstringin pathrequiredconfirmstringin queryrequired
Responses
204Deleted.400confirmisn't the project's slug (code: confirmation_mismatch).404No such project in this workspace.
Update build settings
/api/v1/projects/{projectId}/build-settingsThe install command, build command, output directory and build machine every future deployment of the project uses, unless the deployment sets its own. An omitted field is left unchanged; null goes back to the framework's default (the plan's default machine for buildMachine). rootDirectory is the app's directory in its GitHub repository, for a monorepo (apps/web; null or . for the root): the framework, the build command and the output directory are relative to it, and dependencies are installed where the nearest lockfile is. A deployment from the CLI builds the directory it was run in instead. Deployments already made are not rebuilt.
Requires Developer key or above (project.update)
Parameters
projectIdstringin pathrequired
Body
installCommandstring | nullat most 500 characters
buildCommandstring | nullat most 500 characters
outputDirstring | nullat most 500 characters
rootDirectorystring | nullat most 1000 characters
buildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | null
Responses
200The updated project.Response fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
400rootDirectoryis absolute, contains..or a backslash, or is over 255 characters.402Your plan does not allow that build machine (quota: build_machine), or a spend limit of $0 allows only the default one.Body: see Errors
404No such project in this workspace.
Connect a Git repository
/api/v1/projects/{projectId}/gitConnects the project to a GitHub repository seen through one of the workspace's GitHub installations, replacing any repository already connected. Production then deploys every push to productionBranch (the repository's default branch when omitted); other environments keep the branch they track. Nothing is deployed until the next push.
Requires Developer key or above (project.update)
Parameters
projectIdstringin pathrequired
Body
installationIdstringrequiredownerstringrequiredat most 100 characters
repostringrequiredat most 100 characters
productionBranchstringat most 255 characters
Responses
200The project, with its repository.Response fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
404No such project in this workspace; or the installation isn't the workspace's (code: installation_not_found), or it can't see the repository (code: repository_not_found).409Another environment of the project already deploys that branch (code: branch_taken).501GitHub isn't configured on this instance.
Disconnect the Git repository
/api/v1/projects/{projectId}/gitPushes no longer deploy, and no environment tracks a branch any more. Deployments already made are kept.
Requires Developer key or above (project.update)
Parameters
projectIdstringin pathrequired
Responses
200The project, without a repository.Response fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequiredgitRepositoryobject | nullrequired3 fields
ownerstringrequiredrepostringrequiredautoDeploybooleanrequired
404No such project in this workspace.