# Delete an artifact

Removes the source file in a commit. Git history keeps the body recoverable.

## DELETE `/v1/artifacts/{ref}`

### Authorization

- **Authorization** `Bearer token · header required`
  
  `Authorization: Bearer <key>` with the Space key (`sfc_` prefix) of an unclaimed Space. The same key is the fragment of the claim URL and the token in the Space's `/__/ <key>` sign-in URL.
  
  or
  
- **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:execute`

### Path parameters

- `ref` string required

### Query parameters

- `team` string min length 1

### Responses

#### 204 Response for status 204

```json
{
  "$schema": "string<uri>",
  "data": null
}
```

##### Problem details (RFC 9457)

Any 4xx/5xx response is one `application/problem+json` document.

```json
{
  "$schema": "string<uri>",
  "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`

### Authorization

Bearer token Remember on this device Include my values in samples

### Parameters

- `ref` path *
- `team` query

### Request examples

**cURL**

```bash
curl -X DELETE "https://api.spacefast.com/v1/artifacts/string" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch("https://api.spacefast.com/v1/artifacts/string", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});
```

**Python**

```python
import requests

response = requests.delete(
    "https://api.spacefast.com/v1/artifacts/string",
    headers={
        "Authorization": "Bearer YOUR_TOKEN"
    },
)
```

### Response

#### 204 default

```json
{
  "$schema": "http://example.com",
  "data": null
}
```
