> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emailbison.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating API Keys

<Tabs>
  <Tab title="API" icon="binary">
    <Note>
      **This workflow requires a `super-admin` key.**

      For a refresher on the difference between the key types, you can visit [Authentication](/get-started/authentication).
    </Note>

    <Tip>
      You do not need to switch workspaces using the API or the UI for this workflow.
    </Tip>

    `api-user` keys can be generated for workspaces using the API.

    ### Creating a Key

    Send a `POST` request to the following endpoint.

    ```bash theme={null}
    /api/workspaces/v1.1/{workspace_id}/api-tokens
    ```

    <ParamField path="workspace_id" type="integer" required>
      The ID of the workspace you want to generate a key for.
    </ParamField>

    <Tip>
      Workspace IDs can be aquired by sending a `GET` request to `api/v1.1/workspaces`.
    </Tip>

    You must include a `name` field in a JSON body, this field is the name of the API key you are creating.

    An example of a request creating an API key named "**New token**" for the workspace with ID **54**:

    <CodeGroup>
      ```bash curl theme={null}
      curl 'https://dedi.emailbison.com/api/workspaces/v1.1/54/api-tokens' \
        --request POST \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
        --data '{
        "name": "New token"
      }'
      ```

      ```JavaScript JavaScript theme={null}
      fetch('https://dedi.emailbison.com/api/workspaces/v1.1/54/api-tokens', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          Authorization: 'Bearer YOUR_SECRET_TOKEN'
        },
        body: JSON.stringify({
          name: 'New token'
        })
      })
      ```

      ```Python Python theme={null}
      import requests

      url = "https://dedi.emailbison.com/api/workspaces/v1.1/54/api-tokens"

      payload = { "name": "New token" }
      headers = {
          "Content-Type": "application/json",
          "Authorization": "Bearer YOUR_SECRET_TOKEN"
      }

      response = requests.post(url, json=payload, headers=headers)
      ```
    </CodeGroup>
  </Tab>

  <Tab title="UI" icon="browser">
    1. Navigate to `Settings` -> `Developer API`.
    2. Click the `New API Token` button near the top-right of the page.
    3. Provide a token name and token type.
    4. Click `Generate Token`.
  </Tab>
</Tabs>
