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

# List Access Relationships

> List access relationships for a subject (app instance, resource, role, or team).



## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml get /v2/access-relationships
openapi: 3.1.0
info:
  title: Serval Public API
  description: Serval Public API
  contact:
    name: Serval
    url: https://serval.com
    email: support@serval.com
  license:
    name: Serval License
    url: https://serval.com/license
  version: 2.0.0
servers:
  - url: https://public.api.serval.com
security:
  - BearerAuth: []
tags:
  - name: Access Policy API
  - name: Access Policy Approval Procedure API
  - name: Access Profile API
  - name: Access Relationship API
  - name: Access Request API
  - name: Agent API
  - name: App Instance API
  - name: App Resource API
  - name: App Resource Role API
  - name: Approval Delegation API
  - name: Approval Request API
  - name: Audit Log API
  - name: Change Blackout API
  - name: Change Model API
  - name: Custom Field API
  - name: Custom Service API
  - name: Entity API
  - name: Entity Field Mapping API
  - name: Entity Ingestion Config API
  - name: Entity Type API
  - name: Folder API
  - name: Group API
  - name: Guidance API
  - name: Help Agent API
  - name: Journey API
  - name: Knowledge API
  - name: Knowledge Base API
  - name: Report API
  - name: SLA API
  - name: Schedule API
  - name: Tag API
  - name: Team API
  - name: Team User API
  - name: Ticket API
  - name: Topic API
  - name: User API
  - name: User Relationship API
  - name: Workflow API
  - name: Workflow Approval Procedure API
  - name: Workflow Run API
paths:
  /v2/access-relationships:
    get:
      tags:
        - Access Relationship API
      summary: List Access Relationships
      description: >-
        List access relationships for a subject (app instance, resource, role,
        or team).
      operationId: svrelay.publicv2.PublicAPIServiceV2.ListAccessRelationships
      parameters:
        - name: subjectType
          in: query
          description: The kind of subject to list relationships for.
          required: true
          schema:
            $ref: >-
              #/components/schemas/svflow.common.models.AccessRelationshipSubjectType
            title: subject_type
            description: The kind of subject to list relationships for.
        - name: subjectId
          in: query
          description: >-
            The ID of the subject (app_instance_id | resource_id |
            entitlement_id |
             team_id), disambiguated by subject_type.
          required: true
          schema:
            type: string
            title: subject_id
            description: >-
              The ID of the subject (app_instance_id | resource_id |
              entitlement_id |
               team_id), disambiguated by subject_type.
        - name: targetId
          in: query
          description: Filter by target ID (user or group ID).
          schema:
            type: string
            title: target_id
            description: Filter by target ID (user or group ID).
        - name: targetType
          in: query
          description: Filter by target type.
          schema:
            $ref: >-
              #/components/schemas/svflow.common.models.AccessRelationshipTargetType
            title: target_type
            description: Filter by target type.
        - name: relationshipType
          in: query
          description: Filter by relationship type.
          schema:
            $ref: '#/components/schemas/svflow.common.models.AccessRelationshipType'
            title: relationship_type
            description: Filter by relationship type.
        - name: pageSize
          in: query
          description: Maximum number of results to return per page.
          schema:
            type: integer
            title: page_size
            format: int32
            description: Maximum number of results to return per page.
        - name: pageToken
          in: query
          description: Token for retrieving the next page of results.
          schema:
            type: string
            title: page_token
            description: Token for retrieving the next page of results.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svflow.publicapi.ListAccessRelationshipsResponse
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
      security:
        - BearerAuth: []
components:
  schemas:
    svflow.common.models.AccessRelationshipSubjectType:
      type: string
      title: AccessRelationshipSubjectType
      enum:
        - ACCESS_RELATIONSHIP_SUBJECT_TYPE_UNSPECIFIED
        - ACCESS_RELATIONSHIP_SUBJECT_TYPE_APP_INSTANCE
        - ACCESS_RELATIONSHIP_SUBJECT_TYPE_RESOURCE
        - ACCESS_RELATIONSHIP_SUBJECT_TYPE_ENTITLEMENT
        - ACCESS_RELATIONSHIP_SUBJECT_TYPE_TEAM
      description: |-
        The kind of entity a relationship is on. Generalizes the former
         app_relationships model (app_instance subjects only) so resources, roles
         (entitlements), and teams can have owners too.
    svflow.common.models.AccessRelationshipTargetType:
      type: string
      title: AccessRelationshipTargetType
      enum:
        - ACCESS_RELATIONSHIP_TARGET_TYPE_UNSPECIFIED
        - ACCESS_RELATIONSHIP_TARGET_TYPE_USER
        - ACCESS_RELATIONSHIP_TARGET_TYPE_GROUP
    svflow.common.models.AccessRelationshipType:
      type: string
      title: AccessRelationshipType
      enum:
        - ACCESS_RELATIONSHIP_TYPE_UNSPECIFIED
        - ACCESS_RELATIONSHIP_TYPE_OWNER
    svflow.publicapi.ListAccessRelationshipsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/svflow.pubapimodels.AccessRelationship'
          title: data
          description: The list of access relationships.
          x-stainless-terraform-configurability: optional
        nextPageToken:
          type: string
          title: next_page_token
          description: >-
            Token for retrieving the next page of results. Empty if no more
            results.
          nullable: true
          x-stainless-terraform-configurability: optional
      title: ListAccessRelationshipsResponse
      additionalProperties: false
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          x-stainless-terraform-configurability: optional
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
          x-stainless-terraform-configurability: optional
        detail:
          $ref: '#/components/schemas/google.protobuf.Any'
          x-stainless-terraform-configurability: optional
      title: Connect Error
      additionalProperties: true
      description: >-
        Error type returned by Connect:
        https://connectrpc.com/docs/go/errors/#http-representation
    svflow.pubapimodels.AccessRelationship:
      type: object
      properties:
        id:
          type: string
          title: id
          description: The ID of the access relationship.
          readOnly: true
          x-stainless-terraform-configurability: computed
        relationshipType:
          $ref: '#/components/schemas/svflow.common.models.AccessRelationshipType'
          title: relationship_type
          description: The type of the relationship.
          x-stainless-terraform-configurability: optional
        targetId:
          type: string
          title: target_id
          description: The ID of the target (user or group).
          x-stainless-terraform-configurability: optional
        targetType:
          $ref: >-
            #/components/schemas/svflow.common.models.AccessRelationshipTargetType
          title: target_type
          description: The type of the target.
          x-stainless-terraform-configurability: optional
        createdAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
          description: The timestamp when the relationship was created.
          readOnly: true
          x-stainless-terraform-configurability: computed
        subjectType:
          $ref: >-
            #/components/schemas/svflow.common.models.AccessRelationshipSubjectType
          title: subject_type
          description: The kind of subject this relationship is on.
          x-stainless-terraform-configurability: optional
        subjectId:
          type: string
          title: subject_id
          description: >-
            The ID of the subject (app_instance_id | resource_id |
            entitlement_id |
             team_id), disambiguated by subject_type.
          x-stainless-terraform-configurability: optional
      title: AccessRelationship
      additionalProperties: false
    google.protobuf.Any:
      type: object
      properties:
        type:
          type: string
          x-stainless-terraform-configurability: optional
        value:
          type: string
          format: binary
          x-stainless-terraform-configurability: optional
        debug:
          type: object
          additionalProperties: true
          x-stainless-terraform-configurability: optional
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
    google.protobuf.Timestamp:
      type: string
      format: date-time
      description: A timestamp in RFC 3339 format (e.g., "2025-01-15T01:30:15Z").
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````