If the Namirial Archive option is activated on your workspace, the documents of your completed transactions can be automatically sent to a Namirial Archive vault.
A vault configuration is made of:
- the connection to your Namirial vault,
- schema fields: the document types (typologies) and metadata of your vault,
- routing rules: which documents are sent to the vault (conditions) and which values are sent with them (instructions).
You can configure your vault from the web application (see Configure long-term archiving) or via the API, as described below.
Prerequisites
- You authenticate your requests with an API key of your workspace.
- The Namirial Archive option is activated on your workspace. If you wish to activate it, contact your account manager at Universign.
- Your vault has been created on Namirial side and you received its connection details from the Namirial support team.
- Your document types and the metadata related to them have been created in your vault.
1. Create a vault
Send a request to POST /v1/vaults and pass the provider (namirial) and the name of the vault. The description is optional.
curl
https://api.universign.com/v1/vaults \
-d provider=namirial \
-d name="ACME Vault" \
-d description="Main archive vault"
The API returns a vault object. Keep the vault id for the next requests.
{
"object" : "vault",
"id" : "vlt_id",
"name" : "ACME Vault",
"provider" : "namirial",
"description" : "Main archive vault",
"deployed" : false,
"needs_redeploy" : false,
"created_at" : "2026-05-28T10:00:00Z",
"schema_fields" : [ ],
"rules" : [ ]
}
2. Set the Namirial connection
Send a request to POST /v1/vaults/{vault_id}/config/namirial and pass the connection details provided by the Namirial support team:
username: the client ID,password: the client secret,id_setup: the configuration ID,id_company: the company ID,vat_id: the VAT number.
curl
https://api.universign.com/v1/vaults/vlt_id/config/namirial \
-d id_setup=setup-1 \
-d id_company=company-1 \
-d vat_id=FR-123 \
-d username=client-id \
-d password=s3cr3t
The credentials are checked with Namirial before being saved. The request is rejected if Namirial rejects the credentials or cannot be reached.
Note that the password is stored encrypted and is never returned by the API.
A missing argument leaves the setting unchanged, and an empty argument clears it.
3. Declare the schema fields
Schema fields describe the document types and the metadata of your vault. You must declare at least one document type.
To find the references of your vault, you can list:
- the document types of your vault:
GET /v1/vaults/{vault_id}/config/namirial/document-types. Theidof each document type is theprovider_refto use, - the metadata of a document type:
GET /v1/vaults/{vault_id}/config/namirial/document-types/{doc_type_id}/metadata. Thenameof each metadata is theprovider_refto use.
Then, for each field, send a request to POST /v1/vaults/{vault_id}/schema-fields with the following arguments:
name: the name of the field in Universign,kind:document_typeormetadata,required:trueif a value must always be sent to the vault for this field (default value isfalse),provider_ref: the ID of the document type, or the name of the metadata, as defined in the Namirial vault.
curl
https://api.universign.com/v1/vaults/vlt_id/schema-fields \
-d name=SignedDocument \
-d kind=document_type \
-d required=true \
-d provider_ref=461
curl
https://api.universign.com/v1/vaults/vlt_id/schema-fields \
-d name=document_number \
-d kind=metadata \
-d provider_ref="DOCUMENT NUMBER"
To remove a field, send a request to DELETE /v1/vaults/{vault_id}/schema-fields/{name}.
4. Create a routing rule
Without any routing rule, your documents are not archived. All rules are evaluated for each document: a document that matches several rules is archived once per matching rule.
4.1. Create the rule
Send a request to POST /v1/vaults/{vault_id}/rules and pass the rule name.
curl
https://api.universign.com/v1/vaults/vlt_id/rules \
-d name="Signed documents"
The API returns a rule object with its id. To set a description, send a request to POST /v1/vaults/{vault_id}/rules/{rule_id} with the description argument.
4.2. Add conditions
Conditions define which documents are concerned by the rule. All conditions of a rule must be met for the rule to apply. If a rule has no condition, all documents are eligible for archiving.
Send a request to POST /v1/vaults/{vault_id}/rules/{rule_id}/conditions with:
source: the information to evaluate (see the table below),operator: the comparison operator (see the table below),value: the expected value. With theinandnot_inoperators, pass several values separated by commas (for examplevalue=document,evidence).
curl
https://api.universign.com/v1/vaults/vlt_id/rules/rul_id/conditions \
-d source=document.kind \
-d operator=equals \
-d value=document
source |
Description |
|---|---|
document.kind |
The kind of document. Possible values are document (the documents of the transaction), evidence (the evidence files) and capture (the captured documents). |
document.id |
The document ID. |
document.metadata.<key> |
The value of a document metadata (for example document.metadata.contract_ref). |
transaction.id |
The transaction ID. |
transaction.name |
The transaction name. |
transaction.year |
The transaction year. |
transaction.folder_name |
The name of the transaction folder. |
transaction.metadata.<key> |
The value of a transaction metadata (for example transaction.metadata.clientId). |
operator |
The condition is met if the source… |
|---|---|
equals |
is equal to the value. |
not_equals |
is different from the value. |
in |
is among the values. Separate the values with commas. |
not_in |
is not among the values. Separate the values with commas. |
exists |
is filled in. Do not pass any value. |
not_exists |
is not filled in. Do not pass any value. |
4.3. Add archiving instructions
Instructions define the values sent to the vault for each schema field when the rule applies. Send a request to POST /v1/vaults/{vault_id}/rules/{rule_id}/instructions for each field, with:
field_name: the name of the schema field,value: a static value or an expression between${and}. For the document type field, pass the name of the target document type field (for exampleSignedDocument).
curl
https://api.universign.com/v1/vaults/vlt_id/rules/rul_id/instructions \
-d field_name=document_number \
--data-urlencode 'value=${transaction.id}-${document.name}'
curl
https://api.universign.com/v1/vaults/vlt_id/rules/rul_id/instructions \
-d field_name=SignedDocument \
-d value=SignedDocument
The available expressions are:
| Expression | Value sent to the vault |
|---|---|
${transaction.id} |
The transaction ID |
${transaction.name} |
The transaction name |
${transaction.year} |
The transaction year |
${transaction.created_at} |
The transaction creation date |
${transaction.folder_name} |
The name of the transaction folder |
${transaction.metadata.<key>} |
The value of a transaction metadata |
${document.id} |
The document ID |
${document.name} |
The document name |
${document.metadata.<key>} |
The value of a document metadata |
Note that an expression must always be written between ${ and }. Otherwise, the text is sent to the vault as a static value.
To remove a rule, send a request to DELETE /v1/vaults/{vault_id}/rules/{rule_id}.
Note that conditions and instructions cannot be updated or deleted individually. To change them, delete the rule and create it again with the new conditions and instructions.
5. Deploy the vault
Your configuration is applied only once deployed. Send a request to POST /v1/vaults/{vault_id}/deploy. The provider configuration and the rules are validated, then the current version of the vault is used to route your documents.
curl -X POST
https://api.universign.com/v1/vaults/vlt_id/deploy
The returned vault object has deployed set to true.
Changes made after a deployment are not applied until you deploy the vault again. In this case, the needs_redeploy attribute of the vault is true.
To temporarily suspend archiving through a vault, send a request to POST /v1/vaults/{vault_id}/undeploy. The vault is no longer used to route your documents until you deploy it again.
Route documents with document metadata
Routing rules can rely on the metadata you associate with each document (see Set document metadata), both in conditions and in instructions.
For example, to send to the vault the contract reference you passed when adding the document:
curl
https://api.universign.com/v1/transactions/tx_aA5g6yzYVYW8/documents \
-d document=file_0Y6rOeYJ6qOBxCZ012yY1LrBeg \
-d metadata[contract_ref]=C-2026-001
curl
https://api.universign.com/v1/vaults/vlt_id/rules/rul_id/instructions \
-d field_name=document_number \
--data-urlencode 'value=${document.metadata.contract_ref}'
Retrieve your vault configuration
GET /v1/vaults: lists the vaults of your workspace.GET /v1/vaults/{vault_id}: retrieves a vault with its schema fields and rules.GET /v1/vaults/{vault_id}/rules/{rule_id}: retrieves a rule with its conditions and instructions.
For more details about the vault endpoints, refer to the API reference.
