---
title: "List the organization's service accounts."
method: GET
path: "/organizations/{organizationId}/service-accounts"
tags: ["service-accounts"]
---

# List the organization's service accounts.

`GET /organizations/{organizationId}/service-accounts`

## Request

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

Every service account the organization owns, oldest first.

Requires the `serviceAccounts.view` permission, which only the
`admin` and `owner` roles hold.

## Query parameters

- `per_page` integer
- `cursor` string
- `page` integer

## Response `200`

The organization's service accounts.

- GetServiceAccountsResponse: The response body for GET /organizations/{organizationId}/service-accounts.
  - `service_accounts` ServiceAccount[], required: The organization's service accounts, oldest first.
    - `id` integer, required: The service account's ID, which is also its user ID.
    - `organization_id` integer, required: The organization that owns the service account.
    - `name` string, required: The service account's name.
    - `label` string, required: The name the service account is shown by, `name[bot]`.
    - `role` 'viewer' | 'developer' | 'appManager' | 'auditor', required: A role a service account can hold in its organization: a subset of `Role`. Never `admin` or `owner`, so a leaked key cannot manage the organization's members or its other service accounts.
    - `created_at` string, date-time, required: When the service account was created.
    - `created_by_user_id` integer, nullable, required: The user who created the service account, or null once that user has been deleted.
    - `created_by_email` string, nullable, required: The email of the user who created the service account, or null once that user has been deleted.
    - `last_auth_at` string, date-time, nullable, required: When the service account last authenticated, or null if it never has. Refreshed at most once a day.
  - `next_cursor` string: The opaque cursor of the next page; send it back as `cursor` to get that page. Present only when the request was paginated (sent `per_page`, `cursor` or `page`) and another page follows. Absent on the last page and on unpaginated responses.
  - `total_count` integer: How many items the whole list holds. Present only when the request was paginated.

## Other responses

- `400`: The organization id is not an integer (`organization_id_malformed`).
- `403`: The caller lacks the `serviceAccounts.view` permission.
- `404`: No such organization, or the caller is not a member of it (`organization_membership_guard_error`).
- `424`: A database read failed (`service_account_database_error`, or `organization_membership_guard_error` while checking membership).
- `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)
