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

# Delete Project

> Delete a project and its videos for good

## Overview

Deletes a project and everything it produced.

<Warning>
  **This cannot be undone.** The project, its videos (every render, with their files and thumbnails) and the files the project stored are deleted. Download anything you want to keep first.
</Warning>

What happens:

* The project is deleted. [Get Project](/api-reference/project/details) answers `404` for it from then on.
* Its videos are deleted with it (`deletedVideoIds` lists them); [Get Video Details](/api-reference/video/details) answers `404` for each.
* Posts already recorded for those videos are deleted from Hooked. Videos already published stay on the platform.
* The storage the files used is given back to your team.
* Images and videos of your [media library](/api-reference/media/list) that the project used **stay** in the library.
* Credits the project used are not refunded. A project that failed was refunded automatically when it failed.

## When it is refused

Nothing is deleted and the answer is `409` while:

| `message` | What to do |
| - | - |
| `Project is still processing` | Wait until the project is `completed` or `failed` ([Get Project](/api-reference/project/details)). A project cannot be stopped mid-generation. |
| `A video of this project is still rendering` | Wait until its `video.status` is `COMPLETED` or `FAILED`. |
| `A video of this project has a pending scheduled post…` | Cancel each post in `data.scheduleIds` with [Cancel Scheduled Post](/api-reference/schedule/delete), then delete again. |

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.hooked.so/v1/project/cm4x9k2p10001ab12cd34ef56" \
    -H "x-api-key: your_api_key_here"
  ```

  ```javascript JavaScript theme={null}
  const projectId = "cm4x9k2p10001ab12cd34ef56";

  const response = await fetch(`https://api.hooked.so/v1/project/${projectId}`, {
    method: "DELETE",
    headers: { "x-api-key": process.env.HOOKED_API_KEY },
  });
  const result = await response.json();

  if (response.status === 409) {
    console.log("Not yet:", result.message, result.data?.scheduleIds ?? "");
  } else if (result.success) {
    console.log("Deleted, with videos:", result.data.deletedVideoIds);
  }
  ```

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

  project_id = "cm4x9k2p10001ab12cd34ef56"
  response = requests.delete(
      f"https://api.hooked.so/v1/project/{project_id}",
      headers={"x-api-key": os.environ["HOOKED_API_KEY"]},
  )
  result = response.json()
  if response.status_code == 409:
      print("Not yet:", result["message"])
  else:
      print("Deleted, with videos:", result["data"]["deletedVideoIds"])
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Project deleted",
    "data": {
      "projectId": "cm4x9k2p10001ab12cd34ef56",
      "deleted": true,
      "deletedVideoIds": ["cm4x9n7q20003ab12xy98zt10"]
    }
  }
  ```

  ```json 409 theme={null}
  {
    "success": false,
    "message": "A video of this project has a pending scheduled post. Cancel it first with DELETE /v1/schedule/{scheduleId}",
    "data": { "scheduleIds": ["clxsched0001"] }
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "message": "Project not found"
  }
  ```
</ResponseExample>

## Errors

| Status | When |
| - | - |
| 401 | Missing or invalid API key (`code: "not_authenticated"`) |
| 403 | The team does not have the Hooked app product (`code: "entitlement_required"`) |
| 404 | No such project, including one already deleted. Another team's project, or an id that is not one, answers the same `Project not found` |
| 409 | The project is generating, one of its videos is rendering, or one has a pending scheduled post. Nothing was deleted |
| 500 | `Internal server error`. Read the project before retrying: it may already be gone |


## OpenAPI

````yaml DELETE /v1/project/{projectId}
openapi: 3.0.0
info:
  title: Hooked API
  version: 1.0.0
  description: AI Video Generation API
servers:
  - url: https://api.hooked.so
security:
  - ApiKeyAuth: []
tags:
  - name: Videos
    description: Create projects, follow them and render videos
  - name: Account Analysis
    description: Analyze TikTok and YouTube accounts
  - name: Channels
    description: Connected social accounts you publish to
  - name: Publish
    description: Schedule videos to your connected accounts
  - name: Images
    description: 'Image editing: background removal and expansion'
  - name: Media
    description: 'Your media library: list, import from a URL, upload a file'
  - name: Avatars
    description: Your team's own avatars (Actors) and their Hook + Demo reactions
