---
title: "Get service account"
method: GET
path: "/api/organizations/{name}/service-accounts/{serviceAccountId}"
tags: ["service-accounts"]
---

# Get service account

`GET /api/organizations/{name}/service-accounts/{serviceAccountId}`

## Request

- Base URL: `https://huggingface.co`
- URL: `https://huggingface.co/api/organizations/{name}/service-accounts/{serviceAccountId}`
- Auth: HTTP bearer

Retrieve a single service account and its access token metadata. Token secrets are never returned.

## Path parameters

- `name` string, required
- `serviceAccountId` string, required

## Response `200`

Service account

- object
  - `_id` string, required: A hex string of 24 characters representing an ObjectId.
  - `user` string, required
  - `name` string, required
  - `email` string, required
  - `description` string
  - `createdAt` string, date-time, required
  - `accessTokens` object[]
    - `_id` string, required: A hex string of 24 characters representing an ObjectId.
    - `displayName` string, required
    - `createdAt` string, date-time, required
    - `lastUsedAt` string, date-time
    - `expiration` string, date-time
    - `role` 'read' | 'write' | 'fineGrained', required
    - `permissions` string[], required
    - `repoIds` string[], required
    - `repoPermissions` string[], required
    - `endpointPatterns` string[], required
    - `last4` string
    - `skipNetworkSecurity` boolean
    - `s3AccessKey` string

## Changes

- **2026-10-21** `2b5942a5491f`: 1 info
  - added the optional property `accessTokens/items/s3AccessKey` to the response with the `200` status
- **2026-10-01** `02f8596075cd`: 1 warning
  - added the new `repo.contribute.write` enum value to the `accessTokens/items/permissions/items/` response property for the response status `200`
- **2026-09-08** `bd17546f47b8`: 3 breaking, 4 info
  - the `accessTokens/items/permissions/items/` response's property type changed from no type to `string` for status `200`
  - the `accessTokens/items/repoPermissions/items/` response's property type changed from no type to `string` for status `200`
  - the `accessTokens/items/role` response's property type changed from no type to `string` for status `200`
  - the `accessTokens/items/createdAt` response's property pattern was changed from `^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$` to `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$` for the status `200`
  - …3 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/organizations/:name/service-accounts/:serviceAccountId/get.md)

---

[API](https://skmtc.dev/huggingface/apis/hub-api-endpoints.md) - [All operations](https://skmtc.dev/huggingface/apis/hub-api-endpoints/llms.txt) - [OpenAPI document](https://skmtc.dev/huggingface/apis/hub-api-endpoints/revisions/5cabdcc8a394?raw)
