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

# Get Routes

> Get all the routes for a specific environment.




## OpenAPI

````yaml /enterspeed/enterspeedv1Api.yaml get /routes/v1
openapi: 3.0.0
info:
  version: 0.4.0
  title: API documentation
  description: >-
    The Enterspeed API are based on REST principles.


    Before you start you will need to [create an
    Enterspeed-account](https://app.enterspeed.com) and set up a tenant (a
    property for your website). Here you can create

    - A data source (provides you with an API key for the **Ingest API**).

    - An environment client (provides you with an API key for the **Delivery
    API** and **Query API**).

    - A domain (ensure the correct data gets fetched).


    🎉 Have fun using our API. Make sure to [contact
    us](https://www.enterspeed.com/contact) if you need any help. We're happy
    assist!
  x-logo:
    url: https://docs.enterspeed.com/img/logo.svg
    altText: Enterspeed Logo
  license:
    name: See Enterspeed Terms of service
    url: https://www.enterspeed.com/terms-of-service
servers:
  - url: https://api.enterspeed.com
    description: General API
security: []
tags:
  - name: Delivery
    description: >-
      The Delivery API is what you use to `GET` your data from Enterspeed to
      your frontend project. Before you can fetch your content from Enterspeed,
      you first need to create an **Environment client** which generates an API
      key. This is done under *Settings --> Environment settings*.


      You can find an example of how to fetch data [Umbraco & Next.js
      tutorial](https://docs.enterspeed.com/tutorials/umbraco-nextjs/fetching-data-in-nextjs).
  - name: Ingest
    description: >-
      The Ingest API is used to `POST` your current data sources into
      Enterspeed. Before you can start ingesting data, you'll need to create a
      **Data source** inside Enterspeed, which generates an API key. This is
      done under *Settings --> Data sources*.


      The Ingest API can also be used to `DELETE` already ingested data from
      Enterspeed.
  - name: Routes
    description: >-
      The Routes API is what you use to `GET` all available URL routes for a
      specific environment, which can be helpful for SSG (Static Site
      Generation) or creating a sitemap.


      Before you can fetch your routes from Enterspeed, you first need to create
      an **Environment client** which generates an API key. This is done under
      *Settings --> Environment settings*.


      **ℹ NOTE:** The `first` or `last` parameter is required and must be set
      between 100 - 500 (e.g. `first=250`). Both are not allowed at the same
      time.
  - name: Query
    description: >-
      The Query API is what you use to query items from your indexes.


      Before you can query your indexes from Enterspeed, you first need to
      create an **Environment client** which generates an API key. This is done
      under *Settings --> Environment settings*.
paths:
  /routes/v1:
    get:
      tags:
        - Routes
      summary: Get Routes
      description: |
        Get all the routes for a specific environment.
      operationId: getRoutes
      parameters:
        - name: first
          in: query
          description: >-
            Get the first of the paginated list, aka. get the list in ascending
            order.
          schema:
            type: number
            example: 100
        - name: last
          in: query
          description: >-
            Get the last of the paginated list, aka. get the list in descending
            order.
          schema:
            type: number
            example: 100
        - name: before
          in: query
          description: The cursor to get data before, eg. previous page.
          schema:
            type: number
        - name: after
          in: query
          description: The cursor to get data after, eg. next page.
          schema:
            type: number
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutesResponse'
              example:
                total: 16
                pageInfo:
                  hasNextPage: true
                  hasPreviousPage: false
                  startCursor: YmQ2YTY0NTgtZmU1Ny00MDZmLTlkMzgtNGNjMTczYWZmNzg2
                  endCursor: ZjJlNmY5NWYtOWM3ZS00N2I5LWI0N2ItMGY4M2YxYjMzZjQ1
                results:
                  - url: /about-us
                    redirect: null
                    updatedAt: '2021-05-21T10:22:21.262781Z'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: >-
            Forbidden. The X-Api-Key is valid but does not have the necessary
            permissions.
        '422':
          description: |
            Can be either of these: 
              * first and last is not allowed at the same time (Parameter 'first', 'last')
              * first or last must be set between 100 - 500 (Parameter 'first', 'last')
              * first must be set between 100 - 500 (Parameter 'first'')
              * last must be set between 100 - 500 (Parameter 'last')
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 422
                  message:
                    type: string
                    example: >-
                      first and last is not allowed at the same time (Parameter
                      'first', 'last')
components:
  schemas:
    RoutesResponse:
      $ref: '#/components/schemas/PagedResult'
    PagedResult:
      type: object
      properties:
        total:
          type: number
        pageInfo:
          $ref: '#/components/schemas/PageInfoResponse'
        results:
          type: array
          items:
            $ref: '#/components/schemas/UrlRouteItem'
    PageInfoResponse:
      type: object
      properties:
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          type: string
          description: |
            Cursor for the first element in the list.
        endCursor:
          type: string
          description: |
            Cursor for the last element in the list.
    UrlRouteItem:
      type: object
      properties:
        url:
          type: string
        redirect:
          type: string
        updatedAt:
          type: string

````