Services
Manage background services running in your Sprite environment.
List Services
/v1/sprites/{name}/services
List all configured services and their current state.
Response
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
Get Service
/v1/sprites/{name}/services/{service_name}
Get details of a specific service.
Response
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
Create Service
/v1/sprites/{name}/services/{service_name}
Create or update a service definition.
Query Parameters
duration
duration
Time to monitor logs after starting (default: 5s)
Request Body
application/jsoncmd*
string
Command to execute
args*
string
Command arguments
needs*
string
Service dependencies (started first)
http_port
number
HTTP port for proxy routing
Response
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
Start Service
/v1/sprites/{name}/services/{service_name}/start
Start a service. Returns streaming NDJSON with stdout/stderr.
Query Parameters
duration
duration
Time to monitor logs after starting (default: 5s)
Response
application/x-ndjsonServiceLogStdoutEvent
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
Stop Service
/v1/sprites/{name}/services/{service_name}/stop
Stop a running service. Returns streaming NDJSON with service stop progress.
Query Parameters
timeout
duration
Timeout waiting for service to stop (default: 10s)
Response
application/x-ndjsonServiceLogStoppingEvent
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
Get Service Logs
/v1/sprites/{name}/services/{service_name}/logs
Stream logs for a service.
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
application/x-ndjsonServiceLogStdoutEvent
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