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

# Create a new document link

> Create a new link for a document for the authenticated workspace.



## OpenAPI

````yaml POST /links/document
openapi: 3.1.0
info:
  title: Reqlick API
  description: >-
    REST API for Reqlick — link shortening, QR codes, file-to-link, custom
    domains and analytics.


    Authenticate with a workspace API key (`Authorization: Bearer rqk_...`),
    created under Settings → API Keys.


    A key is scoped to the single workspace it was created in. Using it against
    a different workspace returns 403, even when the owning user is a member of
    both.


    API access requires a paid plan.
  version: 3.0.0
  contact:
    name: Reqlick Support
    email: support@reqlick.com
servers:
  - url: https://api.reqlick.com
security:
  - bearerAuth: []
tags:
  - name: Links
  - name: QR Codes
  - name: Documents
  - name: Domains
  - name: Workspaces
  - name: Users
  - name: Subscriptions
paths:
  /links/document:
    post:
      tags:
        - Links
      summary: Create a link for a document
      description: >-
        Creates an additional short link pointing at an existing uploaded file.


        Only needed for a *second* link on a document — `POST /documents/{url}`
        already accepts `domain` and `key`, so a branded link can be created in
        one call at upload time.
      operationId: createDocumentLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                documentId:
                  type: string
                  description: ID of the uploaded document.
                workspace:
                  type: string
                  description: >-
                    Workspace **slug**, not its ID. Sending an ID returns 422
                    "workspace is required".
                domain:
                  type: string
                  description: >-
                    Custom domain. Must already belong to the workspace, else
                    422. Defaults to rqk.sh.
                key:
                  type: string
                  description: Short key. Generated when omitted.
              required:
                - documentId
                - workspace
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    Link:
      type: object
      properties:
        id:
          type: string
        domain:
          type: string
          examples:
            - rqk.sh
        key:
          type: string
          description: Short key. Combined with `domain` this forms the short URL.
        url:
          type: string
          description: Destination URL. Null for file links.
        title:
          type: string
        description:
          type: string
        image:
          type: string
        isActive:
          type: boolean
        isArchived:
          type: boolean
        isQR:
          type: boolean
        isFile:
          type: boolean
        expiresAt:
          type: string
          format: date-time
        ios:
          type: string
          description: iOS-specific destination.
        android:
          type: string
          description: Android-specific destination.
        workspaceId:
          type: string
        documentId:
          type: string
        clicks:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Missing, malformed or revoked API key — or the plan no longer includes
        API access
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Authenticated, but the key has no access to this workspace or resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: This API key does not have access to this workspace
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Workspace API key, prefixed `rqk_`.

````

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