> ## 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.

# Create Link

> Create a new link for the authenticated workspace.



## OpenAPI

````yaml post /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:
    post:
      description: Create a new link for the authenticated workspace.
      requestBody:
        description: Create a new link for the authenticated workspace.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewLink'
        required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  data:
                    type: object
                    properties:
                      linkId:
                        type: string
                      keyWordExist:
                        type: boolean
                      shortUrl:
                        type: string
                      recommendedUrls:
                        type: array
                        items: {}
                      failToGenerateHash:
                        type: boolean
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewLink:
      allOf:
        - required:
            - workspaceId
            - keywordType
            - longUrl
          type: object
          properties:
            workspaceId:
              type: string
              nullable: false
              description: Id of the Workspace
            keywordType:
              description: >-
                The type slug we use for shortening the url. It can be either
                `HASH` or `CUSTOM`
              type: string
              nullable: false
            longUrl:
              description: The long url for shortening
              type: string
              nullable: false
            customDomain:
              description: >-
                The custom domain value if have any custom domain setupped in
                the workspace to create short url. It can be null if not
                configured
              type: string
              nullable: false
              example: amazon.com
            keyword:
              type: string
              description: >-
                Custom keyword/slug for shortening url if keywordType selected
                as `CUSTOM`
              nullable: false
              example: myYoutubeChannel
    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

````