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

# Rename, change or share a saved search (its author)



## OpenAPI

````yaml /api-reference/openapi.json patch /projects/{projectId}/saved-searches/{searchId}
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /projects/{projectId}/saved-searches/{searchId}:
    patch:
      summary: Rename, change or share a saved search (its author)
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a101
          required: true
          name: projectId
          in: path
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000e001
          required: true
          name: searchId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                query:
                  type: object
                  properties:
                    app_id:
                      type: string
                      pattern: >-
                        ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      description: Only this app of the project.
                    build:
                      type: string
                      enum:
                        - release
                        - debug
                        - all
                      description: >-
                        Which builds: `release` (the default: every build but a
                        debug one, TestFlight included, and data that does not
                        say), `debug` (development builds from Xcode or Android
                        Studio: apsio.app.install.source is `development`), or
                        `all`.
                    filters:
                      type: array
                      items:
                        $ref: '#/components/schemas/ExploreFilter'
                      maxItems: 20
                      default: []
                    kinds:
                      type: array
                      items:
                        type: string
                        enum:
                          - crash
                          - failed_request
                          - hang
                          - error
                          - exit
                          - request
                          - screen
                          - tap
                          - log
                          - span
                      maxItems: 10
                      default: []
                      description: 'Only events of these kinds; none: every kind.'
                    text:
                      type: string
                      minLength: 1
                      maxLength: 200
                      description: >-
                        Events whose text contains this, ignoring case: a log's
                        body and exception, a span's name, route and status
                        message. Plain text, not a pattern.
                  additionalProperties: false
                shared:
                  type: boolean
              additionalProperties: false
      responses:
        '200':
          description: Changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavedSearch'
        '400':
          description: Not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No valid bearer token or console session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Not allowed: not its author, a token changing one, the sandbox, or
            an agent without its grant (grant_required, grant_expired).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WriteRefusal'
        '404':
          description: No such project or saved search (or one only its author sees).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            `plan_limit`: at the limit, 100 shared saved searches a project, or
            100 private ones an author in a project (sharing or making private
            moves a search to the other). `conflict`: making private a search
            that has alerts; delete them first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: >-
            The project or its organization is being deleted (`erasing`); do not
            retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too many writes; try again shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Saved searches are not available here.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    ExploreFilter:
      type: object
      properties:
        field:
          type: string
          pattern: ^[A-Za-z0-9_.:/-]{1,128}$
          description: >-
            A field (event.name or span.name, service.version, os.name,
            os.version, device.model.identifier, session.id, trace_id, ...), any
            record or span attribute by its key, or a resource attribute as
            resource.<key>.
          example: service.version
        op:
          type: string
          enum:
            - eq
            - neq
            - prefix
            - exists
            - not_exists
          default: eq
          description: >-
            eq and neq compare with value, prefix matches values that start with
            it; exists and not_exists need none.
        value:
          type: string
          maxLength: 256
      required:
        - field
    SavedSearch:
      type: object
      properties:
        id:
          type: string
        project_id:
          type: string
        name:
          type: string
          description: 'Untrusted text: render it as text.'
        query:
          $ref: '#/components/schemas/SearchQuery'
        shared:
          type: boolean
          description: Seen by the whole project; false, by its author only.
        created_by:
          type:
            - string
            - 'null'
          description: Its author; null for a token.
        updated_by:
          type:
            - string
            - 'null'
        updated_via:
          type: string
          enum:
            - console
            - token
            - oauth
            - mcp
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - project_id
        - name
        - query
        - shared
        - created_by
        - updated_by
        - updated_via
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
            subject:
              type: string
              enum:
                - organization
                - project
              description: >-
                With `erasing` (410) only: what is being deleted, the
                organization or the project.
            queries_per_minute:
              type: integer
              description: >-
                With `rate_limited` (429) from run_query only: the project's
                queries a minute.
          required:
            - code
            - message
      required:
        - error
    WriteRefusal:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: grant_required
            message:
              type: string
            grant_url:
              type: string
              description: >-
                grant_required and grant_expired for an OAuth client: the
                console page (Settings > Agents and tokens) where the user gives
                this client the capability.
          required:
            - code
            - message
      required:
        - error
    SearchQuery:
      type: object
      properties:
        app_id:
          type: string
          pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          description: Only this app of the project.
        build:
          type: string
          enum:
            - release
            - debug
            - all
          description: >-
            Which builds: `release` (the default: every build but a debug one,
            TestFlight included, and data that does not say), `debug`
            (development builds from Xcode or Android Studio:
            apsio.app.install.source is `development`), or `all`.
        filters:
          type: array
          items:
            $ref: '#/components/schemas/ExploreFilter'
          maxItems: 20
          default: []
        kinds:
          type: array
          items:
            type: string
            enum:
              - crash
              - failed_request
              - hang
              - error
              - exit
              - request
              - screen
              - tap
              - log
              - span
          maxItems: 10
          default: []
          description: 'Only events of these kinds; none: every kind.'
        text:
          type: string
          minLength: 1
          maxLength: 200
          description: >-
            Events whose text contains this, ignoring case: a log's body and
            exception, a span's name, route and status message. Plain text, not
            a pattern.
      description: >-
        Search's query without a range: run it with POST /explore/events over
        the range you want. Its words and values are untrusted text.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        A project token (apsio_pt_v0...), which reads exactly one project, or an
        OAuth access token issued for the API, which reads what its user can.
        Access tokens issued for Apsio's MCP server are accepted only from the
        MCP server itself.

````

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