---
title: "Analyze a source connection"
method: POST
path: "/v1/spaces/{spaceId}/source/connection/analyze"
tags: ["Git"]
---

# Analyze a source connection

`POST /v1/spaces/{spaceId}/source/connection/analyze`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/source/connection/analyze`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.spacefast.com/v1/auth/oauth2/authorize`, token URL `https://api.spacefast.com/v1/auth/oauth2/token`; client credentials, token URL `https://api.spacefast.com/v1/auth/oauth2/token`, scopes: `spaces:read`)

Detects framework settings and unsupported platform configuration for a source connection.

## Path parameters

- `spaceId` string, required

## Query parameters

- `connectionType` 'connected' | 'hosted': Which of the space's repository connections to act on: `connected` for the repository you linked from a provider, `hosted` for the one Spacefast hosts and you push to.

## Request body

- object
  - `ref` string
  - `rootDirectory` string, nullable

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `detected` object, required: Resolved build settings. Builds persist this as an immutable `settingsSnapshot`.
      - `rootDirectory` string, nullable, required
      - `installDirectory` string, nullable, required
      - `installCommand` string, nullable, required
      - `buildCommand` string, nullable, required
      - `outputDirectory` string, nullable, required
      - `ignoredBuildCommand` string, nullable, required
      - `frameworkPreset` string, nullable, required
      - `platformPreset` string, nullable, required
      - `allowUnsupportedPlatformFeatures` boolean, required
      - `timeoutSeconds` integer, required
    - `detectedFiles` string[], required
    - `candidates` object[], required
      - `rootDirectory` string, nullable, required
      - `installDirectory` string, nullable, required
      - `installCommand` string, nullable, required
      - `buildCommand` string, nullable, required
      - `outputDirectory` string, nullable, required
      - `ignoredBuildCommand` string, nullable, required
      - `frameworkPreset` string, nullable, required
      - `platformPreset` string, nullable, required
      - `allowUnsupportedPlatformFeatures` boolean, required
      - `timeoutSeconds` integer, required
      - `workingDirectory` string, required
      - `confidence` integer, required
      - `reasons` string[], required
      - `detectedFiles` string[], required
    - `platformConfigs` object[], required
      - `platform` 'vercel' | 'netlify' | 'cloudflare-pages', required
      - `rootDirectory` string, nullable, required
      - `installDirectory` string, nullable, required
      - `installCommand` string, nullable, required
      - `buildCommand` string, nullable, required
      - `outputDirectory` string, nullable, required
      - `unsupportedFeatures` string[], required
    - `unsupportedFeatures` string[], required
    - `blocked` boolean, required
    - `message` string, nullable, required

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

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