# Get a request receipt

> operationId: `getRequestReceipt`


## Request

This endpoint returns the processing result of a request. When state is completed, result is the original business data, and originalStatus is the original HTTP status. Receipts for template writes do not store the template content. On a replay (including the result of this endpoint), the server reads the cloud template again and returns its current content, the same as GET. When a cloud template write received no confirmation, the receipt has state=unknown and safeError.code=RPA_OUTCOME_UNKNOWN. A retry with the same key does not write again. Check the template list first. For accepted, query again after about 3 seconds. For committed, wait until publication is recovered. For unknown, verify manually, and do not rerun with a different key. Only a 404 RPA_REQUEST_NOT_COMMITTED with error.details.safeToRetrySameKey=true means that the request was confirmed as not committed after a full recovery. A plain 404 does not mean this. Full replay is available for 24 hours. For the 30 days after that, a tombstone returns 410.

- **Prerequisites**: The original request included an Idempotency-Key (a request sent without a key has no receipt to query). Use the original Idempotency-Key, with credentials that belong to the original account/team. A change of authentication token does not affect the receipts of the same account/team.
- **Authentication**: Same as the rest of the Local API; see [Authentication](/api-reference/getting-started/authentication). Resources belong to the current account/team data scope.
- **Side effects**: This call only queries the state of the original intent. It does not resubmit the command.
- **Completion signal**: 200 returns accepted/committed/completed/failed/unknown. Recover according to the state, and do not treat a found receipt as business success.
- **Retries**: Read-only calls can be retried. On 429 or 503, back off as indicated by Retry-After.


### Endpoint

```http
GET /api/rpa/browser/v1/requests/{key}
```

Local API: `http://127.0.0.1:<port>/api/rpa/browser/v1/requests/{key}`. Use the port configured in the client.

### Headers

| Parameter | Type | Required | Description and constraints |
|  --- | --- | --- | --- |
| `Authorization` | string | When Local API authentication is enabled | See [Authentication](/api-reference/getting-started/authentication). |


### Path parameters

| Parameter | Type | Required | Description and constraints |
|  --- | --- | --- | --- |
| `key` | string | Yes | Idempotency-Key UUID of the original write intent. Format "uuid" |


### Query parameters

None.

### Request body

No request body.

Receipts and resources are visible only within the data scope of the original account/team/member. After you switch the account, team, or member, you are using different storage. Failing to find an old receipt there does not prove that the original request was not executed. A change of authentication token does not change the current data scope. RPA has no separate per-resource authorization or revocation.

### Request example

This is a documentation example; it was not sent to a live client. Set `RPA_BASE_URL` as described in [API conventions](/browser-rpa/api/common). Resource variables, the catalog revision, and ETags come from actual responses.

```bash
curl -i -X GET "${RPA_BASE_URL}/requests/${RPA_ORIGINAL_KEY}"
```

## Response

### 200

200 returns accepted/committed/completed/failed/unknown. Recover according to the state, and do not treat a found receipt as business success.

