---
title: "GET /v1/service-accounts/{name}"
method: GET
path: "/v1/service-accounts/{name}"
tags: ["service-accounts"]
---

# GET /v1/service-accounts/{name}

`GET /v1/service-accounts/{name}`

## Request

- Base URL: `https://api.example.com/api`
- URL: `https://api.example.com/api/v1/service-accounts/{name}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `session_id`
- TypeScript: <https://skmtc.dev/lensesio/apis/lenses-hq-api/docs/v1/service-accounts/:name/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns a specific ServiceAccount.

## Path parameters

- `name` string, required

## Response `200`

Happy response.

- ServiceAccount
  - `name` string, required
  - `display_name` string, required
  - `id` string, required
  - `lrn` string, required: Contains the resource identifier for use in access control policies.
  - `created_at` string, date-time, required
  - `description` string, required
  - `groups` CompactGroup[], required
    - `name` string, required
    - `display_name` string, required
    - `lrn` string, required: Contains the resource identifier for use in access control policies.
    - `id` string, required
    - `created_at` string, date-time, required
    - `description` string, required
    - `user_count` integer, required: Is set to the number of users in this group.
    - `sa_count` integer, required: Is set to the number of service accounts in this group.
    - `role_count` integer, required: Is set to the number of roles associated with this group.
    - `metadata` Metadata: Allows attaching custom string key/values to resources. The following maxima apply: - 50 keys/values; - 40 bytes key length; - 500 bytes value length.
  - `token_expires_at` string, date-time: If null, it won't expire.
  - `token_expired` boolean, required
  - `last_seen_at` string, date-time: Updates when this service account has interaction with the API.
  - `is_admin` boolean, required
  - `metadata` Metadata: Allows attaching custom string key/values to resources. The following maxima apply: - 50 keys/values; - 40 bytes key length; - 500 bytes value length.

## Other responses

- `default`: Error object.

---

[API](https://skmtc.dev/lensesio/apis/lenses-hq-api.md) - [All operations](https://skmtc.dev/lensesio/apis/lenses-hq-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lensesio/apis/lenses-hq-api/revisions/9db591647ff6?raw)
