# prov.authorize.calls.relayCode

prov.authorize.calls.relayCode in Node SDK. The last resort: a code and a short address the caller relays to its person.

## Signature

```ts
prov.authorize.calls.relayCode(id: string): Promise<CallRelayCode>
```

## Parameters

- `id` (string)

## Returns

`Promise<CallRelayCode>`

## HTTP operation

[`POST /v1/authorize/call_checks/{id}/relay_codes`](https://provenanceauth.com/docs/api/call-checks.md#post-v1-authorize-call-checks-id-relay-codes): Issue a relayed code

## Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`calls_not_configured`](https://provenanceauth.com/docs/platform/errors.md#calls_not_configured)

## Example

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/call_checks`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "from": "+14155550178", "to": "+14155550123", "code": "123456" }),
})).json();
const checkId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/call_checks/${checkId}/relay_codes`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/authorize/call_checks", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "from": "+14155550178",
    "to": "+14155550123",
    "code": "123456"
}).json()
check_id = step1["id"]
data = httpx.post(f"{api}/v1/authorize/call_checks/{check_id}/relay_codes", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```
