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

# Drop a plan's earlier ID

> Stop an old plan ID resolving, so a new plan can take it.

Removes `alias` from the plan's `previousIds`. Requests that still send it stop finding this plan, and a new plan may then be created with that ID.

Needs the **Catalog** permission at Write.


## OpenAPI

````yaml openapi.json DELETE /v1/plans/{id}/aliases/{alias}
openapi: 3.1.0
info:
  title: Ledger API
  version: 0.1.0
servers:
  - url: https://api.integrateledger.com
    description: Hosted Ledger API
security: []
paths:
  /v1/plans/{id}/aliases/{alias}:
    delete:
      tags:
        - Plans
      summary: Drop a plan's earlier ID
      description: >-
        Drops one of a plan's earlier IDs, so a new plan can take it. Requests
        that still send it stop finding this plan.
      operationId: deletePlanAlias
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            pattern: ^[a-zA-Z0-9_-]+$
            description: The plan's ID.
          required: true
          description: The plan's ID.
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            pattern: ^[a-zA-Z0-9_-]+$
            description: The earlier ID to drop.
          required: true
          description: The earlier ID to drop.
          name: alias
          in: path
      responses:
        '200':
          description: The plan's IDs after dropping the alias
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanIds'
        '400':
          description: Invalid plan ID or alias
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                    description: >-
                      What went wrong and what to do about it, for a person or
                      an agent to read. Every Ledger error has one. The wording
                      can change: branch on `error`, not on this text.
                    example: >-
                      No customer "user_123" exists in this environment. Create
                      it with POST /v1/customers, or check that the API key is
                      for the right environment.
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                    description: >-
                      With `invalid_request`: each field that failed validation
                      and why. `path` is empty for the body itself, such as an
                      unknown field.
                required:
                  - error
        '401':
          description: Invalid Ledger API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                    description: >-
                      What went wrong and what to do about it, for a person or
                      an agent to read. Every Ledger error has one. The wording
                      can change: branch on `error`, not on this text.
                    example: >-
                      No customer "user_123" exists in this environment. Create
                      it with POST /v1/customers, or check that the API key is
                      for the right environment.
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                    description: >-
                      With `invalid_request`: each field that failed validation
                      and why. `path` is empty for the body itself, such as an
                      unknown field.
                required:
                  - error
        '403':
          $ref: '#/components/responses/InsufficientPermissions'
        '404':
          description: >-
            No plan with this ID (plan_not_found), or the ID isn't one of its
            aliases (alias_not_found)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                    description: >-
                      What went wrong and what to do about it, for a person or
                      an agent to read. Every Ledger error has one. The wording
                      can change: branch on `error`, not on this text.
                    example: >-
                      No customer "user_123" exists in this environment. Create
                      it with POST /v1/customers, or check that the API key is
                      for the right environment.
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                    description: >-
                      With `invalid_request`: each field that failed validation
                      and why. `path` is empty for the body itself, such as an
                      unknown field.
                required:
                  - error
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |-
            import os
            from integrateledger import ledger

            client = ledger(api_key=os.environ["LEDGER_API_KEY"])
            client.delete_plan_alias("basic", "starter")
        - lang: bash
          label: cURL
          source: >-
            curl --request DELETE
            'https://api.integrateledger.com/v1/plans/basic/aliases/starter' \
              -H "Authorization: Bearer $LEDGER_API_KEY"
        - lang: typescript
          label: TypeScript SDK
          source: >-
            import ledger from "integrateledger";


            const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? ""
            });

            await client.deletePlanAlias({ id: "basic", alias: "starter" });
components:
  schemas:
    PlanIds:
      type: object
      properties:
        planId:
          type: string
          description: The plan's current ID.
        previousIds:
          type: array
          items:
            type: string
          description: >-
            IDs the plan had before, oldest first. They still resolve to it
            wherever a plan ID is taken.
        changed:
          type: boolean
      required:
        - planId
        - previousIds
        - changed
    InsufficientPermissionsError:
      type: object
      properties:
        error:
          type: string
          example: insufficient_permissions
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
        requiredScope:
          type: string
          example: customers:read
      required:
        - error
        - requiredScope
    RateLimitError:
      type: object
      properties:
        error:
          type: string
          example: rate_limited
        message:
          type: string
          description: >-
            What went wrong and what to do about it, for a person or an agent to
            read. Every Ledger error has one. The wording can change: branch on
            `error`, not on this text.
          example: >-
            No customer "user_123" exists in this environment. Create it with
            POST /v1/customers, or check that the API key is for the right
            environment.
      required:
        - error
  responses:
    InsufficientPermissions:
      description: >-
        The API key works but lacks the permission this endpoint needs, named in
        requiredScope. See the API keys guide.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InsufficientPermissionsError'
    RateLimited:
      description: >-
        Too many requests. Wait Retry-After seconds, then retry. See the rate
        limits guide.
      headers:
        Retry-After:
          description: Seconds until a request is allowed again
          schema:
            type: integer
        RateLimit-Limit:
          description: 'The burst: requests allowed at once'
          schema:
            type: integer
        RateLimit-Remaining:
          description: Requests left right now
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the full burst is back
          schema:
            type: integer
        RateLimit-Policy:
          description: >-
            The sustained rate per second and the burst, such as
            200;w=1;burst=1000
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer

````

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