SignatureExtraction

1 endpoint · Core API

POST

/api/v1/signature/extract

#

Extract signatures from an image

docs.signcare.io/core/api/document-services/signatureextraction/#post-api-v1-signature-extract

This API extracts signatures from an image and returns:

  • Number of signatures found
  • Array of extracted signatures with color and base64 encoded images
  • Boolean indicating if only signature is present

Request fields (camelCase):

  • encodedImage (required): raw Base64 image, without a data-URI prefix.
  • signColor (optional): ink colour filter; empty for none.
  • signCount (optional): integer, default 0.
  • onlySignaturePresent (optional): boolean, default false.
  • consent and consent_text (required): send "Y" and the standard consent text.
  • request_id (optional): your own reference; note the underscore.

Usage Example:

{
  "encodedImage": "iVBORw0KGgoAAAANSUhEUgAABIA...",
  "signColor": "",
  "signCount": 0,
  "onlySignaturePresent": false,
  "consent": "Y",
  "consent_text": "I hear by declare my consent agreement for fetching my information via SignCare API",
  "request_id": "req_12345"
}

Response Example:

{
  "success": true,
  "message": "Success",
  "statusCode": 200,
  "requestId": "req_12345",
  "data": {
    "signCount": 2,
    "signatures": [
      [
        {
          "color": "black",
          "encodedImage": "iVBORw0KGgoAAAANSUhEUgAA..."
        }
      ],
      [
        {
          "color": "black",
          "encodedImage": "/9j/4AAQSkZJRgABAQAAAQA..."
        }
      ]
    ],
    "onlySignaturePresent": false
  }
}

Headers

  • X-API-KEY
    stringrequired
    Your secret API key for the environment you are calling (Stage and Live use different keys).
  • X-API-APP-ID
    stringrequired
    The App ID issued together with the key.
  • Content-Type
    stringrequired
    application/json

Body parameters

application/json
  • consent
    stringrequired
    Required. The end user's consent to this verification. Send `Y`.
    minLength 1default Y
  • consent_text
    stringrequired
    Required. The consent statement shown to the end user. Send the default text from the sample.
    minLength 1default I hear by declare my consent agreeme…
  • request_id
    stringoptional
    Optional. Your own id to correlate this call in your logs. A unique id is generated if you leave it out.
    nullable
  • encodedImage
    stringrequired
    Required. Image to extract signatures from, as a raw Base64 string. No `data:image/...;base64,` prefix; an invalid Base64 string is rejected with 400.
    minLength 1default iVBORw0KGgoAAAANSUhEUgAABIA...
  • signColor
    stringoptional
    Optional. Ink colour of the signatures to extract. Leave empty (default) to apply no colour filter.
    nullable
  • signCount
    integer (int32)optional
    Optional. Number of signatures to extract from the image. Integer; the default 0 applies no fixed count.
    default 0
  • onlySignaturePresent
    booleanoptional
    Optional. Set to true when the image contains only a signature and no other content. Boolean, default false.
    default false
Sample request body
{ "consent": "Y", "consent_text": "I hear by declare my consent agreement for fetching my information via SignCare API", "encodedImage": "iVBORw0KGgoAAAANSUhEUgAABIA...", "signColor": "", "signCount": 0, "onlySignaturePresent": false }

Responses

200OK
  • success
    booleanoptional
    No description.
  • statusCode
    integer (int32)optional
    No description.
    default 200
  • message
    stringoptional
    No description.
    nullabledefault XXXXX
  • data
    objectoptional
    No description.
    3 fields
    • signCount
      integer (int32)optional
      No description.
    • signatures
      array<array>optional
      No description.
      nullable
    • onlySignaturePresent
      booleanoptional
      No description.
  • messages
    array<string>optional
    No description.
    nullable
  • request_id
    stringoptional
    No description.
    nullable
  • isBillable
    booleanoptional
    Whether this request was charged: true if it was, false if not. Errors always show false. Flows that finish later (ITR Fetch, SHCIL eStamp, DigiLocker, eSign) show false here, because the charge is made when the result is ready. eSign charges each signer when they complete signing. DigiLocker deducts the credit when the link is created and refunds it automatically if the link expires before the user completes it.
Example
{ "success": false, "statusCode": 200, "message": "XXXXX", "data": { "signCount": 0, "signatures": [ [ { "color": "string", "encodedImage": "string" } ] ], "onlySignaturePresent": false }, "messages": [ "string" ], "request_id": "string", "isBillable": false }
400Bad Request
  • data
    objectoptional
    No description.
  • messages
    array<string>optional
    No description.
    nullable
  • request_id
    stringoptional
    No description.
    nullable
  • success
    booleanoptional
    No description.
    default false
  • message
    stringoptional
    No description.
    nullabledefault XXXXX
  • isBillable
    booleanoptional
    No description.
  • statusCode
    integer (int32)optional
    No description.
    default 400
Example
{ "data": {}, "messages": [ "string" ], "request_id": "string", "success": false, "message": "XXXXX", "isBillable": false, "statusCode": 400 }
401Unauthorized
  • data
    objectoptional
    No description.
  • messages
    array<string>optional
    No description.
    nullable
  • request_id
    stringoptional
    No description.
    nullable
  • success
    booleanoptional
    No description.
    default false
  • message
    stringoptional
    No description.
    nullabledefault XXXXX
  • isBillable
    booleanoptional
    No description.
  • statusCode
    integer (int32)optional
    No description.
    default 401
Example
{ "data": {}, "messages": [ "string" ], "request_id": "string", "success": false, "message": "XXXXX", "isBillable": false, "statusCode": 401 }
500Internal Server Error
  • data
    objectoptional
    No description.
  • messages
    array<string>optional
    No description.
    nullable
  • request_id
    stringoptional
    No description.
    nullable
  • success
    booleanoptional
    No description.
    default false
  • message
    stringoptional
    No description.
    nullabledefault XXXXX
  • isBillable
    booleanoptional
    No description.
  • statusCode
    integer (int32)optional
    No description.
    default 500
Example
{ "data": {}, "messages": [ "string" ], "request_id": "string", "success": false, "message": "XXXXX", "isBillable": false, "statusCode": 500 }
Code samplescurl · Node.js · Python
Stage: uat-ext.signcare.io
curl -X POST 'https://uat-ext.signcare.io/api/v1/signature/extract' \ -H 'X-API-KEY: YOUR_API_KEY' \ -H 'X-API-APP-ID: YOUR_APP_ID' \ -H 'Content-Type: application/json' \ -d '{ "consent": "Y", "consent_text": "I hear by declare my consent agreement for fetching my information via SignCare API", "encodedImage": "iVBORw0KGgoAAAANSUhEUgAABIA...", "signColor": "", "signCount": 0, "onlySignaturePresent": false }'