Oneschema Sheets API

Sheets operations

OpenAPI Specification

oneschema-sheets-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OneSchema AWS Secrets Manager AWS Secrets Manager Accounts Sheets API
  version: '1'
  description: Configure AWS Secrets Manager account connections and managed secret references for use in Multi FileFeeds.
  contact:
    name: OneSchema Support
    email: support@oneschema.co
  termsOfService: https://www.oneschema.co/terms-and-conditions
  license:
    name: proprietary
    url: https://www.oneschema.co/terms-and-conditions
servers:
- url: https://api.oneschema.co
  description: Production server (hosted in the US)
- url: https://api.eu.oneschema.co
  description: Production server (hosted in the EU)
- url: https://api.ca.oneschema.co
  description: Production server (hosted in Canada)
- url: https://api.au.oneschema.co
  description: Production server (hosted in Australia)
security:
- ApiKeyAuth: []
tags:
- name: Sheets
  description: Sheets operations
paths:
  /v1/sheets/{sheet_id}:
    delete:
      operationId: delete-sheet
      summary: Delete a sheet
      description: Delete a sheet with the given sheet_id.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: embed_id
        in: query
        required: false
        description: The id of the embed which contains the sheet.
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
    get:
      operationId: get-sheet
      summary: Get a sheet
      description: Retrieve a sheet with the given sheet_id.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sheet-resource'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
    patch:
      operationId: update-sheet
      summary: Update a sheet
      description: Update the name and/or custom_metadata of a sheet.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sheet-update-request'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sheet-resource'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/export-file-async/{format}:
    post:
      operationId: export-file-async
      summary: Export as file (async)
      description: Create an asynchronous job to export the sheet in the given format.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: format
        in: path
        required: true
        description: The format of the exported file.
        schema:
          type: string
          enum:
          - csv
          - excel
          - json
          - jsonl
          - parquet
      - name: row_filter
        in: query
        required: false
        description: Which rows should be included in the export.
        schema:
          type: string
          enum:
          - all
          - clean
          - errors
          default: all
        explode: false
      - name: include_unmapped
        in: query
        required: false
        description: If unmapped columns should be included in the exported file.
        schema:
          type: boolean
          default: false
        explode: false
      - name: warning_behavior
        in: query
        required: false
        description: How warnings should be treated during export.
        schema:
          type: string
          enum:
          - importAsError
          - importAsClean
          default: importAsError
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/export-job-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/export-file/csv:
    post:
      operationId: export-file-csv
      summary: Export as CSV file
      description: Create a CSV file with the contents of the sheet.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: row_filter
        in: query
        required: false
        description: Which rows should be included in the export.
        schema:
          type: string
          enum:
          - all
          - clean
          - errors
          default: all
        explode: false
      - name: include_unmapped
        in: query
        required: false
        description: If unmapped columns should be included in the exported file.
        schema:
          type: boolean
          default: false
        explode: false
      - name: embed_id
        in: query
        required: true
        description: '[importer only] The id of the embed which contains the sheet.'
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/download-url-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/export-file/excel:
    post:
      operationId: export-file-excel
      summary: Export as Excel file
      description: Create an Excel file with the contents of the sheet.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: row_filter
        in: query
        required: false
        description: Which rows should be included in the export.
        schema:
          type: string
          enum:
          - all
          - clean
          - errors
          default: all
        explode: false
      - name: include_unmapped
        in: query
        required: false
        description: If unmapped columns should be included in the exported file.
        schema:
          type: boolean
          default: false
        explode: false
      - name: embed_id
        in: query
        required: true
        description: '[importer only] The id of the embed which contains the sheet.'
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/download-url-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/export-file/json:
    post:
      operationId: export-file-json
      summary: Export as JSON file
      description: Create a JSON file with the contents of the sheet.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: include_unmapped
        in: query
        required: false
        description: If unmapped columns should be included in the exported file.
        schema:
          type: boolean
          default: false
        explode: false
      - name: embed_id
        in: query
        required: true
        description: '[importer only] The id of the embed which contains the sheet.'
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/download-url-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/export-file/jsonlines:
    post:
      operationId: export-file-jsonlines
      summary: Export as JSONL file
      description: Create a JSONL file with the contents of the sheet.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: include_unmapped
        in: query
        required: false
        description: If unmapped columns should be included in the exported file.
        schema:
          type: boolean
          default: false
        explode: false
      - name: row_filter
        in: query
        required: false
        description: Which rows should be included in the export.
        schema:
          type: string
          enum:
          - all
          - clean
          - errors
          default: all
        explode: false
      - name: embed_id
        in: query
        required: false
        description: '[importer only] The id of the embed which contains the sheet.'
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/download-url-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/exports/{export_file_id}/download-url:
    get:
      operationId: get-export-download-url
      summary: Get export download URL
      description: Retrieve a pre-signed download URL for an exported file.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: export_file_id
        in: path
        required: true
        description: The id of the export file.
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/export-download-url-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/export-file-async/jobs/{export_job_id}:
    get:
      operationId: get-export-job-status
      summary: Get export job status
      description: Retrieve the status of an asynchronous export job.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: export_job_id
        in: path
        required: true
        description: The id of the export job.
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/export-job-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/mapping:
    get:
      operationId: get-mapping
      summary: Get a sheet's mapping
      description: Retrieve the current mapping of the sheet's columns to the template's columns.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: embed_id
        in: query
        required: false
        description: The id of the embed which contains the sheet.
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sheet-mapping'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
    post:
      operationId: map-columns
      summary: Map sheet columns
      description: Map the sheet columns to template columns and trigger validation for the mapped columns.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: embed_id
        in: query
        required: false
        description: The id of the embed which contains the sheet.
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: 'Successful response. The primary way to verify the request''s success or failure is the response status code.

            In a future API version this endpoint may not return any response body at all.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/map-columns-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/map-columns-request'
  /v1/sheets/{sheet_id}/rows:
    get:
      operationId: get-rows
      summary: Get rows
      description: Return paginated rows from the sheet.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: start_row
        in: query
        required: false
        description: The (0-based) row index of the first row to include.
        schema:
          type: integer
          format: int32
          default: 0
        explode: false
      - name: count
        in: query
        required: false
        description: The number of rows to retrieve (default is all rows).
        schema:
          type: integer
          format: int32
        explode: false
      - name: include_unmapped
        in: query
        required: false
        description: If unmapped columns should be included in the exported file.
        schema:
          type: boolean
          default: false
        explode: false
      - name: embed_id
        in: query
        required: false
        description: The id of the embed which contains the sheet.
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
  /v1/sheets/{sheet_id}/header-row:
    post:
      operationId: set-header-row
      summary: Set the header row
      description: Set which row of the sheet contains column headers, or use auto-detection.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet
        schema:
          type: integer
          format: int32
      - name: embed_id
        in: query
        required: false
        description: The id of the embed which contains the sheet.
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/set-header-row-request'
  /v1/sheets/{sheet_id}/unmap:
    post:
      operationId: unmap-sheet
      summary: Unmap a sheet
      description: Entirely unmap the sheet from its template.
      parameters:
      - name: sheet_id
        in: path
        required: true
        description: The id of the sheet.
        schema:
          type: integer
          format: int32
      - name: embed_id
        in: query
        required: false
        description: The id of the embed which contains the sheet.
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/success-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
  /v1/sheets:
    post:
      operationId: upload-file
      summary: Upload a CSV or Excel file
      description: 'Upload a CSV (.csv) or Excel (.xlsx) file into OneSchema.

        The file should be sent as `multipart/form-data` and include the filename and the file''s media type.


        If no `embed_id` is provided, the file is uploaded into the Workspaces product. Without a `workspace_id`, it goes into your default team workspace; pass a `workspace_id` to target a specific workspace. Provide `embed_id` only when you want to import the file into a specific Embed instead.'
      parameters:
      - name: sheet_name
        in: query
        required: false
        description: If importing an Excel spreadsheet, the name of the sheet that should be imported.
        schema:
          type: string
        explode: false
      - name: workspace_id
        in: query
        required: false
        description: '[Legacy] The OneSchema id of the workspace to import into. If no workspace id is specified, the default team workspace is used.'
        schema:
          type: integer
          format: int32
        explode: false
      - name: embed_id
        in: query
        required: false
        description: The id of the Embed which the file will be imported into. Omit this to upload into the Workspaces product instead of an Embed.
        schema:
          type: integer
          format: int32
        explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/upload-file-response'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-response'
      tags:
      - Sheets
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/sheet-file-upload-request'
            encoding:
              file:
                contentType: application/octet-stream
