Skip to main content
Create a HarnessAgent-based Managed Agent with curl. It will organize meeting notes, write them to a file, and read the file back. Service runs the Agent; you configure it and submit work through the Session API.

Prepare

Complete the Docker Compose quickstart, configure model credentials, and enable BUILDER_ALLOW_LOCAL_ENVIRONMENT=true. The commands require Bash, curl, and jq. Run them in order in one Bash terminal. Set your Service address, platform user token, and authorized namespace. For an existing team deployment, use the configuration supplied by your administrator.
Enter your platform username and password. On a new deployment, use admin and the password from .env, or the password you changed in Profile.
Choose a namespace from the response and use its tenant and name for TENANT and NAMESPACE above. The user token manages resources; see application integration for application credentials.

1. Create an environment

Create a Local Environment so file tools run inside the Dataplane container. If you already have an available environment, set ENVIRONMENT_ID and skip this request. See Environments for other types.

2. Create an Agent

Create a notes assistant using the deployment’s default model and only the file reading and writing tools. Set binding.kind to managed and select the tool environment with defaultEnvironmentId.
Save AGENT_ID to reuse this Agent in later sessions. Use a different agentKey when creating another Agent. This example allows file reads and writes without confirmation; see tool permissions for configuration.

3. Create a session

Create a Session referencing the Agent to retain messages and execution history. Creating a session does not start work; submit a task next.

4. Submit a task

Send a message to the session to create a Turn.
A 202 Accepted response means the task was received. For a network retry, keep the same Idempotency-Key and message. Use a new key for a new task.

5. Inspect progress and results

Read the snapshot to inspect existing messages, tool results, and task status:
If work is still running, receive SSE events after the snapshot’s as_of cursor:
After receiving turn.completed for your TURN_ID, press Ctrl-C to stop the stream and query the final result. Closing the stream does not cancel the task.
Confirm the Turn’s status is completed, tool records show meeting-actions.md was written and read, and the response preserves the Friday deadline, Monday review, and unconfirmed time. The file resides in the execution environment; see files and artifacts for downloads and Artifact publication. If the status is failed, inspect error. For requires_action, inspect the snapshot’s required_actions. See sessions and tasks for handling these states.

Next

Keep AGENT_ID and continue to Session API application integration. To add capabilities, see Agent configuration, tools and MCP, and SSE events.