> For the complete documentation index, see [llms.txt](https://docs.e6data.com/query-engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.e6data.com/query-engine/reference/token-reference/service-account-key-format.md).

# Service account key format

The structure of an e6data service account API key and how it's stored.

A service account API key is a four-part, underscore-separated string carrying a workspace-scoped machine identity.

```
e6sa_<workspace>_<keyId>_<secret>
```

| Segment       | Meaning                                                         |
| ------------- | --------------------------------------------------------------- |
| `e6sa_`       | The service-account prefix - checked before any lookup          |
| `<workspace>` | The workspace the key is scoped to (keys don't span workspaces) |
| `<keyId>`     | The key's identifier                                            |
| `<secret>`    | The secret material                                             |

* The full value is **shown once**, at creation; the secret is stored hashed and cannot be retrieved again.
* A service account can hold multiple keys (rotate freely). Deleting the service account revokes all its keys.
* Like a PAT, the key carries identity only - permissions come from the service account's role bindings.

The other prefix is `e6pat_` (personal access token). See the canonical [token-types table](/query-engine/guides/security/access-tokens.md#token-types).

## See also

* [Personal access token format](/query-engine/reference/token-reference/personal-access-token.md)
* [Token lifecycle states](/query-engine/reference/token-reference/token-lifecycle-states.md)
* [Users, groups, and service accounts](/query-engine/guides/security/identity-and-rbac/users-groups-service-accounts.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.e6data.com/query-engine/reference/token-reference/service-account-key-format.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
