Skip to main content
POST
/
v1
/
agent-deployments
/
{deployment_id}
/
services
Create an agent service instance
import requests

url = "https://api.13-215-85-171.sslip.io/v1/agent-deployments/{deployment_id}/services"

payload = {
    "version_id": "<string>",
    "envs": {}
}
headers = {
    "Idempotency-Key": "<idempotency-key>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "id": "adsvc_1234abcd",
  "deployment_id": "<string>",
  "version_id": "<string>",
  "port": 32768,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "sandbox_id": "<string>",
  "process_id": 123,
  "public_url": "<string>",
  "readiness_status": {},
  "failure_reason": "<string>",
  "started_at": "2023-11-07T05:31:56Z",
  "stopped_at": "2023-11-07T05:31:56Z",
  "idempotency_key": "<string>"
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Headers

Idempotency-Key
string
required

Reuse the same key to safely retry the same create, reusable snapshot create, fork, upload create/complete, or agent deployment create operation without duplicating work.

Path Parameters

deployment_id
string
required

Agent deployment ID

Body

application/json
version_id
string | null
envs
object
write-only

Request-only runtime environment variable values. P0 accepts string values only; future secret references are reserved by AgentSecretReference. Values are injected into agent processes and are not stored in deployment config, run, service, or platform event records.

Response

Agent service instance created

id
string
required
Example:

"adsvc_1234abcd"

deployment_id
string
required
version_id
string
required
status
enum<string>
required
Available options:
starting,
ready,
unhealthy,
stopping,
stopped,
failed
port
integer
required
Required range: 1 <= x <= 65535
created_at
string<date-time>
required
updated_at
string<date-time>
required
sandbox_id
string | null
process_id
integer<uint32> | null
public_url
string<uri> | null

Dynamic public URL for the ready service. Signed edge URLs contain bearer credentials such as edge_token; do not log or persist them. A null value means the service is not ready, has no backing sandbox, or permissions.public_url is disabled.

readiness_status
object

Server-recorded readiness/lifecycle status detail for the service instance. Key set varies by lifecycle phase; deliberately open.

failure_reason
string | null
started_at
string<date-time> | null
stopped_at
string<date-time> | null
idempotency_key
string | null