Body: `application/json`. The top-level `data` uses the model below. For `meta`, see [Metadata](/browser-rpa/api/data-types#metadata).

| Field | Type | Required | Description and constraints |
|  --- | --- | --- | --- |
| `key` | string | Yes | Idempotency-Key UUID of the original write intent. Format "uuid". |
| `operation` | string | Yes | operationId of the original business operation. |
| `state` | `accepted` / `committed` / `completed` / `failed` / `unknown` | Yes | Registration/commit/publication state of the original write intent. It is not the execution status of a run. |
| `createdAt` | integer | Yes | Creation time, Unix milliseconds. Minimum 0. |
| `updatedAt` | integer | Yes | Last update time, Unix milliseconds. Minimum 0. |
| `replayAvailable` | boolean | Yes | Whether the receipt is still within the full replay window. |
| `resourceId` | string or null | Yes | ID of the resource that the original operation created or acted on. Can be null. |
| `originalStatus` | integer or null | Yes | Original HTTP status code. Can be null. |
| `result` | [JsonValue](/browser-rpa/api/data-types#jsonvalue) | Yes | The data of the original successful response, without headers/ETag. It is null when no result was produced or the state is failed. |
| `safeError` | [PublicError](/browser-rpa/api/data-types#publicerror) | No | Public code/message of a failed receipt, with no internal stack trace. |


### Response example

All IDs, timestamps, hashes, and run results are sample data. They don't indicate that the sample was executed.

```json
{
  "data": {
    "key": "8aefcc5a-dce8-4e5b-a494-26f404475850",
    "operation": "createTemplate",
    "state": "completed",
    "createdAt": 1793318400000,
    "updatedAt": 1793318400000,
    "replayAvailable": true,
    "resourceId": "template_example",
    "originalStatus": 201,
    "result": {
      "title": "Read the page URL",
      "description": "Visit the given page and return its URL",
      "workflow": {
        "editorVersion": 2,
        "editorParametersVersion": 1,
        "variables": {
          "type": "object",
          "properties": {
            "targetUrl": {
              "type": "string",
              "description": "HTTP(S) URL to visit"
            }
          },
          "required": [
            "targetUrl"
          ]
        },
        "nodes": [
          {
            "id": "start",
            "type": "start"
          },
          {
            "id": "visit",
            "type": "browser_gotoUrl",
            "data": {
              "browserAction": "gotoUrl",
              "browserUi": {
                "inputs": {
                  "url": "${targetUrl}",
                  "postWaitMs": 500
                },
                "bindings": {},
                "exception": {
                  "policy": "interrupt",
                  "timeout": 30000,
                  "retry": false,
                  "retryTimes": 1,
                  "retryInterval": 2,
                  "screenshot": true
                }
              },
              "title": "Visit website",
              "inputs": {
                "type": "object",
                "properties": {}
              },
              "inputsValues": {},
              "outputs": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "Execution status"
                  },
                  "startedAt": {
                    "type": "string",
                    "description": "Start time"
                  },
                  "endedAt": {
                    "type": "string",
                    "description": "End time"
                  },
                  "durationMs": {
                    "type": "number",
                    "description": "Duration (ms)"
                  },
                  "matchedIndex": {
                    "type": "number",
                    "description": "Match index"
                  },
                  "error": {
                    "type": "object",
                    "description": "Error message",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    }
                  },
                  "data": {
                    "type": "object",
                    "description": "Result",
                    "properties": {
                      "tabId": {
                        "type": "string",
                        "description": "Tab ID"
                      },
                      "httpStatus": {
                        "type": "number",
                        "description": "HTTP status code"
                      },
                      "url": {
                        "type": "string",
                        "description": "URL"
                      },
                      "finalUrl": {
                        "type": "string",
                        "description": "Final URL"
                      },
                      "title": {
                        "type": "string",
                        "description": "Page title"
                      },
                      "isRedirected": {
                        "type": "boolean",
                        "description": "Redirected"
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "id": "url_result",
            "type": "browser_getUrl",
            "data": {
              "browserAction": "getUrl",
              "browserUi": {
                "inputs": {
                  "type": "href"
                },
                "bindings": {},
                "exception": {
                  "policy": "interrupt",
                  "timeout": 30000,
                  "retry": false,
                  "retryTimes": 1,
                  "retryInterval": 2,
                  "screenshot": true
                }
              },
              "title": "Get URL",
              "inputs": {
                "type": "object",
                "properties": {}
              },
              "inputsValues": {},
              "outputs": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "Execution status"
                  },
                  "startedAt": {
                    "type": "string",
                    "description": "Start time"
                  },
                  "endedAt": {
                    "type": "string",
                    "description": "End time"
                  },
                  "durationMs": {
                    "type": "number",
                    "description": "Duration (ms)"
                  },
                  "matchedIndex": {
                    "type": "number",
                    "description": "Match index"
                  },
                  "error": {
                    "type": "object",
                    "description": "Error message",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    }
                  },
                  "data": {
                    "type": "object",
                    "description": "Result",
                    "properties": {
                      "url": {
                        "type": "string",
                        "description": "URL"
                      },
                      "origin": {
                        "type": "string",
                        "description": "Origin"
                      },
                      "pathname": {
                        "type": "string",
                        "description": "Path"
                      },
                      "query": {
                        "type": "object",
                        "properties": {},
                        "description": "Query parameters"
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "id": "end",
            "type": "end",
            "data": {
              "inputsValues": {
                "status": {
                  "type": "constant",
                  "content": "success"
                },
                "message": {
                  "type": "ref",
                  "content": [
                    "url_result",
                    "data",
                    "value"
                  ]
                }
              }
            }
          }
        ]
      },
      "dependencies": [],
      "id": "template_example",
      "version": 1,
      "revisionId": "revision_example_1",
      "createdAt": 1793318400000,
      "updatedAt": 1793318400000,
      "warnings": [],
      "redactedPaths": []
    }
  },
  "meta": {
    "requestId": "7d498f20-7bab-4e59-9b05-88daf51230e9",
    "catalogRevision": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
}
```

### Error responses

| HTTP | error.code | What to do |
|  --- | --- | --- |
| 404 | RPA_REQUEST_NOT_COMMITTED | Recover with the original key only when error.details.safeToRetrySameKey=true. |
| 410 | RPA_REQUEST_EXPIRED | Replay of the original result has expired. Check the resourceId, which is still readable, and decide manually whether a new intent is needed. |
| 503 | RPA_JOURNAL_PENDING | Recovery or publication is not finished yet. Keep the original key and query again. |


For common 400/401/403/404/429/5xx errors and failure fields, see [Errors and recovery](/browser-rpa/api/common#errors-and-recovery). Error response example (403):

```json
{
  "error": {
    "code": "RPA_PERMISSION_DENIED",
    "message": "The request Host or Origin is not allowed, or the current identity can't access the target environment",
    "retryable": false,
    "issues": [],
    "details": null
  },
  "meta": {
    "requestId": "7d498f20-7bab-4e59-9b05-88daf51230e9",
    "catalogRevision": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
}
```

## Related

[Local API reference](/browser-rpa/local-api) · [API conventions](/browser-rpa/api/common) · [Data models](/browser-rpa/api/data-types) · [Workflow structure](/browser-rpa/api/workflow) · [Quickstart](/browser-rpa/quickstart)