# Signing request lifecycle

Handle both immediate results and approval requests when you call the key sign, wallet sign, or wallet raw-sign endpoint.

1. On `200`, read the signature response defined for the signing endpoint.
2. On `202`, keep the `request_id` and inspect the approval response. The operation has not completed.
3. Poll `GET /v1/requests/{request_id}` to follow the operation. This read requires `Authorization`; it does not require the mutation assertion headers.
4. Inspect the body's `status`. A terminal HTTP response can describe a failed, rejected, or cancelled operation rather than success.

| Status | Client action |
|---|---|
| `pending` | Present the approval request and wait for a decision. |
| `approved` | Approval has been granted; continue checking for the operation's result. |
| `processing` | Keep the request ID and poll again. |
| `completed` | Read `type` and the matching result in `data`, where provided by that result type. |
| `failed` | Read the failure result before deciding whether to submit again. |
| `rejected` | Present the rejection and any supplied reason. |
| `cancelled` | Stop waiting for a signature. |

The response schema includes approval-record states as well as operation states. An approval is not itself a completed signing result.

## Check a request

Set `CV_BASE`, `CV_TOKEN` (the complete Authorization value), and `REQUEST_ID` for your environment, then run:

```sh
curl --fail-with-body --silent --show-error \
  "$CV_BASE/v1/requests/$REQUEST_ID" \
  -H "Authorization: $CV_TOKEN"
```

A processing response has this shape:

```json
{
  "status": "processing",
  "request_id": "550e8400-e29b-41d4-a716-446655440000"
}
```

A completed key-signing result has this shape:

```json
{
  "status": "completed",
  "type": "signature",
  "data": {
    "signature": "signature-returned-by-the-vault"
  }
}
```

Use the wallet signature result type for wallet operations. Do not broadcast a transaction until you have its completed signature.

## Approval decisions

Discover requests through `GET /v1/approval-requests`. To vote, submit `decision` and the original request copied from `operation_details.raw` to `POST /v1/requests/{request_id}/vote`. Sign the complete vote request using your normal mutation authentication. Successful voting returns `204`; continue checking the original operation.

An initiator can request cancellation through `POST /v1/requests/{request_id}/cancel` while the request is awaiting approval. Poll the request to observe its outcome. See [Integrate approval workflows](/develop/approvals) for a worked voting example and [approval webhooks](/develop/webhooks) for notifications.

## Errors and retries

Check the HTTP status and content type before parsing an error body. JSON errors expose `err_type` and `err_msg`; some content-type errors are plain text. Correct authentication, policy, or input errors before trying again.

After a timeout, poll an existing request ID or reconcile the created resource before repeating a mutation. Do not assume that a network failure or `500` proves the operation had no effect. See [Errors, pagination and idempotency](/develop/conventions/errors-pagination).

## Concurrent approval and rejection

A rejection or denial that loses a race to approval does not overwrite the approved request or its audit state. Read the latest request status after a conflicting vote. See [approval races](/develop/approvals#votes-that-race-with-approval).
