ExoHub Data Service: Agent-Facing Project Gateway

1. Overview

The ExoHub Data Service is a standalone HTTP service that gives AI agents and automated pipelines a simple, secure interface for consuming and producing ExoHub projects. It sits between the compute environment and ExoHub, handling the git-level mechanics so that agents never need direct git or git-annex access.

Four operations are supported:

DirectionOperationDescription
Consumedownload_projectDownload a project from ExoHub into the compute environment
Produceupload_projectUpload a local folder in place as a new project version in ExoHub
Clean upprune_projectDelete a project’s local copy, or one downloaded version of it
Inspectlist_projectsList the projects in a workspace, catalogued or not
Inspectdescribe_projectReport the state of a project’s local copy

Standalone Deployments

Each Data Service instance is deployed per compute environment and registered under a deployment_id. A central /mcp dispatcher routes agent requests to the correct deployment based on the deployment_id in the request path.

Agent  ──POST /mcp/research──▶  Data Service (research deployment)
Agent  ──POST /mcp/staging──▶   Data Service (staging deployment)

A single Data Service process can host multiple deployments; each deployment is configured independently with its own data root, workspace paths, and git remotes.

Security Model

Each deployment runs with a service account used for git-level operations (cloning project repositories). Data access is per-user, not service-account-bounded: the Data Service exchanges the requesting user’s identity token for that user’s own short-lived cloud credentials, so an agent can only read the object-storage data the requesting user is entitled to — never more. In addition, per-project access checks are always enforced against the requesting user’s JWT.


2. REST API

For integrations that prefer plain HTTP over the MCP protocol, the Data Service exposes a REST API. It shares the MCP tools’ handlers and returns the same asynchronous operation model.

An interactive OpenAPI reference is served by every deployment at /api/docs.

Endpoints

MethodPathSuccessDescription
GET/200Deployment discovery — service version, supported scopes, data root, endpoints. No auth.
POST/api/projects/download202Start (or reuse) a project download
POST/api/projects/upload202Start (or reuse) a project upload
POST/api/projects/prune202Start (or reuse) the deletion of a project’s local copy
GET/api/projects/list200List the projects in a workspace, synchronously
GET/api/projects/describe200Describe a project’s local copy, synchronously
POST/api/exo/<command>[/<subcommand>]202Run an exo command the deployment exposes; with help=true, 200 and its help (see Exo commands )
GET/api/exo/commands200List the exo commands the deployment exposes
GET/api/operations/{id}200Poll operation status, progress, and result

The POST endpoints return 202 Accepted immediately — they start background work and never block on the transfer.

The former paths under /api/datasets/ still answer, but are no longer listed; use the paths above.

Authentication

