> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete CoworkerDataFile

> Delete an existing CoworkerDataFile record by its Id.

Deletes a CoworkerDataFile record. Once deleted, the record is permanently removed from the system.

<Warning>
  This action is permanent and cannot be undone. Consider updating the record instead if you want to preserve its history.
</Warning>

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`CoworkerDataFile-Delete`** role.
</Note>

## Path Parameters

<ParamField path="id" type="integer" required>
  The Id of the CoworkerDataFile record to delete.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE \
    "https://spaces.nexudus.com/api/spaces/coworkerdatafiles/87654321" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/coworkerdatafiles/87654321',
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.delete(
      'https://spaces.nexudus.com/api/spaces/coworkerdatafiles/87654321',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN'
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the deletion.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the deleted record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the deletion was successful.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "CoworkerDataFile was successfully deleted.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T12:00:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 500

```json Example Response theme={null}
{
  "Status": 500,
  "Message": "An error occurred while deleting the record.",
  "Value": null,
  "RedirectURL": null,
  "UpdatedOn": null,
  "UpdatedBy": null,
  "Errors": null,
  "WasSuccessful": false
}
```
