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

# Grep Space Pages

> Find the lines matching a literal string or a regular expression across your spaces.



## OpenAPI

````yaml /openapi-v1.json post /api/v1/spaces/grep
openapi: 3.1.0
info:
  title: AGO Public API
  version: 1.0.0
  description: Programmatic access to your AGO workspace.
servers:
  - url: https://{tenant_id}.api.useago.com
    description: AGO Public API v1
    variables:
      tenant_id:
        default: your-tenant-id
        description: Your AGO tenant identifier
security: []
paths:
  /api/v1/spaces/grep:
    post:
      tags:
        - Spaces
      summary: Grep Space Pages
      description: >-
        Find the lines matching a literal string or a regular expression across
        your spaces.
      operationId: core_api_v1_controllers_spaces_grep_space_pages
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpaceGrepIn'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceGrepOut'
      security:
        - ScopedAPIKeyAuth: []
components:
  schemas:
    SpaceGrepIn:
      properties:
        pattern:
          description: Text to find in each line. Literal unless regex is true.
          title: Pattern
          type: string
        address:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Search only this space or page subtree: '<space>' for a space root,
            '<space>/<path>' for a page (e.g. 'handbook/onboarding/first-week').
          title: Address
        regex:
          default: false
          description: Read pattern as a POSIX advanced regular expression.
          title: Regex
          type: boolean
        ignore_case:
          default: false
          title: Ignore Case
          type: boolean
        context:
          default: 0
          description: Lines to return before and after each match (0 to 10).
          title: Context
          type: integer
        paths_only:
          default: false
          description: Return matching pages with their match counts only.
          title: Paths Only
          type: boolean
        limit:
          default: 50
          description: Maximum matches (or pages with paths_only), 1 to 50.
          title: Limit
          type: integer
      required:
        - pattern
      title: SpaceGrepIn
      type: object
    SpaceGrepOut:
      properties:
        object:
          default: grep_result
          title: Object
          type: string
        mode:
          title: Mode
          type: string
        data:
          anyOf:
            - items:
                $ref: '#/components/schemas/GrepMatchOut'
              type: array
            - items:
                $ref: '#/components/schemas/GrepPageOut'
              type: array
          title: Data
        has_more:
          title: Has More
          type: boolean
        hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Hint
      required:
        - mode
        - data
        - has_more
      title: SpaceGrepOut
      type: object
    GrepMatchOut:
      properties:
        line:
          title: Line
          type: integer
        text:
          title: Text
          type: string
        text_truncated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Text Truncated
        address:
          title: Address
          type: string
        id:
          title: Id
          type: string
        title:
          title: Title
          type: string
        before:
          anyOf:
            - items:
                $ref: '#/components/schemas/GrepLineOut'
              type: array
            - type: 'null'
          title: Before
        after:
          anyOf:
            - items:
                $ref: '#/components/schemas/GrepLineOut'
              type: array
            - type: 'null'
          title: After
      required:
        - line
        - text
        - address
        - id
        - title
      title: GrepMatchOut
      type: object
    GrepPageOut:
      properties:
        address:
          title: Address
          type: string
        id:
          title: Id
          type: string
        title:
          title: Title
          type: string
        match_count:
          title: Match Count
          type: integer
      required:
        - address
        - id
        - title
        - match_count
      title: GrepPageOut
      type: object
    GrepLineOut:
      properties:
        line:
          title: Line
          type: integer
        text:
          title: Text
          type: string
        text_truncated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Text Truncated
      required:
        - line
        - text
      title: GrepLineOut
      type: object
  securitySchemes:
    ScopedAPIKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.