Prefect SavedSearches API

Interact with a Workspace's Saved Searches.

OpenAPI Specification

prefect-savedsearches-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Prefect Cloud Account Billing SavedSearches API
  description: Prefect Cloud REST API documentation.
  version: 0.8.4
tags:
- name: SavedSearches
  description: Interact with a Workspace's Saved Searches.
paths:
  /api/accounts/{account_id}/workspaces/{workspace_id}/saved_searches/:
    put:
      tags:
      - SavedSearches
      summary: Create Saved Search
      description: 'Gracefully creates a new saved search from the provided schema.


        If a saved search with the same name already exists, the saved search''s fields are

        replaced.


        Required workspace scopes: `manage_saved_search`'
      operationId: create_saved_search_api_accounts__account_id__workspaces__workspace_id__saved_searches__put
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavedSearchCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavedSearch'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/accounts/{account_id}/workspaces/{workspace_id}/saved_searches/{id}:
    get:
      tags:
      - SavedSearches
      summary: Read Saved Search
      description: 'Get a saved search by id.


        Required workspace scopes: `see_flows`'
      operationId: read_saved_search_api_accounts__account_id__workspaces__workspace_id__saved_searches__id__get
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The saved search id
          title: Id
        description: The saved search id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavedSearch'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - SavedSearches
      summary: Delete Saved Search
      description: 'Delete a saved search by id.


        Required workspace scopes: `manage_saved_search`'
      operationId: delete_saved_search_api_accounts__account_id__workspaces__workspace_id__saved_searches__id__delete
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The saved search id
          title: Id
        description: The saved search id
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/accounts/{account_id}/workspaces/{workspace_id}/saved_searches/filter:
    post:
      tags:
      - SavedSearches
      summary: Read Saved Searches
      description: 'Query for saved searches.


        Required workspace scopes: `see_flows`'
      operationId: read_saved_searches_api_accounts__account_id__workspaces__workspace_id__saved_searches_filter_post
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: x-prefect-api-version
        in: header
        required: false
        schema:
          type: string
          title: X-Prefect-Api-Version
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Body_read_saved_searches_api_accounts__account_id__workspaces__workspace_id__saved_searches_filter_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SavedSearch'
                title: Response Read Saved Searches Api Accounts  Account Id  Workspaces  Workspace Id  Saved Searches Filter Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SavedSearch:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created
        updated:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated
        name:
          type: string
          title: Name
          description: The name of the saved search.
        filters:
          items:
            $ref: '#/components/schemas/SavedSearchFilter'
          type: array
          title: Filters
          description: The filter set for the saved search.
      type: object
      required:
      - name
      title: SavedSearch
      description: An ORM representation of saved search data. Represents a set of filter criteria.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Body_read_saved_searches_api_accounts__account_id__workspaces__workspace_id__saved_searches_filter_post:
      properties:
        offset:
          type: integer
          minimum: 0.0
          title: Offset
          default: 0
        limit:
          type: integer
          title: Limit
          description: Defaults to PREFECT_ORION_API_DEFAULT_LIMIT if not provided.
      type: object
      title: Body_read_saved_searches_api_accounts__account_id__workspaces__workspace_id__saved_searches_filter_post
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    SavedSearchFilter:
      properties:
        object:
          type: string
          title: Object
          description: The object over which to filter.
        property:
          type: string
          title: Property
          description: The property of the object on which to filter.
        type:
          type: string
          title: Type
          description: The type of the property.
        operation:
          type: string
          title: Operation
          description: The operator to apply to the object. For example, `equals`.
        value:
          title: Value
          description: A JSON-compatible value for the filter.
      type: object
      required:
      - object
      - property
      - type
      - operation
      - value
      title: SavedSearchFilter
      description: A filter for a saved search model. Intended for use by the Prefect UI.
    SavedSearchCreate:
      properties:
        name:
          type: string
          maxLength: 5000
          title: Name
          description: The name of the saved search.
        filters:
          items:
            $ref: '#/components/schemas/SavedSearchFilter'
          type: array
          title: Filters
          description: The filter set for the saved search.
      additionalProperties: false
      type: object
      required:
      - name
      title: SavedSearchCreate
      description: Data used by the Orion API to create a saved search.