---
title: Signature Match
slug: api-marketplace/signature-match
createdAt: 2024-04-11T06:51:48.213Z
---

## Introduction

Signature match API verify whether two files contain same signature of not. The input file should be a cropped signature of the signature only. The API aims at giving a probabilistic score between the two signatures provided to it.&#x20;

## How to call the API

Before making API requests, you need to perform a login authentication and obtain an access token. The access token should be included in the authorization header of subsequent API requests. The API endpoints and environments for different operations are provided below.

## API Input Guidelines

The Signature Match API is used to determine if two document contain same signature. You can provide two images either by uploading them or by providing their URLs as input to the API.

### Endpoint Details

| Endpoints                                                    | Environment   |
| ------------------------------------------------------------ | ------------- |
| https\://api-preproduction.signzy.app/api/v3/signature/match | Preproduction |
| https\://api.signzy.app/api/v3/signature/match               | Production    |

### Request Body Parameters

| **PARAMETER NAME** | **Required/Optional** | **DESCRIPTION**                                                                                                        |
| ------------------ | --------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| urls               | Required              | Array of URLs of length 2 -<br />Accepts two File URLs                                                                 |
| threshold          | Optional              | This threshold parameter helps define a value, beyond which, the result would be shown as "Match". **Defaults to 0.5** |

```json
{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg",
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg"
    ]
}
```

### Request Body Headers

| **Header Name** | **Required/Optional** | **DESCRIPTION**                                    |
| --------------- | --------------------- | -------------------------------------------------- |
| Authorization   | Required              | access token returned as id field of login request |
| Content-Type    | Required              | application/json                                   |

### Code Samples

:::CodeblockTabs
```curl
curl --location 'https://api.signzy.app/api/v3/signature/match' \
--header 'Content-Type: application/json' \
--header 'Authorization: <token>' \
--data '{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg",
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg"
    ]
}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg",
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg"
    ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.signzy.app/api/v3/signature/match',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '<token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

```python
import http.client
import json

conn = http.client.HTTPSConnection("api.signzy.app")
payload = json.dumps({
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg",
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg"
    ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '<token>'
}
conn.request("POST", "/api/v3/signature/match", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.signzy.app/api/v3/signature/match"
  method := "POST"

  payload := strings.NewReader(`{
    "urls": [
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg",
        "https://preproduction-persist.signzy.tech/api/files/abcd/download/xxxx.jpeg"
    ]
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "<token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

### Sample Response

:::CodeblockTabs
200 (Match)

```apex
{
    "result": {
        "result": "Match",
        "score": 0.92
    }
}
```

200 (No Match)

```json
{
    "result": {
        "result": "No Match",
        "score": 0.05
    }
}
```

400

```apex
// Uploaded PDF File has more than 1 page
{
  "error": {
    "status": 400,
    "msg": "PDF file has more than 1 page.",
    "responseCode": "fail"
  }
}

// Only 2 URLs are supported at a time

{
  "error": {
    "name": "Validation Error",
    "status": "400",
    "msg": "List should have at most 2 items after validation, not 3",
    "responseCode": "fail"
  }
}

// File type unsupported
{
  "error": {
    "status": 400,
    "msg": "Supported file types are tif/tiff/jpeg/png/jpg/pdf",
    "responseCode": "fail"
  }
}

// No strings passed within `urls` array parameter
{
  "error": {
    "statusCode": 400,
    "status": "Bad Request",
    "message": "\"requestBody.urls\" must contain at least 1 items",
    "id": "#string"
  }
}

// Passing any non String values within `urls` parameter
{
  "error": {
    "statusCode": 400,
    "status": "Bad Request",
    "message": "\"requestBody.urls\" must be an array",
    "id": "#string"
  }
}
```

422

```apex
// Expired File URL / File not downloadable
{
    "error": {
        "status": 422,
        "msg": "Unable to download the file.",
        "responseCode": "fail"
    }
}
```

415

```apex
// File is Encrypted / Closed / Not readable
{
    "error": 
    {
        "status": 415,
        "msg": "Failed to get image because document closed or encrypted",
        "responseCode": "fail"
    }
}
```
:::

### Response Parameter

| **Parameter** **Name** | **Data Type** | **Description**                                           |
| ---------------------- | ------------- | --------------------------------------------------------- |
| **result**             | String        | Whether signature is matching in both the input documents |
| **score**              | Float         | Score for signature match.                                |

***

### Status Codes

| Status Code | Description                    |
| ----------- | ------------------------------ |
| 200         | OK                             |
| 400         | Bad Request                    |
| 401         | Authorization token is invalid |
| 422         | Unprocessable Entity           |
| 415         | Unsupported File Type          |

***

:::hint{type="info"}
**Maximum file size** of **10 MB** per URL input is allowed

The signature image **must be free of any surrounding text, watermarks, or graphical overlays, else it might lead the AI Model to behave unpredictably**

The signature may be **submitted with a rotation or tilt as well**, provided it remains fully discernible by the verification system.

Supported document types:

- Image - JPEG, JPG, PNG and TIFF/TIF.
- Single page PDF
:::

:::hint{type="success"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

