# Consumer Clients

## Overview <a href="#consumerclients-overview" id="consumerclients-overview"></a>

Consumer Clients are used to authenticate requests to a service you have subscribed to.

The same Consumer Client can be assigned to one or multiple subscriptions. In the case of multiple subscriptions, that single Consumer Client is then shared by whichever subscriptions they are added to, giving you the advantage of multiple services being integrated and consumed with a single authentication method and set of login credentials.

You can manage your clients on the **Consumer Clients** section of **My Hub.** The first table shows your *active* consumer clients; the second table shows clients that have been *revoked*.

You can create a new client anytime by clicking **Create New Client**.

Clicking on the icon on the right side of an existing Consumer Client opens a dropdown, where you can edit or revoke a client.

<figure><img src="/files/9A8to0XhhBVsFMJIUg0i" alt=""><figcaption></figcaption></figure>

## **Authentication methods**

There are two types of consumer clients, based on the underlying authentication method:

1. **API-Key**\
   Consumer Clients based on `API-Keys` will use a `/login` endpoint to authenticate against the marketplace. Within the response of this call, there is a static authorization token that can be used to consume the service (as an API-Key in the header).
2. **OAuth2**\
   OAuth2 Consumer Clients are based on a `ClientId` and a `ClientSecret`. Calling the `/login` endpoint will return an OAuth token, and the same endpoint can be used to refresh the token.

You can select the authentication type while creating a consumer client:

<figure><img src="/files/QZikgZ3BZcrMTifgQwK6" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %}
**Note:** It is not possible to change the authentication type after the client has been created. In such case, please revoke the consumer client and create a new one with the correct type.
{% endhint %}

### API-Key <a href="#consumerclients-api-key" id="consumerclients-api-key"></a>

With this method, an **API key** is generated and displayed below the Name field. This API key is already base64 encoded and can be used without any further required action.

{% hint style="warning" %}
Make sure to **save the API Key** in a secure place as long as it is visible.\
Once you click on Create Client, you will no longer be able to view this API Key, and will have to generate a new key.
{% endhint %}

If you want to **Edit** the client later, you can

* rename the client
* generate a new API Key (but *not* view/copy the existing)

<figure><img src="/files/XU7FdrAUBTqgX2L0LKey" alt="" width="563"><figcaption></figcaption></figure>

### OAuth2 <a href="#consumerclients-oauth2" id="consumerclients-oauth2"></a>

With this method, a **Client ID** and a **Client Secret** is generated and displayed below the Name field

{% hint style="warning" %}
Make sure to **save the Client Secret** in a secure place as long as it is visible.\
Once you click on Create Client, you will no longer be able to view this secret, and will have to generate a new one.
{% endhint %}

If you want to **Edit** the client later, you can

* rename the client
* view and copy the Client ID (but *not* edit)
* generate a new Client Secret (but *not* view/copy the existing).

<figure><img src="/files/UVEbRkXbSEOIBN9BncQn" alt="" width="563"><figcaption></figcaption></figure>

## Other Actions <a href="#consumerclients-otheractions" id="consumerclients-otheractions"></a>

### Assigning Consumer Clients to Subscriptions <a href="#consumerclients-assigningconsumerclientstosubscriptions" id="consumerclients-assigningconsumerclientstosubscriptions"></a>

In order to use an API, a consumer client must be assigned to a subscription. This process is described in detail in [Subscribing to a Service](/step-by-step/subscribe-and-consume-a-service/subscribing-to-a-service.md#subscribingtoaservice-settingupyourconsumerclients).

### Revoking Consumer Clients <a href="#consumerclients-revokingconsumerclients" id="consumerclients-revokingconsumerclients"></a>

Revoking a consumer client will invalidate the credentials of the client and will unassign it from all subscriptions. Revoked Consumer Clients are shown in the table at the bottom of the consumer clients page.

{% hint style="warning" %}
**Note:** Revoking a consumer client can’t be undone.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.apinity.io/step-by-step/subscribe-and-consume-a-service/consumer-clients.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
