# `retrieveLicensee`

Retrieve

Returns a licensee by its `sl_` key. A cancelled or unknown licensee returns `404`.

## Endpoint

`GET /keys/{key}/licensees/{licensee}`

See the [API reference](/docs/api/retrieve-licensee.md) for this endpoint.

This operation needs a Management Key. Set it as `userToken` on the client, which sends it in the `Authorization` header. See [setup](/docs/sdks/typescript/setup.md).

## Import

```ts
import { retrieveLicensee } from "@ideal-postcodes/sdk";
```

## Path Parameters

| Name       | Type     | Required | Description                                        |
| ---------- | -------- | -------- | -------------------------------------------------- |
| `key`      | `string` | yes      | **API Key** The API Key to retrieve. Begins `ak_`. |
| `licensee` | `string` | yes      | **Licensee Key** Uniquely identifies a licensee.   |

## Query Parameters

*None.*

## Response Type

```ts
import type { RetrieveLicenseeResponse } from "@ideal-postcodes/sdk";
```

## Errors

HTTP errors throw an `ApiError` with the HTTP `status` and the API error `code` and `message`. Network failures and aborts reject with the runtime's native error. Pass `throwOnError: false` to get `{ data, error }` instead. See [error handling](/docs/sdks/typescript/errors.md).

## Example

retrieve-licensee.tsts

```ts
import { createIdpcClient, retrieveLicensee } from "@ideal-postcodes/sdk";

export const example = async () => {
  const client = createIdpcClient({
    apiKey: "ak_test",
    userToken: "uk_example",
  });
  const { data } = await retrieveLicensee({
    client,
    path: { key: "ak_test", licensee: "sl_example" },
  });
  return data;
};
```
