Detect a repository's build settings
const url = 'https://api.deploybase.eu/api/v1/api/v1/projects/detect';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"branch":"main","provider":"github","repo_url":"https://codeberg.org/acme/site","root_directory":"apps/site","token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.deploybase.eu/api/v1/api/v1/projects/detect \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "branch": "main", "provider": "github", "repo_url": "https://codeberg.org/acme/site", "root_directory": "apps/site", "token": "example" }'Reads a repository from its https URL and proposes the branch, root directory, framework, package manager, build command and output folder, each with the evidence behind it (source) and whether it was read from the repository or is our default (kind). checks lists what will stop the site from building or running as a static site. Only what detection needs is read: the refs, one shallow blobless fetch of the trees, and a few small files. The host must be public (private, link-local, metadata and reserved addresses are refused at connect time), redirects must stay on the same host, and the whole read is limited in size and time. Limited per team. 422 GIT_VALIDATION_FAILED carries details.git_error_code: auth_required (private or missing, no token sent), auth_failed (the token was refused), repo_not_found, host_not_found, host_not_allowed, timeout, too_large, connection_failed, unknown.
Authorizations
Section titled “ Authorizations ”Request Body
Section titled “ Request Body ”Repository to read
object
Branch to read. Omit to read the repository’s default branch.
Example
mainProvider picks the username the token is sent with (e.g. oauth2 for GitLab).
RepoURL is the repository’s https clone URL.
Example
https://codeberg.org/acme/siteRootDirectory is the folder to detect in. Omit to let detection find it.
Example
apps/siteToken for a private repository. Used for this request only, never stored or logged.
Responses
Section titled “ Responses ”OK
object
object
object
object
object
Title is the check’s own heading, when it has one; the setup page otherwise heads it by its severity.
object
Commit is the full id of the commit detection read, on the chosen branch.
object
Branch is only set when detection knew the repository’s branches (the Git URL path).
object
Candidates lists the folders to choose from when a repository holds several apps. Only on root_directory.
Kind is detected, default or requested.
Label is a human name for Value, e.g. “Astro 5”. Only on the framework.
Source says where Value came from, in words: “found astro.config.mjs”.
Value is the setting. null means there is nothing to set (no framework we know, no package manager because there is no package.json). An empty string is a real value: no build command, or the top of the repository.
object
Candidates lists the folders to choose from when a repository holds several apps. Only on root_directory.
Kind is detected, default or requested.
Label is a human name for Value, e.g. “Astro 5”. Only on the framework.
Source says where Value came from, in words: “found astro.config.mjs”.
Value is the setting. null means there is nothing to set (no framework we know, no package manager because there is no package.json). An empty string is a real value: no build command, or the top of the repository.
object
Candidates lists the folders to choose from when a repository holds several apps. Only on root_directory.
Kind is detected, default or requested.
Label is a human name for Value, e.g. “Astro 5”. Only on the framework.
Source says where Value came from, in words: “found astro.config.mjs”.
Value is the setting. null means there is nothing to set (no framework we know, no package manager because there is no package.json). An empty string is a real value: no build command, or the top of the repository.
object
Candidates lists the folders to choose from when a repository holds several apps. Only on root_directory.
Kind is detected, default or requested.
Label is a human name for Value, e.g. “Astro 5”. Only on the framework.
Source says where Value came from, in words: “found astro.config.mjs”.
Value is the setting. null means there is nothing to set (no framework we know, no package manager because there is no package.json). An empty string is a real value: no build command, or the top of the repository.
object
Candidates lists the folders to choose from when a repository holds several apps. Only on root_directory.
Kind is detected, default or requested.
Label is a human name for Value, e.g. “Astro 5”. Only on the framework.
Source says where Value came from, in words: “found astro.config.mjs”.
Value is the setting. null means there is nothing to set (no framework we know, no package manager because there is no package.json). An empty string is a real value: no build command, or the top of the repository.
object
Candidates lists the folders to choose from when a repository holds several apps. Only on root_directory.
Kind is detected, default or requested.
Label is a human name for Value, e.g. “Astro 5”. Only on the framework.
Source says where Value came from, in words: “found astro.config.mjs”.
Value is the setting. null means there is nothing to set (no framework we know, no package manager because there is no package.json). An empty string is a real value: no build command, or the top of the repository.
Example
{ "data": { "checks": [ { "severity": "blocking" } ], "repo": { "visibility": "public" }, "settings": { "branch": { "kind": "detected" }, "build_command": { "kind": "detected" }, "framework": { "kind": "detected" }, "output_dir": { "kind": "detected" }, "package_manager": { "kind": "detected" }, "root_directory": { "kind": "detected" } } }}Invalid input; details.field names the field
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Forbidden
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}GIT_VALIDATION_FAILED with details.git_error_code
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}RATE_LIMIT_EXCEEDED: too many detections for this team
object
object
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Live 174db30c built