Sample - OpenAI API
GET/agents/sessions/{session_id}/subagents/{subagent_id}

Retrieve a session subagent

Retrieves a subagent belonging to this session. See subagent workflows.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
session_idstringrequired
The ID of the session.
subagent_idstringrequired
The ID of the subagent in this session.

8 status codes
200The requested subagent.
idstringrequired
The ID of the subagent.
objectstringrequired
The object type. Always `agent.session.subagent`.
Allowed:agent.session.subagentDefault:agent.session.subagent
session_idstringrequired
The ID of the session that owns the subagent.
namestringrequired
The runner-assigned nickname, or null when unavailable.
instructionsarrayrequired
Initial task content, or null when unavailable. Text may contain placeholders for images or audio when only a preview is available.
parent_agent_idstringrequired
The ID of the agent that created this subagent.
statusstringrequired
The current status of the subagent.
Allowed:activeclosed
opened_atintegerrequired
The Unix timestamp, in seconds, when the subagent was first opened. Resuming does not change it.
closed_atintegerrequired
The Unix timestamp, in seconds, when the subagent was closed. Null while active, including after resume.
400The request was invalid.
errorobjectrequired
The error returned by the API.
401Authentication or project context was missing.
errorobjectrequired
The error returned by the API.
403The API key lacks the required Responses permission.
errorobjectrequired
The error returned by the API.
404The requested session or event was not found.
errorobjectrequired
The error returned by the API.
409The request conflicted with the current session state.
errorobjectrequired
The error returned by the API.
500An internal error occurred.
errorobjectrequired
The error returned by the API.
503The service is temporarily unavailable.
errorobjectrequired
The error returned by the API.

Error handling

A 400 is returned: The request was invalid. A 401 is returned: Authentication or project context was missing. A 403 is returned: The API key lacks the required Responses permission. A 404 is returned: The requested session or event was not found. A 409 is returned: The request conflicted with the current session state. A 500 is returned: An internal error occurred. A 503 is returned: The service is temporarily unavailable.