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

# Retrieve a list of links

> Returns all links in a workspace with filter support and pagination



## OpenAPI

````yaml get /link
openapi: 3.0.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.cme.sh
security:
  - bearerAuth: []
paths:
  /link:
    get:
      description: Returns all links in a workspace with filter support and pagination
      parameters:
        - name: workspaceId
          in: query
          description: The Id of the workspace
          schema:
            type: string
            description: The Id of the workspace.
            example: d7sfsfffusf6tss
          required: true
        - name: pageSize
          in: query
          description: Number of Links in a page. Defaults to `10`
          schema:
            type: integer
            format: int32
            description: Number of Links in a page. Defaults to `10`
            default: 10
        - name: cursor
          in: query
          description: Cursor. Defaults to `0`
          schema:
            type: integer
            format: int32
            description: Cursor. Defaults to `0`
            default: 0
        - name: orderType
          in: query
          description: >-
            Order in which data is returned. With options `asc` and `desc`.
            Defaults to `desc`
          schema:
            type: string
            description: >-
              Order in which data is returned. With options `asc` and `desc`.
              Defaults to `desc`
            default: desc
        - name: orderBy
          in: query
          description: Field on which data is ordered. Defaults to `createdDate`
          schema:
            type: string
            description: Field on which data is ordered. Defaults to `createdDate`
            default: createdDate
      responses:
        '200':
          description: Links response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  data:
                    type: object
                    properties:
                      pageInfo:
                        type: object
                        properties:
                          cursor:
                            type: integer
                          hasNext:
                            type: boolean
                          pageNumber:
                            type: integer
                          pageSize:
                            type: integer
                          totalCount:
                            type: integer
                          totalPages:
                            type: integer
                      list:
                        type: array
                        items:
                          $ref: '#/components/schemas/Link'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Link:
      type: object
      properties:
        _id:
          type: string
          description: >-
            The unique identifier of the link in ObjectId format, similar to
            MongoDB's ObjectId
          pattern: ^[0-9a-fA-F]{24}$
        workspaceId:
          type: string
          description: The ID of the workspace associated with the link
        shortUrl:
          type: string
          description: The shortened URL of the link
        longUrl:
          type: string
          description: The original (long) URL of the link
        linkActive:
          type: boolean
          description: Indicates if the link is active or not
        tags:
          type: array
          items:
            type: string
          description: Tags associated with the link
        totalClicks:
          type: integer
          description: The total number of clicks on the link
        destinationUrlMetaData:
          type: object
          properties:
            author:
              type: string
              description: The author of the destination URL
            description:
              type: string
              description: The description of the destination URL
            image:
              type: string
              description: The image associated with the destination URL
            logo:
              type: string
              description: The logo associated with the destination URL
            publisher:
              type: string
              description: The publisher of the destination URL
            title:
              type: string
              description: The title of the destination URL
            url:
              type: string
              description: The URL of the destination
            metaTags:
              type: string
              description: Meta tags associated with the destination URL
            date:
              type: string
              format: date-time
              description: The date of the destination URL
        createdBy:
          type: string
          description: The ID of the user who created the link
        modifiedBy:
          type: string
          description: The ID of the user who last modified the link
        createdDate:
          type: string
          format: date-time
          description: The date when the link was created
    Error:
      type: object
      properties:
        status:
          type: boolean
          description: Indicates the status of the error response
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Error code
              errorMessage:
                type: string
                description: Error message
            required:
              - code
              - errorMessage
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````