> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Configure API credentials and connectors in Sigma

> Configure API credentials and connectors in Sigma so workbook actions can call external services securely.

You can configure API connectors and credentials for use in Sigma workbooks.

Connectors are used when configuring a **Call API** action. Along with an associated credential, connectors define an API request, governing which APIs and endpoints users can access when configuring an action in Sigma. For more on using connectors in a workbook, see [Create actions that call API endpoints](/docs/create-actions-that-call-api-endpoints).

This document describes how to configure API connectors and credentials.

## Understanding API connectors

Application programming interfaces (APIs) are protocols for how two pieces of software interact with one another and exchange information. In the case of a public API, an application’s developers configure the API so that external developers can retrieve or manipulate data in their application programmatically, without a user interface.

API connectors in Sigma allow you to pre-configure the details required to make a request in a **Call API** action, including the endpoint, HTTP method, authentication credentials, query parameters, request body, and more. Without a connector, you cannot configure a **Call API** action in a workbook.

API connectors can be associated with a credential. The credential contains the authentication information required to access the API, and you can use it when configuring an API connector. Not all API connectors require a credential. For example, a connector for a public API that does not require authentication does not need a credential.

The API you create a connector for might be your own, a Sigma API, or a third-party API. This document sometimes refers to the API you configure a connection for as a third-party API, indicating that the API is not managed by Sigma or by the user.

## User requirements

* To create and manage API connectors and credentials, you must be assigned an [account type](/docs/account-type-and-license-overview) with the **Manage API connectors** permission enabled.
* You must be able to provide the required authentication credentials for the API endpoint.

> **Warning**
>
> If a user has **Can use** access granted on an API connector in Sigma and at least **Can explore** access to a workbook containing a **Call API** action, they can view all configuration details of the **Call API** action.

## Add a new API credential to Sigma

Add a new API credential to Sigma before creating an API connector. For APIs that require authentication, you must create a credential to store the authentication information and use it in your connector. APIs that do not require authentication do not need a credential.

