Skip to content

Detect a repository's app type

GET/v1/git-connections/github-app/detect

Inspects a repository branch's file list and suggests how to build and run it: whether it is a static site or a service, the framework, the root directory (for monorepos) and the recommended build method. Only file names are inspected, not file contents.

How detection works:

  • The repository root and common app folders (apps/web, frontend, web, api, server, backend and so on) are checked, along with every other folder. The best match wins.
  • Framework config files are recognised first, for example Next.js, Nuxt, Remix and SvelteKit (service), and Astro, Gatsby, Angular and Vite (static). Then Go, Rust, Laravel, PHP, Rails, Ruby, Java, Elixir and Deno projects (service). Then generic markers: package.json, requirements.txt, pyproject.toml, index.php and index.html.
  • A Dockerfile in a folder makes dockerfile the recommended build method and sets dockerfile_path. railpack is always supported.

When nothing is recognised, detected is false and recommended_build_method is omitted.

Requires the secrets read permission (owner, admin or developer role).

Authentication

Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.

Query parameters

repostringRequired

Repository in owner/name form. Must not contain spaces.

branchstring

Branch to inspect. Defaults to main.

Default main

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Response

200

The detection result.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
detectedbooleanRequired

true when a supported app was recognised.

app_typestring

static for sites built to static files, service for apps that run a server. Omitted when nothing was detected.

One ofstaticservice

frameworkstring

Detected framework or language, for example Next.js, Vite, Go, Python, Static site or Dockerfile. Omitted when nothing was detected.

recommended_build_methodstring

Suggested build method. dockerfile when a Dockerfile was found, otherwise railpack. Omitted when nothing was detected.

One ofrailpackdockerfile

supported_build_methodsarray of stringsRequired

Build methods that can be used. Always includes railpack. dockerfile is added when a Dockerfile was found.

One ofrailpackdockerfile

root_directorystringRequired

Folder the app lives in, relative to the repository root. Empty string for the root.

dockerfile_pathstring

Path of the detected Dockerfile. Omitted when there is none.

messagestringRequired

Human-readable summary of what was detected.

Errors

StatusMeaning
400repo is missing or contains spaces.
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404No GitHub account is connected, or none matches the repository's owner.
500GitHub could not be reached, or the repository or branch is not accessible to the app.

Errors use the standard error format.