Skip to main content
Creates a new project and submits it for scheduling.
POST /api/v1/projects
The server validates the request, sets status.phase to Pending, and stores the project. The scheduler picks it up asynchronously and assigns it to a Ready node.

Request body

apiVersion
string
required
Must be "caravanserai/v1".
kind
string
required
Must be "Project".
metadata
object
required
spec
object
required

Response

Returns 201 Created with the stored Project object. status.phase is always Pending at creation time. Returns 409 Conflict if a project with the same name already exists.

Examples

curl -X POST http://localhost:8080/api/v1/projects \
  -H "Content-Type: application/json" \
  -d '{
    "apiVersion": "caravanserai/v1",
    "kind": "Project",
    "metadata": {
      "name": "nginx-demo"
    },
    "spec": {
      "services": [
        {
          "name": "web",
          "image": "nginx:alpine"
        }
      ]
    }
  }'