> **Info**
>
> Any user with access to the credential and an account type with the **Manage API connectors** permission enabled can use the credential when creating new connectors. See [Create a new API connector in Sigma](#create-a-new-api-connector-in-sigma).

Before creating a credential, retrieve the required credentials for making requests to the API. Sigma supports the following authentication methods for API credentials:

* **Bearer token**
* **Basic auth**
* **API key**
* **OAuth (client credentials)**
* **OAuth (authorization code)**
* **OAuth (password credentials)**
* **AWS Signature V4**

Using the credentials you retrieved for the desired API, create a credential in Sigma:

1. Go to **Administration** > **API connectors**.
   1. From the Sigma header, click your user avatar to open the user menu.
   2. Select **Administration** to open the **Administration** portal.
   3. From the side panel, select **API connectors**.

2. Select the **Credentials** tab.

3. Click **Create credential**.

4. On the **New credential** screen, configure the following fields in the **Credential details** section to define the name, description, and authorized domains:

   <table>
     <thead>
       <tr>
         <th>
           Field
         </th>

         <th>
           Description
         </th>
       </tr>
     </thead>

     <tbody>
       <tr>
         <td>
           **Name**
         </td>

         <td>
           The name of the credential as it appears in a connector.
         </td>
       </tr>

       <tr>
         <td>
           **Description**
         </td>

         <td>
           (Optional) A description that helps users identify the credential.
         </td>
       </tr>

       <tr>
         <td>
           **Authorized domains**
         </td>

         <td>
           A set of authorized domains used to restrict access to the credential. The credential can only be used for endpoints that match the authorized domains. Use 

           `*`

            for a wildcard.
         </td>
       </tr>
     </tbody>
   </table>

5. Select an **Authentication method** that you have the required credentials for and configure the fields in the **Authentication details** section. If your organization has a secret manager integration set up and you want to use a secret for specific fields, turn on the **Use secret manager** toggle for that field, and then select the integration and secret you want to use.

#### Bearer token

<table>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Token**
      </td>

      <td>
        The token used to authenticate with the API.
      </td>
    </tr>
  </tbody>
</table>

#### Basic auth

<table>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Username**
      </td>

      <td>
        The username for authentication.
      </td>
    </tr>

    <tr>
      <td>
        **Password**
      </td>

      <td>
        The password associated with the username.
      </td>
    </tr>
  </tbody>
</table>

#### API key

<table>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Key**
      </td>

      <td>
        The key for authentication expected by the endpoint.
      </td>
    </tr>

    <tr>
      <td>
        **Value**
      </td>

      <td>
        The value for the key.
      </td>
    </tr>

    <tr>
      <td>
        **Pass in as**
      </td>

      <td>
        Determines whether the key and value are sent as a request 

        **Header**

         or as a 

        **Query parameter**

        .
      </td>
    </tr>
  </tbody>
</table>

#### OAuth (client credentials)

<table>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Client ID**
      </td>

      <td>
        The client ID for authentication.
      </td>
    </tr>

    <tr>
      <td>
        **Client secret**
      </td>

      <td>
        The client secret associated with the client ID.
      </td>
    </tr>

    <tr>
      <td>
        **Access token URL**
      </td>

      <td>
        The URL to send the client credentials to in order to receive an access token.
      </td>
    </tr>

    <tr>
      <td>
        **Send client credentials as**
      </td>

      <td>
        Determines whether to send client credentials as a 

        **Basic auth header**

         or in the request 

        **Body**

        .
      </td>
    </tr>

    <tr>
      <td>
        **Scopes**
      </td>

      <td>
        (Optional) Additional permissions requested by the OAuth provider.
      </td>
    </tr>

    <tr>
      <td>
        **Token request parameters**
      </td>

      <td>
        (Optional) Additional parameters provided when requesting an access token. Select 

        **+ Add parameters**

         to add a key-value pair, and send it in the body, header, or as a query parameter.
      </td>
    </tr>
  </tbody>
</table>

#### OAuth (authorization code)

<table>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Client ID**
      </td>

      <td>
        The client ID for authentication.
      </td>
    </tr>

    <tr>
      <td>
        **Client secret**
      </td>

      <td>
        The client secret associated with the client ID.
      </td>
    </tr>

    <tr>
      <td>
        **Authorization URL**
      </td>

      <td>
        The URL to send the user to in order to authenticate and receive an authorization code.
      </td>
    </tr>

    <tr>
      <td>
        **Access token URL**
      </td>

      <td>
        The URL to send the authorization code to in order to receive an access token.
      </td>
    </tr>

    <tr>
      <td>
        **Send client credentials as**
      </td>

      <td>
        Determines whether to send client credentials as a 

        **Basic auth header**

         or in the request 

        **Body**

        .
      </td>
    </tr>

    <tr>
      <td>
        **Scopes**
      </td>

      <td>
        (Optional) Additional permissions requested by the OAuth provider.
      </td>
    </tr>

    <tr>
      <td>
        **Authorization request parameters**
      </td>

      <td>
        (Optional) Additional parameters provided when requesting an authorization code. Select 

        **+ Add parameters**

         to add a key-value pair, and send it in the body, header, or as a query parameter.
      </td>
    </tr>

    <tr>
      <td>
        **Token request parameters**
      </td>

      <td>
        (Optional) Additional parameters provided when requesting an access token. Select 

        **+ Add parameters**

         to add a key-value pair, and send it in the body, header, or as a query parameter.
      </td>
    </tr>
  </tbody>
</table>

#### OAuth (password credentials)

<table>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Client ID**
      </td>

      <td>
        (Optional) The client ID for authentication.
      </td>
    </tr>

    <tr>
      <td>
        **Client secret**
      </td>

      <td>
        (Optional) The client secret associated with the client ID.
      </td>
    </tr>

    <tr>
      <td>
        **Username**
      </td>

      <td>
        The username for authentication.
      </td>
    </tr>

    <tr>
      <td>
        **Password**
      </td>

      <td>
        The password associated with the username.
      </td>
    </tr>

    <tr>
      <td>
        **Access token URL**
      </td>

      <td>
        The URL to send the user credentials to in order to receive an access token.
      </td>
    </tr>

    <tr>
      <td>
        **Send client credentials as**
      </td>

      <td>
        Determines whether to send client credentials as a 

        **Basic auth header**

         or in the request 

        **Body**

        .
      </td>
    </tr>

    <tr>
      <td>
        **Scopes**
      </td>

      <td>
        (Optional) Additional permissions requested by the OAuth provider.
      </td>
    </tr>

    <tr>
      <td>
        **Token request parameters**
      </td>

      <td>
        (Optional) Additional parameters provided when requesting an access token. Select 

        **+ Add parameters**

         to add a key-value pair, and send it in the body, header, or as a query parameter.
      </td>
    </tr>
  </tbody>
</table>

#### AWS Signature V4

<table>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Access key ID**
      </td>

      <td>
        The ID for authentication, associated with your 

        **Secret access key**

        .
      </td>
    </tr>

    <tr>
      <td>
        **Secret access key**
      </td>

      <td>
        The secret key used to sign requests.
      </td>
    </tr>

    <tr>
      <td>
        **Session token**
      </td>

      <td>
        (Optional) The current token used to authenticate when using temporary credentials.
      </td>
    </tr>

    <tr>
      <td>
        **Region**
      </td>

      <td>
        (Optional) The AWS region associated with the request. For example, 

        `us-east-1`

        . If left blank, the region is inferred from the 

        **Base URL**

         of the connector.
      </td>
    </tr>

    <tr>
      <td>
        **Service**
      </td>

      <td>
        (Optional) The AWS service name associated with the request. For example, 

        `s3`

        . If left blank, the service is inferred from the 

        **Base URL**

         of the connector.
      </td>
    </tr>

    <tr>
      <td>
        **Temporary credentials URL**
      </td>

      <td>
        (Optional) The URL used to retrieve temporary credentials.
      </td>
    </tr>

    <tr>
      <td>
        **Access key field**
      </td>

      <td>
        (Optional) The field name in the temporary credential response that contains the access key ID.
      </td>
    </tr>

    <tr>
      <td>
        **Secret key field**
      </td>

      <td>
        (Optional) The field name in the temporary credential response that contains the secret access key.
      </td>
    </tr>

    <tr>
      <td>
        **Session token field**
      </td>

      <td>
        (Optional) The field name in the temporary credential response that contains the session token.
      </td>
    </tr>

    <tr>
      <td>
        **Expiration field**
      </td>

      <td>
        (Optional) The field name in the temporary credential response that indicates when the token expires.
      </td>
    </tr>
  </tbody>
</table>

> **Warning**
>
> Secrets like tokens, passwords, and API secret keys are encrypted, and are never returned to any user in the Sigma UI.

6. Click **Save**.

The credential is created and appears in the **Credentials** tab.

For more information on how Sigma constructs the API request header based on the authentication method you select, see [How Sigma handles authentication types in the request header](#how-sigma-handles-authentication-types-in-the-request-header).

### How Sigma handles authentication types in the request header

Based on the authentication method you select when creating an API credential, Sigma constructs a header or query parameter with the credentials you provide. Review the following examples for how selected authentication methods are formatted in the request header:

* [Bearer token](#bearer-token)
* [Basic auth](#basic-auth)
* [API key](#api-key)
* [OAuth (client credentials)](#oauth-client-credentials)

#### Bearer token

For **Bearer token**, Sigma formats the header like the following:

```
Authorization: Bearer <token>
```

Here, `<token>` indicates the token you provide when creating the credential. The token is encrypted and never returned to the user.

#### Basic auth

For **Basic auth**, Sigma formats the header like the following:

```
Authorization: Basic <encoding>
```

Here, `<encoding>` is a Base64 encoding of the string `username:password` as you provide them when creating the credential. The password is encrypted and never returned to the user.

#### API key

For **API key**, Sigma formats the header like the following when the **Pass in as** option is set to **Header**:

```
key: value
```

For **API key**, Sigma formats the header like the following when the **Pass in as** option is set to **Query parameter**:

```
https://api.example.com/endpoint/?key=value
```

Here, `key` and `value` are the values you provided when creating the credential. The `value` is encrypted and never returned to the user.

#### OAuth (client credentials)

For **OAuth (client credentials)**, Sigma makes a POST request at the **Access token URL** specified in the credential, and then uses the token in the header like a **Bearer token**:

```
Authorization: Bearer <token>
```

For **OAuth (client credentials)**, if the **Send client credentials as** option is set to **Basic auth header**, Sigma formats the header like the following:

```
Authorization: Basic <encoding>
```

For **OAuth (client credentials)**, if the **Send client credentials as** option is set to **Body**, Sigma formats the body like the following:

```
client_id=client_id_value&client_secret=client_secret_value
```

## Create a new API connector in Sigma

You can create an API connector in Sigma to use in a **Call API** action.

Any user with access to this connector and an account type with the **Trigger API actions** permission can use the connector when configuring a **Call API** action.

> **Tip**
>
> Before creating a connector, identify an existing credential to use, or [Add a new API credential to Sigma](#add-a-new-api-credential-to-sigma) for that API.

To create a new API connector in Sigma:

1. Go to **Administration** > **API connectors**.
   1. From the Sigma header, click your user avatar to open the user menu.
   2. Select **Administration** to open the **Administration** portal.
   3. From the side panel, select **API connectors**.

2. Click **Create connector**.

3. On the **New API connector** screen, configure the following fields to define the connector:

   | Field                      | Description                                                                                                                                                                                                                                                                                                                                      |
   | :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Name**                   | The name of the connector as it appears to users in a workbook.                                                                                                                                                                                                                                                                                  |
   | **Description**            | (Optional) A description that helps users identify the connector and verify its contents.                                                                                                                                                                                                                                                        |
   | **Credentials**            | (Optional) A credential from your configured API credentials in Sigma. See [Add a new API credential to Sigma](#add-a-new-api-credential-to-sigma).                                                                                                                                                                                              |
   | **Certificate**            | (Optional) A certificate from your configured certificates in Sigma. See [Configure mutual transport layer security (mTLS) for API connectors in Sigma](/docs/configure-mutual-transport-layer-security-for-api-connectors-in-sigma).                                                                                                            |
   | **Connector type**         | The type of connector. You can select **Custom connector** or **via OpenAPI**. If you select **via OpenAPI**, select a specification, base URL, and endpoint from that specification. For more information, see [Import an OpenAPI specification](#import-an-openapi-specification).                                                             |
   | **Base URL**               | An **HTTP method** and the **URL** for the request.                                                                                                                                                                                                                                                                                              |
   | **Request headers**        | (Optional) A header for the request.                                                                                                                                                                                                                                                                                                             |
   | **Query parameters**       | (Optional) Query parameters for the request. For more information see [Configure query parameters for an API connector](#configure-query-parameters-for-an-api-connector).                                                                                                                                                                       |
   | **Path parameters**        | (Optional) Dynamic path parameters. To set path parameters, you must include `/:<path_param>` in the **Base URL** for each path parameter you want to configure. You can then configure the path parameter with a **Static** value or **Dynamic** values supplied by the workbook user when configuring a **Call API** action for the connector. |
   | **Request body**           | (Optional) A request body, including **form-data**, or **raw** JSON, Text, and XML. For more information, see [Configure a request body for an API connector](#configure-a-request-body-for-an-api-connector).                                                                                                                                   |
   | **Response output**        | (Optional) A custom output, parsed from the response. To make use of the response data in a workbook, such as in controls or input tables, see [Create custom action variables for an API connector](#create-custom-action-variables-for-an-api-connector).                                                                                      |
   | **Advanced configuration** | (Optional) Additional settings for governance and security, including retries, timeouts, and rate limiting. For more information, see [Configure governance settings for an API connector](#configure-governance-settings-for-an-api-connector).                                                                                                 |

4. Review the endpoint preview for accuracy.

5. (Optional) Select **Test connector** to [test the connector](#test-an-api-connector).

6. Click **Save**.

To use your API connector in a workbook, see [Create actions that call API endpoints](/docs/create-actions-that-call-api-endpoints).

### Import an OpenAPI specification

You can import an OpenAPI specification to Sigma to create a connector based on the definitions available in the specification:

1. Go to **Administration** > **API connectors**.

2. Select **OpenAPI**.

3. Select **Create OpenAPI**.

4. On the **OpenAPI details** screen, configure the following fields:

   | Field                 | Description                            |
   | :-------------------- | :------------------------------------- |
   | **Name**              | The name of the OpenAPI specification. |
   | **Specification URL** | The URL of the OpenAPI specification.  |

   > **Tip**
   >
   > For a step-by-step example of using an OpenAPI specification to create an API connector, follow the instructions in [Tutorial: Configure API credentials, connectors, and actions for the Sigma REST API](/docs/tutorial-configure-api-credentials-connectors-and-actions-for-the-sigma-rest-api#create-a-connector).

5. Click **Save**.

The OpenAPI specification is imported and appears in the **Select OpenAPI specification** dropdown when creating a new API connector. You can update or delete the specification by selecting it from the list on the **OpenAPI** screen.

### Create an API connector based on a cURL request

If you have an existing [client URL (cURL)](https://en.wikipedia.org/wiki/CURL) request that you want to migrate to Sigma, you can create a new API connector by importing the cURL request:

1. Go to **Administration** > **API connectors**.

2. Click **Create connector**.

3. On the **New API connector** screen, select **Import from cURL** in the header.

4. In the **Import from cURL** modal, enter a valid cURL request.

   For example, to create a connector that calls the [List data models](/reference/list-data-models) endpoint, enter a request in the following format:

   #### Example cURL import format

   ```shell
   curl --request GET \
     --url <base_url>/v2/dataModels \
     --header 'accept: application/json' 
   ```

   > **Tip**
   >
   > To test the request above, follow the instructions to [Generate Sigma API credentials](/reference/generate-client-credentials), store the token as an [API credential](#add-a-new-api-credential-to-sigma) used in the new connector, and enter the [API request URL](/reference/get-started-sigma-api#identify-your-api-request-url) for your Sigma organization in place of the `<base_url>` placeholder.

5. Select **Import**.

   Sigma parses the cURL request for a URL, HTTP verb, headers, and request body and populates their details as fields in the **New API connector** screen.

6. After configuring the remaining fields in the **New API connector** screen, click **Save**.

### Configure query parameters for an API connector

When creating an API connector in Sigma, you can optionally set query parameters in the **Request details** section of the **New API connector** screen:

1. Under **Query parameters**, click ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg) **Add parameter**.

2. For the query parameter, configure the following fields:

   | Field     | Description                                                                                                                                           |
   | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Key**   | The key for the query parameter.                                                                                                                      |
   | **Mode**  | Select **Static** to set a static value, or **Dynamic** to set the value based on a selection in the workbook when configuring a **Call API** action. |
   | **Value** | The value for that query parameter. If **Mode** is set to **Static**, enter the value.                                                                |

   > **Info**
   >
   > To identify valid arguments you can use as query parameters, review the documentation for the API as you configure the connector.

3. After configuring the remaining fields in the **New API connector** screen, click **Save**.

For **Static** parameter values, you can set a key and value for the query parameter, which appear in the endpoint in the following way:

```
https://api.example.com/endpoint/?key=value
```

For example, if you configure a **Static** query parameter with the **key** `limit` and the **value** `100`, the endpoint is constructed in the following way:

```
https://api.example.com/endpoint/?limit=100
```

For **Dynamic** parameter values, you can set a key for the query parameter, which appears in the endpoint preview like the following:

```
https://api.example.com/endpoint/?key={{key}}
```

The dynamic value `{{key}}` is populated by the user that creates a **Call API** action with this connector. Any user with access to this connector, as well as an account type with the **Trigger API actions** permission enabled, can use it in a workbook with any valid value for the query parameter.

### Configure a request body for an API connector

When creating an API connector in Sigma, you can optionally configure a request body in the **Request details** section of the **New API connector** screen.

See the following sections for guidance on formatting a request body:

* [Configure a request body as a set of key-value pairs](#configure-a-request-body-as-a-set-of-key-value-pairs)
* [Configure a request body as raw JSON, Text, or XML](#configure-a-request-body-as-raw-json-text-or-xml)
* [Configure a request body for a GraphQL endpoint](#configure-a-request-body-for-a-graphql-endpoint)
* [Configure dynamic values and types in a request body](#configure-dynamic-values-and-types-in-a-request-body)

#### Configure a request body as a set of key-value pairs

To configure the request body as a series of key-value pairs:

1. Under **Request body**, select **form-data**.

2. For **form-data**, configure the following fields:

   | Field     | Description                                                                                                                                           |
   | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Key**   | The key for this object in the request body.                                                                                                          |
   | **Mode**  | Select **Static** to set a static value, or **Dynamic** to configure a dynamic value when using the connector in a **Call API** action in a workbook. |
   | **Value** | The value for that key in the request body. If **Mode** is set to **Static**, enter the value.                                                        |

3. (Optional) To configure additional keys for the request body, click ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg) **Add key** and configure the fields as described in step 2.

4. After configuring the remaining fields in the **New API connector** screen, click **Save**.

#### Configure a request body as raw JSON, Text, or XML

To configure the request body as **JSON**, **Text**, or **XML**:

1. Under **Request body**, select **raw**.

2. In the dropdown, select **JSON**, **Text**, or **XML**.

3. In the text area, configure the request body for the connector.

   * If you configured any dynamic values in the request body, configure their types. For more information, see [Configure dynamic values and types in a request body](#configure-dynamic-values-and-types-in-a-request-body).

   > **Tip**
   >
   > When configuring a request body as **JSON**, you can select **Beautify** to automatically format the JSON in the text area, making it easier to read, edit, and organize nested objects.

4. After configuring the remaining fields in the **New API connector** screen, click **Save**.

#### Configure a request body for a GraphQL endpoint

Sigma supports queries and mutations to GraphQL endpoints in addition to traditional REST API endpoints.

To configure an API connector that targets a GraphQL endpoint:

1. Under **Request body**, select **GraphQL**.

   After selecting **GraphQL**, the HTTP method is set to **POST**, and the options to add **Query parameters** and **Path parameters** are removed.

2. Configure the following fields to define the request headers:

   | Field     | Description                                                                                                                                           |
   | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Key**   | The key for this object in the request header.                                                                                                        |
   | **Mode**  | Select **Static** to set a static value, or **Dynamic** to configure a dynamic value when using the connector in a **Call API** action in a workbook. |
   | **Value** | The value for that key in the request body. If **Mode** is set to **Static**, enter the value.                                                        |

3. In the **Request body** field, define the query or mutation. If you configured any dynamic values in the request body, configure their types. For more information, see [Configure dynamic values and types in a request body](#configure-dynamic-values-and-types-in-a-request-body).

   For example, to configure a query against an endpoint that returns details on countries, and declare a dynamic `$code` input for the country, you can write a request body like the following:

   #### GraphQL query request body example

   ```graphql
   query GetCountry($code: ID!) {
     country(code: $code) {
       name
       capital
       currency
       languages { name }
     }
   }
   ```

   Or, to configure a mutation that creates a new post in a social media feed, and declare a dynamic `$input` for the post's contents, you can write a request body like the following:

   #### GraphQL mutation request body example

   ```graphql
   mutation CreatePost($input: CreatePostInput!) {
     createPost(input: $input) {
       id
       title
       body
     }
   }
   ```

4. After configuring the remaining fields in the **New API connector** screen, click **Save**.

#### Configure dynamic values and types in a request body

When configuring a **raw** request body, you can add a dynamic value using the following syntax:

```
{{dynamic-value}}
```

When configuring a **GraphQL** request body, you can add a dynamic value using the following syntax:

```
$dynamic-value
```

When using a connector with a dynamic value in a **Call API** action in a workbook, users can populate the dynamic values with a **Static** value, **Control** value, or **Formula**.

You can also apply types to dynamic values in the request body to enforce the data type of that value when users create a **Call API** action in a workbook. After entering a dynamic value in the request body, open the **Type** dropdown and select one of the following types:

* Text
* Number
* Logical
* Variant
* Array

> **Tip**
>
> When configuring a dynamic value with the **Array** type, you must set a type for the array's contents. If you set the type of the array to **Object**, you must also set types for the properties of that object.
>
> For example, to configure a connector that sends a request with a list of users, you can set a dynamic value with the type **Array**, set the type of that array's contents to **Object**, and then set the types of each property in that object (e.g. `user_id` with type **Number**).

When users create a **Call API** action and populate a dynamic value with **Static values**, Sigma automatically applies the selected type. For example, if you configure a dynamic value with the type **Text**, Sigma automatically converts **Static values** to text when entered. If a user enters a number (e.g. `123`), it is converted to a string (e.g. `"123"`).

![An example Call API action configured with a static value of 123 on a dynamic value with the type Text](/_fern-files/_img/f4628c468274b111add18afa3fe02fc19582e4ab82f4204d0b8b4050c7c2c371.webp)

When users create a **Call API** action and populate a dynamic value with a **Control** value or **Formula**, Sigma performs validation for the selected type. For example, if you configure a dynamic value with the type **Text**, Sigma validates inputs from a **Formula** to ensure they are text data. If a user enters a number (e.g. `123`) in the formula bar, Sigma shows an **Invalid type** error.

![An example Call API action configured with a formula value of 123 on a dynamic value with the type Text, showing an Invalid type error](/_fern-files/_img/5b742b4756c7436ce5f098ea0c8774aa3ab48f49e9a6fccf273f17b60fbd7082.webp)

Controls are only shown in the **Call API** action if the type of the control matches the type of the dynamic value. For example, if you configure a dynamic value with the type **Text**, only controls with a **Text** type are shown.

### Create custom action variables for an API connector

When creating an API connector in Sigma, you can parse the response to create custom variables for use in other workbook actions. For example, you can parse a response body, and then use that parsed response value in a **Set control value** action after calling the API to set the control based on the response from the API.

To add custom action variables while editing or creating an API connector:

1. Under **Response output**, click ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg) **+ Add**.

2. For the new action variable, configure the following fields:

   | Field             | Description                                                                                                                                                                                                                             |
   | :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Variable name** | The name of the action variable that appears in action sequences.                                                                                                                                                                       |
   | **Accessor**      | A formula used to parse the response from the API connector. For example, `[response][0].key` returns the value of the `key` property from the first object in an array of objects.                                                     |
   | **Shape**         | The data type or shape of the action variable. You can either select a top-level type for a single value, such as **Text**, **Number**, **Logical**, or **Variant**, or select **Array** to parse the response into an array of values. |

   > **Tip**
   >
   > Consider the data type of the response and the desired shape of the response variable when configuring the **Shape** and **Accessor**. For example, if you receive an array from the API connector, and want to return the first value of a field in the array to a **Text** control, select **Text** as the **Shape**, and use an accessor like `[response][0].key`.

   > **Info**
   >
   > Response output parsing only supports up to one level of nesting. You can parse an array of objects, or an object with an array as one of its properties. You can't add keys for properties inside a nested object or array.
   >
   > To use data with deeper nesting, you can use a **Variant** response shape to capture the whole response, and then parse the nested values with [custom SQL](/docs/write-custom-sql) or [Python](/docs/write-and-run-python-code).

3. Click **Save**.

The custom action variable is available to use in workbook action sequences that use the API connector in a **Call API** action. For more information on using the action variable in an action sequence, see [Use variables in actions](/docs/use-variables-in-actions).

#### Parse an API response body into multiple rows in an input table

You can parse an array from an API response body into multiple rows and columns in an input table using a [custom action variable](#create-custom-action-variables-for-an-api-connector) and the **Insert row(s)** action.

While creating a new API connector that returns an array in the response body, configure a custom action variable:

1. Under **Response output**, click ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg) **+ Add** to add a new action variable.

2. For the new action variable, configure the following fields:

   | Field             | Setting                                                                                                                                                                                                                                                                                 |
   | :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Variable name** | Enter a name for the action variable containing the array of values.                                                                                                                                                                                                                    |
   | **Accessor**      | Enter a formula that returns an array. For example, if the response body returns only an array, enter `[response]`. Or, if the response body returns an object with an array as one of its properties, enter `[response].<key>`, replacing `<key>` with the identifier of the property. |
   | **Shape**         | Select **Array**. Then, select an output type for the items within the array. For example, if the response array contains a series of product names, select **Text** to be able to insert them into a **Text** column in an input table.                                                |

3. (Optional) If you selected **Object** as the type for array items, select **+ Add key** to parse one or more properties from the object and set their types in the output object. For example, if the API response body contains an array of objects with a numeric `Id` value, add a property labeled **Id** with a type of **Number** to add it to the action variable.

4. Click **Save**.

Then, in a workbook with an input table, add a **Call API** action that uses the API connector and writes to the input table:

1. In an action sequence, add a **Call API** action that uses the connector you defined an action variable for in the previous steps.
2. In the same action sequence, after the **Call API** action, add an **Insert row(s)** action, and configure it with the following settings:

   | Field                 | Setting                                                                                   |
   | :-------------------- | :---------------------------------------------------------------------------------------- |
   | **Action**            | Select **Insert row(s)**.                                                                 |
   | **Insert type**       | Select **Source data**.                                                                   |
   | **Into**              | Select the input table to insert data from the API response into.                         |
   | **From**              | Select **Action variable** and then select the action variable you defined previously.    |
   | **Set column values** | For each column in the input table, select properties from the action variable to insert. |

When the action sequence triggers, new rows are added based on each object in the response body.

For an end-to-end example that includes defining an API connector and action variable, as well as parsing the contents of that action variable into a table, see [Tutorial: Configure API credentials, connectors, and actions for the NYC Open Data API](/docs/tutorial-configure-api-credentials-connectors-and-actions-for-the-nyc-open-data-api).

### Configure governance settings for an API connector

When creating an API connector in Sigma, you can configure advanced settings to control timeouts, retries, redirects, and rate limiting.

To manage these settings, configure the following fields while editing or creating an API connector:

| Field                           | Description                                                                                                                                  |
| :------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------- |
| **Request timeout (seconds)**   | The maximum time, in seconds, before requests from this connector fail due to timeout. Set to `30` by default.                               |
| **Maximum retries**             | The maximum number of retries made per request for this connector on any **Retryable status codes**. Set to `0` by default.                  |
| **Retryable status codes**      | A comma-separated list of response status codes that trigger a retry, up to the **Maximum retries**. Set to `429, 502, 503, 504` by default. |
| **Maximum redirects**           | The maximum number of redirects before a request from this connector fails. Set to `0` by default. Only supports HTTPS redirects.            |
| **Maximum requests per minute** | The maximum number of requests that can be made per minute using this connector. Set to `60` by default.                                     |

> **Info**
>
> To enhance data security, or meet the requirements of a particular platform, you can add mutual authentication to a connector. For more information, see [Configure mutual transport layer security (mTLS) in Sigma](/docs/configure-mutual-transport-layer-security-for-api-connectors-in-sigma).

### Test an API connector

When creating an API connector in Sigma, you can test the connector to ensure it is configured correctly and returns the expected response.

1. After following the steps to [create a new API connector in Sigma](#create-a-new-api-connector-in-sigma), but before clicking **Save**, click **Test connector**.
2. In the **Test connector** modal, enter values for any dynamic parameters in **Request headers**, **Query parameters**, **Path parameters**, or the **Request body**.
3. (Optional) Turn on the **Dry run** toggle to compile and review the request without sending it.
4. Click **Test**.
5. Review the response in the **Test results** section.
6. Click **Close**.

> **Info**
>
> When the **Dry run** toggle is on, Sigma shows you the compiled request that Sigma sends to the API endpoint without sending it. This can be used to review the method, URL, headers, and body of the request without incurring any costs associated with sending an actual request. To test the request and receive a response from the API endpoint, turn off the **Dry run** toggle.

## Grant access to API credentials and connectors

For information on granting users and teams access to API credentials and connectors, see [Manage API credential and connection access](/docs/manage-api-credential-and-connection-access).

## Examples

For step-by-step tutorials on how to configure API credentials and connectors, see the following:

* [Tutorial: Configure API credentials, connectors, and actions for the Sigma REST API](/docs/tutorial-configure-api-credentials-connectors-and-actions-for-the-sigma-rest-api)
* [Tutorial: Configure API credentials, connectors, and actions for the NYC Open Data API](/docs/tutorial-configure-api-credentials-connectors-and-actions-for-the-nyc-open-data-api)

## Related resources

* [Manage API credential and connection access](/docs/manage-api-credential-and-connection-access)
* [Create actions that call API endpoints](/docs/create-actions-that-call-api-endpoints)
* [Configure mutual transport layer security (mTLS) in Sigma](/docs/configure-mutual-transport-layer-security-for-api-connectors-in-sigma)
* [Tutorial: Configure API credentials, connectors, and actions for the NYC Open Data API](/docs/tutorial-configure-api-credentials-connectors-and-actions-for-the-nyc-open-data-api)
* [Tutorial: Configure API credentials, connectors, and actions for the Sigma REST API](/docs/tutorial-configure-api-credentials-connectors-and-actions-for-the-sigma-rest-api)