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

# Delete reference

> DELETE /v1/references/{reference_id} removes one of the account's references; its handle stops resolving at once.

Remove one of your references by the `id` from [`GET /v1/references`](/api/endpoints/list-references). The response is `204` with no body. From then on a prompt that mentions its handle is refused with `400 invalid_config`, and the handle may be taken by a new character or reference.

Only your own references can be deleted here; any other id is a `404 reference_not_found`. Requests that already ran with the reference keep their results.


## OpenAPI

````yaml api/openapi.json DELETE /v1/references/{reference_id}
openapi: 3.1.0
info:
  title: Mage API
  version: v1
  description: >-
    Run Mage models from your own code: submit a generation, poll its status,
    download the result. Every request is paid in gems.
  contact:
    name: Mage
    url: https://www.mage.space
    email: mage@mage.space
servers:
  - url: https://api.mage.space
    description: Production
security:
  - apiKey: []
tags:
  - name: Requests
    description: Submit, poll, and cancel generations.
  - name: Catalog
    description: What the API can generate with.
  - name: Account
    description: The gems balance.
  - name: Uploads
    description: Large input files.
  - name: Characters
    description: Saved characters a prompt mentions by `@handle`.
  - name: References
    description: Saved image and audio references a prompt mentions by `@handle`.
  - name: Image models
    description: One endpoint per image architecture.
  - name: Video models
    description: One endpoint per video architecture.
paths:
  /v1/references/{reference_id}:
    delete:
      tags:
        - References
      summary: Delete reference
      description: >-
        Remove the account's reference. Its handle stops resolving at once and
        may be taken again.
      operationId: delete_reference
      parameters:
        - name: reference_id
          in: path
          required: true
          description: The reference's `id`.
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: The reference was deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ReferenceNotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    Unauthorized:
      description: The key is missing, malformed, unknown, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: The API key is invalid or has been revoked.
    ReferenceNotFound:
      description: No reference with this id belongs to the account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: reference_not_found
              message: No reference with this id belongs to the account.
    InternalError:
      description: >-
        Something failed on Mage's side. Retry, and contact support if it
        persists.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: >-
                Something went wrong on our side. Retry, and contact support if
                it persists.
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - invalid_request
                - invalid_config
                - architecture_not_found
                - architecture_retired
                - request_not_found
                - character_not_found
                - reference_not_found
                - not_found
                - insufficient_gems
                - forbidden
                - content_blocked
                - request_finished
                - handle_taken
                - too_many_requests
                - generation_failed
                - internal_error
              description: A stable error code; treat an unknown code by its HTTP status.
            message:
              type: string
              description: What went wrong, for a person.
            request_id:
              description: >-
                The request the refusal belongs to, when one was recorded before
                the refusal.
              type: string
              format: uuid
            gems_required:
              description: The price of the refused generation, on `insufficient_gems`.
              type: number
            docs_url:
              description: Where to read the API reference, on `not_found`.
              type: string
              format: uri
            handle:
              description: The handle that is taken, on `handle_taken`.
              type: string
          required:
            - code
            - message
          additionalProperties: true
          description: Further fields depend on the code.
      required:
        - error
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An API key from Settings → API, sent as `Authorization: Bearer
        mage_sk_…`. Keys are for server-side code only.

````