---
updatedAt: 2025-11-11T01:53:29.000Z
agentTools:
  projectIndex: https://docs.formant.io/llms.txt
---

# Create service account using fctl

You can use `fctl` to programmatically create a service account. A service account will allow you to authenticate data interactions with your Formant organization without using your login credentials.

For more information on service accounts, see [Users, service accounts, and teams](https://docs.formant.io/docs/users).

# Prerequisites

## Install `fctl`

Follow the steps in [fctl overview and installation](https://docs.formant.io/reference/fctl-overview-and-installation) to install the `fctl` command-line tool.

## Prepare to save account credentials

> ❗️
>
> This is the only time you will be able to copy the password for your service account. Be prepared to copy the email and password for your service account to a secure file. You will need these credentials to authenticate your service account and access Formant.

# Step 1: Create a service account

To create a service account, use the `create service-account` command with the following syntax:

```shell
fctl create service-account <account-name> --role <desired-role> --output <output-format>
```

...where the parameters are used as follows:

| Parameter                    | Usage                                                                                                                                                                              |
| :--------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<account-name>`             | Enter the name of the service account you want to create.                                                                                                                          |
| `<desired-role>`             | Enter the name of the role you want to assign to this service account. Must match an existing role in your Formant organization.                                                   |
| (Optional) `--output`        | (Optional) This flag indicates that the following entry will be your desired output format. If you do not set the `--output` flag, the credentials will be returned as plain text. |
| (Optional) `<output-format>` | Required if the `--output` flag is used. Enter either `json` or `text`.                                                                                                            |

# Step 2: Get credentials

When your service account is successfully created, the credentials will be printed in the terminal. If you used the `--output json`  flag in Step 1, this output will be in JSON format.

Save these credentials to a secure file.

> ❗️
>
> This is the **only** time you will be able to save these credentials!

# Example

Suppose you want to create a service account called `server1` with administrator privileges, and you want to receive the credentials as plain text. You would run the following command:

```shell
fctl create service-account server1 --role administrator
```

<Callout icon="👋" theme="default">
  ### If you notice an issue with this page or need help, please reach out to us! Use the 'Did this page help you?' buttons below, or get in contact with our Customer Success team via the Intercom messenger in the bottom-right corner of this page, or at [support@formant.io](mailto:support@formant.io).
</Callout>