> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Service Accounts

> List service accounts. Returns metadata and display prefixes only - never hashes or plaintext.



## OpenAPI

````yaml get /service-accounts
openapi: 3.1.0
info:
  title: Agno API Reference
  description: The all-in-one, private, secure agent platform that runs in your cloud.
  version: 2.7.2
servers: []
security: []
paths:
  /service-accounts:
    get:
      tags:
        - Service Accounts
      summary: List Service Accounts
      description: >-
        List service accounts. Returns metadata and display prefixes only -
        never hashes or plaintext.
      operationId: list_service_accounts_service_accounts_get
      parameters:
        - name: include_revoked
          in: query
          required: false
          schema:
            type: boolean
            default: true
            title: Include Revoked
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Limit
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            default: created_at
            title: Sort By
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            default: desc
            title: Sort Order
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_ServiceAccountResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    PaginatedResponse_ServiceAccountResponse_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ServiceAccountResponse'
          type: array
          title: Data
          description: List of items for the current page
        meta:
          $ref: '#/components/schemas/PaginationInfo'
          description: Pagination metadata
      type: object
      required:
        - data
        - meta
      title: PaginatedResponse[ServiceAccountResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ServiceAccountResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        principal:
          type: string
          title: Principal
          description: >-
            The user_id attached to runs made with this token, e.g.
            'sa:claude-code'
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: >-
            The user this account belongs to; None for workspace-level accounts.
            Distinct from created_by, which records who minted the token.
        token_prefix:
          type: string
          title: Token Prefix
          description: First characters of the token, for display only
        scopes:
          items:
            $ref: '#/components/schemas/ScopeSchema'
          type: array
          title: Scopes
          description: Scopes granted to the token, in the shared RBAC read shape
        created_at:
          type: integer
          title: Created At
        expires_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expires At
        last_used_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last Used At
        revoked_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Revoked At
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
      type: object
      required:
        - id
        - name
        - principal
        - token_prefix
        - created_at
      title: ServiceAccountResponse
      description: Service account metadata. Never includes the token hash or plaintext.
    PaginationInfo:
      properties:
        page:
          type: integer
          minimum: 0
          title: Page
          description: Current page number (0-indexed)
          default: 0
        limit:
          type: integer
          minimum: 1
          title: Limit
          description: Number of items per page
          default: 20
        total_pages:
          type: integer
          minimum: 0
          title: Total Pages
          description: Total number of pages
          default: 0
        total_count:
          type: integer
          minimum: 0
          title: Total Count
          description: Total count of items
          default: 0
        search_time_ms:
          type: number
          minimum: 0
          title: Search Time Ms
          description: Search execution time in milliseconds
          default: 0
      type: object
      title: PaginationInfo
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ScopeSchema:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: >-
            Scope id (always null here; kept for shape parity with the cloud
            RBAC API, which addresses scopes individually)
        raw:
          type: string
          title: Raw
          description: Original scope string, e.g. 'agents:*:run'
        namespace:
          type: string
          title: Namespace
          description: Resource namespace, e.g. 'agents'
        sub_namespace:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Namespace
          description: Specific resource id or wildcard '*'
        permission:
          type: string
          title: Permission
          description: Action, e.g. 'read' / 'run' / 'write'
        value:
          type: string
          title: Value
          description: '''allow'' or ''deny'''
          default: allow
      type: object
      required:
        - raw
        - namespace
        - permission
      title: ScopeSchema
      description: >-
        Read shape for one scope: the parsed RBAC payload shared by every
        scope-bearing API.


        Mirrors the cloud RBAC scope shape ({raw, namespace, sub_namespace,
        permission, value})

        so a frontend renders scopes from any AgentOS API with one integration.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````