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

# Delete URL

> Delete a URL permanently.

**This action is IRREVERSIBLE.** The URL, its alias, and all associated
click analytics data will be permanently deleted. The alias may be reclaimed
by another user afterward.

**Authentication**: Required — you must own the URL.

**API Key Scope**: `urls:manage` or `admin:all`

**Rate Limits**: 60/min, 1,000/day

**Recommendation**: Consider setting the URL status to `INACTIVE` via
`PATCH /urls/{url_id}/status` instead if you may want to restore it later.



## OpenAPI

````yaml /openapi-v1.json delete /api/v1/urls/{url_id}
openapi: 3.1.0
info:
  title: spoo.me
  description: >-
    REST API for spoo.me — free and open-source URL shortening service serving
    400k+ redirects/day.


    Authenticate using either:

    - **API Key**: `Authorization: Bearer spoo_<your_key>`

    - **JWT Token**: `Authorization: Bearer <jwt>` (obtained via /auth/login)

    - **Session Cookie**: `access_token` cookie (set automatically on login)
  contact:
    name: spoo.me
    url: https://spoo.me/contact
    email: support@spoo.me
  license:
    name: AGPL-3.0
    url: https://github.com/spoo-me/spoo/blob/main/LICENSE
  version: 1.0.0
servers:
  - url: https://spoo.me
    description: Production
security:
  - ApiKeyAuth: []
  - JWTAuth: []
tags:
  - name: URL Shortening
    description: Create new shortened URLs
  - name: Link Management
    description: List, update, and delete your shortened URLs
  - name: Statistics
    description: Click analytics and data export
  - name: API Keys
    description: Create and manage API keys for programmatic access
  - name: Authentication
    description: Login, register, password management, and email verification
  - name: OAuth
    description: OAuth provider login, linking, and unlinking
  - name: System
    description: Health checks and server metrics
paths:
  /api/v1/urls/{url_id}:
    delete:
      tags:
        - Link Management
      summary: Delete URL
      description: >-
        Delete a URL permanently.


        **This action is IRREVERSIBLE.** The URL, its alias, and all associated

        click analytics data will be permanently deleted. The alias may be
        reclaimed

        by another user afterward.


        **Authentication**: Required — you must own the URL.


        **API Key Scope**: `urls:manage` or `admin:all`


        **Rate Limits**: 60/min, 1,000/day


        **Recommendation**: Consider setting the URL status to `INACTIVE` via

        `PATCH /urls/{url_id}/status` instead if you may want to restore it
        later.
      operationId: deleteUrl
      parameters:
        - name: url_id
          in: path
          required: true
          schema:
            type: string
            description: Unique identifier of the URL
            title: Url Id
          description: Unique identifier of the URL
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteUrlResponse'
        '400':
          description: Bad Request — invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — insufficient permissions or scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DeleteUrlResponse:
      properties:
        message:
          type: string
          title: Message
          description: Confirmation message.
          examples:
            - URL deleted
        id:
          type: string
          title: Id
          description: ID of the deleted URL.
          examples:
            - 507f1f77bcf86cd799439011
      type: object
      required:
        - message
        - id
      title: DeleteUrlResponse
      description: Response body for DELETE /api/v1/urls/{url_id}.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        error_code:
          type: string
          title: Error Code
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        details:
          anyOf:
            - {}
            - type: 'null'
          title: Details
      type: object
      required:
        - error
        - error_code
      title: ErrorResponse
      description: Standard error JSON body produced by the AppError exception handler.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: spoo_<key>
      description: 'API key authentication. Pass your key as: `Bearer spoo_<your_key>`'
    JWTAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'JWT access token from /auth/login. Pass as: `Bearer <jwt_token>`'

````