# Remove certification file

Source: https://docs.orbiqhq.com/docs/api/v1/certifications/id/filetype/delete

### DELETE /api/v1/certifications/{id}/{filetype}

**Remove certification file**

Detach the document or badge from a certification. With a non-default `locale` it removes that language's file instead; for `document` this also stops the language falling back to the default language's file. The removed file is only deleted once no language or version of the certification still uses it.

**Authentication:** Bearer token (`Authorization: Bearer <token>`)

**Path parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | Yes | Certification ID |
| `filetype` | enum: document \| badge | Yes | Type of file to remove |

**Query parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `locale` | enum: en \| de \| fr \| ja \| ko \| zh | No | Locale whose file should be removed. Defaults to the tenant's default locale. |

**Responses:**

- `200` - File removed successfully
  - `success` (boolean, required)
  - `data` (object, required)
    - `message` (enum: document removed successfully | badge removed successfully, required)

  Example (Badge removed):
  
  ```json
  {
  "success": true,
  "data": {
    "message": "badge removed successfully"
  }
}
  ```
- `400` - The path parameters are not valid (`invalid_parameters`) or the locale is not enabled for the tenant (`locale_not_enabled`)
  - `error` (string, required)
  - `code` (string, required): Machine-readable error code. Known values: invalid_input, invalid_id, unauthenticated, forbidden, not_found, method_not_allowed, conflict, unsupported_media_type, unprocessable, rate_limited, service_unavailable, internal_error. The set is open: treat any code you don't recognise as a generic error.
- `401` - Unauthorized - invalid or missing token
- `403` - Forbidden - insufficient permissions
- `404` - The certification does not belong to the tenant (`certification_not_found`), or it has no file of that type to remove (`no_document_to_delete`, `no_badge_to_delete`)
  - `error` (string, required)
  - `code` (string, required): Machine-readable error code. Known values: invalid_input, invalid_id, unauthenticated, forbidden, not_found, method_not_allowed, conflict, unsupported_media_type, unprocessable, rate_limited, service_unavailable, internal_error. The set is open: treat any code you don't recognise as a generic error.
- `500` - Internal server error
  - `error` (string, required)
  - `code` (string, required): Machine-readable error code. Known values: invalid_input, invalid_id, unauthenticated, forbidden, not_found, method_not_allowed, conflict, unsupported_media_type, unprocessable, rate_limited, service_unavailable, internal_error. The set is open: treat any code you don't recognise as a generic error.

**Code samples:**

cURL:

```bash
curl -X DELETE "https://app.orbiqhq.com/api/v1/certifications/{id}/badge" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
