Delete a commit note - Spacefast Docs
Delete a commit note
Removes the Git note attached to a commit and returns the new notes ref tip. The commit itself is untouched.
DELETE /v1/spaces/{spaceId}/source/notes
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:write
Path parameters
spaceId string required
Request body
required application/json
connectionTypestring required
Allowed:connected,hostedshastring required
Commit whose note to remove.
min length 1expectedRefShastring
Commit the notes ref must currently point at. The write is rejected when it moved.
min length 1authorobjectnamestring required
min length 1emailstringrequired
matches^(?!\.)(?!.*\.\.)([A-Za-z0-9\'_\-\.]+)\@[A-Za-z0-9]+\.[A-Za-z]{2,}$
Responses
200 Response for status 200
{
"$schema": "string<uri>",
"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"
},
"repositoryId": "string",
"sha": "string",
"targetRef": "string",
"baseCommit": "string",
"newRefSha": "string",
"success": true,
"status": "string",
"message": "string"
}
}
Error Response
{
"$schema": "http://example.com",
"type": "string",
"title": "string",
"status": -9007199254740991,
"detail": "string",
"code": "string",
"pointer": "string",
"details": {
"property1": null,
"property2": null
},
"suggestions": [
"string"
],
"next": [
"string"
],
"requestId": "string"
}
Try it
Server Base URL: https://api.spacefast.com
cURL Example
curl -X DELETE "https://api.spacefast.com/v1/spaces/string/source/notes" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"connectionType": "connected",
"sha": "string",
"expectedRefSha": "string",
"author": {
"name": "string",
"email": "user@example.com"
}
}'
JavaScript Example
const response = await fetch("https://api.spacefast.com/v1/spaces/string/source/notes", {
method: "DELETE",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"connectionType\": \"connected\",\n \"sha\": \"string\",\n \"expectedRefSha\": \"string\",\n \"author\": {\n \"name\": \"string\",\n \"email\": \"user@example.com\"\n }\n}"
});
Python Example
import requests
response = requests.delete(
"https://api.spacefast.com/v1/spaces/string/source/notes",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
data="{\n \"connectionType\": \"connected\",\n \"sha\": \"string\",\n \"expectedRefSha\": \"string\",\n \"author\": {\n \"name\": \"string\",\n \"email\": \"user@example.com\"\n }\n}",
)