Redirect a Signer once the signature is completed

Once the signature is done, maybe you want the signer to end its journey on a particular page. In this case, you can choose your redirection URL when initiating a Signature Request. It allows you to redirect the signer once the signature request is completed.

To define your success redirection URL, as usual, you need to create a Signature Request and add a Signer to it.

POST /signature_requests/{signatureRequestId}/signers

In this example, you replace {{successUrl}} with the URL you want to redirect the signer to after signing.

{
    "info": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]",
        "phone_number": "+33700000000",
        "locale": "fr"
    },
    "signature_level": "electronic_signature",
    "signature_authentication_mode": "no_otp",
    "fields": [
        {
            "document_id": "{{documentId}}",
            "type": "signature",
            "page": 1,
            "width": 180,
            "x": 400,
            "y": 650
        }
    ],
    "redirect_urls": {
       "success": "{{successUrl}}"
    }
}

Once the Signer signed, the Signer will be automatically redirected to the success URL you specified when initiating the Signature Request.

Redirection in case of error

In the same way, as for the success URL, you can specify an error URL.

The Signer will be automatically redirected to the error URL you specified when:

  • Yousign doesn't manage to access or display the document to sign (corrupted document, wrong pdf password).
  • Yousign doesn't manage to add the Signature to the document.

Example

In this example, you replace {{successUrl}} with the URL you want to redirect the signer to after signing and {{errorUrl}} with the URL you want to redirect the signer in case of error :

{
    "info": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]",
        "phone_number": "+33700000000",
        "locale": "fr"
    },
    "signature_level": "electronic_signature",
    "signature_authentication_mode": "no_otp",
    "fields": [
        {
            "document_id": "{{documentId}}",
            "type": "signature",
            "page": 1,
            "width": 180,
            "x": 400,
            "y": 650
        }
    ],
    "redirect_urls": {
       "success": "{{successUrl}}",
       "error": "{{errorUrl}}"
    }
}

📘

URL and query parameters

When a user is redirected to a success or error URL, two query parameters are always added:

  • the Signature Request Id
  • the Signer Id
  • the External Id if not null

For example, the URL will have this pattern: https://urltoredirectexample.com/?signature_request_id=XXX&signer_id=XXX&external_id=XXX