# How to: Setup a feature permission

## Prerequisites

* Reviewed the page [Permissions - Features permissions](/spark-apis/authorization-api-keys/permissions-features-permissions.md).
* A folder has already been created containing Spark services.
* The folder is accessible by a user group that begins with `user:`. Check if the tenant is a [Private tenant](/tenant-administration/private-tenant.md) in the [Navigation menu](/navigation/navigation-menu.md#user-menu).
  * For a [Private tenant](/tenant-administration/private-tenant.md) [Private tenant](/tenant-administration/private-tenant.md#set-permissions-on-folders).
  * For a Shared tenant, we will use `user:pf` as the user group instead.

## Example for downloading an API call

Let's take an example we would like to download the Excel representation of an API call using the API key for authorization. The instructions below explain how to setup the API key and the associated feature permissions.

1. Visit the [Permissions - Features permissions](/spark-apis/authorization-api-keys/permissions-features-permissions.md) screen to identify the feature permissions that you would like to be exposed via an API key.
   1. In this example the we are interested in the [Download as Excel (legacy)](/spark-apis/api-call-history-apis/download-as-excel-legacy.md) API which is associated with the `Spark.DownloadServiceByCallId.json` feature permission.
2. Check which permissions are needed to access the particular services using [Private tenant](/tenant-administration/private-tenant.md#set-permissions-on-folders). Let's say for example all of the services of interest are in a folders accessible by `user:teamgreen`.
3. Follow the steps [Manage users](/tenant-administration/manage-users.md#add-user-groups) to create a user group that will be associated with the feature permissions of interest. For example it could be `user:downloadcall`. No users need to be assigned to this user group.
4. Follow the steps in [Authorization - API keys](/spark-apis/authorization-api-keys.md#add-api-key-groups) to create a new API key group and API key instance. It should include:
   1. `user:teamgreen` in other words, permission to access the requested services. For a shared tenant we will use `user:pf` which has access to all services in the environment.
   2. AND `user:downloadcall` in other words permission to perform particular actions, in this case download the Excel file with the API call embedded.
5. Return to the [Permissions - Features permissions](/spark-apis/authorization-api-keys/permissions-features-permissions.md) screen.
   1. Identify the feature permission of interest `Spark.DownloadServiceByCallId.json` and click the view icon.
   2. Alternatively if it is acceptable for the key to be used for all of the available feature permissions, then open `Spark.AllEncompassingProxy.json`.
6. Add `user:downloadcall` to the user groups assigned to the feature permission then **Close** the modal.

   <figure><img src="/files/f3fEBqH85ieVrapAa8Um" alt=""><figcaption></figcaption></figure>
7. Now compose the API call with the API key. Remember the API request should headers for :
   1. `x-synthetic-key` for the previously created API key.
   2. `x-tenant-name` for the tenant name.


---

# 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.coherent.global/spark-apis/authorization-api-keys/how-to-setup-a-feature-permission.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.
