> ## 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 Requestable Roles

> List roles that are available for requesting access. Returns roles with their access policy IDs so callers can look up policy constraints (max duration, justification requirements) via the Access Policy API.



## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml get /v2/requestable-roles
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 Session 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: 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/requestable-roles:
    get:
      tags:
        - Access Request API
      summary: List Requestable Roles
      description: >-
        List roles that are available for requesting access. Returns roles with
        their access policy IDs so callers can look up policy constraints (max
        duration, justification requirements) via the Access Policy API.
      operationId: svrelay.publicv2.PublicAPIServiceV2.ListRequestableRoles
      parameters:
        - name: teamId
          in: query
          description: The ID of the team. Required.
          required: true
          schema:
            type: string
            title: team_id
            description: The ID of the team. Required.
        - name: targetUserId
          in: query
          description: |-
            The ID of the user to check requestable roles for.
             Defaults to the authenticated user if omitted.
          schema:
            type: string
            title: target_user_id
            description: |-
              The ID of the user to check requestable roles for.
               Defaults to the authenticated user if omitted.
        - name: pageSize
          in: query
          description: >-
            Maximum number of results to return. Default is 100, maximum is
            1000.
          schema:
            type: integer
            title: page_size
            format: int32
            description: >-
              Maximum number of results to return. Default is 100, maximum is
              1000.
        - name: pageToken
          in: query
          description: Token for pagination. Leave empty for the first request.
          schema:
            type: string
            title: page_token
            description: Token for pagination. Leave empty for the first request.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svflow.publicapi.ListRequestableRolesResponse
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
      security:
        - BearerAuth: []
