Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions content/manuals/ai/sandboxes-api/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,18 @@ For CI jobs and other unattended applications, use
[PAT authentication](authentication.md#authenticate-automation-with-a-pat).

If the program stops after printing the sandbox name, retrieve the sandbox
with `client.get(name)` and delete it when you're finished. Closing the client
doesn't delete the sandbox.
with `client.get(name)` and delete it when you're finished. The `name` value is
the full resource name printed by the program, such as
`sandboxes/<uid>`:

```typescript
const existing = await client.get(name);
const latest = await existing.refresh();
const deleting = await latest.delete({ force: true });
await deleting?.waitUntilDeleted();
```

Closing the client doesn't delete the sandbox.

## Next steps

Expand Down
Loading