# Cortex service accounts

In order for org and study configuration to be moved around between environments, the system should be able to easily map user accounts. That's difficult because of passwords and unique email addresses. Roles are currently mapped but user accounts are not. Since views and scripts can be run as a user and resources created must have a creator, packages will need user accounts to act on their behalf. Service accounts enable running a view or a script without having to use a named account. Developer tools and deployments will be able to import and export service accounts.

## Create a service account

We are going to create our first service account so that you can assign this account to your custom scripts.

* Go to your org control panel
* Click on Settings > Service Account and click New Service Account
* The create service account form is displayed. Click Create

| Field  | Description                                                                                                                     |
| ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| Name   | Unique name for the service account. You cannot have 2 service accounts with the same name.                                     |
| Label  | Unique label for the service account. You cannot have 2 service accounts with the same label.                                   |
| Locked | When locked, a service account cannot be authenticated (eg. via access token) but can still be used to run scripts, views, etc. |
| Roles  | Role(s) associated to the service account                                                                                       |

![Service Accounts are also supported for deployment using the cortex developer tools. Documentation for installation and usage for the Cortex developer tools can be found here: https://github.com/Medable/mdctl.](https://files.readme.io/652bb2a-Screen_Shot_2019-04-12_at_11.27.57_AM.png)

Service Accounts are also supported for deployment using the cortex developer tools. Documentation for installation and usage for the Cortex developer tools can be found here: <https://github.com/Medable/mdctl>.


---

# 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.medable.com/getting-started/cortex-user-guide/cortex-service-accounts.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.
