# Delete a resource container

`DELETE https://api.lingohub.com/v1/{workspaceUrl}/projects/{projectUrl}/resources/{fileName}`

LingoHub API V1 · [Resources](https://developers.lingohub.com/reference/v1/operations/tags/resources.md) · operation `v1ResourceDeleteResourceContainer`

Deletes the specified resource container (file) and all its associated locale files. The fileName and optional path parameters must identify the source language file of the resource container. If the specified file does not belong to the source language, the request will be rejected with a 400 error.


## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `workspaceUrl` | path | yes | string | workspaceUrl |
| `projectUrl` | path | yes | string | projectUrl |
| `fileName` | path | yes | string | File name of the resource file to be deleted. Has to address the source language file. |
| `path` | query | no | string | File Path of the resource file to deleted. Has to address the source language file. |
| `branch` | query | no | string | Name of the project branch. If omitted, the project's default branch is used. Returns 422 if the branch name does not exist in the project. |

## Example request

```sh
curl --request DELETE \
  --url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Responses

- `200`: Successfully deleted the resource container and all its associated locale files.
- `400`: Bad Request: The specified file name/path does not belong to the source language of the project.
- `401`: Unauthorized: Authentication credentials are missing or invalid.
- `403`: Forbidden: The authenticated user does not have resource management permission on this project.
- `404`: Not Found: The specified workspace, project, or resource container does not exist.
- `422`: Unprocessable Entity: The specified branch name does not exist in the project.

## OpenAPI definition

The complete definition of this operation, with every schema it references:

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "LingoHub API V1",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.lingohub.com",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "Resources",
      "description": "Endpoints for the operations that can be performed on the resource files"
    }
  ],
  "paths": {
    "/v1/{workspaceUrl}/projects/{projectUrl}/resources/{fileName}": {
      "delete": {
        "tags": [
          "Resources"
        ],
        "summary": "Delete a resource container",
        "description": "Deletes the specified resource container (file) and all its associated locale files. The fileName and optional path parameters must identify the source language file of the resource container. If the specified file does not belong to the source language, the request will be rejected with a 400 error.\n",
        "operationId": "v1ResourceDeleteResourceContainer",
        "parameters": [
          {
            "name": "workspaceUrl",
            "in": "path",
            "description": "workspaceUrl",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectUrl",
            "in": "path",
            "description": "projectUrl",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileName",
            "in": "path",
            "description": "File name of the resource file to be deleted. Has to address the source language file.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "description": "File Path of the resource file to deleted. Has to address the source language file.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "branch",
            "in": "query",
            "description": "Name of the project branch. If omitted, the project's default branch is used. Returns 422 if the branch name does not exist in the project.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted the resource container and all its associated locale files."
          },
          "400": {
            "description": "Bad Request: The specified file name/path does not belong to the source language of the project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: The authenticated user does not have resource management permission on this project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "404": {
            "description": "Not Found: The specified workspace, project, or resource container does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity: The specified branch name does not exist in the project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ErrorInfo"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "V1ErrorInfo": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "API key authentication. Create API keys in your LingoHub workspace settings. Keys use the `lh-api_` prefix. Pass the full key as the Bearer token.",
        "scheme": "bearer"
      }
    }
  }
}
````
