Skip to content
Console
Menu

Alerts and status pages

App store purchases

Credits

Knowledge

KV

Notifications

Organizations

Storage

Workflows

API reference

Getting Started

Authentication

KV Store

Create a goal

Creates an optional objective owned by this Session, without an external Task.

Creates an optional objective owned by this Session, without an external Task. The operation_id keeps the original receipt beyond request replay expiry.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals
  • Scope agents:sessions
  • Effect write — a successful call changes state.
  • Collection goals
  • Query operation_id

#Request

FieldTypeWhat it is
parentstringThe existing Session that owns this Goal. Required.
agent_session_goalAgentSessionGoalOnly objective and optional token_budget are caller supplied. Required.
operation_idstringCaller-stable mutation identity, nonempty and at most 128 bytes. Required.

#AgentSessionGoal

FieldTypeWhat it is
namestringThe exact Session-owned Goal name.
objectivestringThe objective, nonempty and at most 4,000 characters. Required.
token_budgetint64Omit unless the caller explicitly requests a positive token budget.

#Response

FieldTypeWhat it is
namestringThe exact Session-owned Goal name.
uidstringThe platform Resource UID; the conserved Goal UUID is its name's final id. Output only.
metaResourceMetaStandard resource metadata. Output only.
objectivestringThe objective, nonempty and at most 4,000 characters. Required.
token_budgetint64Omit unless the caller explicitly requests a positive token budget.
stateGoalStateLifecycle; an execution hold is represented separately. Output only. One of working, waiting, completed, failed.
versionint32Optimistic acceptance-contract version, starting at one. Output only.
tokens_usedint64Observed tokens charged exactly once per runtime step. Output only.
usage_unavailableboolUnknown usage holds execution when a token budget is enforced. Output only.
owner_pausedboolExplicit owner pause; an unfinished Goal stays unfinished. Output only.
impasseboolExecution held after the required repeated observation of an impasse. Output only.
receiptSessionGoalReceiptThe terminal observation, retained after another Goal becomes active. Output only.
create_timetimestampWhen this Goal was created. Output only.
update_timetimestampWhen this Goal last changed. Output only.

#ResourceMeta

FieldTypeWhat it is
generationint64Increases by one on every change to spec. Output only.
etagstringStrong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only.
create_timetimestampWhen the Resource was created. Output only.
update_timetimestampWhen the Resource last changed. Output only.
delete_timetimestampSet while the Resource is being deleted. Output only.
labelsmap<string, string>Caller-writable, indexed labels (AIP-122 label rules).
annotationsmap<string, string>Caller-writable, unindexed annotations.
display_namestringCaller-writable human-readable name.
creatorstringThe principal that created the Resource. Output only.

#SessionGoalReceipt

FieldTypeWhat it is
stagestringThe observed delivery stage. Required.
targetstringThe concrete surface or artifact observed. Required.
evidencestructNonempty structured evidence from that surface. Required.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"objective":"…"}'