Skip to main content
Agents

Download agent code

GET
/agents/{agent_name}/code:download

Downloads the code zip for a code-based hosted agent. Returns the previously-uploaded zip (`application/zip`). If `agent_version` is supplied, returns that version's code zip; otherwise returns the latest version's code zip. The SHA-256 digest of the returned bytes matches the `content_hash` on the resolved version's `code_configuration`.

Path Parameters
agent_namestringrequired
The name of the agent.
Query Parameters
agent_versionstringoptional
The version of the agent whose code zip should be downloaded. If omitted, the latest version's code zip is returned.
api-versionstringrequired
The API version to use for this operation.
Header Parameters
Foundry-Featuresstringoptional
A feature flag opt-in required when using preview operations or modifying persisted preview resources.
CodeAgents=V1Preview
Responses