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

# List trust rules

> Lists the trust rules you administer.

> [!NOTE]
>
> [Workload identity federation](https://docs.baseten.co/organization/workload-identity.md) is in **Private Preview**.


## OpenAPI

````yaml get /v1/access/trust_rules
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/access/trust_rules:
    get:
      summary: Lists trust rules
      description: >-
        Lists the trust rules you administer: every rule for an organization
        admin, and rules for your teams' service accounts for a team admin.
      parameters:
        - name: cursor
          in: query
          required: false
          description: >-
            Opaque cursor returned by a previous page. Omit to fetch the first
            page.
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Cursor
        - name: limit
          in: query
          required: false
          description: Maximum number of items to return.
          schema:
            default: 100
            maximum: 1000
            minimum: 1
            title: Limit
            type: integer
        - name: name
          in: query
          required: false
          description: Only the rule with this name, ignoring case
          schema:
            anyOf:
              - minLength: 1
                type: string
              - type: 'null'
            default: null
            title: Name
        - name: identity_provider_id
          in: query
          required: false
          description: Only this provider's rules
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Identity Provider Id
        - name: service_account_id
          in: query
          required: false
          description: Only rules for this service account
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Service Account Id
        - name: team_id
          in: query
          required: false
          description: Only rules for this team's service accounts
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Team Id
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTrustRulesV1'
      x-codeSamples:
        - lang: bash
          source: |
            curl --request GET \
            --url https://api.baseten.co/v1/access/trust_rules \
            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/access/trust_rules"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "GET",
                url,
                headers=headers,
                params={'cursor': None, 'name': None, 'identity_provider_id': None, 'service_account_id': None, 'team_id': None}
            )

            print(response.text)
components:
  schemas:
    AccessTrustRulesV1:
      description: A page of trust rules.
      properties:
        items:
          description: Items in this page.
          items:
            $ref: '#/components/schemas/AccessTrustRuleV1'
          title: Items
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponseV1'
          description: Pagination metadata for the page.
      required:
        - items
        - pagination
      title: AccessTrustRulesV1
      type: object
    AccessTrustRuleV1:
      description: Which tokens from an identity provider may act as a service account.
      properties:
        id:
          description: Trust rule ID. Workloads pass it when they exchange a token.
          title: Id
          type: string
        name:
          description: Name, unique in the organization
          title: Name
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Description
          title: Description
        identity_provider_id:
          description: The identity provider whose tokens it accepts
          title: Identity Provider Id
          type: string
        identity_provider_name:
          description: Name of the identity provider
          title: Identity Provider Name
          type: string
        service_account_id:
          description: The service account its tokens act as
          title: Service Account Id
          type: string
        service_account_name:
          description: Name of the service account
          title: Service Account Name
          type: string
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The service account's team. Null for an organization service
            account.
          title: Team Id
        team_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Name of the service account's team. Null for an organization service
            account.
          title: Team Name
        condition:
          description: >-
            A CEL expression over the token's `claims` that must evaluate to
            true. It must pin a specific `claims.sub` in a top-level `&&`
            clause, plus any provider-required checks. Up to 4,096 characters.
          examples:
            - >-
              claims.repository_owner_id == '12345' &&
              claims.sub.startsWith('repo:acme/models:') && claims.ref ==
              'refs/heads/main'
          title: Condition
          type: string
        audience:
          description: >-
            The token's `aud` must equal this, or contain it when `aud` is a
            list. Up to 1,024 characters.
          title: Audience
          type: string
        max_access_token_lifetime_seconds:
          description: Longest lifetime of a token the rule issues, in seconds
          title: Max Access Token Lifetime Seconds
          type: integer
        last_used_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: >-
            Last time a request authenticated with a token the rule issued, to
            within an hour. Null until the first.
          title: Last Used At
        created_by:
          description: ID of the user who created the rule
          title: Created By
          type: string
        created_at:
          description: Time the rule was created
          format: date-time
          title: Created At
          type: string
        updated_at:
          description: Time the rule was last updated
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - name
        - identity_provider_id
        - identity_provider_name
        - service_account_id
        - service_account_name
        - condition
        - audience
        - max_access_token_lifetime_seconds
        - created_by
        - created_at
        - updated_at
      title: AccessTrustRuleV1
      type: object
    PaginationResponseV1:
      properties:
        has_more:
          description: Whether more items exist after this page.
          title: Has More
          type: boolean
        cursor:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Opaque cursor to pass into the next request. Null when there is no
            next page.
          title: Cursor
      required:
        - has_more
      title: PaginationResponseV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````