Skip to content

Drive From a Script

Read, save, move and delete the files of an agent inbox with an API key from a script, a cron job or a CI step, with no browser and no MCP client.

View Markdown

On this page

What It Is

A script holding a full API key works an agent inbox's Drive over REST, as an agent: it keeps to the modes the owner set, the secret check and the storage limit, exactly as a connected session does. A key pinned to one agent works that agent's Drive. An account key works any agent inbox of the account by name. Neither reaches your own inbox's Drive or a business's, so give a script an agent inbox of its own, for example one named ci.

What You Need

  1. 1 A full API key, made by you in the app under API Keys. Put it in $HOMING_API_KEY yourself, in your shell or your CI's secret store, and never in a script or a prompt. An approvals key does not open this door.
  2. 2 An agent inbox for the script, made in the app under Agent Inboxes. Its handle (or the part after the dot) is the {inbox} in every address below.

Read a File

The answer is the file's receipt: its text inline up to the inline limit, otherwise a short-lived download link. With download=1 the address redirects to that link, so curl -L saves the bytes. Add version to read an older one.

The receipt:

curl -sS -H "Authorization: Bearer $HOMING_API_KEY" "https://api.tryhoming.com/drive/ci/files/notes/plan.md"

The bytes, saved to a file:

curl -sS -L -H "Authorization: Bearer $HOMING_API_KEY" "https://api.tryhoming.com/drive/ci/files/notes/plan.md?download=1" -o plan.md

Save a File

The body is the file. A put with text or bytes in the request takes up to 256 KB; for a larger file, send size_bytes (and sha256) with no body and the answer carries a one-time upload address to PUT the bytes to. Send a client_id of your own: a retry with the same one answers unchanged and writes nothing. if_version refuses the save if the file moved on since you read it.

Save a file:

curl -sS -X PUT --data-binary @plan.md -H "Authorization: Bearer $HOMING_API_KEY" "https://api.tryhoming.com/drive/ci/files/notes/plan.md?client_id=nightly-2026-12-03"

Ask for an upload link for a large one:

curl -sS -X PUT -H "Authorization: Bearer $HOMING_API_KEY" "https://api.tryhoming.com/drive/ci/files/builds/app.zip?client_id=build-42&size_bytes=$(stat -c%s app.zip)"

List, Move and Delete

GET /drive/{inbox} lists a folder (path), searches (find, since) and pages (skip), with the real total. POST /drive/{inbox}/move takes path and to, and moves a folder when both end in a slash. DELETE on a file's address, or a folder's with a trailing slash, moves it to the trash, where you can restore it from the app for 30 days. Nothing here purges, restores, shares or changes a mode.

List a folder:

curl -sS -H "Authorization: Bearer $HOMING_API_KEY" "https://api.tryhoming.com/drive/ci?path=notes/"

Move a file:

curl -sS -X POST -H "Authorization: Bearer $HOMING_API_KEY" -H "content-type: application/json" -d '{"path":"notes/plan.md","to":"archive/plan.md"}' "https://api.tryhoming.com/drive/ci/move"

Delete to the trash:

curl -sS -X DELETE -H "Authorization: Bearer $HOMING_API_KEY" "https://api.tryhoming.com/drive/ci/files/archive/plan.md"

What You Will See

  1. 1 A refusal keeps the receipt's code and words under its HTTP status: read_only (403) where the owner set a folder to Read Only, version_conflict (409), secret_in_content (422), storage_full and files_full (507), rate_limited (429, with Retry-After).
  2. 2 A path the owner keeps Private is the same file_not_found as a path that is not there.
  3. 3 An inbox that is not the key's to work, another account's, a retired agent and your own inbox are all one 404, the same as an inbox that does not exist. A wrong, revoked or approvals key is a 401.
  4. 4 Every save and delete is recorded with the key that made it, and the owner sees it in the app.

Questions

Can a script reach my own Drive?

Not with a key. A key works agent inboxes only, so give the script one and keep what it needs there. Your own inbox's Drive stays in the app and in the sessions you sign in to.

Can a script delete files?

Yes, to the trash and only where the owner's mode lets an agent edit. The owner can bring a file back from the app until the trash window ends.

Start with a note to yourself.

Works in Claude Code, ChatGPT, Codex, Gemini and other AI apps that can connect to Homing.

Connect an agent

Paste this into your agent.

Set me up with Homing in this session. Read https://tryhoming.com/setup-instructions.md and follow it. I'll sign in or set up a key when you ask.

Full Setup Guide

Step by step: Claude CodeCodexGeminiMore…