Create a new objective
Creates a new objective in the workspace
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
Body
"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y"
Arbitrary data rendered into the selected variation's system_prompt_template (liquid) to produce the objective's system prompt. If the agent has a system_prompt_data_schema, this must satisfy it.
Optional explicit variation selection. Overrides the agent's variation_selection_mode.
"agentvar_01HXKD2E5NQM3T9AYWCF32BSPP"
CreateOperationMetadata contains the user-provided fields for creating an operation. Read-only fields (id, account_id, workspace_id, created_at, profile_id) are excluded since they are set by the server.
Optional explicit first user message for the LLM chat history. When not set, the selected variation's first_user_message_template is rendered with first_user_message_data instead. If neither this field nor a first_user_message_template is present, the request is rejected with InvalidArgument.
Secrets that can be used in the headers for tool calls using the secret interpolation format.
Memory layers/entries layered over the baseline cascade inherited from the selected variation — element-level rules over inherited styles, in CSS terms.
Array order is resolution order: EARLIER elements are more specific and are consulted first. Entries pinned via memory_entry_id behave as single-entry layers at their position.
System-managed layers (e.g., episodic) cannot be referenced here; they attach themselves automatically based on the episodic key.
Size cap: the TOTAL effective cascade (this field + the variation's memory layer assignments) must not exceed 10 entries. A request that would produce a larger cascade is rejected with InvalidArgument.
Arbitrary data rendered into the selected variation's first_user_message_template
(liquid) to produce the first user message. Separate from system_prompt_data,
which renders the system prompt template.
If the agent variation that is selected has episodic memory enabled, then this key is used to create/update a memory layer specific to the episodic memory. The layer may have a TTL configured by the variation.
Optional tenant assertion — the customer's org/company identifier for the end user this objective serves. Upserts the tenant record in the workspace and associates the objective with it.
Optional subject assertion — the person within the tenant this objective
serves. Requires tenant; a subject asserted without a tenant is
rejected with InvalidArgument.
Parameters forced onto this objective's tool calls. A pinned parameter is removed from the tool schema the LLM sees, and its value is always overwritten server-side with the pinned value — the model cannot choose a different value for it. By default a pinned key applies to every tool with a top-level parameter of the same name; a tool set's overlays (ToolSetSpec.overlays) can bind pinned keys to nested paths, differently named parameters, or a subset of tools.
Response
OK
Objective is the data for an objective. It contains the snapshotted fields for the selected agent and variation. Secrets are returned only with their names, and the output definition is copied from the agent's configuration.
Metadata for ephemeral operations and activities (e.g., objectives, executions, runs)
The snapshot of the agent and the variation selected (either explicitly or by sampling) will be set here. Cadenya stores the point-in-time snapshot of the configuration used to start an objective and maintains it throughout the entire lifecycle so that changes to agents and variations in the middle of a cycle don't impact the objective itself
The current lifecycle state of the objective.
STATE_UNSPECIFIED, STATE_PENDING, STATE_RUNNING, STATE_WAITING, STATE_FAILED, STATE_CANCELLED, STATE_FINALIZED, STATE_TIMED_OUT Optional human-readable detail about the current state (e.g. a failure reason).
system_prompt is read-only, derived from the selected variation's prompt
The first user message in the LLM chat history, either provided explicitly at creation or rendered from the variation's first_user_message_template.
A parent objective means the objective was spawned off using a separate agent to complete an objective
"obj_01HXKD2E5NQM3T9AYWCFQAZGFV"
Secrets that can be used in the headers for tool calls using the secret interpolation format.
Memory layers/entries layered over the baseline cascade inherited from the selected variation — element-level rules over inherited styles, in CSS terms.
Array order is resolution order: EARLIER elements are more specific and are consulted first. Entries pinned via memory_entry_id behave as single-entry layers at their position.
System-managed layers (e.g., episodic) cannot be referenced here; they attach themselves automatically based on the episodic key.
Size cap: the TOTAL effective cascade (this field + the variation's memory layer assignments) must not exceed 10 entries. A request that would produce a larger cascade is rejected with InvalidArgument.
Parameters forced onto this objective's tool calls, as provided at creation. See CreateObjectiveRequest.pinned_parameters for semantics.
Read-only aggregated info about this objective's execution
Arbitrary data rendered into the variation's system_prompt_template
The output of the objective, populated when the objective completes. Will match the schema of output_json_schema or output_json_inferred. This will only be set if the state of the objective is set to STATE_FINALIZED
Arbitrary data rendered into the variation's first_user_message_template
If the agent variation that is selected has episodic memory enabled, then this key is used to create/update a memory layer specific to the episodic memory. The layer may have a TTL configured by the variation.