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

# Delete designs

> Remove an embed user's designs and the files behind them.



## OpenAPI

````yaml /openapi.yaml delete /api/v1/designs
openapi: 3.1.0
info:
  title: Pixy Public API
  version: 1.0.0
  description: >
    Public API for validating bearer API keys, browsing and duplicating saved

    designs, and generating rendered design output from a Pixy design or
    template.


    The first endpoint in this reference is the API key validation endpoint used
    by

    integrations such as Zapier. Design, template, duplicate, and generate
    endpoints

    follow after it.


    This specification documents the currently exposed public endpoints in

    `apps/pixy-web/app/api/(public)`.
servers:
  - url: https://app.pixy.art
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Resolve the current user for a Pixy bearer API key.
  - name: Generate
    description: Render design output from a Pixy design or template.
  - name: Templates
    description: Browse public Pixy templates.
  - name: Designs
    description: Browse designs saved in your Pixy organization.
paths:
  /api/v1/designs:
    delete:
      tags:
        - Designs
      summary: Delete an embed user's designs
      description: |
        Permanently removes every design belonging to one embedder user, along
        with their renders, that user's media library, and every file those
        documents put on Pixy's CDN.

        `userId` is required. There is deliberately no way to delete every
        design in an organization with one call.

        Built for account clean-up: an application whose customer has closed or
        stopped paying for their account calls this once the retention period
        it promised them has passed, and the storage goes back.
      operationId: deleteDesigns
      parameters:
        - in: query
          name: userId
          required: true
          schema:
            type: string
            maxLength: 128
          description: The embedder-provided user identifier whose designs are deleted.
          example: user_123
      responses:
        '200':
          description: The designs, and the files behind them, are gone.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      deleted:
                        type: integer
                        description: Designs removed.
                      media:
                        type: integer
                        description: Media library items removed with them.
                      files:
                        type: integer
                        description: Files taken off the CDN.
                      failed:
                        type: array
                        description: >-
                          Files that could not be deleted, named so they can be
                          chased. Absent when there were none.
                        items:
                          type: string
              examples:
                deleted:
                  value:
                    data:
                      deleted: 12
                      media: 48
                      files: 137
        '400':
          description: The request is invalid, most often a missing `userId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingUserId:
                  value:
                    message: >-
                      A userId is required. Deleting every design in an
                      organization is not supported.
        '401':
          description: The bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    message: Unauthorized
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: javascript
          label: npm / @pixy-art/sdk
          source: |
            import { Pixy } from '@pixy-art/sdk'

            const pixy = new Pixy({
              apiKey: 'YOUR_API_KEY',
            })

            const result = await pixy.designs.delete({
              userId: 'YOUR_APP_USER_ID',
            })

            console.log(result.data)
components:
  schemas:
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Organization API key passed as a bearer token.

````

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