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

# For each source at a date, the k items it will most likely link to



## OpenAPI

````yaml /api-reference/openapi.json post /v1/databases/{database_id}/recommend
openapi: 3.1.0
info:
  title: tabSutra API
  version: '1.0'
  description: >-
    One pretrained model for forecasting, classification, regression and
    recommendation on tables and databases.
servers:
  - url: https://api.tabsutra.com
security:
  - bearerAuth: []
paths:
  /v1/databases/{database_id}/recommend:
    post:
      summary: For each source at a date, the k items it will most likely link to
      operationId: recommend_v1_databases__database_id__recommend_post
      parameters:
        - name: database_id
          in: path
          required: true
          schema:
            type: string
            title: Database Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecommendRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RecommendRequest:
      properties:
        source_table:
          type: string
          title: Source Table
          description: The table whose rows get a list (customers).
          examples:
            - customers
        dest_table:
          type: string
          title: Dest Table
          description: The table the list is made of (products).
          examples:
            - products
        rows:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Rows
          description: 'The rows to predict: a source and a date.'
        source_column:
          type: string
          title: Source Column
          description: >-
            The column of the rows (and of the links) that holds the source
            table's primary key.
        time_column:
          type: string
          title: Time Column
          description: The column of the rows that holds the date.
        window_days:
          type: number
          exclusiveMinimum: 0
          title: Window Days
          description: The list is of the links in the window_days days after the date.
          examples:
            - 30
        k:
          type: integer
          maximum: 1000
          minimum: 1
          title: K
          description: Items per list.
          default: 10
        link_table:
          anyOf:
            - type: string
            - type: 'null'
          title: Link Table
          description: >-
            A table of the database whose rows are the links (orders): a time
            column and a foreign key to each of the two tables. Give this or
            links.
          examples:
            - orders
        links:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Links
          description: >-
            The links themselves: source, destination and time, one object per
            link.
        dest_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Dest Column
          description: >-
            With links: the column that holds the destination table's primary
            key.
        link_time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Link Time Column
          description: 'With links: the column of their time (default: time_column).'
        id_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Id Column
          description: >-
            A column of the rows that keys the lists (default: the row's
            position).
        explain:
          type: boolean
          default: false
          title: Explain
          description: >-
            Add to each prediction the contribution of each input to it. See
            Explanations.
        explain_top:
          type: integer
          default: 10
          minimum: 1
          maximum: 100
          title: Explain Top
          description: The number of largest contributions returned per prediction.
        explain_class:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Explain Class
          description: >-
            Classification: the class whose probability is explained. Default:
            the predicted label.
        format:
          type: string
          enum:
            - json
            - csv
            - parquet
          default: json
          title: Format
          description: json, or a table with one row per item.
      type: object
      required:
        - source_table
        - dest_table
        - rows
        - source_column
        - time_column
        - window_days
      title: RecommendRequest
    PredictResponse:
      properties:
        predictions:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Predictions
          description: >-
            One object per row, keyed by 'id' (the id column, or the row's
            position).
        report:
          additionalProperties: true
          type: object
          title: Report
      type: object
      required:
        - predictions
        - report
      title: PredictResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as ''Authorization: Bearer <key>''.'

````

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