---
title: "Create Service Account in TSB. Service Accounts are local to TSB and can be used to access the platform using JWT tokens signed with the Service Account's private key for authentication."
method: POST
path: "/v2/organizations/{organization}/serviceaccounts"
tags: ["Teams"]
---

# Create Service Account in TSB. Service Accounts are local to TSB and can be used to access the platform using JWT tokens signed with the Service Account's private key for authentication.

`POST /v2/organizations/{organization}/serviceaccounts`

## Request

- Base URL: `https://docs.tetrate.io` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.tetrate.io/v2/organizations/{organization}/serviceaccounts`
- Auth: none declared
- TypeScript: <https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api/docs/v2/organizations/:organization/serviceaccounts/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `organization` string, required

## Request body

- object
  - `keyEncoding` 'PEM' | 'JWK'
  - `name` string, required: The short name for the resource to be created.
  - `serviceAccount` Tsbv2ServiceAccount, required: `ServiceAccount` represents a service account that can be used to access the TSB platform. Service accounts have a set of associated public and private keys that can be used to generate signed JWT tokens that are suitable to authenticate to TSB. A default key-pair is generated on service account creation and the public key is stored in TSB. Private keys are returned when service accounts are created, but TSB will not store them. It is up to the client to store them securely.
    - `fqn` string
    - `displayName` string
    - `etag` string
    - `description` string: A description of the resource.
    - `keys` ServiceAccountKeyPair[]
      - `id` string
      - `publicKey` string
      - `privateKey` string
      - `encoding` 'PEM' | 'JWK'
      - `defaultToken` string

## Response `200`

A successful response.

- Tsbv2ServiceAccount: `ServiceAccount` represents a service account that can be used to access the TSB platform. Service accounts have a set of associated public and private keys that can be used to generate signed JWT tokens that are suitable to authenticate to TSB. A default key-pair is generated on service account creation and the public key is stored in TSB. Private keys are returned when service accounts are created, but TSB will not store them. It is up to the client to store them securely.
  - `fqn` string
  - `displayName` string
  - `etag` string
  - `description` string: A description of the resource.
  - `keys` ServiceAccountKeyPair[]
    - `id` string
    - `publicKey` string
    - `privateKey` string
    - `encoding` 'PEM' | 'JWK'
    - `defaultToken` string

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api.md) - [All operations](https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tetrate/apis/tetrate-service-bridge-api/revisions/2f19c3a1ae57?raw)
