# Delete a repository tag

Deletes a tag from the repository. The commit it pointed at is untouched.

## DELETE `/v1/spaces/{spaceId}/source/tags`

### 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`

- `connectionType` string required

Allowed: `connected`, `hosted`

- `name` string required

Tag to delete. min length 1

### Responses

**200** Response for status 200

```json
{
  "$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",
    "tag": {
      "name": "string",
      "message": "string"
    }
  }
}
```

### Try it

**Server**

Base URL: `https://api.spacefast.com`

#### Request

- **Parameters**

- `spaceId` path *

- **Body** `application/json`

```json
{
  "connectionType": "connected",
  "name": "string"
}
```

#### Example cURL Request

```bash
curl -X DELETE "https://api.spacefast.com/v1/spaces/string/source/tags" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "connectionType": "connected",
  "name": "string"
}'
```

#### Example JavaScript Request

```javascript
const response = await fetch("https://api.spacefast.com/v1/spaces/string/source/tags", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: "{\n  \"connectionType\": \"connected\",
  \"name\": \"string\"\n}"
});
```

#### Example Python Request

```python
import requests

response = requests.delete(
    "https://api.spacefast.com/v1/spaces/string/source/tags",
    headers={
        "Authorization": "Bearer YOUR_TOKEN",
        "Content-Type": "application/json"
    },
    data="{\n  \"connectionType\": \"connected\",\n  \"name\": \"string\"\n}",
)
```

### Response

#### 200 Default

```json
{
  "$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"
}
```
