---
title: "Read the server code of an app"
method: GET
path: "/apps/{id}/code"
tags: ["Apps"]
---

# Read the server code of an app

`GET /apps/{id}/code`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/apps/{id}/code`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `sites:read`)

Read-only. main_module and the modules of the running version, or of a kept earlier version with version. Use it to continue building after a break or in a new chat: read the code, change what is needed, and deploy only the changed modules with keep_existing_modules: true. One answer holds at most about 200,000 characters of code; a module that does not fit comes without content (truncated: true) and can be read alone with module.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `version` integer
- `module` string

## Response `200`

The code.

- object
  - `object` 'app_code', required
  - `app_id` string, uuid, required
  - `version` integer, required: The version these modules belong to.
  - `running_version` integer, required: The version that runs now.
  - `main_module` string, required: The module with export default { fetch }.
  - `modules` object[], required: The main module first, then the others by name.
    - `name` string, required
    - `type` 'esm' | 'json' | 'text', required
    - `bytes` integer, required
    - `content` string, nullable, required: The module's text. null when the answer was full: ask for it alone with ?module=.
    - `truncated` boolean, required: true: content is missing or cut off because the answer has a size limit; ask for this module alone with ?module=.

## Other responses

- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required.
- `404`: Not Found: not_found.
- `422`: Unprocessable Content: validation_failed.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

[API](https://skmtc.dev/hypamoon/apis/hypamoon-api.md) · [All operations](https://skmtc.dev/hypamoon/apis/hypamoon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hypamoon/apis/hypamoon-api/revisions/9f0b90004c06?raw)
