Delete an ephemeral repository branch - Spacefast Docs

Delete an ephemeral repository branch

Delete a short-lived repository branch after a preview or experiment.

Endpoint

DELETE /v1/spaces/{spaceId}/source/ephemeral-branch

Authorization

Authorization Bearer Token

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

Authorization OAuth2 Access Token

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

Scopes: spaces:write

Path Parameters

Query Parameters

Request Body

Content-Type: application/json

Responses

200 Response for Status 200

Example Request

curl -X DELETE "https://api.spacefast.com/v1/spaces/string/source/ephemeral-branch?connectionType=connected" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"branch": "string", "ttlSeconds": 86400, "readOnlyRefs": ["string"]}'

Example Response

{
  "$schema": "http://example.com",
  "data": {
    "repositoryConnection": {
      "id": "string",
      "spaceId": "string",
      "provider": "github",
      "connectionType": "connected",
      "repositoryId": "string",
      "installationId": null,
      "cloneUrlConfigured": false,
      "upstreamUrlConfigured": false,
      "repositoryName": "string",
      "repositoryFullName": "string",
      "defaultBranch": "string",
      "productionBranch": "string",
      "credentialConfigured": true,
      "autoDeployProduction": true,
      "autoDeployPreviews": true,
      "buildSettings": {
        "rootDirectory": null,
        "installDirectory": null,
        "installCommand": null,
        "buildCommand": null,
        "outputDirectory": null,
        "ignoredBuildCommand": null,
        "frameworkPreset": null,
        "platformPreset": null,
        "allowUnsupportedPlatformFeatures": false,
        "timeoutSeconds": 900
      },
      "syncStatus": "idle",
      "providerAccessStatus": "active",
      "providerAccessError": null,
      "lastSyncedAt": "2019-08-24T14:15:22Z",
      "lastSyncError": "string",
      "syncRunId": "string",
      "connectedUserId": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z"
    },
    "branch": {
      "repositoryId": "string",
      "branch": "string",
      "baseRef": "string",
      "baseBranch": "string",
      "ephemeral": true
    }
  }
}