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

# CREATE SERVICE ACCOUNT

> Reference and syntax for the CREATE SERVICE ACCOUNT command.

Creates a new service account.

For more information, see [Service accounts](https://docs.firebolt.io/managed-service/organization/service-accounts.md).

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
CREATE SERVICE ACCOUNT [ IF NOT EXISTS ] <service_account_name> 
    [ WITH
    [ DESCRIPTION = <description> ] 
    [ NETWORK_POLICY = <network_policy_name> ]
    [ IS_ORGANIZATION_ADMIN = { TRUE|FALSE } ]
    [ CONNECTION_PREFERENCE = { PUBLIC_ONLY | PRIVATE_ONLY | PREFER_PUBLIC | PREFER_PRIVATE | DEFAULT } ]
    ]
```

## Parameters

| Parameter | Description |
| - | - |
| `<service_account_name>` | The name of the service account. Must start with a letter and may contain only alphanumeric, digit, or underscore (\_) characters. |
| `<description>` | An optional description for the service account. |
| `<network_policy_name>` | An optional parameter to define the network policy to link to the created service account. |
| `IS_ORGANIZATION_ADMIN` | A `BOOLEAN` value specifying if the login is an organization admin. By default, this value is `FALSE`. |
| `CONNECTION_PREFERENCE` | Defines how the service account connects to Firebolt. The default value is `PREFER_PUBLIC` if not specified. See **Connection preferences** for details. |

### Connection preferences

The `CONNECTION_PREFERENCE` parameter determines how a [service account](https://docs.firebolt.io/managed-service/organization/service-accounts.md) accesses Firebolt:

* **`PUBLIC_ONLY`**: Allows access only through the public internet.
* **`PRIVATE_ONLY`**: Allows access only through AWS PrivateLink.
* **`PREFER_PUBLIC`** (Default): Prefers the public internet but calls that do reach Firebolt via AWS PrivateLink won't be explicitly rejected.
* **`PREFER_PRIVATE`**: Prefers AWS PrivateLink but calls that do reach firebolt via the public internet won't be explicitly rejected.

## Example

The following code example creates a service account `sa1` linked to the `my_network_policy` network policy:

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
CREATE SERVICE ACCOUNT "sa1" WITH NETWORK_POLICY = my_network_policy
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.