> ## Documentation Index
> Fetch the complete documentation index at: https://conductorone-docs-ia-reframe-draft.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Graph

> SearchGraph performs a server-side BFS traversal and returns a bounded, filtered subgraph.
 Exactly one of user_id, app_id, or resource_id must be set.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/search/graph
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/search/graph:
    post:
      tags:
        - App Entitlement
      summary: Search Graph
      description: >-
        SearchGraph performs a server-side BFS traversal and returns a bounded,
        filtered subgraph.
         Exactly one of user_id, app_id, or resource_id must be set.
      operationId: c1.api.app.v1.AppEntitlementSearchService.SearchGraph
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/c1.api.app.v1.AppEntitlementSearchServiceSearchGraphRequest
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.app.v1.AppEntitlementSearchServiceSearchGraphResponse
          description: SearchGraph response. Contains a subgraph of nodes and edges.
      x-codeSamples:
        - lang: go
          label: SearchGraph
          source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/shared\"\n\tconductoronesdkgo \"github.com/conductorone/conductorone-sdk-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := conductoronesdkgo.New(\n        conductoronesdkgo.WithSecurity(shared.Security{\n            BearerAuth: \"<YOUR_BEARER_TOKEN_HERE>\",\n            Oauth: \"<YOUR_OAUTH_HERE>\",\n        }),\n    )\n\n    res, err := s.AppEntitlementSearch.SearchGraph(ctx, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.AppEntitlementSearchServiceSearchGraphResponse != nil {\n        // handle response\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: >-
            import { ConductoroneSDKTypescript } from
            "conductorone-sdk-typescript";


            const conductoroneSDKTypescript = new ConductoroneSDKTypescript({
              security: {
                bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
                oauth: "<YOUR_OAUTH_HERE>",
              },
            });


            async function run() {
              const result = await conductoroneSDKTypescript.appEntitlementSearch.searchGraph();

              console.log(result);
            }


            run();
components:
  schemas:
    c1.api.app.v1.AppEntitlementSearchServiceSearchGraphRequest:
      description: >-
        SearchGraph request. Builds a filtered access graph starting from a root
        entity.
         Exactly one of user_id, app_id, or resource_id must be set.
         Server validates this constraint and returns InvalidArgument if violated.
      properties:
        appId:
          description: The appId field.
          type: string
        appIds:
          description: Filters — all optional, applied at every traversal hop
          items:
            type: string
          type:
            - array
            - 'null'
        entitlementIds:
          description: The entitlementIds field.
          items:
            type: string
          type:
            - array
            - 'null'
        entitlementNameQuery:
          description: The entitlementNameQuery field.
          type: string
        maxDepth:
          description: Traversal controls
          format: int32
          type: integer
        maxFanOut:
          description: >-
            Legacy per-parent fan-out limit. Superseded by max_nodes and
            server-computed
             per-parent budgets, but still honored for callers that set it.
          format: int32
          type: integer
        maxNodes:
          description: >-
            Overall node budget for the returned subgraph. 0 uses the server
            default.
          format: int32
          type: integer
        pageSize:
          description: >-
            Legacy traversal page size. Superseded by max_nodes, but still
            honored for
             callers that set it.
          format: int32
          type: integer
        pageToken:
          description: >-
            Legacy pagination token. Superseded by max_nodes-based traversal,
            but still
             honored for callers that set it.
          type: string
        resourceId:
          description: The resourceId field.
          type: string
        resourceIds:
          description: The resourceIds field.
          items:
            type: string
          type:
            - array
            - 'null'
        resourceNameQuery:
          description: The resourceNameQuery field.
          type: string
        resourceTypeIds:
          description: The resourceTypeIds field.
          items:
            type: string
          type:
            - array
            - 'null'
        userId:
          description: Root entity — exactly one must be set
          type: string
      title: App Entitlement Search Service Search Graph Request
      type: object
      x-speakeasy-name-override: AppEntitlementSearchServiceSearchGraphRequest
    c1.api.app.v1.AppEntitlementSearchServiceSearchGraphResponse:
      description: SearchGraph response. Contains a subgraph of nodes and edges.
      properties:
        edges:
          description: The edges field.
          items:
            $ref: '#/components/schemas/c1.api.app.v1.GraphEdge'
          type:
            - array
            - 'null'
        hasMore:
          description: The hasMore field.
          type: boolean
        nodeCeilingHit:
          description: |-
            True if the server-side node budget stopped the traversal before it
             finished walking the graph. Distinct from has_more, which can also be set
             by a request timeout or scan limit.
          type: boolean
        nodes:
          description: The nodes field.
          items:
            $ref: '#/components/schemas/c1.api.app.v1.GraphNode'
          type:
            - array
            - 'null'
        pageToken:
          description: The pageToken field.
          type: string
        pathsReturned:
          description: The pathsReturned field.
          format: int32
          type: integer
        truncatedNodeIds:
          description: The truncatedNodeIds field.
          items:
            type: string
          type:
            - array
            - 'null'
      title: App Entitlement Search Service Search Graph Response
      type: object
      x-speakeasy-name-override: AppEntitlementSearchServiceSearchGraphResponse
    c1.api.app.v1.GraphEdge:
      description: An edge in the access graph.
      properties:
        hiddenChildren:
          description: The hiddenChildren field.
          format: int32
          type: integer
        isTruncated:
          description: The isTruncated field.
          type: boolean
        sourceId:
          description: The sourceId field.
          type: string
        targetId:
          description: The targetId field.
          type: string
        type:
          description: The type field.
          enum:
            - GRAPH_EDGE_TYPE_UNSPECIFIED
            - GRAPH_EDGE_TYPE_IDENTITY_LINK
            - GRAPH_EDGE_TYPE_DIRECT_GRANT
            - GRAPH_EDGE_TYPE_APP_HIERARCHY
            - GRAPH_EDGE_TYPE_RESOURCE_HIERARCHY
            - GRAPH_EDGE_TYPE_PROXY_BINDING
          type: string
          x-speakeasy-unknown-values: allow
      title: Graph Edge
      type: object
      x-speakeasy-name-override: GraphEdge
    c1.api.app.v1.GraphNode:
      description: A node in the access graph.
      properties:
        appId:
          description: The appId field.
          type: string
        displayName:
          description: The displayName field.
          type: string
        id:
          description: The id field.
          type: string
        resourceTypeId:
          description: The resourceTypeId field.
          type: string
        secondaryText:
          description: >-
            Optional secondary line shown under the display name (e.g. an
            account's
             email/username, or an identity's email).
          type: string
        type:
          description: The type field.
          enum:
            - GRAPH_NODE_TYPE_UNSPECIFIED
            - GRAPH_NODE_TYPE_USER
            - GRAPH_NODE_TYPE_APP_USER
            - GRAPH_NODE_TYPE_APP
            - GRAPH_NODE_TYPE_RESOURCE_TYPE
            - GRAPH_NODE_TYPE_RESOURCE
            - GRAPH_NODE_TYPE_ENTITLEMENT
            - GRAPH_NODE_TYPE_GRANT
          type: string
          x-speakeasy-unknown-values: allow
      title: Graph Node
      type: object
      x-speakeasy-name-override: GraphNode
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````