---
topic: source
connector: "Your Embarko connector's \"Download the app's code\" tool, with appName"
api: "GET https://ship.embarko.ai/api/apps/{app-name}/source"
requires: [claim]
---

[← Guide home](https://embarko.ai/docs)

# Get the latest code

**On this page:** With the connector, Over HTTP, Limits, Errors, What to tell the person

> Plain words unless the person is a developer. Never invent a link, name or code. [Rules](https://embarko.ai/docs/prerequisites) Needs first: [claim](https://embarko.ai/docs/claim) (over HTTP only).

Embarko keeps the code of every deploy. Before you change an app you did not deploy in this conversation, download the live code and work from it, so you never overwrite someone else's changes with an old copy. The answer is a link that works for 10 minutes to a .tar.gz of exactly what was built. Secrets are not in it: .env files are left out (templates like .env.example stay), and so are node_modules, .git and build caches.

**Connector:** Your Embarko connector's "Download the app's code" tool, with appName

**Done when:** You have the live code unpacked and are making your change on top of it.

**With the connector**

1. Call the "Download the app's code" tool with appName (add deployment for an earlier version).
2. Download the url it returns within 10 minutes and unpack it.
3. Make the change on that code, then redeploy as usual.

**Over HTTP**

1. GET https://ship.embarko.ai/api/apps/{app-name}/source with the token. Add ?deployment={deploymentId} for an earlier version (ids from GET .../deployments; entries with hasSource: true have code).
2. Download url from the reply within 10 minutes (curl -L -o app.tar.gz "<url>") and unpack it (tar -xzf app.tar.gz). filename, version and bytes say what it is.
3. Make the change on that code and redeploy. Add your own .env values again if the app needs them locally; on Embarko they stay in the app's env vars.

**Limits**

- Kept for deploys since November 2026: the newest 20 per app, plus the live one.
- A deploy over 100 MB packed has no code kept.
- Needs Can contribute or Can edit. Someone with Can edit can turn downloads off for Can contribute.

**Errors**

| Code | Status | Retry | What to do |
| --- | --- | --- | --- |
| `source_not_kept` | 404 | No | That version's code was not kept (older, or too big). Use the code you have, or ask the person who deployed it; the next deploy keeps code from then on. |
| `no_live_deployment` | 404 | No | The app has never been deployed. There is no code yet. |
| `deployment_not_found` | 404 | No | That deploymentId is not one of this app's. Read GET .../deployments again. |
| `source_download_off` | 403 | No | The owner turned code downloads off. Tell the person to ask someone with Can edit. |
| `source_unavailable` | 503 | Yes, after a minute | Download links can't be made right now. |
| `unauthorized` | 401 | No | Bad token. |
| `permission_denied` | 403 | No | The person who made this token is not allowed to do this. The reply names the permission and their access to the app (or their role). Nothing changed. Tell the person (say_to_user.no_permission); do not try another way round it. |

**What to tell the person**

- done: "I got the latest code of {app-name} from Embarko, so my change builds on what is live now."

**Next:** Make the change on the downloaded code and redeploy.

**Related:** [deploy](https://embarko.ai/docs/deploy) · [team](https://embarko.ai/docs/team) · [rollback](https://embarko.ai/docs/rollback)

---

[Guide home](https://embarko.ai/docs) · JSON: add .json