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

# List plan instance versions

> Lists the versions of a plan instance, newest first, without their charges. A plan instance that does not exist answers an empty list.

Requires the role `plan_instance_versions:read`.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/plan-instance-versions/
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/plan-instance-versions/:
    get:
      tags:
        - Plan Instances
      summary: List plan instance versions
      description: >-
        Lists the versions of a plan instance, newest first, without their
        charges. A plan instance that does not exist answers an empty list.


        Requires the role `plan_instance_versions:read`.
      parameters:
        - schema:
            type: string
            format: uuid
          in: query
          name: planInstanceId
          required: true
          description: >-
            The unique identifier of the plan instance whose versions the
            request lists.
        - schema:
            type: integer
            default: 0
            minimum: 0
            maximum: 2147483647
          in: query
          name: offset
          required: false
          description: Number of items to skip before collecting the page.
        - schema:
            type: integer
            minimum: 1
            default: 100
            maximum: 100
          in: query
          name: limit
          required: false
          description: Maximum number of items to return per page.
      responses:
        '200':
          description: The versions of the plan instance, newest first.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      description: >-
                        Schema representing a plan instance version in a list,
                        without its charges and its custom field values. Fetch
                        the plan instance version by id to read them.
                      properties:
                        id:
                          description: >-
                            The unique identifier of the plan instance version
                            in our system.
                          type: string
                          format: uuid
                        versionNumber:
                          description: >-
                            The number of the version in its plan instance, from
                            1, one more for each new version.
                          type: integer
                          minimum: 1
                        isActive:
                          description: >-
                            Whether billing uses this version. A plan instance
                            has one active version.
                          type: boolean
                        planInstanceVersionReason:
                          description: >-
                            Why the version exists: created_from_plan_version
                            (it comes from a plan version of the plan),
                            duplicated_from_contract (a copy of a plan instance
                            of another contract), manual_override (an update of
                            the charges of the plan instance), readjustment (a
                            rate adjustment) or rollback (a restore of an
                            earlier version).
                          type: string
                          enum:
                            - created_from_plan_version
                            - duplicated_from_contract
                            - manual_override
                            - readjustment
                            - rollback
                        metadata:
                          anyOf:
                            - type: object
                              description: >-
                                The details of a version that comes from a plan
                                version of the plan.
                              properties:
                                reason:
                                  type: string
                                  enum:
                                    - created_from_plan_version
                                  description: >-
                                    The reason of the version:
                                    created_from_plan_version.
                                sourcePlanVersionId:
                                  description: >-
                                    The unique identifier of the plan version
                                    that the version comes from.
                                  type: string
                                  format: uuid
                              required:
                                - reason
                                - sourcePlanVersionId
                              additionalProperties: false
                            - type: object
                              description: >-
                                The details of a version that copies a plan
                                instance of another contract, from a duplication
                                of that contract.
                              properties:
                                reason:
                                  type: string
                                  enum:
                                    - duplicated_from_contract
                                  description: >-
                                    The reason of the version:
                                    duplicated_from_contract.
                                sourceContractId:
                                  type: string
                                  format: uuid
                                  description: >-
                                    The unique identifier of the contract that
                                    the duplication copied.
                                sourcePlanInstanceId:
                                  type: string
                                  format: uuid
                                  description: >-
                                    The unique identifier of the plan instance
                                    that the version copies.
                              required:
                                - reason
                                - sourceContractId
                                - sourcePlanInstanceId
                              additionalProperties: false
                            - type: object
                              description: >-
                                The details of a version from an update of the
                                charges of the plan instance, in the billing app
                                or through the API.
                              properties:
                                reason:
                                  type: string
                                  enum:
                                    - manual_override
                                  description: 'The reason of the version: manual_override.'
                                previousPlanInstanceVersionId:
                                  type: string
                                  format: uuid
                                  description: >-
                                    The unique identifier of the plan instance
                                    version that was active before the update.
                              required:
                                - reason
                                - previousPlanInstanceVersionId
                              additionalProperties: false
                            - type: object
                              description: >-
                                The details of a version from a rate adjustment,
                                which applies a percentage to the prices of the
                                plan instance.
                              properties:
                                reason:
                                  type: string
                                  enum:
                                    - readjustment
                                  description: 'The reason of the version: readjustment.'
                                previousPlanInstanceVersionId:
                                  type: string
                                  format: uuid
                                  description: >-
                                    The unique identifier of the plan instance
                                    version that was active before the rate
                                    adjustment.
                                percentage:
                                  type: string
                                  description: >-
                                    The percentage that the rate adjustment
                                    applied to the prices, as a decimal string,
                                    such as "5" for a rise of 5%.
                                  examples:
                                    - '5'
                              required:
                                - reason
                                - previousPlanInstanceVersionId
                                - percentage
                              additionalProperties: false
                            - type: object
                              description: >-
                                The details of a version from a restore of an
                                earlier version.
                              properties:
                                reason:
                                  type: string
                                  enum:
                                    - rollback
                                  description: 'The reason of the version: rollback.'
                                rolledBackFromPlanInstanceVersionId:
                                  type: string
                                  format: uuid
                                  description: >-
                                    The unique identifier of the plan instance
                                    version whose charges the restore brought
                                    back.
                              required:
                                - reason
                                - rolledBackFromPlanInstanceVersionId
                              additionalProperties: false
                            - type: 'null'
                              description: Aira recorded no details for the version.
                          description: >-
                            The details of how the version came to exist, by
                            reason, such as the plan version that it comes from,
                            the version before it or the percentage of a rate
                            adjustment, or null when Aira recorded none.
                        createdAt:
                          description: The moment when Aira created the version.
                          type: string
                          format: date-time
                      required:
                        - id
                        - versionNumber
                        - isActive
                        - planInstanceVersionReason
                        - metadata
                        - createdAt
                      additionalProperties: false
                    description: A list of items.
                  hasMore:
                    description: Indicates if there are more items to fetch.
                    type: boolean
                required:
                  - items
                  - hasMore
                additionalProperties: false
        '400':
          description: >-
            The request cannot succeed as sent.


            - `json_schema_validation_error`: a query parameter breaks the
            schema of the endpoint.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - json_schema_validation_error
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                json_schema_validation_error:
                  value:
                    message: '''planInstanceId'' must match format "uuid"'
                    code: json_schema_validation_error
        '401':
          description: >-
            The request carries no API key.


            - `no_authorization`: the request carries no API key in the
            `X-API-KEY` header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - no_authorization
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                no_authorization:
                  value:
                    message: No authorization provided
                    code: no_authorization
        '403':
          description: >-
            The API key cannot call the endpoint.


            - `bad_auth`: the API key does not hold the role that the endpoint
            requires.

            - `invalid_api_key`: the API key does not exist.

            - `deactivated_api_key`: the API key is deactivated.

            - `revoked_api_key`: the API key is revoked.

            - `expired_api_key`: the API key is past its expiry date.

            - `ip_not_allowed`: the tenant does not allow the IP of the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - bad_auth
                      - invalid_api_key
                      - deactivated_api_key
                      - revoked_api_key
                      - expired_api_key
                      - ip_not_allowed
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                bad_auth:
                  value:
                    message: role plan_instance_versions:read can not be satisfied
                    code: bad_auth
                invalid_api_key:
                  value:
                    message: Invalid API key
                    code: invalid_api_key
                deactivated_api_key:
                  value:
                    message: Deactivated API key
                    code: deactivated_api_key
                revoked_api_key:
                  value:
                    message: Revoked API key
                    code: revoked_api_key
                expired_api_key:
                  value:
                    message: Expired API key
                    code: expired_api_key
                ip_not_allowed:
                  value:
                    message: IP not allowed
                    code: ip_not_allowed
        '429':
          description: >-
            The tenant reached one of its limits of reads.


            - `too_many_reads_per_second`: the tenant already made 50 reads in
            this second.

            - `too_many_reads_in_flight`: the tenant already has 20 reads in
            flight.
          headers:
            Retry-After:
              schema:
                type: integer
              description: The seconds to wait before the next read.
            RateLimit-Limit:
              schema:
                type: integer
              description: >-
                The limit that the read hit: 20 for the reads in flight, 50 for
                the reads per second.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The reads left under that limit, which is 0.
            RateLimit-Reset:
              schema:
                type: integer
              description: >-
                The seconds to wait before the next read, as in Retry-After. The
                limit of reads per second takes new reads in the next second,
                but the limit of reads in flight takes a new read only once one
                of the reads in flight ends.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - too_many_reads_per_second
                      - too_many_reads_in_flight
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                too_many_reads_per_second:
                  value:
                    message: >-
                      Too many reads: a tenant can make at most 50 reads per
                      second. Retry after 1 second.
                    code: too_many_reads_per_second
                too_many_reads_in_flight:
                  value:
                    message: >-
                      Too many reads in flight: a tenant can have at most 20
                      reads in flight. Retry after 1 second.
                    code: too_many_reads_in_flight
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````

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