All /api/* endpoints require an ExoHub JWT:

Authorization: Bearer <jwt>

GET /api/operations/{id} additionally accepts a capability token in place of a JWT, which is what makes operation_url shareable — see Capability Tokens .

The examples below assume two shell variables:

EDS=https://eds.example.com     # your deployment's Data Service base URL
TOKEN=<your ExoHub JWT>

POST /api/projects/download

Starts a download. The project is identified in one of two ways — supply either shape, never both. A body mixing them (or carrying any unknown key) is rejected with 422.

Shape A — by repository:

FieldTypeRequiredDescription
repositorystring✓Full git URL of the project repository
refstring | nullA catalogued ref: commit SHA, tag or branch. latest is the latest catalogued version (unless a version is catalogued under that name). Omit it to get the default branch’s current tip.
scope"user" | "global"Defaults to "user". "global" is for the project’s owners and deployment admins only

Shape B — by catalog project:

FieldTypeRequiredDescription
project_idstring✓ExoHub catalog project ID
versionstring | nullA catalogued version. latest is the latest catalogued version (unless a version is catalogued under that name). Omit it to get the default branch’s current tip.
scope"user" | "global"Defaults to "user". "global" is for the project’s owners and deployment admins only

Both shapes, user scope only (in global scope these are rejected with 422):

FieldTypeRequiredDescription
worktreesbool | nulltrue: one detached worktree per version under the project folder (a read-only copy). false: one plain repository, as upload produces. Omit it to keep the layout already on disk; a new download is a plain repository.
checkoutboolLet an existing plain repository switch to the requested version; without it a different version fails with version_mismatch. Defaults to false.
forceboolLet an update or checkout of an existing plain repository go ahead over its unpublished work: changed and untracked files, and the commits not on origin of the branch it moves or of a detached HEAD, are discarded, and a nested repository (an untracked folder with its own .git, named in the refusal) is deleted with its own history and content; commits on other branches and annexed content are kept. Ignored files outside nested repositories are not counted and kept; as in git, one the requested version tracks is replaced. Defaults to false.
contentboolfalse: clone or update and initialise the project, but fetch no annexed content: you get the history, the files in git and the annex pointers. Content already present is kept. The operation is separate from the same download with content, and its result carries content: "skipped". A later download with content, or exo get in the folder, fetches the content. Defaults to true.

Without a version you get the default branch’s tip, not the latest catalogued version as before. Send "version": "latest" (or "ref": "latest") to keep the old result. A branch is checked out as a local branch tracking origin, and later downloads fast-forward it to origin’s tip, so the same request can bring newer content over time; a tag or commit is checked out detached. Progress totals are null until the worker has resolved the tip, and stay null if no catalog entry has that commit. In global scope a request without a version is refused unless the tip is a catalogued commit.

Response — 202 Accepted:

FieldTypeDescription
operation_idstringDeterministic operation ID — poll it, or reuse it to deduplicate
operation_urlstringReady-to-open status URL carrying a capability token

Download by repository:

curl -X POST "$EDS/api/projects/download" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "repository": "https://github.com/genentech/exohub-data-tutorials/mnist.git",
        "ref": "v0.1.0",
        "scope": "user"
      }'

Download by catalog project (the default branch’s tip, since version is omitted):

curl -X POST "$EDS/api/projects/download" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "project_id": "mnist", "scope": "user" }'

Both return:

{
  "operation_id": "ds-download-dev-mnist-1ad7be7e5b6d17ac",
  "operation_url": "https://eds.example.com/api/operations/ds-download-dev-mnist-1ad7be7e5b6d17ac?t=Ux3n_S9pQ2t7bK1v"
}

The catalog is the source of truth. Both shapes are resolved against the ExoHub catalog before anything is dispatched, and a project that is not catalogued cannot be downloaded — you get 404 even when the git URL is valid and reachable (without a version, the project must still be catalogued: its catalog entry gives the repository). Resolution also means latest is pinned to a concrete version at request time, and that a repository request and a project request for the same project converge on the same operation.

POST /api/projects/upload

Uploads a folder from the compute filesystem in place: the source directory itself becomes the project. It must already be inside the requesting user’s own workspace. Uploads are user-scope only — there is no scope field. Files are left as ordinary writable files (not locked into read-only symlinks), so the same directory can be changed and uploaded again to publish an updated version.

FieldTypeRequiredDescription
source_folderstring✓The directory to upload: an absolute path as the worker sees it, or the name of a folder directly in your workspace (e.g. "mnist" for {workspace}/mnist). Must be inside your own workspace.
project_idstringCatalog project id (also the repository name). Defaults to the last path segment of source_folder. An id the catalog already holds is an update, allowed only to the project’s owners.
read_access"public" | "authenticated" | "viewers" | "owners"Who may read the project. Omit it to keep the project’s current value, or the deployment’s default on a new project.
ownersarray of string | nullUsernames/groups that may publish new versions and always read the project. Replaces the current owners; cannot be empty. Omit it to keep the current owners.
viewersarray of string | nullUsernames/groups that may read the project when read_access is "viewers". Replaces the current viewers; omit it to keep them.
commit_messagestringMessage for the upload’s commit. Omit it for "feat: upload project <project_id>".
pathsarray of string | nullUpload only these paths, relative to source_folder: files, directories (everything under them) or glob patterns (* within a folder, ** across folders). Only the new or modified files they match are committed; other changes stay in the folder, uncommitted. Entries that match nothing are listed in the result’s skipped_paths. 1 to 1000 entries; omit it to upload every change. See Uploading selected paths .

Returns the same 202 shape as download: operation_id and operation_url.

By default the published project is not private: the repository is created with internal visibility and the project is readable by any authenticated ExoHub user. Narrow it with read_access and viewers, or widen it to anyone with read_access: "public".

curl -X POST "$EDS/api/projects/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "source_folder": "/data/users/alice/workspace/mnist-analysis-alice-20260601",
        "project_id": "mnist-analysis-alice-20260601",
        "read_access": "viewers",
        "viewers": ["bob"],
        "commit_message": "add MNIST classification results"
      }'

Which folder state is uploaded

An update (a project the catalog already holds) is uploaded only from a branch that origin has and is not behind, and is pushed to that branch. The checks run before the upload changes the folder’s files or configuration, so a refused upload leaves them as they were:

Source folderOutcome
no repository yeta new project on the default branch
on branch B, origin has B, and origin’s B is B or an ancestor of itcommit, push to B
on branch B, origin has B with commits B lacksrefused: B is behind origin; bring it up to date first
on branch B, origin has no Brefused: B is not a branch of the project on origin
detached HEAD (at a tag or a commit)refused: check out a branch first
the project’s .exohub/ but no commit of the projectrefused: download the project and upload from that folder
a version folder of a worktrees download, or its .git-storerefused with 400: a worktrees download is a read-only copy

Uploads add and replace, they never remove. With or without paths, an upload is refused before anything is committed when the folder has a staged deletion or rename (git rm, git mv; unstage it with git restore --staged) or a file of the project deleted from the folder (restore it with git checkout -- <file>).

After the commit and before the push, the upload checks that no tracked file differs from the commit (what publishing requires) and fails without pushing otherwise. If publishing fails after the push (for example a transfer cut short), send the same request again: it finds the earlier commit, commits nothing new, and finishes the push and publish.

Uploading selected paths

With paths, only what the entries match is committed:

Refused before anything is committed:

Folder stateWhy
changes staged outside the entriesthe commit would take them along; unstage them or upload without paths
tracked files changed on disk outside the entries (also type changes such as git annex unlock, and git add -N entries)publishing refuses a folder whose tracked files differ from the commit; add them to paths or revert them
an entry covers a file whose name contains *, ?, [ or \, or starts with :exo add would match the name again as a pattern and stage unlisted files; upload without paths

Rejected with 422 before anything starts: an empty list, more than 1000 entries, an absolute entry, one that leaves the folder (..), one starting with :, or one containing a NUL or line break.

curl -X POST "$EDS/api/projects/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "source_folder": "/data/users/alice/workspace/mnist",
        "paths": ["results/", "figures/**/*.png", "README.md"],
        "commit_message": "add March results"
      }'

POST /api/projects/prune

Deletes a project’s local copy — the whole project, or one downloaded version of it — from your workspace or the shared path. Give path as an absolute path, whose scope follows from where it is, or as the project folder’s name, looked up in scope.

FieldTypeRequiredDescription
pathstring✓A directory directly inside your workspace or the shared path: an absolute path as the worker sees it, or the folder’s name (e.g. "mnist"); symlinks are resolved first. A path deeper inside a project is refused with 400. Any directory at that level is accepted, project or not — a directory that is not a repository counts as entirely unpublished, so only force deletes it.
scope"user" | "global"Where a folder name is looked up: "user" (your workspace, the default) or "global" (the shared path). With an absolute path, a scope that does not match where it is is refused with 400.
versionstringOne downloaded version to remove, with the content no other version uses. Omit it to remove the whole project. Refused with 400 when path is an existing directory that is not a download; a version (or project) that is not there completes with nothing removed.
forcebooleanDelete even unpublished work. Default false.

Returns the same 202 shape as download: operation_id and operation_url.

