---
title: Persist File System
slug: contract360/persist-file-system
docTags: 
createdAt: 2024-04-19T07:32:44.318Z
---

# Introduction

Signzy's Persist File System is a dynamic solution designed to streamline file uploading and sharing processes with ease and efficiency. With our system, users can conveniently upload files either as base64-encoded data or traditional file formats, allowing for flexible integration across various platforms. Once uploaded, our system securely stores the files and generates publicly accessible URLs, enabling seamless sharing and access for intended recipients. Whether for personal or professional use, Signzy's Persist File System ensures hassle-free file management and distribution, empowering users with a reliable and convenient solution.

# API Details

The details of the API can be found here.

## Sample cURL

### File Upload

:::CodeblockTabs
Pre Production

```curl
curl --location 'https://preproduction-persist.signzy.tech/api/files/upload' \
--form 'file=@"/path/to/file"' \
--form 'ttl="3 years"'
```

Production

```curl
curl --location 'https://persist.signzy.tech/api/files/upload' \
--form 'file=@"/path/to/file"' \
--form 'ttl="3 years"'
```
:::

### Base64 Upload

:::CodeblockTabs
Pre Production

```curl
curl --location 'https://preproduction-persist.signzy.tech/api/base64strings/upload' \
--form 'base64string=""' \
--form 'mimetype="image/jpeg"' \
--form 'ttl="3 years"'
```

Production

```curl
curl --location 'https://persist.signzy.tech/api/base64strings/upload' \
--form 'base64string=""' \
--form 'mimetype="image/jpeg"' \
--form 'ttl="3 years"'
```
:::

### Base64 JSON Upload

:::CodeblockTabs
Pre Production

```curl
curl --location 'https://preproduction-persist.signzy.tech/api/base64' \
--header 'Content-Type: application/json' \
--data '{
    "base64String": "",
    "mimetype": "image/jpeg",
    "ttl": "10 mins"
}'
```

Production

```curl
curl --location 'https://persist.signzy.tech/api/base64' \
--header 'Content-Type: application/json' \
--data '{
    "base64String": "",
    "mimetype": "image/jpeg",
    "ttl": "10 mins"
}'
```
:::

## Input Parameters

| **Key**      | **Description**                                                                                                                                                                                             |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| file         | File you want to upload (Maximum Size 100 MB)                                                                                                                                                               |
| ttl          | Accepts the following values: (2 mins, 10 mins, 30 mins, 2 hrs, 12 hrs, 24 hrs, 7 days, 15 days, 1 month, 3 month, 6 month, 1 year, 3 years, infinity). Default value, if invalid ttl is passed is 30 secs. |
| base64string | base64 of the file with 100Mb size limit                                                                                                                                                                    |
| mimetype     | mime type possible types: (image/jpeg, image/png, image/jpg, application/pdf)                                                                                                                               |

## Sample Response

:::CodeblockTabs
File Upload

```json
{
      "file": {
        "id": "...id...",
        "filetype": "...mimeType...",
        "size": size,
        "directURL": "https://persist.signzy.tech/api/files/...id.../download/...name...",
        "protected": true/false
      }
}
```

Base64 Upload

```json
{
      "file": {
        "id": "...id...",
        "filetype": "...mimeType...",
        "size": size,
        "directURL": "https://persist.signzy.tech/api/base64strings/...id.../download/...name...",
        "protected": true/false
      }
}
```

Base64 JSON Upload

```curl
{
      "file": {
        "id": "...id...",
        "filetype": "...mimeType...",
        "size": size,
        "directURL": "https://persist.signzy.tech/api/files/...id.../download/...name...",
        "protected": true/false
      }
}
```
:::

## Sample Errors

:::CodeblockTabs
400

```json
{
    "name": "error",
    "message": "",
    "reason": "VALIDATION_ERROR",
    "type": "Bad Request",
    "statusCode": 400
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

404

```json
{
    "name": "error",
    "message": "",
    "reason": "Not Found",
    "type": "Not Found",
    "statusCode": 404
}
```

500

```json
{
    "error": {
        "name": "error",
        "message": "Internal Server Error",
        "reason": "INTERNAL_SERVER_ERROR",
        "type": "Internal Server Error",
        "statusCode": 500
    }
}
```
:::

## Error Parameters

| **Parameter** | **Type** | **Description**                                                            |
| ------------- | -------- | -------------------------------------------------------------------------- |
| name          | String   | In case of errors, it will have the value "error". It represents an error. |
| message       | String   | Message for the error                                                      |
| reason        | String   | Reasons for the error                                                      |
| type          | String   | Type of error                                                              |
| statusCode    | String   | Status code of the error                                                   |

## Error Codes

| **Error Code** | **Error Message**     | **Explanation**                                                    |
| -------------- | --------------------- | ------------------------------------------------------------------ |
| 400            | Bad Request           | Input parameter has a missing required parameter or invalid inputs |
| 401            | Authorization Failed  | Authorization token is invalid                                     |
| 404            | Not found             | Signer ID or the Contract ID is not found in the system            |
| 500            | Internal Server Error | Internal error at Signzy, Please reach out to help\@signzy.com     |

