---
title: NOM-151 Certificate of Data Preservation via API
description: Learn how to generate NOM-151 Certificates of Data Preservation via Mifiel's API — giving your electronic documents legal integrity and certain date.
---

[Skip to content](https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api#main-content)

- [English](https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api)
- [Español](https://guia.mifiel.com/es/constancias-de-conservacion-nom-151-via-api)

English

Show submenu for translations

[![mifiel\_logo.png\]](https://guia.mifiel.com/hs-fs/hubfs/mifiel_logo.png?height=35&name=mifiel_logo.png)](https://www.mifiel.com/en/)

Open main navigation

Close main navigation

- - [English](https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api)
    - [Español](https://guia.mifiel.com/es/constancias-de-conservacion-nom-151-via-api)

  English
  
  Show submenu for translations

 Hi! How can we help you?

- There are no suggestions because the search field is empty.

1. [Frequently Asked Questions](https://guia.mifiel.com/en?hsLang=en)
2. [API integration](https://guia.mifiel.com/en/api-integration?hsLang=en)
3. [Additional features](https://guia.mifiel.com/en/api-integration?hsLang=en#additional-features)

# NOM-151 Certificate of Data Preservation via API

## A Certificate of Data Preservation generated through Mifiel grants, in accordance with NOM-151, integrity and a certain date to electronic documents

This feature is exclusively available through Mifiel's API and is designed for documents that require a Certificate of Data Preservation **without an electronic signature.**

Documents signed in Mifiel automatically include a Certificate of Data Preservation.

### Contents

1. [What is a Certificate of Data Preservation?](https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api#what-is-a-certificate-of-data-preservation)
2. [How to Obtain a Certificate of Data Preservation via API](https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api#how-to-obtain-a-certificate)
3. [How Do I Get Started?](https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api#get-started)

---

### What is a Certificate of Data Preservation?

A Certificate of Data Preservation is an electronic receipt signed by a Trust Service Provider (PSC, for its Spanish acronym) that incorporates a timestamp in accordance with NOM-151.

Certificates of Data Preservation generated through Mifiel are issued by **Advantage Security**, a Trust Service Provider accredited by the Ministry of Economy.

**The Certificate of Data Preservation demonstrates that a document existed at a specific point in time and that its content has not been altered since it was stamped, providing evidence of its integrity and certain date.**

**Certificate of Data Preservation do not "make an electronic signature valid**." The validity of an electronic signature depends on the process used to create it. For more information, see this article:[https://blog.mifiel.com/nom-151-firma-electronica/](https://blog.mifiel.com/nom-151-firma-electronica/)

---

### How to Obtain a Certificate of Data Preservation via API

Mifiel's NOM-151 API has two endpoints: one for generating a Certificate of Data Preservation and another for retrieving previously generated certificates.

1. **Generate a Certificate of Data Preservation (POST):**
2. Endpoint: `/api/v1/psc/nom151`
3. Accepted parameters in the request body:
4. `hash`: SHA256 hash string of the document (required).
5. `external_id`: Unique identifier for external reference.
6. Response includes:
7. `id`: Unique identifier of the certificate.
8. `nom151`: Base64 string of the generated certificate.
9. `created_at`: Date the certificate was created.
10. `certificate`: Certificate of the Trust Service Provider (PSC) that issued it.
11. `hash`: SHA256 hash string provided.
12. **Retrieve a Certificate of Data Preservation (GET):**
13. Endpoints:
14. By `external_id: /api/v1/psc/nom151?external_id={:external_id}`
15. By `id: /api/v1/psc/nom151/{:id}`
16. Response includes:
17. `id`: Unique identifier of the certificate.
18. `nom151`: Base64 string of the generated certificate.
19. `created_at`: Date the certificate was created.
20. `certificate`: Certificate of the issuing PSC.
21. `hash`: SHA256 hash string provided​.

#### Your First Certificate of Data Preservation

Below you'll find examples in different programming languages covering how to obtain the SHA-256 hash of the PDF, authenticate with your API keys, and generate the certificate.

#### Code Examples

<iframe src="https://jsfiddle.net/Mifiel/k2exdLqj/embedded/result/" width="100%" height="600" frameborder="0" loading="lazy" allowfullscreen style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial;">
</iframe>

 

---

### How Do I Get Started?

Mifiel has two environments: a **test environment (Sandbox)** and a **production environment**. You can start testing in the Sandbox or acquire the feature directly.

**To test in the Sandbox:**

1. Create an account in [Mifiel's Sandbox](https://app-sandbox.mifiel.com/users/sign_up?locale=en).
2. Contact us via chat (the green icon in the bottom-right corner) **to request API access and test credits**.
3. Generate your API keys in the [API Settings section](https://app-sandbox.mifiel.com/settings/access-tokens?_gl=1*1tw3oab*_gcl_au*OTg3MzEzMjE2LjE3ODExMzQ4MjkuMzE5NjA0NzExLjE3ODM0NjkyMjcuMTc4MzQ2OTIyNw..*_ga*ZWVmYjE5YTItN2E2Ny00MDUxLTgyM2ItMTMwMDJhNTkyNWI0*_ga_HC8KKJV9TY*czE3ODQzMDgyNTAkbzE4MyRnMSR0MTc4NDMxNDg2NyRqNjAkbDAkaDA.).

Once you finish testing, contact us via chat to acquire the feature for your production environment.

**To acquire the feature directly:**

If you prefer to skip the test environment, contact us via chat and we’ll help you set up your production environment.

[Download the price list](https://share.hsforms.com/1ecTXQhpKRbOp1ndHOwasyA16vjy?__hstc=45788219.8a2815fc707605b7c72daf85ad140134.1784157019492.1784157019492.1784157019492.1&__hssc=45788219.1.1784157019492&__hsfp=5a93a5b591af0a4924108417a06a69dc) to see rates based on how many certificates you need.

- [Document signing](https://guia.mifiel.com/en/document-signing?hsLang=en#main-content)

    - [How to sign a document using the e.firma in Mifiel](https://guia.mifiel.com/en/document-signing?hsLang=en#how-to-sign-a-document-using-the-e-firma-in-mifiel)
    - [Features of the e.firma](https://guia.mifiel.com/en/document-signing?hsLang=en#features-of-the-e-firma)
    - [Common errors](https://guia.mifiel.com/en/document-signing?hsLang=en#common-errors)
- [Document preparation](https://guia.mifiel.com/en/document-preparation?hsLang=en#main-content)

    - [Invite signers](https://guia.mifiel.com/en/document-preparation?hsLang=en#invite-signers)
    - [Customize the characteristics of a document](https://guia.mifiel.com/en/document-preparation?hsLang=en#customize-the-characteristics-of-a-document)
- [Document management](https://guia.mifiel.com/en/document-management?hsLang=en#main-content)

    - [General](https://guia.mifiel.com/en/document-management?hsLang=en#general)
    - [For document managers](https://guia.mifiel.com/en/document-management?hsLang=en#for-document-managers)
- [Verifying a signed document and its signatures](https://guia.mifiel.com/en/verifying-a-signed-document-and-its-signatures?hsLang=en)
- [Private signing process of encrypted documents](https://guia.mifiel.com/en/private-signing-process-of-encrypted-documents?hsLang=en#main-content)

    - [Creation of encrypted documents](https://guia.mifiel.com/en/private-signing-process-of-encrypted-documents?hsLang=en#creation-of-encrypted-documents)
    - [Signing of encrypted documents](https://guia.mifiel.com/en/private-signing-process-of-encrypted-documents?hsLang=en#signing-of-encrypted-documents)
    - [Set up of organizations and accounts](https://guia.mifiel.com/en/private-signing-process-of-encrypted-documents?hsLang=en#set-up-of-organizations-and-accounts)
- [API integration](https://guia.mifiel.com/en/api-integration?hsLang=en#main-content)

    - [General](https://guia.mifiel.com/en/api-integration?hsLang=en#general)
    - [Signing widget customizations](https://guia.mifiel.com/en/api-integration?hsLang=en#signing-widget-customizations)
    - [Additional features](https://guia.mifiel.com/en/api-integration?hsLang=en#additional-features)
- [Plans and packets, billing and payment](https://guia.mifiel.com/en/plans-and-packets-billing-and-payment?hsLang=en#main-content)

    - [Features](https://guia.mifiel.com/en/plans-and-packets-billing-and-payment?hsLang=en#features)
    - [Pricing scheme](https://guia.mifiel.com/en/plans-and-packets-billing-and-payment?hsLang=en#pricing-scheme)
    - [Purchasing process](https://guia.mifiel.com/en/plans-and-packets-billing-and-payment?hsLang=en#purchasing-process)
    - [Billing process](https://guia.mifiel.com/en/plans-and-packets-billing-and-payment?hsLang=en#billing-process)
    - [Checking your consumption](https://guia.mifiel.com/en/plans-and-packets-billing-and-payment?hsLang=en#checking-your-consumption)
- [Managing your e.firma and your Mifiel account](https://guia.mifiel.com/en/managing-your-e-firma-and-your-mifiel-account?hsLang=en#main-content)

    - [Your Mifiel account](https://guia.mifiel.com/en/managing-your-e-firma-and-your-mifiel-account?hsLang=en#your-mifiel-account)
    - [Features for signers](https://guia.mifiel.com/en/managing-your-e-firma-and-your-mifiel-account?hsLang=en#features-for-signers)
    - [Your e.firma (FIEL)](https://guia.mifiel.com/en/managing-your-e-firma-and-your-mifiel-account?hsLang=en#your-e-firma-fiel)
- [Legal topics](https://guia.mifiel.com/en/legal-topics?hsLang=en#main-content)

    - [Electronic signature regulations](https://guia.mifiel.com/en/legal-topics?hsLang=en#electronic-signature-regulations)
    - [Common questions when transitioning to electronic signature](https://guia.mifiel.com/en/legal-topics?hsLang=en#common-questions-when-transitioning-to-electronic-signature)
- [Organization Management](https://guia.mifiel.com/en/organization-management?hsLang=en#main-content)

    - [Generating an organization in Mifiel](https://guia.mifiel.com/en/organization-management?hsLang=en#generating-an-organization-in-mifiel)
    - [Adding members and editing their permissions](https://guia.mifiel.com/en/organization-management?hsLang=en#adding-members-and-editing-their-permissions)
- [About Mifiel](https://guia.mifiel.com/en/about-mifiel?hsLang=en#main-content)

    - [General information](https://guia.mifiel.com/en/about-mifiel?hsLang=en#general-information)
- [Signing from the app](https://guia.mifiel.com/en/signing-from-the-app?hsLang=en)

[![Chill listening crop-3](https://guia.mifiel.com/hs-fs/hubfs/logo-only-1.png?width=24&height=24&name=logo-only-1.png "Chill listening crop-3")](http://www.mifiel.com)

```json
{
  "@context" : "https://schema.org",
  "@type" : "TechArticle",
  "about" : [ {
    "@type" : "Thing",
    "name" : "NOM-151"
  }, {
    "@type" : "Thing",
    "name" : "Certificate of Data Preservation"
  }, {
    "@type" : "Thing",
    "name" : "Electronic Document Integrity"
  }, {
    "@type" : "Thing",
    "name" : "Timestamp"
  }, {
    "@type" : "Thing",
    "name" : "API"
  } ],
  "audience" : {
    "@type" : "Audience",
    "audienceType" : "Developers"
  },
  "author" : {
    "@type" : "Organization",
    "name" : "Mifiel",
    "url" : "https://mifiel.com"
  },
  "description" : "Learn how to generate and retrieve NOM-151 Certificates of Data Preservation using the Mifiel API, including endpoints, authentication, request parameters, responses, and code examples.",
  "headline" : "NOM-151 Certificate of Data Preservation via API",
  "inLanguage" : "en",
  "keywords" : [ "NOM-151", "Certificate of Data Preservation", "Data Preservation Certificate", "Mifiel API", "Data Preservation", "Electronic Document Integrity", "Timestamp", "SHA-256", "Electronic Documents" ],
  "mainEntity" : {
    "@type" : "SoftwareApplication",
    "applicationCategory" : "DeveloperApplication",
    "name" : "Mifiel API",
    "operatingSystem" : "Any",
    "url" : "https://docs.mifiel.com/en/"
  },
  "mainEntityOfPage" : {
    "@id" : "https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api",
    "@type" : "WebPage"
  },
  "proficiencyLevel" : "Intermediate",
  "publisher" : {
    "@type" : "Organization",
    "name" : "Mifiel",
    "url" : "https://mifiel.com"
  },
  "url" : "https://guia.mifiel.com/en/nom-151-certificate-of-data-preservation-via-api"
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "FAQPage",
  "mainEntity" : [ {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "A Certificate of Data Preservation is an electronic receipt signed by a Trust Service Provider (PSC) that incorporates a timestamp in accordance with NOM-151. It proves that a document existed at a specific point in time and that its content has not been altered since it was stamped."
    },
    "name" : "What is a Certificate of Data Preservation?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Use the POST /api/v1/psc/nom151 endpoint with the SHA-256 hash of your document. The API returns the generated certificate, its identifier, creation date, the issuing Trust Service Provider certificate, and the original hash. You can later retrieve the certificate by its ID or external_id."
    },
    "name" : "How do I obtain a Certificate of Data Preservation via API?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Create a Mifiel Sandbox account, request API access and test credits through chat, generate your API keys, and begin testing. Once testing is complete, contact Mifiel to enable the production environment, or contact Mifiel directly to acquire the feature without using the Sandbox."
    },
    "name" : "How do I get started?"
  } ]
}
```