/ 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}Rename a project
- delete/projects/{projectId}Delete a project
- patch/projects/{projectId}/build-settingsUpdate build settings
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[]required13 fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequireddefaultDomainstring | nullrequiredlatestDeploymentobject | nullrequired25 fields
idstringrequiredenvironmentIdstringrequiredworkerScriptRefstring | nullrequiredassetsManifestRefstring | nullrequiredstatus"queued" | "pending" | "success" | "failed"requiredtriggerSource"cli" | "upload"requiredtriggeredByUserIdstringrequiredgitShastring | nullrequiredgitRefstring | nullrequiredframework"rasengan" | "futon" | "hono" | "vite" | "static" | nullrequiredcommitMessagestring | nullrequiredcommitAuthorstring | nullrequiredrepoUrlstring | nullrequireddeployedUrlstring | nullrequirederrorstring | nullrequiredcreatedAtstringrequiredfinishedAtstring | nullrequireddispatchStatus"not_applicable" | "pending" | "live" | "error"requireddispatchErrorstring | nullrequiredpublishStartedAtstring | nullrequiredpublishPlannedbooleanbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredstartedAtstring | nullrequiredqueuePositioninteger | nullqueueReason"plan_limit" | "capacity" | nullrequired
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
projectobjectrequired11 fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequired
environmentobjectrequired10 fields
idstringrequiredprojectIdstringrequirednamestringrequiredworkerNamestringrequiredactiveDeploymentIdstring | nullrequiredsuspendedReason"inactive" | "hibernated" | nullrequiredsuspendedAtstring | nullrequiredneverHibernatebooleanrequiredvariablesobject[]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" | nullrequiredcreatedAtstringrequired
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.
Requires Developer key or above (project.create)
Body
namestringrequiredslugstringrequiredrootDirectorystring | nullat most 1000 characters
Responses
201The project, its production environment and its default domain.Response fields
projectobjectrequired11 fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequired
environmentobjectrequired10 fields
idstringrequiredprojectIdstringrequirednamestringrequiredworkerNamestringrequiredactiveDeploymentIdstring | nullrequiredsuspendedReason"inactive" | "hibernated" | nullrequiredsuspendedAtstring | nullrequiredneverHibernatebooleanrequiredvariablesobject[]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.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
Rename a project
/api/v1/projects/{projectId}Changes the project's display name. The slug, and with it the default hostname, never changes.
Requires Developer key or above (project.update)
Parameters
projectIdstringin pathrequired
Body
namestringrequiredat most 64 characters
Responses
200The renamed project.Response fields
idstringrequiredworkspaceIdstringrequirednamestringrequiredslugstringrequiredproductionEnvironmentIdstringrequiredinstallCommandstring | nullrequiredbuildCommandstring | nullrequiredoutputDirstring | nullrequiredrootDirectorystring | nullrequiredbuildMachine"standard-1" | "standard-2" | "standard-3" | "standard-4" | nullrequiredcreatedAtstringrequired
400An empty name, one over 64 characters, or a body with any other field (the slug can't be changed).404No such project in this workspace.
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" | nullrequiredcreatedAtstringrequired
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.