Creates a new session for an agent endpoint. The endpoint resolves the backing agent version
from version_indicator and enforces session ownership using the provided user identity for
session-mutating operations.
Creates a new agent version from code. Uploads the code zip and creates a new version for an
existing agent. The SHA-256 hex digest of the zip is provided in the x-ms-code-zip-sha256
header for integrity and dedup. The request body is multipart/form-data with a JSON metadata
part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB.
Deletes an agent. For hosted agents, if any version has active sessions, the request is
rejected with HTTP 409 unless force is set to true. When force is true, all associated
sessions are cascade-deleted along with the agent and its versions.
Deletes a specific version of an agent. For hosted agents, if the version has active sessions,
the request is rejected with HTTP 409 unless force is set to true. When force is true, all
sessions associated with this version are cascade-deleted.
Disables the specified agent, preventing it from accepting new sessions or processing requests.
Existing active sessions are allowed to drain gracefully but no new sessions can be created.
This operation is idempotent — disabling an already-disabled agent returns success with no side
effects.
Enables the specified agent, allowing it to accept new sessions and process requests. This
operation is idempotent — enabling an already-enabled agent returns success with no side
effects.
Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish
request, without publishing it. Returns the app package as application/zip.
Streams console logs (stdout / stderr) for a specific hosted agent session
as a Server-Sent Events (SSE) stream.
Each SSE frame contains:
event: always "log"
data: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string)
Example SSE frames:
event: log
data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"}
event: log
data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."}
event: log
data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"}
event: log
data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"}
The stream remains open until the client disconnects or the server
terminates the connection. Clients should handle reconnection as needed.
Lists candidates for the given optimization job with cursor pagination, including the original
baseline and generated candidates. Each output.mutations item identifies a changed
attribute by type; mutation value fields are omitted unless the client passes
expand=mutations.
Returns files and directories at the specified path in the session sandbox. The response
includes only the immediate children of the target directory and defaults to the session home
directory when no path is supplied.
Promote a candidate for an agent optimization job.
Promotes a candidate to the Foundry agent stored in the parent job's target configuration.
Promotion is unavailable when the job omitted target_configuration. Prompt-agent promotion
creates a new agent version. Hosted-agent promotion currently records promotion metadata
without deploying a new hosted-agent version.
Uploads binary file content to the specified path in the session sandbox. The service stores
the file relative to the session home directory and rejects payloads larger than 50 MB.
Creates a new session for an agent endpoint. The endpoint resolves the backing agent version
from version_indicator and enforces session ownership using the provided user identity for
session-mutating operations.
Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters. Default value is None.
(Preview) Whether this agent version is a draft (candidate) rather than a
release. The service defaults to false if a value is not specified by the caller. Draft
versions are recorded but excluded from default 'latest' resolution and are not auto-promoted.
Default value is None.
Creates a new agent version from code. Uploads the code zip and creates a new version for an
existing agent. The SHA-256 hex digest of the zip is provided in the x-ms-code-zip-sha256
header for integrity and dedup. The request body is multipart/form-data with a JSON metadata
part and a binary code part (part order is irrelevant). Maximum upload size is 250 MB.
The code zip file stream (max 250 MB). Required. The stream must
expose a name attribute (for example, a stream returned by
open) and that name must end with .zip.
SHA-256 hex digest of the uploaded code zip. Used for change
detection (dedup) and integrity verification. If not provided, it will be calculated
automatically from the code content. Default value is None.
Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters. Default value is None.
Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters. Default value is None.
Deletes an agent. For hosted agents, if any version has active sessions, the request is
rejected with HTTP 409 unless force is set to true. When force is true, all associated
sessions are cascade-deleted along with the agent and its versions.
For Hosted Agents, if true, force-deletes the agent even if its versions
have active sessions, cascading deletion to all associated sessions. The service defaults to
false if a value is not specified by the caller. This value is not relevant for other Agent
types. Default value is None.
Deletes a specific version of an agent. For hosted agents, if the version has active sessions,
the request is rejected with HTTP 409 unless force is set to true. When force is true, all
sessions associated with this version are cascade-deleted.
For Hosted Agents, if true, force-deletes the version even if it has active
sessions, cascading deletion to all associated sessions. The service defaults to false if a
value is not specified by the caller. This value is not relevant for other Agent types. Default
value is None.
Disables the specified agent, preventing it from accepting new sessions or processing requests.
Existing active sessions are allowed to drain gracefully but no new sessions can be created.
This operation is idempotent — disabling an already-disabled agent returns success with no side
effects.
Enables the specified agent, allowing it to accept new sessions and process requests. This
operation is idempotent — enabling an already-enabled agent returns success with no side
effects.
Generates the Microsoft Teams app package (zip) for a Foundry agent from the supplied publish
request, without publishing it. Returns the app package as application/zip.
ARM resource id of the Azure Bot Service that fronts this agent in
Microsoft Teams. Required for
workspaces on the default bot-based Teams backend; optional for workspaces on the API-based
backend.
Must not be supplied when publishAsAutopilot is true. Default value is None.
When true, the agent is published as an autopilot (digital
worker) agent: the bot id is taken from
the agent's blueprint identity and the generated Teams manifest is marked as a digital worker.
Default value is None.
Activity-protocol access boundaries to apply to the agent when
publishing as an autopilot agent.
An empty list clears the existing boundaries. When omitted, the existing boundaries are left
unchanged. Default value is None.
Exact selection of delegated permission scopes to grant to
the autopilot blueprint. May only be
supplied when publishAsAutopilot is true. When omitted or empty, the platform's default
permission set is used. Mandatory platform permissions are always granted and are not affected
by
this value. Default value is None.
Controls how the published agent responds to Teams
messages: when true it responds to all messages
on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing
Teams
message-notification setting is left unchanged. Default value is None.
App version (for example 1.2.3) written into the Teams manifest. May
contain only digits and
periods, must not start with 0, and must end with a digit. When omitted, a platform
default is
used. Default value is None.
Optional base64-encoded PNG used as the color (full-bleed) icon in
the Teams app package. Must be a
192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When
omitted, the
platform default color icon is used. Default value is None.
Optional base64-encoded PNG used as the outline icon in the Teams
app package. Must be a 32x32 PNG.
Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value
is None.
Streams console logs (stdout / stderr) for a specific hosted agent session
as a Server-Sent Events (SSE) stream.
Each SSE frame contains:
event: always "log"
data: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time; clients should treat it as an opaque string)
Example SSE frames:
event: log
data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"}
event: log
data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."}
event: log
data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"}
event: log
data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"}
The stream remains open until the client disconnects or the server
terminates the connection. Clients should handle reconnection as needed.
Filter agents by kind. If not provided, all agents are returned. Known values
are: "prompt", "hosted", "workflow", "external", and "voice". Default value is None.
Sort order by the created_at timestamp of the objects. asc for
ascending order anddesc
for descending order. Known values are: "asc" and "desc". Default value is None.
A cursor for use in pagination. before is an object ID that defines your
place in the list.
For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Default value is None.
Lists candidates for the given optimization job with cursor pagination, including the original
baseline and generated candidates. Each output.mutations item identifies a changed
attribute by type; mutation value fields are omitted unless the client passes
expand=mutations.
Comma-separated list of expand keys. Pass mutations to populate mutation
value fields; omit to receive mutation items containing only type. Additional expand
keys may be added in future previews. Default value is None.
Sort order by the created_at timestamp of the objects. asc for
ascending order anddesc
for descending order. Known values are: "asc" and "desc". Default value is None.
A cursor for use in pagination. before is an object ID that defines your
place in the list.
For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Default value is None.
Returns files and directories at the specified path in the session sandbox. The response
includes only the immediate children of the target directory and defaults to the session home
directory when no path is supplied.
Sort order by the created_at timestamp of the objects. asc for
ascending order anddesc
for descending order. Known values are: "asc" and "desc". Default value is None.
A cursor for use in pagination. before is an object ID that defines your
place in the list.
For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Default value is None.
Sort order by the created_at timestamp of the objects. asc for
ascending order anddesc
for descending order. Known values are: "asc" and "desc". Default value is None.
A cursor for use in pagination. before is an object ID that defines your
place in the list.
For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Default value is None.
Sort order by the created_at timestamp of the objects. asc for
ascending order anddesc
for descending order. Known values are: "asc" and "desc". Default value is None.
A cursor for use in pagination. before is an object ID that defines your
place in the list.
For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Default value is None.
(Preview) Whether to include draft versions in the listing. The
service defaults to false if a value is not specified by the caller (only non-draft
versions are returned). Default value is None.
Promote a candidate for an agent optimization job.
Promotes a candidate to the Foundry agent stored in the parent job's target configuration.
Promotion is unavailable when the job omitted target_configuration. Prompt-agent promotion
creates a new agent version. Hosted-agent promotion currently records promotion metadata
without deploying a new hosted-agent version.
ARM resource id of the Azure Bot Service that fronts this agent in
Microsoft Teams. Required for
workspaces on the default bot-based Teams backend; optional for workspaces on the API-based
backend.
Must not be supplied when publishAsAutopilot is true. Default value is None.
When true, the agent is published as an autopilot (digital
worker) agent: the bot id is taken from
the agent's blueprint identity and the generated Teams manifest is marked as a digital worker.
Default value is None.
Activity-protocol access boundaries to apply to the agent when
publishing as an autopilot agent.
An empty list clears the existing boundaries. When omitted, the existing boundaries are left
unchanged. Default value is None.
Exact selection of delegated permission scopes to grant to
the autopilot blueprint. May only be
supplied when publishAsAutopilot is true. When omitted or empty, the platform's default
permission set is used. Mandatory platform permissions are always granted and are not affected
by
this value. Default value is None.
Controls how the published agent responds to Teams
messages: when true it responds to all messages
on its surfaces, when false only when it is at-mentioned. When omitted, the agent's existing
Teams
message-notification setting is left unchanged. Default value is None.
App version (for example 1.2.3) written into the Teams manifest. May
contain only digits and
periods, must not start with 0, and must end with a digit. When omitted, a platform
default is
used. Default value is None.
Optional base64-encoded PNG used as the color (full-bleed) icon in
the Teams app package. Must be a
192x192 PNG (perfect square, no border or rounded corners). Max 1 MB after decode. When
omitted, the
platform default color icon is used. Default value is None.
Optional base64-encoded PNG used as the outline icon in the Teams
app package. Must be a 32x32 PNG.
Max 1 MB after decode. When omitted, the platform default outline icon is used. Default value
is None.
Uploads binary file content to the specified path in the session sandbox. The service stores
the file relative to the session home directory and rejects payloads larger than 50 MB.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.