---
title: "Requesting timestamps to Rest PKI Core"
description: "How to use a Rest PKI Core instance as a timestamp provider through the TSP protocol (RFC 3161) or a REST API, including creating an app and API key."
canonical: "https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/requesting-timestamps"
locale: "en"
product: "Rest PKI Core"
last_updated: "2026-10-13"
---

# Requesting timestamps to Rest PKI Core

You can use an instance of [Rest PKI Core](https://docs.lacunasoftware.com/en-us/articles/rest-pki/core) as a timestamp provider for requesting timestamps through the TSP protocol (*Timestamp Protocol* - RFC 3161)
or through a REST API.

1. Sign in to your Rest PKI Core dashboard (e.g.: *https://restpkicore.yourcompany.com*)
1. Click on **Applications** on the left menu, then on *Add*
1. Fill out a name and select a subscription (you most likely have a single subscription, so select it)
1. Mark the **Worker** role
1. Click on **Create**
1. Click on **Keys**, then on **Add**
1. Fill out some description and, on the *Expiration* field, choose **Never expires**
1. Click on **Create**
1. Copy the **API key** generated (this value cannot be retrieved later)

> **Note**
>
> When requesting timestamps to the SaaS instance of Rest PKI Core, the dashboard URL is [https://core.pki.rest/](https://core.pki.rest/)

Then, use on of the following methods to request a timestamp.

## Timestamp Protocol

Use these parameters to request a timestamp through TSP protocol:

* Protocol: HTTPS
* Method: POST
* Url: `https://restpkicore.yourcompany.com/tsp`
* Authentication: HTTP header `Authorization: ApiKey YOUR_API_KEY`

> **Note**
>
> If you need to specify a tier, add the suffix `/TIER` to the URL, i.e. `https://restpkicore.yourcompany.com/tsp/TIER`

When requesting timestamps to the SaaS instance of Rest PKI Core, it is necessary to specify one of the following tiers:

* PKI Brazil timestamp: `PkiBrazil` (or `a402df41-8559-47b2-a05c-be555bf66310`)
* Test timestamp: `LacunaTest`

> **Note**
>
> Different rates apply according to the tier chosen

## REST API

Use these parameters to request a timestamp through a REST API:

* Url: `https://restpkicore.yourcompany.com/api/tsp` (optionally with a suffix `/TIER`)
* Method: POST
* Request headers
  * `Authorization` : `ApiKey YOUR_API_KEY`
  * `Content-Type` : `application/json`
* Request
  * `algorithm` : algorithm name (see suported algoritm below)
  * `value` : hash value to be stamped, Base64 encoded **or**
  * `hexValue` : hash value to be stamped, encoded in hexadecimal (*case insensitive*)
* Response
  * `encodedValue` : timestamp, Base64 encoded
  * `info` : informations about the timestamp

> **Note**
>
> The REST API URL is very similar to the TSP URL, with the difference being the extra `/api/` segment

The [API reference](https://core.pki.rest/swagger) lists this route as `POST /api/tsp/{identifier}`, where `identifier` is the tier. The tier segment is optional
on both URLs: without it, Rest PKI Core uses the instance's default tier, so on the SaaS instance always add it.

Example request with SHA-256 algorithm and Base64 hash:

```json
{
	"algorithm": "SHA256",
	"value": "L80RIvFw2jwpiObzFQN+tuEQQ4E9qnGeYYYd+4DrM8M="
}
```

Example request with SHA-1 algorithm and hash in hex:

```json
{
	"algorithm": "SHA1",
	"hexValue": "3ade2832feafe081f246aa2fb89cb9c7929ac911"
}
```

## Supported Algorithms

Currently, the following algorithms are supported:

* SHA-1
  * TSP: 1.3.14.3.2.26
  * API: "SHA1"
* SHA-256
  * TSP: 2.16.840.1.101.3.4.2.1
  * API: "SHA256"

**Demos and samples**

- Live demo: [Timestamp a PDF](https://try.lacunasoftware.com/en/pki-suite/timestamp-a-pdf)
- Timestamp a PDF with Rest PKI Core: [.NET](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/spa/PkiSuiteAspNetCoreAngularSample/PkiSuiteAspNetCoreAngularSample.Server/Controllers/TimestampPdfRestPkiCoreController.cs) · [Node.js](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/nodejs/expressmvc/routes/timestamp-pdf-core.js) · [PHP](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/php/plain/public/timestamp-pdf-rest-core/index.php) · [Python](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/python/flask/sample/views/timestamp_pdf_rest_core.py) · [Ruby](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/ruby/rails/app/controllers/timestamp_pdf_rest_core_controller.rb)
