---
title: Compress PDF
slug: api-marketplace/compress-pdf
description: Sorry, but I can't generate an SEO description for a document that is not available yet.
createdAt: 2023-04-20T22:39:23.000Z
---

## Introduction

PDF Compression API is a powerful and efficient tool designed to streamline your document management processes by reducing the file size of PDF documents. In today's digital landscape, handling large PDF files can be cumbersome, leading to storage issues, slow transfers, and inefficiencies in workflow. Our API addresses these challenges head-on by providing a seamless solution for compressing PDF files.

### Key Features

- **High Compression Rates**: Achieve significant reductions in file size, making storage and sharing more efficient.
- **User-Friendly Integration**: Easily integrate the API into your existing applications and workflows with comprehensive documentation and support.
- **Cloud Hosting:&#x20;**&#x59;our compressed pdfs are securely hosted on the cloud, ensuring accessibility and reliability.

***

## API details

### Endpoint

:::CodeblockTabs
Production Endpoint

```text
POST https://api.signzy.app/api/v3/converters/compressPdf
```
:::

:::CodeblockTabs
UAT Endpoint

```text
POST https://api-preproduction.signzy.app/api/v3/converters/compressPdf
```
:::

***

### Request Headers

| **Name&#x20;** | **Required** | **Description**                                                                                            |
| -------------- | ------------ | ---------------------------------------------------------------------------------------------------------- |
| Content-type   | Mandatory    | The type of content that the request body contains.                                                        |
| Authorization  | Mandatory    | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

### Request body parameters

| **Parameter** | **Data Type** | **Description**                                                                                                                                                                                                        | **Required** |
| ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| url           | String        | persist links of pdf that needs to be compressed.                                                                                                                                                                      | Yes          |
| ttl           | String        | Time to live for the link generated for compressed pdfs<br />Valid times -> \['30 secs', '2 mins', '10 mins', '30 mins', '2 hrs', '12 hrs', '7 days', '15 days', '1 month', '3 month', '6 month', '1 year', '3 years'] | No           |

```json
{
       "url": "",
       "ttl" : ""
}
```

***

### Code Samples

:::CodeblockTabs
Curl

```json
curl --location 'https://api.signzy.app/api/v3/converters/compressPdf' \
--header 'Content-Type: application/json' \
--header 'Authorization: XXXXXXXXXXXXXXXXX' \
--data '{
    "url": "",
    "ttl": ""
}'
```

Node.js

```nodejs
const axios = require('axios');

const requestData = {
    url : "",
    ttl : ""
};

const headers = {
    'Content-Type': 'application/json',
    'Authorization': 'xxxxxxxxxxxxxxxxxxxxxxx'
};

axios.post('https://api.signzy.app/api/v3/converters/compressPdf', requestData, { headers })
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });


```

Python

```python
import requests

url = 'https://api.signzy.app/api/v3/converters/compressPdf'
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'xxxxxxxxxxxxxxxxxxxxxxx'
}
data = {
    'url' : "",
    "ttl" : ""
}

response = requests.post(url, json=data, headers=headers)
print(response.json())

```

GO

```go
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://api.signzy.app/api/v3/converters/compressPdf"
    data := map[string]string{
        "url" : "",
        "ttl" : ""
    }
    jsonData, _ := json.Marshal(data)
    req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    if err != nil {
        fmt.Println("Error creating request:", err)
        return
    }
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "xxxxxxxxxxxxxxxxxxxxxxx")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error making request:", err)
        return
    }
    defer resp.Body.Close()

    // Print response body
    var result map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&result)
    fmt.Println(result)
}

```
:::

***

### Response body parameters

| **Parameter** | **Data Type** | **Description**                        |
| ------------- | ------------- | -------------------------------------- |
| result        | Object        | The root object containing the result. |
| compressedPdf | String        | Persist link of the compressed pdf     |



:::CodeblockTabs
200

```json
{
      "result": {
        "compressedPdf": ""
    }
}
```

400

```json


//If ttl is not a valid value

{
    "error": {
        "statusCode": 400,
        "status": "Bad Request",
        "message": "Only Pass valid ttl values."
    }
}

//if file is not of pdf format

{
    "error": {
        "statusCode": 400,
        "status": "Bad Request",
        "message": "Only Pdf file to be supported"
    }
}

```

401

```none
//For no authorization passed

{
    "message": "No API key found in request"
}
```
:::

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!
