Compare source branches - Spacefast Docs

Compare source branches

Compare one source branch with another branch. The default branch is the base if you do not set base.

GET /v1/spaces/{spaceId}/source/diff

Authorization

Authorization Bearer token · header required

Authorization: Bearer <token>

with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).

or

Authorization OAuth2 access token · header required

OAuth 2.0 with Spacefast scopes. People use the authorization code flow; machines use client credentials.

Scopes: spaces:read

Path parameters

Query parameters

Responses

200 Response for status 200

Error Response

Try it

cURL Example

curl -X GET "https://api.spacefast.com/v1/spaces/string/source/diff?connectionType=connected&branch=string&patch=false" \
  -H "Authorization: Bearer YOUR_TOKEN"

JavaScript Example

const response = await fetch("https://api.spacefast.com/v1/spaces/string/source/diff?connectionType=connected&branch=string&patch=false", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});

Python Example

import requests

response = requests.get(
    "https://api.spacefast.com/v1/spaces/string/source/diff?connectionType=connected&branch=string&patch=false",
    headers={
        "Authorization": "Bearer YOUR_TOKEN"
    },
)