Archive Session
Archive Session through the OMA API.
curl --request POST \
--url http://localhost:38080/v1/sessions/{session_id}/archive \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/sessions/{session_id}/archive"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/sessions/{session_id}/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/sessions/{session_id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "session",
"id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"status": "idle",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null,
"budget": null,
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"title": "Order #1234 inquiry",
"metadata": {},
"agent": {
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1,
"name": "My First Agent",
"description": "A general-purpose starter agent.",
"model": {
"id": "claude-sonnet-4-6",
"speed": "standard"
},
"system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
"tools": [
{
"type": "agent_toolset_20260401",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"configs": []
}
],
"mcp_servers": [
{
"type": "url",
"name": "example-mcp",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"skills": [
{
"type": "anthropic",
"skill_id": "xlsx",
"version": "1"
},
{
"type": "custom",
"skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx",
"version": "2"
}
],
"multiagent": null
},
"resources": [
{
"type": "file",
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": {
"type": "branch",
"name": "main"
},
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
],
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_read_input_tokens": 0
},
"stats": {
"duration_seconds": 0,
"active_seconds": 0
},
"outcome_evaluations": [
{
"type": "outcome_evaluation",
"outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP",
"description": "Produce a 2-page summary as summary.md",
"result": "satisfied",
"iteration": 0,
"completed_at": "2026-03-15T10:02:31Z",
"explanation": "All five sections present with inline citations."
}
]
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}?beta=true.Authorizations
OMA workspace API key.
Path Parameters
Path parameter session_id
Query Parameters
Selects the beta API contract for this endpoint. Must be true.
true Response
Successful response (OK)
A Managed Agents session.
session "session"
"sesn_011CZkZAtmR3yMPDzynEDxu7"
SessionStatus enum
rescheduling, running, idle, terminated "idle"
A timestamp in RFC 3339 format
"2026-03-15T10:00:00Z"
A timestamp in RFC 3339 format
"2026-03-15T10:00:00Z"
"env_011CZkZ9X2dpNyB7HsEFoRfW"
"Order #1234 inquiry"
Show child attributes
Show child attributes
{ "key": "value" }
Resolved agent definition for a session. Snapshot of the agent at session creation time.
Show child attributes
Show child attributes
{
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1,
"name": "My First Agent",
"description": "A general-purpose starter agent.",
"model": {
"id": "claude-sonnet-4-6",
"speed": "standard"
},
"system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
"tools": [
{
"type": "agent_toolset_20260401",
"default_config": {
"enabled": true,
"permission_policy": { "type": "always_ask" }
},
"configs": []
}
],
"mcp_servers": [
{
"type": "url",
"name": "example-mcp",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"skills": [
{
"type": "anthropic",
"skill_id": "xlsx",
"version": "1"
},
{
"type": "custom",
"skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx",
"version": "2"
}
],
"multiagent": null
}
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": { "type": "branch", "name": "main" },
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
[
{
"type": "file",
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": { "type": "branch", "name": "main" },
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
]
Vault IDs attached to the session at creation. Empty when no vaults were supplied.
["vlt_011CZkZDLs7fYzm1hXNPeRjv"]
Per-outcome evaluation state. One entry per define_outcome event sent to the session.
Show child attributes
Show child attributes
[
{
"type": "outcome_evaluation",
"outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP",
"description": "Produce a 2-page summary as summary.md",
"result": "satisfied",
"iteration": 0,
"completed_at": "2026-03-15T10:02:31Z",
"explanation": "All five sections present with inline citations."
}
]
Cumulative token usage for the session.
Show child attributes
Show child attributes
{
"input_tokens": 0,
"output_tokens": 0,
"cache_read_input_tokens": 0
}
Timing statistics for the session.
Show child attributes
Show child attributes
{
"duration_seconds": 0,
"active_seconds": 0
}
When the session was archived. Null if not archived.
null
The session's enforced spend ceiling, or null when no budget is set.
Show child attributes
Show child attributes
null
Deployment ID when the session was created from a deployment reference. Null otherwise.
Was this page helpful?
curl --request POST \
--url http://localhost:38080/v1/sessions/{session_id}/archive \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/sessions/{session_id}/archive"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/sessions/{session_id}/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/sessions/{session_id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "session",
"id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"status": "idle",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null,
"budget": null,
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"title": "Order #1234 inquiry",
"metadata": {},
"agent": {
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1,
"name": "My First Agent",
"description": "A general-purpose starter agent.",
"model": {
"id": "claude-sonnet-4-6",
"speed": "standard"
},
"system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
"tools": [
{
"type": "agent_toolset_20260401",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"configs": []
}
],
"mcp_servers": [
{
"type": "url",
"name": "example-mcp",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"skills": [
{
"type": "anthropic",
"skill_id": "xlsx",
"version": "1"
},
{
"type": "custom",
"skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx",
"version": "2"
}
],
"multiagent": null
},
"resources": [
{
"type": "file",
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"type": "github_repository",
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"url": "https://github.com/example-org/example-repo",
"mount_path": "/workspace/example-repo",
"checkout": {
"type": "branch",
"name": "main"
},
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
],
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_read_input_tokens": 0
},
"stats": {
"duration_seconds": 0,
"active_seconds": 0
},
"outcome_evaluations": [
{
"type": "outcome_evaluation",
"outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP",
"description": "Produce a 2-page summary as summary.md",
"result": "satisfied",
"iteration": 0,
"completed_at": "2026-03-15T10:02:31Z",
"explanation": "All five sections present with inline citations."
}
]
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}