# List artifacts

URL: https://docs.hanzo.ai/docs/openapi/agent/get-agent-coding-by-session-artifacts

> Lists what a coding run left, kept after its sandbox is gone: every file it added or changed and its whole change as `changes.patch`, stored beside the run; the ports it served, each a preview while its sandbox is kept; its pull request and where its work was published.

`GET /v1/agent/coding/{session}/artifacts`

> [Agent →](https://docs.hanzo.ai/docs/openapi/agent) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                            |
| ------------- | ---------------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/agent/coding/{session}/artifacts` |
| **Method**    | `GET`                                                      |
| **Operation** | `get_agent_coding_by_session_artifacts`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                     |

Lists what a coding run left, kept after its sandbox is gone: every file it
added or changed and its whole change as `changes.patch`, stored beside the run;
the ports it served, each a preview while its sandbox is kept; its pull request
and where its work was published. A run that is still working, or saved
nothing, answers an empty list.

## Request

1 field.

| Field     | In   | Type   | Required | Description                                                                                      |
| --------- | ---- | ------ | -------- | ------------------------------------------------------------------------------------------------ |
| `session` | path | string | yes      | Session is the run's handle — the sessionId POST /v1/agent/coding answered with — from the path. |

## Response

| Status    | Body                  | Meaning |
| --------- | --------------------- | ------- |
| `200`     | agent.CodingArtifacts | ok      |
| `default` | problem-details       | refused |

`200` body — 10 fields.

| Field                 | In   | Type              | Always | Description                                                                                                                                             |
| --------------------- | ---- | ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `artifacts`           | body | agent.Artifact\[] | —      | Artifacts are the run's artifacts, stored files first.                                                                                                  |
| `artifacts[].kind`    | body | string            | —      | Kind is file, patch, preview, pull or deploy.                                                                                                           |
| `artifacts[].name`    | body | string            | —      | Name is the artifact's handle: a changed file's path in the workspace, or `changes.patch` for the whole change; for a link, its kind and what it names. |
| `artifacts[].port`    | body | integer (int64)   | —      | Port is a preview's port in the run's sandbox, which POST /v1/sandbox/{id}/preview opens while the sandbox is kept.                                     |
| `artifacts[].sandbox` | body | string            | —      | Sandbox is the sandbox a preview is served from.                                                                                                        |
| `artifacts[].sha256`  | body | string            | —      | SHA256 is a stored artifact's digest, hex.                                                                                                              |
| `artifacts[].size`    | body | integer (int64)   | —      | Size is a stored artifact's length in bytes.                                                                                                            |
| `artifacts[].url`     | body | string            | —      | URL is where a link points: a preview's host, a pull request, a deployment.                                                                             |
| `saved`               | body | string            | —      | Saved is when the artifacts were saved, RFC 3339 in UTC; empty while the run has saved none.                                                            |
| `session`             | body | string            | —      | Session is the run's handle.                                                                                                                            |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

`hanzo` has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

**SDK**

**.ts**

```ts
import { Configuration, AgentApi } from 'hanzoai';

const api = new AgentApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAgentCodingBySessionArtifacts({ session: 'session' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AgentApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AgentApi(client).get_agent_coding_by_session_artifacts(session='session')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AgentAPI.GetAgentCodingBySessionArtifacts(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, agent_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = agent_api::get_agent_coding_by_session_artifacts(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AgentApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AgentApi(client).getAgentCodingBySessionArtifacts();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/agent/coding/<session>/artifacts \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **agent** through the `agent` tool, which names its 38 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_agents"
         }
       }
     }'
```

---

[Agent API](https://docs.hanzo.ai/docs/openapi/agent) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