What the check looks for without force. Before deleting, the prune looks for work no remote holds — in each version folder of a download (or only the one named by version), or in a repository such as an upload’s: uncommitted or untracked changes, commits that no remote-tracking branch or tag contains, and annexed content no configured remote of the repository has (a copy in someone’s private clone does not count). In a version folder the commits looked at are those reachable from its checked-out commit; in a repository, those reachable from its checked-out commit or any local branch other than git-annex and synced/*. If it finds any, the operation fails and names each kind of change with a count and a few example paths:

…/workspace/mnist/v0.1.0 holds 3 unpublished change(s): 2 modified (e.g. v0.1.0/train.csv,
v0.1.0/labels.csv); 1 untracked (e.g. v0.1.0/notes.md). Prune again with force to delete them.

Not covered by the check — these are deleted without warning, even without force: files ignored by .gitignore, stashes, commits reachable only from a tag you never pushed, and commits your local remote-tracking branches wrongly show as pushed (the check does not ask the server). When a whole download is pruned, also: anything in the project folder outside its version folders and .git-store/ (such as files you added next to them), uncommitted or untracked changes in the working tree of .git-store/ itself, and commits reachable only from local branches that no version folder has checked out. In a repository, commits reachable only from git-annex or synced/* branches are not checked either. Move anything you need out of the project first.

Without force, it then drops annexed content only once git-annex has verified it on a remote; anything it cannot verify is kept and the directory is left in place. With force nothing is verified: a whole-project prune deletes the directory as is, and a version prune drops its content unchecked. If your credentials expire part-way, send the same request again — it continues where it stopped.

curl -X POST "$EDS/api/projects/prune" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path": "mnist", "version": "v0.1.0"}'

The same request by absolute path, {"path": "/data/users/alice/workspace/mnist", "version": "v0.1.0"}, is the same operation.

GET /api/projects/list

Lists, synchronously, the projects in your workspace: one entry per folder directly in it, downloads, uploads and folders not yet pushed alike. It is quick because it reads, per folder, only whether it is a repository and its origin URL, and asks the catalog once per repository whether it holds it; for a project’s versions and unpublished work, describe it.

Query parameterRequiredDescription
scopeWhat to list: user (your workspace, the default) or global (the shared path)
userDeployment admins only: whose workspace to list in user scope. Anyone else who sends it, even with their own name, gets 403; a value that is not a plain username gets 400; with scope=global, 422.
FieldTypeDescription
scopestringThe scope listed
userstring | nullWhose workspace was listed; null in global scope
workspacestringThe scope’s root: that user’s workspace, or the shared path
projectsarrayOne entry per folder directly in workspace, sorted by name. Files and symlinks are not listed.

Each projects entry:

FieldTypeDescription
pathstringThe folder’s name: what describe and prune take as path
project_idstring | nullThe catalog’s project id; null when the folder is not catalogued
repositorybooleanWhether the folder is a git repository
layoutstring | nullworktrees (a download) or repository (an upload, or a plain-repository download); null when it is not a repository
cataloguedboolean | nullFor a repository, whether the catalog holds at least one version of the repository its origin names (an exact match); null when it is not a repository, or could not be read
errorstring | nullWhy the folder could not be read; null when it was. The other folders are listed as usual.
{
  "scope": "user",
  "user": "alice",
  "workspace": "/data/users/alice/workspace",
  "projects": [
    {"path": "draft",   "project_id": null,    "repository": true,  "layout": "repository", "catalogued": false, "error": null},
    {"path": "mnist",   "project_id": "mnist", "repository": true,  "layout": "worktrees",  "catalogued": true,  "error": null},
    {"path": "scratch", "project_id": null,    "repository": false, "layout": null,         "catalogued": null,  "error": null}
  ]
}

A workspace that does not exist yet (you have neither downloaded nor uploaded anything) answers 404. Catalog searches and folder reads run at most 16 at a time, and a listing that takes longer than the time limit (20 s by default) answers 504.

GET /api/projects/describe

Reports, synchronously, what a project’s local copy holds. It reads the copy on the API itself and never waits for a worker, so it answers even while long downloads keep every worker busy. It changes nothing in your files; it only reads the repositories (with git and git-annex) and the project’s lock file.

Query parameterRequiredDescription
path✓A project in your workspace or the shared path: an absolute path of the project or of anything inside it, or the project folder’s name (e.g. mnist)
scopeWhere a folder name is looked up: user (your workspace, the default) or global (the shared path). With an absolute path, a scope that does not match where it is is refused with 400.
FieldTypeDescription
project_rootstringThe project directory path belongs to
project_idstringThe catalog’s project id, found through the copy’s origin URL (else the directory name)
layoutstringworktrees (a worktrees download: one folder per version), repository (a plain repository: an upload’s, or a download’s), or none
running_operationsarrayOperations currently holding the project: operation_id and mode (shared for worktrees downloads, exclusive for plain-repository downloads, uploads, prunes and exo commands). A sync exo command running in the API has no operation: it shows as operation_id: null, kind: "exo_command", its command and expires_at
local_versionsarrayOne entry per version folder of a worktrees copy, or the one checkout of a repository: its branch, or an empty version when detached (below)
catalog_versionsarray of stringVersions the catalog holds, visible to you, for the repository the copy’s origin URL names (an exact match). Empty when the folder holds no repository, the repository has no origin, or the catalog has no entry for that URL.

Each local_versions entry: version, commit, detached (true for a download worktree, or a repository on a tag or commit; false for a branch you can change and upload), catalogued (whether commit is the one the catalog records for that version), and unpublished_changes — grouped by kind, each kind once with its count and at most five examples, so the response stays small however many files changed. These come from the same check a prune runs, with the same blind spots (see Not covered by the check under prune ): an empty list does not mean a prune would lose nothing.

{
  "project_root": "/data/users/alice/workspace/mnist",
  "project_id": "mnist",
  "layout": "worktrees",
  "running_operations": [],
  "local_versions": [
    {"version": "v0.1.0", "commit": "7ec78f52da961f6aa954759900518a5aabde05ae", "detached": true,
     "catalogued": true, "unpublished_changes": []},
    {"version": "v0.2.0", "commit": "20e7e8c534dca71c4e050dce14aaea91bdd013fa", "detached": true,
     "catalogued": true,
     "unpublished_changes": [{"change": "untracked", "count": 2, "examples": ["notes.md", "scratch/run.log"]}]}
  ],
  "catalog_versions": ["v0.1.0", "v0.2.0"]
}

Reading every version of a large project takes time: if reading the local copy exceeds the time limit (60 s by default) describe answers 504. The limit covers only that read; the catalog lookup and the running-operations lookup come after it, so allow a client timeout somewhat above it.

Exo commands

A deployment can expose chosen exo commands — for example exo doctor, exo locate or exo provenance add — to run in your workspace. This is optional: which commands and parameters are exposed is set per deployment, and many expose none. Ask the deployment with GET /api/exo/commands or the MCP tool exo_commands; anything else answers 404 (an unlisted command) or 422 (an unlisted parameter). A command with subcommands runs only through the subcommands listed, never bare.

GET /api/exo/commands lists what this deployment exposes: for each command its description, REST endpoint, MCP tool, allowed parameters (with their group and type, read from exo), mode (sync or async) and time limit. The same list is the MCP tool exo_commands.

Each command’s description is generated from exo’s own help, and is the same in the listing, in the command’s MCP tool and in /api/docs: what the command does and how it answers, exo’s text with its command-line examples rewritten as request fields (exo locate --present data/ becomes {"present": true, "args": ["data/"]}), the flags that text mentions but the command does not accept, the values the request accepts (which parameters are paths inside the project, and the characters each may use) and the parameters it does accept. Depending on the deployment, paragraphs about flags it does not accept may be left out.

curl -H "Authorization: Bearer $TOKEN" "$EDS/api/exo/commands"

Help

?help=true on a command endpoint answers 200 at once with exo’s own help for the command, and runs nothing; no body is needed:

FieldDescription
kind"exo_command_help", so it is told from a command’s answer at once
commandThe command, e.g. "provenance show"
helpexo’s --help for it, written for exo’s command line; its Flags: list holds only the flags the command accepts here
noteThat the text is exo’s and may mention flags the command does not accept; the accepted ones are under Flags: and in the command’s description
curl -X POST -H "Authorization: Bearer $TOKEN" "$EDS/api/exo/provenance/show?help=true"

Request

Without help=true, the command runs as the deployment configured it (its mode in the listing):

FieldTypeRequiredDescription
pathstring✓Where the command runs: a project folder, or a version folder of a download (e.g. "mnist/v0.1.0"), relative to your workspace or absolute; symlinks are resolved first. Anything else, or anything in the shared path, is refused with 400: exo commands never reach global copies.
argsarray of stringPositional arguments, in order; only for a command configured to take them
a parameterboolean, string, number or arrayOne of the command’s allowed parameters: true for a flag (false leaves it out), a value for any other (a list, for a repeatable one)
Query parameter (MCP: tool argument)RequiredDescription
helptrue for the help instead of a run
userDeployment admins only: run in that user’s workspace. Anyone else who sends it gets 403.
curl -X POST "$EDS/api/exo/locate" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path": "mnist/v0.1.0", "json": true, "missing": true, "args": ["data/"]}'

runs exo locate --json --missing data/ in {workspace}/mnist/v0.1.0.

Validation and safety

The API checks every request before anything runs, and refuses with 422:

exo is started with an argument list, never through a shell, each value written as --key=value. It runs as you, with your credentials, and path and the paths in the request are checked again just before exo starts, in case one was replaced by a symlink in the meantime.

Running

Sync answers

A sync command answers with its result, in the shape of an exo operation without operation_id, last_heartbeat_at and progress: kind, command, input, status (completed or failed), started_at, completed_at, duration_seconds, result and, when failed, failure. A completed command answers 200; a failed one answers with the same body and the status of its failure.reason:

failure.reasonStatus
command_failed422
command_timeout504
project_busy409
exo_version_drift503
internal_error500

A failed command never answers 2xx, and never 5xx for command_failed: clients and proxies retry 5xx, and a command must not run twice. After command_timeout, the command was stopped part-way and may have done some of its work: check before sending it again.

{
  "kind": "exo_command",
  "command": "locate",
  "input": {"path": "mnist", "json": true, "fast": true},
  "status": "completed",
  "started_at": "2026-11-05T10:00:00+00:00",
  "completed_at": "2026-11-05T10:00:01+00:00",
  "duration_seconds": 0.7,
  "result": {"exit_code": 0, "text": "{\"file\":\"GB/file1\",\"type\":\"annex\",\"locked\":true}\n..."},
  "failure": null
}

GET /api/operations/{id}

Returns the current state of an operation. Authorize it either with your JWT or with the capability token from operation_url — not both.

# With your JWT
curl -H "Authorization: Bearer $TOKEN" \
  "$EDS/api/operations/ds-download-dev-mnist-1ad7be7e5b6d17ac"

# With the capability token from operation_url (no login required)
curl "$EDS/api/operations/ds-download-dev-mnist-1ad7be7e5b6d17ac?t=Ux3n_S9pQ2t7bK1v"

Response envelope:

FieldTypeDescription
statusstringrunning, completed, failed, canceled, or terminated
environmentstring | nullEnvironment of the deployment that started the operation (e.g. dev, prd)
progressobject | nullLive progress. Present while running; null otherwise.
resultobject | nullFinal result. Present when completed; null otherwise.
errorstring | nullFailure detail — which activity failed and the root cause
reasonstring | nullMachine-readable failure class, when recognised
messagestring | nullHuman-readable, actionable failure message, when recognised
failed_filesarray | nullFor the download content failures below: a sample (up to 5) of the files that could not be fetched, each with path, key, copies, remotes, and the commit / author that introduced it

Note that a failed operation still returns HTTP 200 — the HTTP status describes the poll, not the work. Always branch on the status field.

The progress object

FieldTypeDescription
stepstring | nullCurrent phase, e.g. cloning, exo_init, syncing, waiting_for_repo_lock
files_syncedintegerAnnexed files fetched so far
bytes_syncedintegerBytes fetched so far
files_totalinteger | nullTotal files in this version (null when unknown)
bytes_totalinteger | nullTotal bytes in this version (null when unknown)
annex_files_totalinteger | nullTotal annexed files in this version (null when unknown)
files_addedintegerFiles staged so far (upload operations)
tsstring | nullTimestamp of the most recent progress report
activitiesarrayPer-activity detail (below)

The *_total fields come from the catalog and are available as soon as the operation starts, so files_synced / files_total can be rendered as a progress ratio from the very first poll.

Each entry in activities describes one in-flight unit of work:

FieldTypeDescription
activity_typestringe.g. check_project_read_permission, project_clone, project_exo_get
statestringscheduled, started, or cancel_requested
attemptinteger | nullCurrent attempt (counts from 1) — climbing means it is retrying
last_failurestring | nullWhy the last attempt failed
stdout_tailstring | nullTail of the underlying command’s stdout
stderr_tailstring | nullTail of the underlying command’s stderr
last_heartbeat_timestring | nullWhen the activity last reported in
step, files_synced, bytes_synced, files_addedSame meaning as above, for this activity alone

A running download:

{
  "status": "running",
  "progress": {
    "step": "syncing",
    "files_synced": 3,
    "bytes_synced": 12058624,
    "files_total": 8,
    "bytes_total": 33576840,
    "annex_files_total": 6,
    "files_added": 0,
    "ts": "2026-09-11T12:55:48.543299+00:00",
    "activities": [
      {
        "activity_type": "project_exo_get",
        "state": "started",
        "attempt": 1,
        "last_failure": null,
        "stdout_tail": "get train-images-idx3-ubyte.gz (from s3-annex...) ok",
        "stderr_tail": null,
        "last_heartbeat_time": "2026-09-11T12:55:48.550314Z",
        "step": "syncing",
        "files_synced": 3,
        "bytes_synced": 12058624,
        "files_added": 0
      }
    ]
  },
  "result": null,
  "error": null,
  "reason": null,
  "message": null
}

The result object

FieldTypeDescription
statusstringok on success; degraded for a download that completed but still misses files
errorstringEmpty on success
scopestringuser or global (downloads and prunes)
repo_dirstringThe project folder a download materialised, in both layouts — see On-disk layout ; for a prune, the project or version directory it removed
repo_urlstringGit URL of the project’s repository (uploads)
files_syncedintegerAnnexed files fetched (downloads)
bytes_syncedintegerBytes fetched (downloads)
verifiedbooleanWhether the download’s completeness check ran
missing_filesarray of stringFiles still absent after the completeness check and one repair attempt (downloads)
contentstringskipped for a download with content: false (files_synced and bytes_synced are 0, status ok); absent otherwise
files_totalinteger | nullTotal files in this version
bytes_totalinteger | nullTotal bytes in this version
annex_files_totalinteger | nullTotal annexed files in this version
files_addedintegerFiles committed (uploads)
commit_shastringCommit created (uploads)
skipped_pathsarray of stringEntries of an upload’s paths that matched no new or modified file, so nothing of them was uploaded
versionstringBranch published to (uploads)
catalog_job_urlstringCataloguing job that indexes the project after the operation finishes (uploads)
permissionobject | nullWhy read access was granted (downloads)
public_accessobject | nullHow publicness was established (global downloads only)

A completed download:

{
  "status": "completed",
  "progress": null,
  "result": {
    "status": "ok",
    "error": "",
    "scope": "user",
    "repo_dir": "/data/users/alice/workspace/mnist",
    "repo_url": "",
    "files_synced": 6,
    "bytes_synced": 33576840,
    "files_total": 8,
    "bytes_total": 33576840,
    "annex_files_total": 6,
    "files_added": 0,
    "commit_sha": "",
    "permission": {
      "granted": true,
      "username": "alice",
      "read_access": "public",
      "matched": "public",
      "reason": "read_access=public grants every user."
    },
    "public_access": null
  },
  "error": null,
  "reason": null,
  "message": null
}

files_synced counts annexed files, so it converges on annex_files_total (6) rather than files_total (8) — the difference is plain git files, which arrive with the clone.

Exo operations

An async exo command ’s operation has its own shape instead of the envelope above; every other operation keeps the envelope.

FieldTypeDescription
operation_idstringThe operation’s id
kindstring"exo_command"
commandstringThe command run, e.g. "provenance add"
inputobjectThe request as validated: path, the parameters sent, and args when sent
statusstringrunning, completed or failed
started_at, completed_atstring | nullcompleted_at is null while running
duration_secondsnumberSo far, while running
last_heartbeat_atstring | nullWhen the worker last reported, while running
progressobject | nullWhile running: stdout_tail and stderr_tail, the last 20 lines of each
resultobject | nullOnce finished: exit_code (null after a time-out, a lost worker or a version drift), data when exo printed JSON or text otherwise, and stderr only when the command failed
failureobject | nullWhen failed: reason (below), message (for command_failed, the last lines of stderr) and detail (null unless there is more)
failure.reasonMeaningWhat to do
command_failedexo exited with a non-zero code; result keeps its outputRead message and result, fix the cause, send the request again
command_timeoutThe command’s time limit was reached and exo was stoppedNarrow the command, or ask for a longer limit
worker_lostThe worker running exo stopped reporting (it died or was restarted)Send the request again
project_busyAnother running operation holds the project; message names itWait for it, then send the request again
exo_version_driftThe worker’s exo is not the version the API read the command’s help fromRetry once the deployment runs one version everywhere
internal_errorAnything else, including output too large for an operation (2 MiB)Read message

Secrets are masked in progress, result and failure, by the worker before anything is stored and again when the operation is read: signed URLs, token=… and the like in any text, and in JSON output the whole value of any key that names a secret (secret, token, password, credential, signature, session, api_key, access_key, …).

{
  "operation_id": "ds-exo-dev-mnist-1a2b3c4d5e6f7a8b",
  "kind": "exo_command",
  "command": "doctor",
  "input": {"path": "mnist", "json": true},
  "status": "failed",
  "started_at": "2026-11-03T10:00:00+00:00",
  "completed_at": "2026-11-03T10:00:12+00:00",
  "duration_seconds": 12.0,
  "last_heartbeat_at": null,
  "progress": null,
  "result": {"exit_code": 1, "data": [{"check": "auth", "status": "FAIL"}], "stderr": "auth: FAIL ..."},
  "failure": {"reason": "command_failed", "message": "auth: FAIL ...", "detail": null}
}

Errors

Request-level problems are returned as standard HTTP errors with a {"detail": "..."} body:

StatusMeaning
400Scope not supported by this deployment, a required destination path is unconfigured, or a prune/describe path outside your workspace and the shared path (prune: not directly in it, or version on a project that is not a download); or an upload source_folder that is a version folder of a worktrees download or its .git-store; or a path/source_folder that is neither absolute nor a single folder name, or a scope that does not match where an absolute path is; or a list user that is not a plain username; or an exo command path that is not a project or version folder in the workspace (or is in the shared path), or a user that is not a plain username
401Missing or invalid JWT
403Your groups are not authorised for this deployment, or global scope was denied because the project is not public; or a list or exo command user from a caller who is not a deployment admin
404Project is not in the catalog; or the operation does not exist / is not yours; or (list) the workspace does not exist; or an /api/exo/… command the deployment does not expose
422Body matched neither download shape, mixed both, or contained an unknown key; or a global-scope download set worktrees, checkout or force, or content: false; or an upload’s paths was empty, had more than 1000 entries, or had an entry that is absolute, leaves the folder, starts with :, or contains a NUL or line break; or a list user with scope=global; or an exo command request the API refuses (see Validation and safety )
502Malformed catalog entry, or the workflow could not be started
503Catalog unreachable, the deployment’s task queue is not configured, or (describe, list) the API does not run as the worker’s user and cannot read the repositories, or (list) the workspace cannot be read, or (exo commands) exo’s version changed since the API started, or exo cannot be run on the API, or (sync exo commands) the API runs as many as it allows already, with Retry-After
504Describe or list took longer than the deployment’s time limit

Failures that happen during the operation are not HTTP errors — they surface on the poll as status: "failed" with error populated, and reason / message set for recognised classes:

{
  "status": "failed",
  "progress": null,
  "result": null,
  "error": "activity 'project_exo_get' failed [MAXIMUM_ATTEMPTS_REACHED]: Code: 1: get: 12 failed",
  "reason": "credentials_expired",
  "message": "Your credentials expired during the download and could not be refreshed. Please submit a new download request with a fresh token."
}
reasonMeaningWhat to do
credentials_expiredYour token expired mid-operation and could not be refreshedSend the same request again with a fresh token
project_busyAnother running operation holds the project (see Project lock ); message names itWait for that operation, then retry
content_unavailableAnnexed content has no known copy, or only in a repository that is not a remote of this deploymentAsk the project’s owners to publish it; see failed_files
remote_not_authorizedThe content is on a configured remote you are not authorized to readRequest access to the project; see failed_files
remote_unreachableThe content is on a configured remote that could not be reachedRetry later; see failed_files
layout_mismatchThe project folder holds the other layout than the request asks for (worktrees, or checkout on a worktrees copy)Download with the layout on disk, or prune the project first
version_mismatchThe plain repository is on another version; message names itSend the request with checkout: true to switch it
local_changesThe update or checkout would discard unpublished work; message lists itPublish or move the work, or send force: true to discard it
divergedThe local branch and origin’s have diverged; message lists the local workPublish or move the work, or send force: true to reset to origin
foreign_directoryThe project folder holds something else: files without a repository, another project’s repository, a repository with no commit, or a symlinkMove it away; force does not apply

failed_files is a bounded sample; message states the true total.

Example: end-to-end walkthrough

EDS=https://eds.example.com     # your deployment's Data Service base URL
TOKEN=<your ExoHub JWT>

# 1. Start the download; capture the operation id
OP=$(curl -s -X POST "$EDS/api/projects/download" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "project_id": "mnist", "version": "v0.1.0", "scope": "user" }' \
  | jq -r .operation_id)

# 2. Poll until the operation reaches a terminal state
while true; do
  BODY=$(curl -s -H "Authorization: Bearer $TOKEN" "$EDS/api/operations/$OP")
  STATUS=$(echo "$BODY" | jq -r .status)
  echo "$BODY" | jq -r '"\(.status) \(.progress.bytes_synced // 0)/\(.progress.bytes_total // 0) bytes"'
  case "$STATUS" in completed|failed|canceled|terminated) break ;; esac
  sleep 10
done

# 3. Read where the data landed
REPO_DIR=$(echo "$BODY" | jq -r .result.repo_dir)
ls "$REPO_DIR"

# 4. Upload results back as a new project (source_folder must be inside your own workspace)
curl -s -X POST "$EDS/api/projects/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "source_folder": "/data/users/alice/workspace/mnist-analysis-alice-20260601", "project_id": "mnist-analysis-alice-20260601" }' \
  | jq .

3. MCP Interface

The Data Service exposes a true Model Context Protocol (MCP) server over HTTP. Agents connect using any MCP-compatible client.

Endpoint

POST /mcp/{deployment_id}

Examples:

Authentication

Pass a valid ExoHub JWT in the Authorization header:

Authorization: Bearer <jwt>

An optional header can override the deployment resolved from the URL path:

X-ExoHub-Deployment: research

Tools

The former tool names request_dataset, upload_dataset, prune_dataset and describe_dataset are still accepted, but are no longer listed; use the names below.

download_project — Download a project

Downloads an ExoHub project into the compute environment for the requesting user.

ParameterTypeRequiredDescription
repositorystring✓¹Full git URL of the project repository
refstringA catalogued ref: commit SHA, tag or branch; latest for the latest catalogued version. Omit it to get the default branch’s current tip.
project_idstringCatalog project id — the alternative to repository (give one or the other)
versionstringCatalogued version of project_id; latest for the latest catalogued version. Omit it to get the default branch’s current tip.
scope"user" | "global"Destination scope (see Scopes ). Defaults to "user".
worktrees, checkout, force, contentbooleanUser scope only, as in the REST endpoint .
wait_secondsnumberOptional, default 0 (immediate return). A positive value waits up to that many seconds for a terminal state before returning the final payload inline, instead of a separate get_operation/wait_for_operation poll. MCP-only — there is no REST equivalent.

Returns: an operation_id and an operation_url — poll with get_operation (or long-poll with wait_for_operation) for progress.

¹ Give repository (with optional ref) or project_id (with optional version), never both — the same two shapes as the REST endpoint .

upload_project — Upload a folder as a new project version

Uploads a local folder in the compute environment in place as a new ExoHub project version: the source directory itself becomes the project. It must be inside the requester’s own workspace — there is no scope parameter, and uploads never target the global path. By default the published project is not private: the repository is created with internal visibility and is readable by any authenticated ExoHub user. Narrow it with read_access and viewers, or widen it to anyone with read_access: "public".

ParameterTypeRequiredDescription
source_folderstring✓The directory to upload: an absolute path, or the name of a folder directly in your workspace. Must be inside your own workspace.
project_idstringCatalog project id (also the repository name). Defaults to the last path segment of source_folder.
read_access"public" | "authenticated" | "viewers" | "owners"Who may read the project. Omit it to keep the current/default value.
ownersarray of stringUsernames/groups that may publish new versions. Replaces the current owners; cannot be empty.
viewersarray of stringUsernames/groups that may read the project when read_access is "viewers".
commit_messagestringMessage for the upload’s commit. Omit it for "feat: upload project <project_id>".
pathsarray of stringUpload only these paths (1 to 1000 entries), as in the REST endpoint .

Returns: an operation_id and an operation_url — poll with get_operation (or long-poll with wait_for_operation) for progress.

prune_project — Delete a project’s local copy

Same parameters and behaviour as POST /api/projects/prune : path (required; an absolute path or a folder name), scope, version, force.

Returns: an operation_id and an operation_url — poll with get_operation (or long-poll with wait_for_operation).

describe_project — Describe a project’s local copy

Same parameters and response as GET /api/projects/describe : path (required; an absolute path or a folder name) and scope. Answers at once — no operation to poll.

list_projects — List the projects in a workspace

Same parameters and response as GET /api/projects/list : scope and, for deployment admins only, user. Answers at once — no operation to poll.

exo_commands and exo_<command>[_<subcommand>] — Exo commands

Only on a deployment that exposes exo commands : exo_commands lists them, as GET /api/exo/commands, and each exposed command is a tool named after it (exo_doctor, exo_provenance_show; a - becomes _), its description the command’s generated description. A command’s tool takes the same body as its REST endpoint (path, args, the allowed parameters), plus help (true for exo’s help instead of a run) and, for deployment admins only, user.

Returns: for a sync command, its result, as the sync answer ; a failure is a tool error carrying the same body. For an async one, an operation_id and an operation_url — poll with get_operation (or long-poll with wait_for_operation). With help: true, exo’s help, as ?help=true answers it.

get_operation — Poll async operation status

ParameterTypeRequiredDescription
operation_idstring✓Operation ID returned by download_project, upload_project, prune_project or an exo_* tool

Returns: the same envelope as GET /api/operations/{id} — status, progress, result, and failure fields.

wait_for_operation — Long-poll an operation to completion

Long-polls an existing operation (from download_project, upload_project, prune_project or an exo_* tool) until it reaches a terminal state or timeout_seconds elapses, instead of repeatedly calling get_operation yourself.

ParameterTypeRequiredDescription
operation_idstring✓Operation ID returned by download_project, upload_project, prune_project or an exo_* tool
timeout_secondsnumberHow long to wait for a terminal state before returning.

Returns: the same terminal payload as get_operation if the operation finishes in time (status: completed/failed/canceled/terminated plus result or error). Otherwise returns a status: "running" payload carrying next_action — a ready-to-call {tool: "wait_for_operation", arguments: {operation_id, timeout_seconds}} — so you can call it again to keep waiting; the workflow keeps running server-side even if the connection drops.

Example: Full Agent Workflow

// 1. Download a project into the user workspace
{
  "tool": "download_project",
  "arguments": {
    "dataset": "datasets/reference-genome-hg38",
    "ref": "v2.1.0",
    "scope": "user"
  }
}
// → { "operation_id": "op_01HXYZ..." }

// 2. Poll until complete
{
  "tool": "get_operation",
  "arguments": { "operation_id": "op_01HXYZ..." }
}
// → { "status": "completed", "path": "/data/users/<you>/datasets/reference-genome-hg38" }

// 3. ... agent processes data, writes results into its own workspace at
//    /data/users/<you>/workspace/hg38-analysis-results ...

// 4. Upload the results as a new project (source_folder must be inside your own workspace)
{
  "tool": "upload_project",
  "arguments": {
    "source_folder": "/data/users/<you>/workspace/hg38-analysis-results",
    "project_id": "hg38-analysis-results"
  }
}
// → { "operation_id": "op_01HABC..." }

// 5. Poll until uploaded
{
  "tool": "get_operation",
  "arguments": { "operation_id": "op_01HABC..." }
}
// → { "status": "completed", "dataset": "datasets/hg38-analysis-results@v0.1.0" }

4. Scopes

The scope parameter controls where a downloaded project lands. It defaults to "user".

user scope

global scope

Fail-closed: if the project does not meet the global eligibility criteria, the operation is rejected with an access error. No partial downloads occur.

On-disk layout

Within the scope’s destination root, each project gets one folder, {destination}/{project_id} (result.repo_dir), in one of two layouts:

{destination}/{project_id}/
├── .git-store/        shared git + annex objects for every version
├── v0.1.0/            worktree — what you read
└── v0.2.0/            worktree — a second version, sharing the store above

A project keeps the layout it was first downloaded in. Because worktree versions share one object store, downloading a second version of the same project only transfers what is genuinely new. Version names are URL-encoded, so a ref like release/2.9.0 becomes the directory release%2F2.9.0; a request without a version uses the default branch’s folder (e.g. main).


5. Async Operations

Downloads, uploads and prunes are long-running operations backed by Temporal workflows inside ExoWorkers; they may take seconds to minutes depending on project size. describe is the exception: it answers synchronously and starts no operation.

Operation Lifecycle

POST /api/projects/download   (or /upload, /prune)
        │
        ▼
  202 Accepted — operation_id + operation_url returned immediately
        │
        ▼
  Temporal workflow executes in background
        │
        ├── status: "running"    (actively transferring / committing)
        ├── status: "completed"  (done; `result` populated)
        ├── status: "failed"     (`error` populated)
        ├── status: "canceled"   (cancelled before finishing)
        └── status: "terminated" (forcibly stopped by an operator)

Operation identity

Operation IDs are deterministic, derived from what the operation acts on and for whom:

OperationIdentity
Download, user scopeproject + version (or the default branch) + worktrees/checkout/force + username
Download, global scopeproject + version or the default branch (shared across its owners and admins)
Uploadsource directory + username (not the project id — the source directory is consumed in place, so two uploads must never run against it at once)
Prune, user scopeproject directory + version + username
Prune, global scopeproject directory + version (shared across its owners and admins)

Re-issuing a request that is already in flight does not start a second workflow — it returns the existing operation_id. This makes retries safe, lets several agents converge on one shared global download, and means a repository-shaped request and a project-shaped request for the same project return the same operation. Different versions of the same project are distinct operations; whether they may run at the same time is decided by the project lock below.

Project lock

Every download, upload, prune and exo command holds its project — the directory directly inside your workspace or the shared path — for as long as it runs:

OperationHolds the projectRuns alongside
Download, worktrees (global scope always)sharedother worktrees downloads of the project (e.g. another version) — their steps take turns on the project’s shared store, so the transfers themselves run one after another
Download, plain repositoryexclusivenothing on that project: a plain repository has one working tree
Uploadexclusivenothing on that project
Pruneexclusivenothing on that project
Exo commandexclusivenothing on that project

An operation that would conflict is still accepted (202) but fails at once with reason: "project_busy", and message names the operation in its way — wait for it, then send the request again. describe shows who holds a project in running_operations. A holder that ended without releasing (a crash, an operator terminating it) never blocks the project: the next operation finds it is no longer running and takes over.

A sync exo command is answered at once instead: 409 with failure.reason: "project_busy". While it runs, it holds the project like any operation; if the API process running it dies, its hold lapses on its own, at the latest about 100 seconds after it started.

Polling

Poll get_operation (MCP) or GET /api/operations/{id} (REST) until status is completed, failed, canceled, or terminated. There is no push or webhook mechanism — polling is the intended pattern.

A few seconds between polls is plenty; every poll is a Temporal query, and progress counters only advance as files land. Back off to 15–30 seconds for large projects, and treat the activities entries as the place to look when an operation seems stuck — a climbing attempt with a last_failure means it is retrying, and stderr_tail usually says why.


6. Auth & Access Control

JWT Validation

The Data Service validates the Authorization: Bearer <jwt> token independently on every request. Tokens are issued by ExoHub’s OIDC OAuth server. The service never caches user identity across requests.

Capability Tokens

Every 202 response includes an operation_url — the operation’s status URL with an unguessable capability token appended as ?t=<token>:

https://eds.example.com/api/operations/ds-download-dev-mnist-1ad7be7e5b6d17ac?t=Ux3n_S9pQ2t7bK1v

Anyone holding that URL can poll the operation without logging in, which makes it safe to paste into a browser, a chat message, or a CI log line. The operation ID itself is deterministic and therefore guessable, so it is not treated as a secret — the token is. A request carrying a wrong token returns 404 rather than 403, and never falls back to identity auth, so a bad link cannot be used to probe which operations exist.

Credential Vending

For data held in object storage, the Data Service does not hold standing data-access credentials. Instead it exchanges the requesting user’s identity token via OIDC (the STS exchange) for that user’s own short-lived cloud credentials, and uses those to read the data directly. Access is therefore bounded by the user’s own identity and entitlements — the service cannot read anything the user could not read themselves. These per-user credentials are cached briefly server-side (until shortly before they expire), so a multi-file transfer reuses a single token exchange rather than re-exchanging per object.

Per-Project Access Checks

Before starting any download, the Data Service checks that the requesting user (identified by the JWT) has read access to the requested project. This check is performed against ExoHub’s access control system, not the service account’s permissions. The outcome is recorded in the operation’s result.permission so you can see why access was granted.

Deployment-Level Authorization

Each deployment restricts which user groups may use it via an allowed_groups configuration key. Requests from users outside the allowed groups are rejected with 403 before any project check occurs. The check is fail-closed: a deployment with no allowed groups configured accepts nobody, and the wildcard "*" is required to allow all users.


7. Provenance

The Data Service records precise provenance for every upload operation, ensuring projects are always traceable back to their origin. This is git-level provenance (who committed what, and how data was fetched) — a different, lower-level concept from the exo provenance W3C PROV records covered in the user guide , which track the lineage of individual files and folders within a repository.

Download Provenance

Downloads do not use exo download. Instead, the service performs a full git workflow:

  1. git clone — clones the ExoHub project repository
  2. exo init — initializes the local ExoHub workspace
  3. exo get — materializes the requested file content from storage backends

exo get is a uni-directional pull (it only fetches annexed content into the local repo) — deliberately not exo sync, which is bidirectional and would push local state back, violating the read-only contract of a download. This ensures the local workspace is a fully-valid ExoHub clone, not a bare file copy.

Upload Provenance

Every upload_project operation commits as the requesting user, not a service account:

Git fieldValue
AuthorRequesting user (name + email from JWT, falling back to the service identity if those claims are absent)
CommitterRequesting user (same name + email as Author)

There is no Co-authored-by trailer and no separate “Data Service account as committer” step: the upload sets both GIT_AUTHOR_* and GIT_COMMITTER_* to the uploading user’s identity, so the requesting user is recorded as both the author and the committer of the resulting commit.


8. Configuration

Each deployment is configured independently. Below are the key configuration parameters an operator sets per deployment.

KeyDescription
deployment_idUnique identifier for this deployment (used in the MCP URL path)
data_rootRoot directory on the compute filesystem where projects are staged
user_workspace_patternTemplate for per-user workspace paths (e.g. {data_root}/users/{username}/workspace)
global_pathShared path for global-scoped projects
scopesWhich scopes this deployment accepts (a request for any other scope is rejected with 400)
allowed_groupsExoHub groups allowed to use this deployment ("*" allows all)
git_locationBase URL of the ExoHub git hosting (used for git clone)
git_annex_remotesAnnex remote definitions (annex, export, atlas) used during exo get

A deployment’s effective configuration can be read at runtime from its discovery endpoint:

curl -s "$EDS/" | jq .

One setting is an environment variable of the API process rather than a deployment key, and is not shown by the discovery endpoint:

Environment variableDescription
DS_DESCRIBE_TIMEOUT_SECONDSHow long describe may read a project’s local copy before answering 504 (default 60)

Integration with ExoHub Components

The Data Service is deployed alongside ExoWorkers — Temporal workflows execute the actual git and transfer operations. The service itself is a thin HTTP frontend that dispatches work to ExoWorkers and forwards status back to the caller. The one exception is describe, which reads the project on the API itself; for that the API runs as the same user as the workers.