components:
  schemas:
    svflow.publicapi.ListRequestableRolesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/svflow.pubapimodels.RequestableRole'
          title: data
          description: The list of requestable roles with their access policies.
          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: ListRequestableRolesResponse
      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.RequestableRole:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/svflow.pubapimodels.Role'
          title: role
          description: The role that can be requested.
          x-stainless-terraform-configurability: optional
        accessPolicy:
          $ref: '#/components/schemas/svflow.pubapimodels.AccessPolicy'
          title: access_policy
          description: |-
            The access policy governing this role's request constraints
             (max duration, recommended duration, justification requirements).
          x-stainless-terraform-configurability: optional
      title: RequestableRole
      additionalProperties: false
      description: |-
        RequestableRole pairs a role with its access policy, giving callers
         everything needed to build an access request form in a single response.
    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.
    svflow.pubapimodels.Role:
      type: object
      properties:
        id:
          type: string
          title: id
          description: The ID of the role.
          readOnly: true
          x-stainless-terraform-configurability: computed
        resourceId:
          type: string
          title: resource_id
          description: The ID of the resource that the role belongs to.
          x-stainless-terraform-configurability: optional
        name:
          type: string
          title: name
          description: The name of the role.
          x-stainless-terraform-configurability: optional
        description:
          type: string
          title: description
          description: A description of the role.
          x-stainless-terraform-configurability: optional
        requestsEnabled:
          type: boolean
          title: requests_enabled
          description: Whether requests are enabled for the role.
          x-stainless-terraform-configurability: computed_optional
        accessPolicyId:
          type: string
          title: access_policy_id
          description: The default access policy for the role.
          nullable: true
          x-stainless-terraform-configurability: optional
        provisioningMethod:
          $ref: '#/components/schemas/svflow.pubapimodels.RoleProvisioningMethod'
          title: provisioning_method
          description: Provisioning configuration. **Exactly one method should be set.**
          x-stainless-terraform-configurability: optional
        externalId:
          type: string
          title: external_id
          description: The external ID of the role in the external system (optional).
          nullable: true
          x-stainless-terraform-configurability: optional
        externalData:
          type: string
          title: external_data
          description: Data from the external system as a JSON string (computed by server).
          nullable: true
          readOnly: true
          x-stainless-terraform-configurability: computed
        requireFormConfirmation:
          type: boolean
          title: require_form_confirmation
          x-stainless-terraform-configurability: computed_optional
        tagIds:
          type: array
          items:
            type: string
          title: tag_ids
          description: IDs of the tags currently attached to this role.
          x-stainless-terraform-configurability: optional
      title: Role
      additionalProperties: false
      description: Role represents a requestable role on an app resource.
    svflow.pubapimodels.AccessPolicy:
      type: object
      properties:
        id:
          type: string
          title: id
          description: The ID of the access policy.
          readOnly: true
          x-stainless-terraform-configurability: computed
        teamId:
          type: string
          title: team_id
          description: The ID of the team that the access policy belongs to.
          x-stainless-terraform-configurability: optional
        name:
          type: string
          title: name
          description: The name of the access policy.
          x-stainless-terraform-configurability: optional
        description:
          type: string
          title: description
          description: A description of the access policy.
          nullable: true
          x-stainless-terraform-configurability: optional
        maxAccessMinutes:
          type: integer
          title: max_access_minutes
          format: int32
          description: The maximum number of minutes that access can be granted for.
          nullable: true
          x-stainless-terraform-configurability: optional
        requireBusinessJustification:
          type: boolean
          title: require_business_justification
          description: Whether a business justification is required when requesting access.
          nullable: true
          x-stainless-terraform-configurability: computed_optional
        recommendedAccessMinutes:
          type: integer
          title: recommended_access_minutes
          format: int32
          description: The recommended duration in minutes for access requests (optional).
          nullable: true
          x-stainless-terraform-configurability: optional
      title: AccessPolicy
      additionalProperties: false
    svflow.pubapimodels.RoleProvisioningMethod:
      type: object
      oneOf:
        - $ref: >-
            #/components/schemas/svflow.pubapimodels.RoleProvisioningMethod.BuiltinWorkflow
        - $ref: >-
            #/components/schemas/svflow.pubapimodels.RoleProvisioningMethod.CustomWorkflow
        - $ref: >-
            #/components/schemas/svflow.pubapimodels.RoleProvisioningMethod.LinkedRoles
        - $ref: >-
            #/components/schemas/svflow.pubapimodels.RoleProvisioningMethod.Manual
      title: RoleProvisioningMethod
      description: |-
        Provisioning configuration for a role.
         Exactly one method should be set.
    svflow.pubapimodels.RoleProvisioningMethod.BuiltinWorkflow:
      type: object
      title: Builtin Workflow
      properties:
        builtinWorkflow:
          $ref: '#/components/schemas/svflow.pubapimodels.BuiltinWorkflowProvisioning'
          title: builtin_workflow
          x-stainless-terraform-configurability: optional
      required:
        - builtinWorkflow
      additionalProperties: false
    svflow.pubapimodels.RoleProvisioningMethod.CustomWorkflow:
      type: object
      title: Custom Workflow
      properties:
        customWorkflow:
          $ref: '#/components/schemas/svflow.pubapimodels.CustomWorkflowProvisioning'
          title: custom_workflow
          x-stainless-terraform-configurability: optional
      required:
        - customWorkflow
      additionalProperties: false
    svflow.pubapimodels.RoleProvisioningMethod.LinkedRoles:
      type: object
      title: Linked Roles
      properties:
        linkedRoles:
          $ref: '#/components/schemas/svflow.pubapimodels.LinkedRolesProvisioning'
          title: linked_roles
          x-stainless-terraform-configurability: optional
      required:
        - linkedRoles
      additionalProperties: false
    svflow.pubapimodels.RoleProvisioningMethod.Manual:
      type: object
      title: Manual
      properties:
        manual:
          $ref: '#/components/schemas/svflow.pubapimodels.ManualProvisioning'
          title: manual
          x-stainless-terraform-configurability: optional
      required:
        - manual
      additionalProperties: false
    svflow.pubapimodels.BuiltinWorkflowProvisioning:
      type: object
      title: BuiltinWorkflowProvisioning
      additionalProperties: false
      description: Provisioning is handled by the service's builtin workflow integration.
    svflow.pubapimodels.CustomWorkflowProvisioning:
      type: object
      properties:
        provisionWorkflowId:
          type: string
          title: provision_workflow_id
          description: The workflow ID to provision access.
          x-stainless-terraform-configurability: optional
        deprovisionWorkflowId:
          type: string
          title: deprovision_workflow_id
          description: The workflow ID to deprovision access.
          x-stainless-terraform-configurability: optional
      title: CustomWorkflowProvisioning
      additionalProperties: false
      description: Provisioning is handled by custom workflows for provision + deprovision.
    svflow.pubapimodels.LinkedRolesProvisioning:
      type: object
      properties:
        linkedRoleIds:
          type: array
          items:
            type: string
          title: linked_role_ids
          description: The IDs of prerequisite roles.
          x-stainless-terraform-configurability: optional
      title: LinkedRolesProvisioning
      additionalProperties: false
      description: Provisioning depends on prerequisite roles being provisioned first.
    svflow.pubapimodels.ManualProvisioning:
      type: object
      properties:
        assignees:
          type: array
          items:
            $ref: >-
              #/components/schemas/svflow.pubapimodels.ManualProvisioningAssignee
          title: assignees
          description: >-
            Users and groups that should be assigned/notified for manual
            provisioning.
          x-stainless-terraform-configurability: optional
      title: ManualProvisioning
      additionalProperties: false
      description: Provisioning is handled manually by assigned users/groups.
    svflow.pubapimodels.ManualProvisioningAssignee:
      type: object
      properties:
        assigneeId:
          type: string
          title: assignee_id
          description: The ID of the user or group.
          x-stainless-terraform-configurability: optional
        assigneeType:
          $ref: >-
            #/components/schemas/svflow.pubapimodels.ManualProvisioningAssigneeType
          title: assignee_type
          description: The type of assignee.
          x-stainless-terraform-configurability: optional
      title: ManualProvisioningAssignee
      additionalProperties: false
    svflow.pubapimodels.ManualProvisioningAssigneeType:
      type: string
      title: ManualProvisioningAssigneeType
      enum:
        - MANUAL_PROVISIONING_ASSIGNEE_TYPE_UNSPECIFIED
        - MANUAL_PROVISIONING_ASSIGNEE_TYPE_USER
        - MANUAL_PROVISIONING_ASSIGNEE_TYPE_GROUP
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````