components:
  schemas:
    mapping-sheet-column:
      type: object
      required:
      - id
      properties:
        id:
          type: integer
          format: int32
          description: The unique identifier of the sheet column.
        template_column_key:
          type:
          - string
          - 'null'
          description: The key of the template column this sheet column is mapped to, if any.
    download-url-response:
      type: object
      properties:
        download_url:
          type: string
          examples:
          - https://s3.amazonaws.com/XXX
    sheet-mapping:
      type: object
      properties:
        template_key:
          type:
          - string
          - 'null'
          description: The unique key of the template assigned to the sheet, if any.
        sheet_columns:
          type: array
          description: The sheet columns and their current template mappings.
          items:
            $ref: '#/components/schemas/mapping-sheet-column'
        template_columns:
          type: array
          description: The template columns and the sheet columns mapped to each one.
          items:
            $ref: '#/components/schemas/mapping-template-column'
    empty-response:
      type: object
      properties: {}
    sheet-file-upload-request:
      type: object
      properties:
        file:
          description: The contents of the file you are importing.
          format: binary
          type: string
      required:
      - file
    upload-file-response:
      type: object
      properties:
        sheets:
          type: array
          items:
            $ref: '#/components/schemas/sheet-resource'
    sheet-resource:
      type: object
      required:
      - id
      - workspace_id
      - name
      properties:
        id:
          type: integer
          format: int32
          description: The unique identifier of the sheet.
        workspace_id:
          type: integer
          format: int32
          description: The id of the Workspace that contains the sheet.
        name:
          type: string
          description: The name of the sheet.
        template_key:
          type:
          - string
          - 'null'
          description: The unique key of the template assigned to the sheet, if any.
        custom_metadata:
          type:
          - object
          - 'null'
          description: Custom metadata associated with the sheet.
        columns:
          type: array
          description: The columns of the sheet, included when the sheet's headers have been set.
          items:
            $ref: '#/components/schemas/sheet-column'
    set-header-row-request:
      type: object
      required:
      - index
      properties:
        index:
          type: string
          description: Set this to the (0-based) index of the row which includes the headers, or "auto" to automatically detect and set the header row.
          default: auto
    sheet-update-request:
      type: object
      anyOf:
      - required:
        - name
      - required:
        - custom_metadata
      properties:
        name:
          type: string
          minLength: 1
          description: The new name of the sheet.
        custom_metadata:
          type:
          - object
          - 'null'
          description: Custom metadata associated with the sheet. Must be a flat object with non-reserved keys.
          additionalProperties:
            type:
            - string
            - number
            - boolean
            - 'null'
    export-job-response:
      type: object
      properties:
        id:
          type: integer
          description: The id of the export job.
        status:
          type: string
          enum:
          - RUNNING
          - SUCCESS
          - ERROR
          description: The status of the export job.
        sheet_export_id:
          type: integer
          description: The id of the resulting export file (available when status is SUCCESS).
    success-response:
      type: object
      properties:
        success:
          type: boolean
          examples:
          - true
          default: true
    mapping-template-column:
      type: object
      required:
      - key
      properties:
        key:
          type: string
          description: The key of the template column.
        mapped_to:
          type: array
          description: The ids of the sheet columns mapped to this template column.
          items:
            type: integer
            format: int32
    map-columns-response:
      type: object
      properties:
        success:
          type: boolean
          examples:
          - true
          default: true
    map-columns-request:
      type: object
      properties:
        overrides:
          type: array
          items:
            $ref: '#/components/schemas/ColumnOverride'
          description: These mappings will override mappings created automatically. Either column_id or column_name must be specified. If template_column_key is null, the sheet column will not be mapped.
        autofix:
          type: boolean
          description: Whether to autofix errors after the mapping step. This is akin to clicking the "Fix all formatting errors" button.
          default: false
        strategies:
          type: array
          items:
            type: string
          description: Which mapping strategies to use in which order. Values are `exact`, `hint` (Alternative column names for mapping), `fuzzy`, `historical_user`, and `historical_org`. If `historical_user` and `historical_org` should be used it's preferred to provide `historical` instead.
          default:
          - exact
          - hint
    export-download-url-response:
      type: object
      properties:
        download_url:
          type: string
          description: The pre-signed URL to download the exported file.
    ColumnOverride:
      type: object
      required:
      - template_column_key
      properties:
        column_id:
          type: integer
          format: int32
          description: The id of the sheet column.
        column_name:
          type: string
          description: The label of the sheet column.
        template_column_key:
          anyOf:
          - type: string
          - type: 'null'
          description: The key of the template column.
    sheet-column:
      type: object
      required:
      - id
      - name
      properties:
        id:
          type: integer
          format: int32
          description: The unique identifier of the column.
        name:
          type: string
          description: The label of the column.
        template_column_key:
          type:
          - string
          - 'null'
          description: The key of the template column this sheet column is mapped to, if any.
        is_custom:
          type: boolean
          description: Whether the column is a custom column not present in the assigned template.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY