Disconnect a connection - Spacefast Docs

Disconnect a connection

Purges the stored credential, tombstones the connection, and audits it. Idempotent: disconnecting an already-disconnected connection is a no-op.

Request

POST /v1/connectors/connections/{connectionId}/disconnect

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:

connectors:write

Path parameters

connectionId string required

Query parameters

team string

Responses

200 Response for status 200

{
  "$schema": "string<uri>",
  "data": {
    "id": "string",
    "connector": "string",
    "owner": "string",
    "displayName": "string",
    "description": "any",
    "status": "string",
    "identityLabel": "any",
    "credentialConfigured": true,
    "authMethod": "any",
    "scopes": [ "string" ],
    "isDefault": true,
    "toolCount": 0,
    "createdBy": "any",
    "lastCheckedAt": "string<date-time>",
    "revokedAt": "string<date-time>",
    "createdAt": "string<date-time>",
    "updatedAt": "string<date-time>"
  },
  "operation": {
    "id": "string",
    "kind": "string",
    "status": "string",
    "resources": [{
      "type": "string",
      "id": "string"
    }],
    "progress": {
      "total": 0,
      "completed": 0,
      "failed": 0
    },
    "diagnostics": [{
      "code": "string",
      "severity": "string",
      "message": "string",
      "path": "any",
      "provider": "any",
      "details": { },
      "fix": "any",
      "retryable": true
    }],
    "createdAt": "string<date-time>",
    "finishedAt": "any"
  }
}

Error Response

{
  "$schema": "string<uri>",
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "pointer": "any",
  "details": { },
  "suggestions": ["string"],
  "next": ["string"],
  "requestId": "string"
}

Try it

cURL

curl -X POST "https://api.spacefast.com/v1/connectors/connections/string/disconnect" \
  -H "Authorization: Bearer YOUR_TOKEN"

JavaScript

const response = await fetch("https://api.spacefast.com/v1/connectors/connections/string/disconnect", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});

Python

import requests

response = requests.post(
    "https://api.spacefast.com/v1/connectors/connections/string/disconnect",
    headers={
        "Authorization": "Bearer YOUR_TOKEN"
    },
)