PermuteDocs
Go to Permute

Apps · appsSourceFileGet

Read an app source file

Returns exact file bytes as base64 from the source manifest of the specified app revision. This public endpoint requires an API key with app write permission. Invited editors can download source from App details using their platform user session. Source files are never served through the hosted app.

GET/v1/apps/{applicationId}/source-file
betaapiKeyworkspace

When to use

Read exact source bytes from a saved app revision.

For agents

Requires app write permission. The response contains base64 bytes for a file in that revision’s source manifest. Prefer checkoutApp from @permute/sdk/deploy to download and verify a complete project into a new folder.

Example

typescript
import { PermuteClient } from '@permute/sdk';

const orgClient = new PermuteClient({
  apiKey: process.env.PERMUTE_API_KEY!,
});

const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);

const result = await client.apps.sourceFile('appl_abcdefghijklmnopqrstuvwx', { revisionId: 'rvsn_source123', path: 'src/main.tsx' });

Response

json
{
  "data": {
    "data": "ZXhwb3J0IHt9Ow=="
  }
}