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

# Data model

> A quick overview of how Reqlick is structured.

Whether you are using Reqlick's [API](/api-reference/introduction) or not, this page is a quick way to understand how Reqlick works.

Within Reqlick, all data belongs to a [**Workspace**](#workspaces). Within a workspace, you have [Links](#links), [Documents](#documents), [Subscriptions](#subscriptions), [Domains](#domains) and more.

## Workspaces

Workspaces is the defacto way of organizing your links and working with your team on Reqlick. You can think of a Reqlick workspace like a workspace on Slack or Discord – it's a shared space where you can invite your team members to collaborate on links, QR codes and files.

When interacting with Reqlick's API, you will also need to specify the Workspace URL to perform any operation. You can find the workspace URL under the **General** settings page of your workspace.

<Accordion title="Workspace model">
  <ResponseField name="id" type="string" required>
    The unique identifier for the workspace.
  </ResponseField>

  <ResponseField name="url" type="string" required>
    The URL of the workspace.
  </ResponseField>

  <ResponseField name="name" type="string" required>
    The name of the workspace.
  </ResponseField>

  <ResponseField name="logo" type="string">
    The logo of the workspace.
  </ResponseField>

  <ResponseField name="links" type="object[]">
    The links of the workspace.
  </ResponseField>

  <ResponseField name="documents" type="object[]">
    The documents of the workspace.
  </ResponseField>

  <ResponseField name="qrcode" type="object[]">
    The QR Codes of the workspace.
  </ResponseField>

  <ResponseField name="views" type="object[]">
    The views associated with the related links, qrcodes and documents in the
    workspace.
  </ResponseField>

  <ResponseField name="domains" type="object[]">
    The domains associated with the workspace.
  </ResponseField>

  <ResponseField name="members" type="object[]">
    The members of the workspace.
  </ResponseField>

  <ResponseField name="isArchived" type="boolean" default="false">
    Indicates whether the workspace is archived.
  </ResponseField>

  <ResponseField name="subscriptionId" type="string" required>
    The subscription ID of the workspace.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time when the workspace was created.
  </ResponseField>

  <ResponseField name="viewedAt" type="string">
    The date and time when the workspace was viewed.
  </ResponseField>

  <ResponseField name="updatedAt" type="string">
    The date and time when the workspace was updated.
  </ResponseField>
</Accordion>

## Links

Links are the bread and butter of Reqlick. You can shorten any URL to a Reqlick link, which you can then share with your audience. Links can be created, updated, and deleted via the [Reqlick API](/api-reference/introduction) or the [Reqlick dashboard](https://app.reqlick.com).

<Accordion title="Link model">
  <ResponseField name="id" type="string" required>
    The unique identifier for the link.
  </ResponseField>

  <ResponseField name="documentId" type="string">
    The ID of the associated document.
  </ResponseField>

  <ResponseField name="url" type="string">
    The URL of the link.
  </ResponseField>

  <ResponseField name="key" type="string" required>
    The unique key of the link (e.g., /github), also stored in Redis.
  </ResponseField>

  <ResponseField name="domain" type="string" required>
    The domain associated with the link.
  </ResponseField>

  <ResponseField name="expiresAt" type="string">
    The optional expiration date of the link.
  </ResponseField>

  <ResponseField name="password" type="string">
    The password required to access the link, also stored in Redis.
  </ResponseField>

  <ResponseField name="isFile" type="boolean" default="true">
    Indicates whether the link is associated with a file.
  </ResponseField>

  <ResponseField name="isQR" type="boolean" default="false">
    Indicates whether the link is associated with a QR code.
  </ResponseField>

  <ResponseField name="title" type="string">
    The OG title for the link.
  </ResponseField>

  <ResponseField name="description" type="string">
    The OG description for the link.
  </ResponseField>

  <ResponseField name="image" type="string">
    The OG image for the link (e.g., [https://reqlick.com/\_static/thumbnail.png](https://reqlick.com/_static/thumbnail.png)).
  </ResponseField>

  <ResponseField name="views" type="object[]">
    The tracked views associated with the link.
  </ResponseField>

  <ResponseField name="projectId" type="string" required>
    The ID of the associated project.
  </ResponseField>

  <ResponseField name="isPublic" type="boolean" default="true">
    Indicates whether the link is public.
  </ResponseField>

  <ResponseField name="isActive" type="boolean" default="true">
    Indicates whether the link is active.
  </ResponseField>

  <ResponseField name="isArchived" type="boolean" default="false">
    Indicates whether the link is archived.
  </ResponseField>

  <ResponseField name="utm_source" type="string">
    The UTM source for the link (e.g., youtube.com).
  </ResponseField>

  <ResponseField name="utm_medium" type="string">
    The UTM medium for the link (e.g., social).
  </ResponseField>

  <ResponseField name="utm_campaign" type="string">
    The UTM campaign for the link (e.g., summer-sale).
  </ResponseField>

  <ResponseField name="utm_term" type="string">
    The UTM term for the link (e.g., reqlick).
  </ResponseField>

  <ResponseField name="utm_content" type="string">
    The UTM content for the link (e.g., description).
  </ResponseField>

  <ResponseField name="ref" type="string">
    The referral for the link.
  </ResponseField>

  <ResponseField name="ios" type="string">
    The custom link for iOS devices.
  </ResponseField>

  <ResponseField name="android" type="string">
    The custom link for Android devices.
  </ResponseField>

  <ResponseField name="qrcode" type="object[]">
    The QR codes associated with the link.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time when the link was created.
  </ResponseField>

  <ResponseField name="updatedAt" type="string">
    The date and time when the link was last updated.
  </ResponseField>
</Accordion>

## Documents

Documents are the files that you can upload and manage within your workspace. These can include contracts, reports, or any file you need to store and share with your team. Using the [Reqlick API](/api-reference/introduction), you can upload, update, and delete documents.

<Accordion title="Document model">
  <ResponseField name="id" type="string" required>
    The unique identifier for the document.
  </ResponseField>

  <ResponseField name="name" type="string" required>
    The name of the document.
  </ResponseField>

  <ResponseField name="description" type="string">
    The description of the document.
  </ResponseField>

  <ResponseField name="file" type="string" required>
    The reference to where the file is stored (e.g., S3, Google Cloud Storage).
  </ResponseField>

  <ResponseField name="size" type="number" requried>
    The size of the file (in bytes).
  </ResponseField>

  <ResponseField name="type" type="string" requried>
    The file type (e.g., pdf, docx).
  </ResponseField>

  <ResponseField name="links" type="object[]">
    The links associated with the document.
  </ResponseField>

  <ResponseField name="views" type="object[]">
    The tracked views associated with the document.
  </ResponseField>

  <ResponseField name="projectId" type="string">
    The ID of the associated project.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time when the document was created.
  </ResponseField>

  <ResponseField name="updatedAt" type="string">
    The date and time when the document was last updated.
  </ResponseField>
</Accordion>

## QR Codes

Reqlick allows you to generate custom QR codes for your links, providing a visual and scannable representation of your shortened URLs. These QR codes can be customized with colors, logos, and other design elements.

You can create, update, and delete QR codes via the [Reqlick API](/api-reference/introduction). Each QR code is linked to a specific shortened link for easy access.

<Accordion title="QR Code model">
  <ResponseField name="id" type="string" required>
    The unique identifier for the QR code.
  </ResponseField>

  <ResponseField name="image" type="string" required>
    The image of the QR code.
  </ResponseField>

  <ResponseField name="bgColor" type="string">
    The background color of the QR code.
  </ResponseField>

  <ResponseField name="fgColor" type="string">
    The foreground color of the QR code.
  </ResponseField>

  <ResponseField name="level" type="string" required>
    The error correction level of the QR code.
  </ResponseField>

  <ResponseField name="size" type="number" requried>
    The size of the QR code.
  </ResponseField>

  <ResponseField name="url" type="string" required>
    The URL associated with the QR code.
  </ResponseField>

  <ResponseField name="image_src" type="string" requried>
    The source URL for the image associated with the QR code.
  </ResponseField>

  <ResponseField name="image_excavate" type="boolean" requried>
    Indicates whether to excavate the image (e.g., if the image is embedded).
  </ResponseField>

  <ResponseField name="image_height" type="number" requried>
    The height of the image associated with the QR code.
  </ResponseField>

  <ResponseField name="image_width" type="number" requried>
    The width of the image associated with the QR code.
  </ResponseField>

  <ResponseField name="views" type="object[]">
    The tracked views associated with the QR code.
  </ResponseField>

  <ResponseField name="projectId" type="string">
    The ID of the associated project.
  </ResponseField>

  <ResponseField name="link" type="object">
    The link associated with the QR code.
  </ResponseField>

  <ResponseField name="linkId" type="string">
    The ID of the associated link.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time when the QR code was created.
  </ResponseField>

  <ResponseField name="updatedAt" type="string">
    The date and time when the QR code was last updated.
  </ResponseField>
</Accordion>

## Domains

On Reqlick, you can add custom domains to create branded short links for better brand recognition.

<Accordion title="Domain model">
  <ResponseField name="id" type="string" required>
    The unique identifier for the domain.
  </ResponseField>

  <ResponseField name="slug" type="string" required>
    The unique slug for the domain.
  </ResponseField>

  <ResponseField name="verified" type="boolean" default="false">
    Indicates whether the domain has been verified.
  </ResponseField>

  <ResponseField name="target" type="string">
    The target URL or resource associated with the domain.
  </ResponseField>

  <ResponseField name="type" type="string" default="redirect">
    The type of the domain (e.g., redirect).
  </ResponseField>

  <ResponseField name="description" type="string">
    A description of the domain.
  </ResponseField>

  <ResponseField name="primary" type="boolean" default="false">
    Indicates whether the domain is the primary domain.
  </ResponseField>

  <ResponseField name="lastChecked" type="string">
    The date and time when the domain was last checked.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time when the domain was created.
  </ResponseField>

  <ResponseField name="updatedAt" type="string">
    The date and time when the domain was last updated.
  </ResponseField>

  <ResponseField name="projectId" type="string">
    The ID of the associated project.
  </ResponseField>
</Accordion>

## Subscriptions

Reqlick operates on a subscription-based model, allowing users to unlock various features depending on their subscription level. You can manage subscription plans, view current subscriptions, and upgrade or downgrade subscriptions only on the [Reqlick dashboard](https://app.reqlick.com).

<Accordion title="Subscription model">
  <ResponseField name="id" type="string" required>
    The unique identifier for the subscription.
  </ResponseField>

  <ResponseField name="userId" type="string">
    The ID of the associated user.
  </ResponseField>

  <ResponseField name="plan" type="string" default="FREE">
    The subscription plan of the user.
  </ResponseField>

  <ResponseField name="billingCycleStart" type="number">
    The day of the month when the billing cycle starts.
  </ResponseField>

  <ResponseField name="stripeId" type="string">
    The Stripe ID associated with the subscription.
  </ResponseField>

  <ResponseField name="isCanceledAtPeriodEnd" type="boolean" default="false">
    Indicates whether the subscription will be canceled at the end of the current
    billing period.
  </ResponseField>

  <ResponseField name="isActive" type="boolean" default="true">
    Indicates whether the subscription is currently active.
  </ResponseField>

  <ResponseField name="isPaymentFailed" type="boolean" default="false">
    Indicates whether the payment for the subscription has failed.
  </ResponseField>

  <ResponseField name="isCanceledAt" type="string">
    The date and time when the subscription was canceled.
  </ResponseField>

  <ResponseField name="isCancelAt" type="string">
    The date and time when the subscription is scheduled to be canceled.
  </ResponseField>

  <ResponseField name="interval" type="string">
    The billing interval for the subscription (e.g., year, month).
  </ResponseField>

  <ResponseField name="subscriptionScheduleId" type="string">
    The ID of the subscription schedule.
  </ResponseField>

  <ResponseField name="periodEnd" type="string">
    The end date of the subscription period.
  </ResponseField>

  <ResponseField name="projects" type="object[]">
    The projects associated with the subscription.
  </ResponseField>

  <ResponseField name="amount" type="number" default="0">
    The amount of the subscription (\$0 by default).
  </ResponseField>

  <ResponseField name="domainsLimit" type="number" default="0">
    The limit on the number of domains for the subscription.
  </ResponseField>

  <ResponseField name="projectsLimit" type="number" default="1">
    The limit on the number of projects for the subscription.
  </ResponseField>

  <ResponseField name="usersLimit" type="number" default="1">
    The limit on the number of users for the subscription.
  </ResponseField>

  <ResponseField name="stockageLimit" type="bigint" default="536870912">
    The storage limit for the subscription (in bytes; 512MB by default).
  </ResponseField>

  <ResponseField name="clicksLimit" type="number" default="1000">
    The limit on the number of clicks for the subscription.
  </ResponseField>

  <ResponseField name="shortLinksLimit" type="number" default="10">
    The limit on the number of short links for the subscription.
  </ResponseField>

  <ResponseField name="qrCodeLinksLimit" type="number" default="2">
    The limit on the number of QR code links for the subscription.
  </ResponseField>

  <ResponseField name="stockageUsage" type="bigint" default="0">
    The current storage usage (in bytes).
  </ResponseField>

  <ResponseField name="clicksUsage" type="number" default="0">
    The current number of clicks used.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time when the subscription was created.
  </ResponseField>

  <ResponseField name="updatedAt" type="string">
    The date and time when the subscription was last updated.
  </ResponseField>
</Accordion>

## Users

Users are the individuals who interact with Reqlick. Each user is associated with one or more workspaces and can be assigned different roles, such as admin or collaborator. The API allows for user creation, role management, and user authentication.

<Accordion title="User model">
  <ResponseField name="id" type="string" required>
    The unique identifier for the user.
  </ResponseField>

  <ResponseField name="name" type="string">
    The first name of the user.
  </ResponseField>

  <ResponseField name="lastName" type="string">
    The last name of the user.
  </ResponseField>

  <ResponseField name="email" type="string">
    The email address of the user, which must be unique.
  </ResponseField>

  <ResponseField name="image" type="string">
    The URL of the user's profile image.
  </ResponseField>

  <ResponseField name="password" type="string">
    The hashed password of the user.
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time when the user was created.
  </ResponseField>

  <ResponseField name="lastLogin" type="string">
    The date and time when the user last logged in.
  </ResponseField>

  <ResponseField name="team" type="object[]">
    The team members associated with the user.
  </ResponseField>

  <ResponseField name="subscription" type="object">
    The subscription associated with the user.
  </ResponseField>

  <ResponseField name="tokens" type="object[]">
    The tokens associated with the user.
  </ResponseField>

  <ResponseField name="apiTokens" type="object[]">
    The API tokens associated with the user.
  </ResponseField>

  <ResponseField name="client_id" type="string">
    The client ID associated with the user.
  </ResponseField>

  <ResponseField name="client_secret" type="string">
    The client secret associated with the user.
  </ResponseField>
</Accordion>
