Skip to Content
SeyloDocs

Create an app or cron service

POST
/api/v1/services.create

Creates an app or cron service in a project on one node. The source can be set now or later (services.setSource, github.connectRepo). Nothing runs until the first deploy, unless deployNow is true. Databases, Boxes, compose stacks and templates have their own create ops.

Needs services.create on the project. Available to MCP clients and the assistant.

Authorization

cookieseylo_session<token>

Request Body

application/json
  1. body
projectId*string

Panel-issued id.

Match^[a-z0-9]{16}$
name*string

DNS-safe; the service's host name on the project network. Unique in its project.

Match^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
Length1 <= length <= 40
kind*string|string
nodeId*string

Panel-issued id.

Match^[a-z0-9]{16}$
source?|||||
build?
ports?array<>
Itemsitems <= 20
cron?
deployNow?boolean
Defaultfalse

Response Body

Success.

application/json
  1. response
id*string

Panel-issued id.

Match^[a-z0-9]{16}$
projectId*string

Panel-issued id.

Match^[a-z0-9]{16}$
name*string

DNS-safe; the service's host name on the project network. Unique in its project.

Match^[a-z0-9]([a-z0-9-]*[a-z0-9])?$
Length1 <= length <= 40
kind*||||||||

Compose members have kind app and a parentId naming their stack.

parentId*|null
status*string|string|string|string|string|string|string|string|string|string
source*
address*string|null
placements*array<>
cpuPercent*|null
memoryBytes*|null
memoryLimitBytes*|null
liveDeployment*|null
lastDeployedAt*|null
protected*boolean
templateSlug*string|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
stopped*boolean
generation*integer
Range1 <= value
sourceConfig*|||||
build*
container*
ports*array<>
healthCheck*|null
crashPolicy*
restartDelaySeconds*integer
Range0 <= value
resources*
deploy*
cron*|null
stickySessions*boolean
entryNodeId*|null
notes*string
members*array<>
volumes*array<>
Example Request
curl -X POST 'https://example.com/api/v1/services.create' \  -H 'Content-Type: application/json' \  -d '{  "projectId": "string",  "name": "string",  "kind": "app",  "nodeId": "string"}'
Example Response
{  "id": "string",  "projectId": "string",  "name": "string",  "kind": "app",  "parentId": "string",  "status": "idle",  "source": {    "type": "github",    "label": "string",    "branch": "string",    "builder": "railpack"  },  "address": "string",  "placements": [    {      "nodeId": "string",      "nodeName": "string",      "replicas": 1    }  ],  "cpuPercent": 0,  "memoryBytes": 0,  "memoryLimitBytes": 0,  "liveDeployment": {    "id": "string",    "label": "string",    "createdAt": "2019-08-24T14:15:22Z"  },  "lastDeployedAt": "2019-08-24T14:15:22Z",  "protected": true,  "templateSlug": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "stopped": true,  "generation": 1,  "sourceConfig": {    "type": "github",    "installationId": "string",    "repo": "string",    "branch": "string",    "deployOnPush": true  },  "build": {    "builder": "railpack",    "contextPath": "string",    "dockerfilePath": "string",    "inlineDockerfile": "string",    "targetStage": "string",    "buildNodeId": "string",    "startCommand": "string",    "installCommand": "string",    "buildCommand": "string"  },  "container": {    "command": [      "string"    ],    "entrypoint": [      "string"    ],    "workingDir": "string",    "user": "string",    "stopSignal": "string",    "stopGraceSeconds": 1  },  "ports": [    {      "containerPort": 1,      "protocol": "tcp"    }  ],  "healthCheck": {    "probe": {      "type": "tcp",      "port": 1    },    "intervalSeconds": 1,    "timeoutSeconds": 1,    "startPeriodSeconds": 0,    "failureThreshold": 1  },  "crashPolicy": {    "restart": true,    "stopAfterCrashes": 0  },  "restartDelaySeconds": 0,  "resources": {    "memoryLimitBytes": 6291456,    "memoryReservationBytes": 0,    "cpuWeight": 1,    "pidsLimit": 16  },  "deploy": {    "mode": "rolling",    "healthTimeoutSeconds": 10  },  "cron": {    "schedule": "stringstr",    "timeZone": "string",    "command": [      "string"    ],    "timeoutSeconds": 1,    "concurrency": "forbid"  },  "stickySessions": true,  "entryNodeId": "string",  "notes": "string",  "members": [    {      "id": "string",      "name": "string",      "status": "idle"    }  ],  "volumes": [    {      "id": "string",      "name": "string",      "mountPath": "string",      "kind": "volume",      "readOnly": true,      "sharedWith": [        {          "id": "string",          "name": "string"        }      ]    }  ]}