> For the complete documentation index, see [llms.txt](https://docs.shadowcipher.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shadowcipher.in/reference/signing-flow.md).

# Signing flow and statuses

What happens on the signing page, and how transaction statuses change.

## The signing link

* The signing page can only be opened through a `signing_url` from the API. There is no other way in.
* The link contains an encrypted reference (`txnref`, AES-256-GCM) that is checked every time it is opened. Tampered links go to an error page.
* The link, and any signing session opened from it, stops working **20 minutes** after it is issued (`expires_at`).

## What the signer does

1. Opens the `signing_url`. Your `reference_no` is shown on the page.
2. For template requests, fills in the template. The PDF is generated from it.
3. Chooses a signature type from those you allowed.
4. Signs. The signature goes on the `page` and `position` you set.
5. Is redirected to your `return_url`.

## Transaction statuses

| Status      | Meaning                                                                        |
| ----------- | ------------------------------------------------------------------------------ |
| `INITIATED` | Created, not signed yet. `fetchDoc` returns the original PDF.                  |
| `SIGNED`    | Signed. `fetchDoc` returns the signed PDF, and the signing link stops working. |

The only status change is `INITIATED` → `SIGNED`.

## When the signer cancels

The signer is sent to your `return_url` with `status=CANCELLED`, but the transaction **stays `INITIATED`**. The same link can be reopened until it expires.

If the link has expired, start a new transaction to get a new link.

## Return URL parameters

| Parameter      | Description                           |
| -------------- | ------------------------------------- |
| `txn_no`       | Transaction number.                   |
| `reference_no` | Your reference.                       |
| `status`       | The outcome, for example `CANCELLED`. |

{% hint style="info" %}
Treat the redirect as a signal, not proof. Call [Fetch a document](https://docs.shadowcipher.in/endpoints/fetch-document.md) and check `status` before you mark a document as signed.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.shadowcipher.in/reference/signing-flow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
