# Send a Test to Your Callback

> Coming soon, upon request — this feature is turned on for your tenant by the Aurea team. [Contact us](https://www.aureahub.com/contact)

Aurea sends your endpoint one signed request of kind `test` and tells you what it answered.

## Overview

- Sent to the environment's `url`, checked with its `publicKeys`, as the settings stand — `on` or `off`. The request is `kind` `test`, `attempt` `1`, with a new `requestId`, a `deadlineAt` a minute ahead, and no `operation` or `approval`. Any action answers it; `approvalSignature` does not belong.
- **Nothing is stored, changed or signed** for your tenant: the test is not in [List Requests](https://docs.aureahub.com/docs/institution-callback-requests.md).
- `outcome`: `answered` (a valid signed answer: `action`, and `reason` — your code, or `null`), `invalid` (`reason`: the check that failed, from `malformed` to `approval_signature_unexpected` — [Your Answer](https://docs.aureahub.com/docs/guide-institution-callback.md)) or `unavailable` (`reason`: `timeout`, `unreachable`, `bad_status` with its `status`, `blocked_url`; or `signer_not_configured`, `signer_unavailable`, `signer_refused` when Aurea could not sign the request). `durationMs`: how long it took.
- `404` `INSTITUTION_CALLBACK_NOT_FOUND` (`This environment has no callback endpoint and key to test`) without a saved `url` and key. At most 10 a minute.
- For `owner`, `tenantadmin`, `non_signing_admin` and `security_admin`, on their own tenant. Not a covered action of your tenant's quorum.

## Endpoint

### `POST /v1/admin/tenants/{id}/institution-callback/{environment}/test`

Authentication: bearer token required.

Sends the environment's endpoint a signed test request and reports its answer.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Tenant UUID |
| `environment` | string | yes | `production` or `sandbox` |

**Responses**

`200` Answered

```json
{
  "outcome": "answered",
  "action": "APPROVE",
  "reason": null,
  "status": null,
  "durationMs": 184
}
```

`200` Invalid

```json
{
  "outcome": "invalid",
  "action": null,
  "reason": "unknown_kid",
  "status": null,
  "durationMs": 201
}
```

`200` Unavailable

```json
{
  "outcome": "unavailable",
  "action": null,
  "reason": "bad_status",
  "status": 502,
  "durationMs": 96
}
```

`404` Nothing to test

```json
{
  "statusCode": 404,
  "error": "NotFoundError",
  "message": "This environment has no callback endpoint and key to test",
  "details": { "code": "INSTITUTION_CALLBACK_NOT_FOUND" }
}
```

**Example request**

```bash
curl -X POST "https://api.aureahub.com/v1/admin/tenants/6f1e2d3c-4b5a-4968-8776-a5b4c3d2e1f0/institution-callback/sandbox/test" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

---

Web version: https://docs.aureahub.com/#institution-callback-test