paths:
  /v1/project/{projectId}:
    delete:
      tags:
        - Videos
      summary: Delete Project
      description: >-
        Deletes a project for good. **This cannot be undone.** Its videos go
        with it: their rows, files and thumbnails, and any post already recorded
        for them; the storage they used is freed. Images and videos of your
        media library that the project used stay in the library. Refused with
        409 while the project is generating (`processing`), while one of its
        videos is rendering, or while one of its videos has a pending scheduled
        post (cancel those first with DELETE /v1/schedule/{scheduleId}). Credits
        the project used are not refunded.
      operationId: deleteProject
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
          description: The `projectId` a create endpoint answered.
          example: cm4x9k2p10001ab12cd34ef56
      responses:
        '200':
          description: Project deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - projectId
                      - deleted
                    properties:
                      projectId:
                        type: string
                        description: The project that was deleted
                      deleted:
                        type: boolean
                        description: Always `true`
                      deletedVideoIds:
                        type: array
                        items:
                          type: string
                        description: The videos deleted with it (they now answer 404).
              example:
                success: true
                message: Project deleted
                data:
                  projectId: cm4x9k2p10001ab12cd34ef56
                  deleted: true
                  deletedVideoIds:
                    - cm4x9n7q20003ab12xy98zt10
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/EntitlementRequired'
        '404':
          description: >-
            No such project, including one already deleted. Another team's
            project, or an id that is not one, answers the same way.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound404'
              example:
                success: false
                message: Project not found
        '409':
          description: The project cannot be deleted yet; nothing was deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict409'
              examples:
                processing:
                  value:
                    success: false
                    message: Project is still processing
                rendering:
                  value:
                    success: false
                    message: A video of this project is still rendering
                scheduled:
                  value:
                    success: false
                    message: >-
                      A video of this project has a pending scheduled post.
                      Cancel it first with DELETE /v1/schedule/{scheduleId}
                    data:
                      scheduleIds:
                        - clxsched0001
        '429':
          $ref: '#/components/responses/RateLimited429'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error401'
    EntitlementRequired:
      description: The team does not have the product this endpoint needs
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EntitlementRequired403'
    RateLimited429:
      description: >-
        Your team is over a rate limit: 30 POST requests per minute, 120 other
        requests per minute, or 3 downloads of your URLs running at once.
        Nothing ran and nothing was charged: wait `Retry-After` seconds and send
        the request again. See [Rate
        limits](/guides/error-handling#rate-limits-429).
      headers:
        Retry-After:
          description: Seconds to wait before sending again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: The limit of the bucket you hit (not sent for the download cap).
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: 'Requests left in this window: 0 (not sent for the download cap).'
          schema:
            type: integer
        X-RateLimit-Reset:
          description: >-
            When the window ends, in Unix seconds (not sent for the download
            cap).
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              errorCode:
                type: string
                enum:
                  - RATE_LIMITED
              message:
                type: string
              retryAfterSeconds:
                type: integer
            required:
              - success
              - errorCode
              - message
              - retryAfterSeconds
          example:
            success: false
            errorCode: RATE_LIMITED
            message: >-
              Rate limit exceeded: 30 POST requests per minute per team. Retry
              after 12 s.
            retryAfterSeconds: 12
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error500'
  schemas:
    NotFound404:
      type: object
      description: >-
        Not found. Another team's resource answers the same way as a missing
        one.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
      required:
        - success
        - message
      example:
        success: false
        message: Project not found
    Conflict409:
      type: object
      description: >-
        The resource cannot be deleted right now. `message` says why; nothing
        was deleted.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        data:
          type: object
          properties:
            scheduleIds:
              type: array
              items:
                type: string
              description: >-
                The pending scheduled posts in the way. Cancel each with DELETE
                /v1/schedule/{scheduleId}, then retry.
      required:
        - success
        - message
    Error401:
      type: object
      description: Missing or invalid `x-api-key`.
      properties:
        code:
          type: string
          enum:
            - not_authenticated
        message:
          type: string
          example: Not authenticated
        errorCode:
          type: string
          enum:
            - NOT_AUTHENTICATED
        details:
          type: object
          additionalProperties:
            type: string
      example:
        code: not_authenticated
        message: Not authenticated
        errorCode: NOT_AUTHENTICATED
        details:
          x-api-key: Header not provided or API Key invalid
    EntitlementRequired403:
      type: object
      description: >-
        Valid key, but the team does not have the product this endpoint belongs
        to.
      properties:
        code:
          type: string
          enum:
            - entitlement_required
        error:
          type: string
          enum:
            - entitlement_required
        message:
          type: string
        product:
          type: string
          example: app
      required:
        - code
        - error
        - message
        - product
      example:
        code: entitlement_required
        error: entitlement_required
        message: This endpoint requires the "app" product.
        product: app
    Error500:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
          description: Present on some endpoints
      example:
        success: false
        message: Internal server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.