---
title: "List the service accounts an enterprise and its organizations own."
method: GET
path: "/enterprises/{enterpriseId}/service-accounts"
tags: ["enterprises"]
---

# List the service accounts an enterprise and its organizations own.

`GET /enterprises/{enterpriseId}/service-accounts`

## Request

- Base URL: `https://api.shorebird.dev/api/v1`
- URL: `https://api.shorebird.dev/api/v1/enterprises/{enterpriseId}/service-accounts`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

By organization name and then account name, with their
organizations, each with its first apps. The enterprise's own
accounts have no organization (`team_id` is null) and come last.
`owner` narrows the list, and `total_count`, to one kind of owner.
Admins only.

## Query parameters

- `per_page` integer
- `cursor` string
- `page` integer
- `owner` 'enterprise' | 'organization'
- `sort` 'account' | '-account' | 'organization' | '-organization' | 'created_by' | '-created_by' | 'last_used' | '-last_used'

## Response `200`

One page of service accounts.

- object: The paging fields of a page of an enterprise list.
  - `total_count` integer, required: How many items the whole list holds.
  - `next_cursor` string: The cursor of the next page; absent on the last page.
  - `teams` EnterpriseTeam[], required
    - `id` integer, required
    - `name` string, required
    - `member_count` integer, required
    - `app_count` integer, required
    - `default_role` 'viewer' | 'developer', required: A role a default organization joins people at.
    - `apps` EnterpriseAppSummary[], required
      - `id` string, required
      - `display_name` string, required
  - `apps` EnterpriseAppSummary[], required
    - `id` string, required
    - `display_name` string, required
  - `service_accounts` EnterpriseServiceAccount[], required
    - `user_id` integer, required
    - `name` string, required
    - `team_id` integer, nullable, required: The organization that owns the account, or null when the enterprise does.
    - `role` 'owner' | 'admin' | 'appManager' | 'developer' | 'viewer' | 'auditor' | 'scim' | 'none', required: A role that a user can have relative to an Organization or App.
    - `created_at` string, date-time, required
    - `last_auth_at` string, date-time, nullable, required
    - `created_by_email` string, nullable, required

## Other responses

- `default`: Standard error response. Emitted for any non-2xx status where a body can be decoded into an [ErrorResponse].

---

[API](https://skmtc.dev/shorebird/apis/shorebird-codepush-api.md) - [All operations](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/revisions/941da8871d10?raw)
