Create project
create_projectCreate a project on a server: the home for one web page, site, app, API or bot, with its own URL at .apps.server4agent.com. Projects default to private; set visibility to "public" to expose that URL. Use lifecycle="ephemeral" for one-shot work that should be cleaned up when done (call cleanup_project after); default is "persistent" for long-lived monitors / dashboards / tools. Pass template (see list_templates) to apply a starter's defaults, or a source to seed the workspace from your own code (kind git/archive); name is derived from the repo/archive when omitted. Pass secrets to set project-scoped env vars at creation (values are write-only). Explicit fields override the template. Fails if the server is at its tier's project cap. Returns listen_port, the port inside the box that this project's URL is routed to: a project serves only while a process is listening there, so bind that rather than a port of your own choosing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Human-friendly project name. Optional when a source or template supplies one. | |
| access | No | Who may open the URL once visibility is public. public = anyone with the link (default). team = the visitor has to sign in to Server4Agent and be a member of this account. password = anyone with the link who enters the password given in access_password, no account needed. No effect while the project is private. | |
| source | No | Where to seed the workspace from. Omit for a blank project. For your own code use kind 'git' (git_url, optional ref/subdir/auth_secret) or 'archive' (archive_path). | |
| secrets | No | Project-scoped env vars to set and bind. Values are write-only. | |
| template | No | Optional template id from list_templates (e.g. 'import-git', 'invoice-and-quote-maker'). Pre-fills name/description/visibility/lifecycle; any explicit field overrides the template's default. | |
| lifecycle | No | persistent = lives until deleted (default). ephemeral = call cleanup_project when the task is done. | |
| server_id | Yes | The server's id, as returned by create_server or list_servers. | |
| visibility | No | public = live at the project URL; private = not publicly reachable. Defaults to private. | |
| description | No | Optional one-line description. | |
| access_password | No | The password visitors enter when access is password. Required with access password. At least 4 characters, so a 4 digit code works. Write-only: it is stored encrypted and never returned. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Project id. | |
| url | No | Public URL. null while the project is private. | |
| name | No | Project name. | |
| note | No | Set when the project was created but its code was not set up, with what to do instead. | |
| slug | No | URL slug. Stays the same when visibility changes. | |
| access | No | Who may open the URL once it is public. | |
| source | No | What the workspace was seeded from: kind plus git_url, ref, subdir, or archive_path. | |
| template | No | Template id it was created from. | |
| lifecycle | No | ephemeral projects are removed with cleanup_project. | |
| server_id | Yes | The server the project lives on. | |
| created_at | No | ISO 8601 timestamp. | |
| init_phase | No | Where bring-up has got to, for a project seeded from a source. | |
| updated_at | No | ISO 8601 timestamp. | |
| url_status | No | Whether the address and certificate are ready. Not a health check. | |
| visibility | No | public = live at url. private = not publicly reachable. | |
| cert_status | No | State of the shared certificate. null while private. | |
| description | No | One-line description. | |
| init_run_id | No | The bring-up run started for a git or archive source. Poll it with get_run. | |
| listen_port | No | The port inside the box this project's URL is routed to. | |
| runtime_status | No | Whether the project is running or paused. |