---
title: "Get List of Data Subject Tokens"
method: GET
path: "/rest/api/consent/v4/linktokens"
tags: ["Magic Link Tokens V4"]
---

# Get List of Data Subject Tokens

`GET /rest/api/consent/v4/linktokens`

## Request

- Base URL: `https://hostname`
- URL: `https://hostname/rest/api/consent/v4/linktokens`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://{hostname}/api/access/v1/oauth/token` scopes: `CONSENT`

Use this API to retrieve a list of link tokens created between a specified date range for all data subjects.

> 🗒 Things to Know
> 
> - The maximum date range that can be returned is 7 days.

## Query parameters

- `fromDate` string, date-time, required
- `toDate` string, date-time, required
- `page` integer
- `size` integer
- `sort` 'expiryDate,asc' | 'expiryDate,desc'

## Headers

- `requestContinuation` string

## Response `200`

OK

List of Email Link Tokens retrieved successfully.

- ConsentAPIEmailLinkTokenSliceDto
  - `content` ConsentAPIEmailLinkTokenResponseDto[]
    - `token` string: The data subject link token. This token can be appended to the preference center URL to form the preference center magic link.
    - `identifier` string: The data subject identifier of the data subject.
    - `createdDate` string, date-time: The date and time that the data subject link token was created.
    - `expiryDate` string, date-time: The date and time that the data subject link token expires.
  - `number` integer: The page number of the results.
  - `size` integer: The number of results per page.
  - `pageable` ConsentAPIPageableObject
    - `offset` integer
    - `sort` ConsentAPISortObject
      - `empty` boolean
      - `sorted` boolean
      - `unsorted` boolean
    - `pageNumber` integer
    - `paged` boolean
    - `pageSize` integer
    - `unpaged` boolean
  - `last` boolean: Flag indicating whether this is the last page or not.
  - `sort` ConsentAPISortObject
    - `empty` boolean
    - `sorted` boolean
    - `unsorted` boolean
  - `first` boolean
  - `numberOfElements` integer
  - `empty` boolean
  - `requestContinuation` string: The token used to paginate a response if the number of records is more than a page.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests. For more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500`: Internal Server Error

---

[API](https://skmtc.dev/onetrust/apis/consent-preferences-universal-consent-preference-management.md) - [All operations](https://skmtc.dev/onetrust/apis/consent-preferences-universal-consent-preference-management/llms.txt) - [OpenAPI document](https://skmtc.dev/onetrust/apis/consent-preferences-universal-consent-preference-management/revisions/fe4a0697ec9d?raw)
