Pull agent definition (config-as-code)

Return the canonical config-as-code definition and provenance for an agent by name — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live agent state, so it is accurate even immediately after a dashboard edit.

Authentication

AuthorizationBearer
API key or Clerk session token

Query parameters

namestringRequired>=1 character

Response

Canonical definition + provenance

agentIdstring
contentHashstring
definitionobject
lastModifiedSourcestring or null
updatedAtstring or null
versionIdstring or null
warningslist of strings

Present only when a raw tool_… reference could not be emitted as a portable tool:<name> (the tool was deleted, or its name is shadowed by an older same-named tool). Those references are left as raw ids, which the ensure surface rejects; each warning explains how to fix it.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error