Services
Manage background services running in your Sprite environment.
Services
List Services
List all configured services and their current state.
/sprites/{name}/services
Response Body
application/jsonname*
string
Service name
cmd*
string
Command to execute
args*
string
Command arguments
needs*
string
Service dependencies
http_port?
number
HTTP port for proxy routing
state?
Current runtime state
name*
string
Service name
status*
string
stopped, starting, running, stopping, or failed
pid?
number
Process ID when running
started_at?
string
ISO 8601 timestamp
error?
string
Error message if failed
Response Codes
Success
Not Found - Resource not found
Internal Server Error
Services
Get Service
Get details of a specific service.
/sprites/{name}/services/{service_name}
Response Body
application/jsonname*
string
Service name
cmd*
string
Command to execute
args*
string
Command arguments
needs*
string
Service dependencies
http_port?
number
HTTP port for proxy routing
state?
Current runtime state
name*
string
Service name
status*
string
stopped, starting, running, stopping, or failed
pid?
number
Process ID when running
started_at?
string
ISO 8601 timestamp
error?
string
Error message if failed
Response Codes
Success
Not Found - Resource not found
Internal Server Error
Services
Create Service
Create or update a service definition.
/sprites/{name}/services/{service_name}
Query Parameters
duration?
duration
Time to monitor logs after starting (default: 5s)
Request Body
application/jsoncmd*
string
Command to execute
args*
string
Command arguments
env?
map
Environment variables to add to the base service environment
dir?
string
Working directory for the service
needs*
string
Service dependencies (started first)
http_port?
number
HTTP port for proxy routing
Response Body
application/jsonname*
string
Service name
cmd*
string
Command to execute
args*
string
Command arguments
needs*
string
Service dependencies
http_port?
number
HTTP port for proxy routing
state?
Current runtime state
name*
string
Service name
status*
string
stopped, starting, running, stopping, or failed
pid?
number
Process ID when running
started_at?
string
ISO 8601 timestamp
error?
string
Error message if failed
Response Codes
Success
Bad Request - Invalid request body
Not Found - Resource not found
Internal Server Error
Services
Start Service
Start a service. Returns streaming NDJSON with stdout/stderr.
/sprites/{name}/services/{service_name}/start
Query Parameters
duration?
duration
Time to monitor logs after starting (default: 5s)
Response Body
application/x-ndjson
ServiceLogStdoutEvent
type*
"stdout"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogStderrEvent
type*
"stderr"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogExitEvent
type*
"exit"
exit_code*
integer
Process exit code
timestamp*
integer
Unix milliseconds
ServiceLogErrorEvent
type*
"error"
data*
String
Error message
timestamp*
integer
Unix milliseconds
ServiceLogCompleteEvent
type*
"complete"
timestamp*
integer
Unix milliseconds
ServiceLogStartedEvent
type*
"started"
timestamp*
integer
Unix milliseconds
Response Codes
Success - Streaming NDJSON response
Not Found - Resource not found
Internal Server Error
Services
Stop Service
Stop a running service. Returns streaming NDJSON with service stop progress.
/sprites/{name}/services/{service_name}/stop
Query Parameters
timeout?
duration
Timeout waiting for service to stop (default: 10s)
Response Body
application/x-ndjson
ServiceLogStoppingEvent
type*
"stopping"
timestamp*
integer
Unix milliseconds
ServiceLogStdoutEvent
type*
"stdout"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogStderrEvent
type*
"stderr"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogErrorEvent
type*
"error"
data*
String
Error message
timestamp*
integer
Unix milliseconds
ServiceLogStoppedEvent
type*
"stopped"
exit_code*
integer
Process exit code
timestamp*
integer
Unix milliseconds
ServiceLogCompleteEvent
type*
"complete"
timestamp*
integer
Unix milliseconds
Response Codes
Success - Streaming NDJSON response
Not Found - Resource not found
Internal Server Error
Services
Restart Service
Restart a service (stop if running, then start). Returns streaming NDJSON with stop and start progress.
/sprites/{name}/services/{service_name}/restart
Query Parameters
duration?
duration
Time to monitor logs after starting (default: 5s)
Response Body
application/x-ndjson
ServiceLogStoppingEvent
type*
"stopping"
timestamp*
integer
Unix milliseconds
ServiceLogStoppedEvent
type*
"stopped"
exit_code*
integer
Process exit code
timestamp*
integer
Unix milliseconds
ServiceLogStdoutEvent
type*
"stdout"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogStderrEvent
type*
"stderr"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogExitEvent
type*
"exit"
exit_code*
integer
Process exit code
timestamp*
integer
Unix milliseconds
ServiceLogErrorEvent
type*
"error"
data*
String
Error message
timestamp*
integer
Unix milliseconds
ServiceLogCompleteEvent
type*
"complete"
timestamp*
integer
Unix milliseconds
ServiceLogStartedEvent
type*
"started"
timestamp*
integer
Unix milliseconds
Response Codes
Success - Streaming NDJSON response
Not Found - Resource not found
Internal Server Error
Services
Get Service Logs
Stream logs for a service.
/sprites/{name}/services/{service_name}/logs
Query Parameters
lines?
int
Number of lines to return from log buffer (default: all)
duration?
duration
Time to follow new logs (default: 0, no follow)
Response Body
application/x-ndjson
ServiceLogStdoutEvent
type*
"stdout"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogStderrEvent
type*
"stderr"
data*
String
Log line content
timestamp*
integer
Unix milliseconds
ServiceLogExitEvent
type*
"exit"
exit_code*
integer
Process exit code
timestamp*
integer
Unix milliseconds
ServiceLogErrorEvent
type*
"error"
data*
String
Error message
timestamp*
integer
Unix milliseconds
ServiceLogCompleteEvent
type*
"complete"
timestamp*
integer
Unix milliseconds
Response Codes
Success - Streaming NDJSON response
Not Found - Resource not found
Internal Server Error