---
title: "Fetch a service account by ID"
method: GET
path: "/api/v2/service-accounts/{service_account_id}"
tags: ["Service Accounts"]
---

# Fetch a service account by ID

`GET /api/v2/service-accounts/{service_account_id}`

## Request

- Base URL: `https://console.jumpcloud.com`
- URL: `https://console.jumpcloud.com/api/v2/service-accounts/{service_account_id}`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/docs/api/v2/service-accounts/:service_account_id/get.ts> (a function with typed inputs; its response is checked against the schema)

Get service account

## Path parameters

- `service_account_id` string, byte, required

## Headers

- `x-org-id` string

## Response `200`

Service account successfully retrieved.

- JumpcloudServiceAccountsServiceAccount
  - `authConfigList` JumpcloudServiceAccountsAuthConfig[]
    - `apiKeyConfig` JumpcloudServiceAccountsApiKeyConfig: contains configuration for an API key auth config (prefix on read; full key once on create).
      - `apiKey` string
      - `apiKeyPrefix` string
      - `createdAt` string, date-time
      - `createdBy` JumpcloudServiceAccountsServiceAccountActor
        - `id` string, byte
        - `name` string
        - `type` 'ADMIN' | 'SERVICE_ACCOUNT': - ADMIN: the actor is admin - SERVICE_ACCOUNT: the actor is a service account
      - `expiresAt` string, date-time
      - `lifetime` string
      - `objectId` string, byte
      - `status` 'ACTIVE' | 'EXPIRED' | 'EXPIRING'
    - `authType` 'AUTH_TYPE_UNSPECIFIED' | 'CLIENT_SECRET' | 'API_KEY': - AUTH_TYPE_UNSPECIFIED: unspecified authentication type - CLIENT_SECRET: client secret authentication - API_KEY: API key authentication (jcs_* direct org)
    - `clientSecretConfig` JumpcloudServiceAccountsClientSecretConfig
      - `clientId` string
      - `clientSecret` string: client secret associated with the client ID. This field will hold the secret only at the time of creation and will be visible to users only once. The subsequent retrievals will not return the secret for security reasons.
      - `createdAt` string, date-time
      - `createdBy` JumpcloudServiceAccountsServiceAccountActor
        - `id` string, byte
        - `name` string
        - `type` 'ADMIN' | 'SERVICE_ACCOUNT': - ADMIN: the actor is admin - SERVICE_ACCOUNT: the actor is a service account
      - `expiresAt` string, date-time
      - `lifetime` string
      - `objectId` string, byte
      - `status` 'ACTIVE' | 'EXPIRED' | 'EXPIRING'
  - `authType` 'AUTH_TYPE_UNSPECIFIED' | 'CLIENT_SECRET' | 'API_KEY': - AUTH_TYPE_UNSPECIFIED: unspecified authentication type - CLIENT_SECRET: client secret authentication - API_KEY: API key authentication (jcs_* direct org)
  - `createdAt` string, date-time
  - `expiresAt` string, date-time
  - `name` string
  - `objectId` string, byte
  - `orgCount` integer
  - `orgId` string, byte
  - `providerId` string, byte
  - `roleId` string, byte
  - `roleName` string: DEPRECATED: Call roles API with the role_id to get the role name.
  - `status` 'ACTIVE' | 'EXPIRED' | 'EXPIRING'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/revisions/f396d9271b46?raw)
