Rapidata Datapoints API

The Datapoints API from Rapidata — 4 operation(s) for datapoints.

OpenAPI Specification

rapidata-datapoints-api-openapi.yml Raw ↑
openapi: 3.0.4
info:
  title: Rapidata Asset Datapoints API
  description: The API for the Rapidata Asset service
  version: v1
servers:
- url: https://api.rapidata.ai/
tags:
- name: Datapoints
  x-displayName: Datapoints
paths:
  /dataset/{datasetId}/datapoint:
    post:
      tags:
      - Datapoints
      summary: Creates a new datapoint in the specified dataset.
      parameters:
      - name: datasetId
        in: path
        description: The id of the dataset to create the datapoint in.
        required: true
        schema:
          type: string
      requestBody:
        description: The datapoint model containing asset, metadata, and sort index.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDatapointEndpoint_Input'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDatapointEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /datapoint/{datapointId}:
    delete:
      tags:
      - Datapoints
      summary: Deletes the specified datapoint.
      parameters:
      - name: datapointId
        in: path
        description: The unique identifier of the datapoint to delete.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
    get:
      tags:
      - Datapoints
      summary: Gets the details of a datapoint by its id.
      parameters:
      - name: datapointId
        in: path
        description: The id of the datapoint to get.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDatapointEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /dataset/{datasetId}/datapoints/failed:
    get:
      tags:
      - Datapoints
      summary: Gets a list of all datapoints that failed to upload.
      description: "A datapoint usually fails to upload when using a deferred upload mechanism such as when providing a URL\n and the URL is not accessible."
      parameters:
      - name: datasetId
        in: path
        description: The id of the dataset to get the failed datapoints of.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFailedDatapointsEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /dataset/{datasetId}/datapoints:
    get:
      tags:
      - Datapoints
      summary: Queries all datapoints of a dataset.
      parameters:
      - name: datasetId
        in: path
        description: The id of the dataset to get the datapoints of.
        required: true
        schema:
          type: string
      - name: page
        in: query
        description: The 1-based page index.
        schema:
          type: integer
        x-parameter-group: page
      - name: page_size
        in: query
        description: The number of items per page.
        schema:
          type: integer
        x-parameter-group: page
      - name: sort
        in: query
        description: Sort fields. Prefix with - for descending order (e.g. -created_at).
        schema:
          type: array
          items:
            enum:
            - id
            - -id
            - created_at
            - -created_at
            type: string
        x-parameter-group: sort
      - name: id
        in: query
        description: Filter by id.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: created_at
        in: query
        description: Filter by created_at.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: logic
        in: query
        description: 'How to combine the field filters: "and" (default) requires every filter to match, "or" requires any of them to match.'
        schema:
          enum:
          - and
          - or
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryDatapointsByDatasetIdEndpoint_PagedResultOfOutput'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
components:
  schemas:
    MetadataModelCollection:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/IMetadataModel'
    IMetadataModelClassificationMetadataModel:
      required:
      - classification
      - _t
      properties:
        _t:
          enum:
          - ClassificationMetadata
          type: string
        classification:
          type: string
    IMetadataModelTextMetadataModel:
      required:
      - text
      - _t
      properties:
        _t:
          enum:
          - TextMetadata
          type: string
        text:
          type: string
          nullable: true
    MetadataVisibilities:
      type: array
      items:
        enum:
        - None
        - Users
        - Customers
        - Admins
        - Dashboard
        - All
        type: string
    IAssetModelNullAssetModel:
      required:
      - metadata
      - identifier
      - _t
      properties:
        _t:
          enum:
          - NullAsset
          type: string
        metadata:
          $ref: '#/components/schemas/MetadataModelCollection'
        identifier:
          type: string
    IAssetInputMultiAssetInput:
      required:
      - assets
      - _t
      properties:
        _t:
          enum:
          - MultiAssetInput
          type: string
        assets:
          type: array
          items:
            $ref: '#/components/schemas/IAssetInput'
        metadata:
          type: object
          oneOf:
          - $ref: '#/components/schemas/MetadataInputCollection'
          nullable: true
        identifier:
          type: string
          nullable: true
    IMetadataModelFileTypeMetadataModel:
      required:
      - fileType
      - _t
      properties:
        _t:
          enum:
          - FileTypeMetadata
          type: string
        fileType:
          $ref: '#/components/schemas/FileType'
    IMetadataModel:
      required:
      - _t
      type: object
      oneOf:
      - $ref: '#/components/schemas/IMetadataModelClassificationMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelCountMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelFileTypeMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelImageDimensionMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelLocationMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelOriginalFilenameMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelSourceUrlMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelStreamsMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelTextMetadataModel'
      - $ref: '#/components/schemas/IMetadataModelVideoDurationMetadataModel'
      discriminator:
        propertyName: _t
        mapping:
          ClassificationMetadata: '#/components/schemas/IMetadataModelClassificationMetadataModel'
          CountMetadata: '#/components/schemas/IMetadataModelCountMetadataModel'
          FileTypeMetadata: '#/components/schemas/IMetadataModelFileTypeMetadataModel'
          ImageDimensionMetadata: '#/components/schemas/IMetadataModelImageDimensionMetadataModel'
          LocationMetadata: '#/components/schemas/IMetadataModelLocationMetadataModel'
          OriginalFilenameMetadata: '#/components/schemas/IMetadataModelOriginalFilenameMetadataModel'
          SourceUrlMetadataModel: '#/components/schemas/IMetadataModelSourceUrlMetadataModel'
          StreamsMetadata: '#/components/schemas/IMetadataModelStreamsMetadataModel'
          TextMetadata: '#/components/schemas/IMetadataModelTextMetadataModel'
          VideoDurationMetadata: '#/components/schemas/IMetadataModelVideoDurationMetadataModel'
    IAssetModelMultiAssetModel:
      required:
      - assets
      - metadata
      - identifier
      - _t
      properties:
        _t:
          enum:
          - MultiAsset
          type: string
        assets:
          type: array
          items:
            $ref: '#/components/schemas/IAssetModel'
        metadata:
          $ref: '#/components/schemas/MetadataModelCollection'
        identifier:
          type: string
    IMetadataModelSourceUrlMetadataModel:
      required:
      - url
      - _t
      properties:
        _t:
          enum:
          - SourceUrlMetadataModel
          type: string
        url:
          type: string
    IMetadataModelVideoDurationMetadataModel:
      required:
      - duration
      - _t
      properties:
        _t:
          enum:
          - VideoDurationMetadata
          type: string
        duration:
          type: string
          format: date-time
    IMetadataModelStreamsMetadataModel:
      required:
      - hasVideo
      - hasAudio
      - hasSubtitles
      - _t
      properties:
        _t:
          enum:
          - StreamsMetadata
          type: string
        hasVideo:
          type: boolean
        hasAudio:
          type: boolean
        hasSubtitles:
          type: boolean
    GetDatapointEndpoint_Output:
      required:
      - id
      - datasetId
      - state
      - asset
      - createdAt
      type: object
      properties:
        id:
          type: string
          description: The id of the datapoint.
        datasetId:
          type: string
          description: The id of the dataset this datapoint belongs to.
        state:
          allOf:
          - $ref: '#/components/schemas/DatapointState'
          description: The current state of the datapoint.
        asset:
          allOf:
          - $ref: '#/components/schemas/IAssetModel'
          description: The asset that will be displayed to the users.
        sortIndex:
          type: integer
          description: An optional upload index used to force a certain order.
          format: int64
          nullable: true
        createdAt:
          type: string
          description: The timestamp when the datapoint was created.
          format: date-time
    CreateDatapointEndpoint_Output:
      required:
      - datapointId
      type: object
      properties:
        datapointId:
          type: string
          description: The id of the created datapoint.
    GetFailedDatapointsEndpoint_Output:
      required:
      - datapoints
      type: object
      properties:
        datapoints:
          allOf:
          - type: array
            items:
              $ref: '#/components/schemas/GetFailedDatapointsEndpoint_Datapoint'
          description: The list of failed datapoints.
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    IAssetInputTextAssetInput:
      required:
      - text
      - _t
      properties:
        _t:
          enum:
          - TextAssetInput
          type: string
        text:
          type: string
        metadata:
          type: object
          oneOf:
          - $ref: '#/components/schemas/MetadataInputCollection'
          nullable: true
        identifier:
          type: string
          nullable: true
    IAssetModelTextAssetModel:
      required:
      - text
      - metadata
      - identifier
      - _t
      properties:
        _t:
          enum:
          - TextAsset
          type: string
        text:
          type: string
        metadata:
          $ref: '#/components/schemas/MetadataModelCollection'
        identifier:
          type: string
    IMetadataInputTextMetadataInput:
      required:
      - text
      - visibilities
      - _t
      properties:
        _t:
          enum:
          - TextMetadataInput
          type: string
        text:
          type: string
          nullable: true
        visibilities:
          $ref: '#/components/schemas/MetadataVisibilities'
    DatapointState:
      enum:
      - Ready
      - Pending
      - Failed
    IAssetInput:
      required:
      - _t
      type: object
      oneOf:
      - $ref: '#/components/schemas/IAssetInputExistingAssetInput'
      - $ref: '#/components/schemas/IAssetInputMultiAssetInput'
      - $ref: '#/components/schemas/IAssetInputTextAssetInput'
      discriminator:
        propertyName: _t
        mapping:
          ExistingAssetInput: '#/components/schemas/IAssetInputExistingAssetInput'
          MultiAssetInput: '#/components/schemas/IAssetInputMultiAssetInput'
          TextAssetInput: '#/components/schemas/IAssetInputTextAssetInput'
    IMetadataModelOriginalFilenameMetadataModel:
      required:
      - originalFilename
      - _t
      properties:
        _t:
          enum:
          - OriginalFilenameMetadata
          type: string
        originalFilename:
          type: string
    IAssetModel:
      required:
      - _t
      type: object
      oneOf:
      - $ref: '#/components/schemas/IAssetModelFileAssetModel'
      - $ref: '#/components/schemas/IAssetModelMultiAssetModel'
      - $ref: '#/components/schemas/IAssetModelNullAssetModel'
      - $ref: '#/components/schemas/IAssetModelTextAssetModel'
      discriminator:
        propertyName: _t
        mapping:
          FileAsset: '#/components/schemas/IAssetModelFileAssetModel'
          MultiAsset: '#/components/schemas/IAssetModelMultiAssetModel'
          NullAsset: '#/components/schemas/IAssetModelNullAssetModel'
          TextAsset: '#/components/schemas/IAssetModelTextAssetModel'
    QueryDatapointsByDatasetIdEndpoint_PagedResultOfOutput:
      required:
      - total
      - page
      - pageSize
      - items
      type: object
      properties:
        total:
          type: integer
          format: int64
        page:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        items:
          type: array
          items:
            $ref: '#/components/schemas/QueryDatapointsByDatasetIdEndpoint_Output'
        totalPages:
          type: integer
          format: int32
    FileType:
      enum:
      - Unknown
      - Image
      - Video
      - Audio
    QueryDatapointsByDatasetIdEndpoint_Output:
      required:
      - id
      - datasetId
      - asset
      type: object
      properties:
        id:
          type: string
          description: The id of the datapoint.
        datasetId:
          type: string
          description: The id of the dataset this datapoint belongs to.
        asset:
          allOf:
          - $ref: '#/components/schemas/IAssetModel'
          description: The asset that will be displayed to the users.
    MetadataInputCollection:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/IMetadataInput'
    IMetadataModelImageDimensionMetadataModel:
      required:
      - _t
      properties:
        _t:
          enum:
          - ImageDimensionMetadata
          type: string
        height:
          type: integer
          format: int32
        width:
          type: integer
          format: int32
    IMetadataModelCountMetadataModel:
      required:
      - count
      - _t
      properties:
        _t:
          enum:
          - CountMetadata
          type: string
        count:
          type: integer
          format: int32
    IMetadataModelLocationMetadataModel:
      required:
      - x
      - y
      - _t
      properties:
        _t:
          enum:
          - LocationMetadata
          type: string
        x:
          type: number
          format: float
        y:
          type: number
          format: float
    CreateDatapointEndpoint_Input:
      required:
      - asset
      type: object
      properties:
        asset:
          allOf:
          - $ref: '#/components/schemas/IAssetInput'
          description: The asset within the datapoint.
        context:
          type: string
          description: An additional context to show the users when solving the rapid.
          nullable: true
        contextAsset:
          allOf:
          - $ref: '#/components/schemas/IAssetInput'
          description: An optional asset context for the datapoint.
        sortIndex:
          type: integer
          description: The sort index represents the order of the datapoint in the dataset.
          format: int64
          nullable: true
        group:
          type: string
          description: The group a datapoint belongs to.
          nullable: true
        transcription:
          type: string
          description: For audio or video assets, an optional transcription of the content.
          nullable: true
        privateMetadata:
          allOf:
          - type: object
            additionalProperties:
              type: string
            nullable: true
          description: Private metadata for internal tracking. Not displayed to users.
      description: The body request for creating a new datapoint.
    GetFailedDatapointsEndpoint_Datapoint:
      required:
      - id
      - datasetId
      - sortIndex
      - asset
      - createdAt
      type: object
      properties:
        id:
          type: string
        datasetId:
          type: string
        sortIndex:
          type: integer
          format: int64
          nullable: true
        asset:
          $ref: '#/components/schemas/IAssetModel'
        createdAt:
          type: string
          format: date-time
    IMetadataInput:
      required:
      - _t
      type: object
      oneOf:
      - $ref: '#/components/schemas/IMetadataInputTextMetadataInput'
      discriminator:
        propertyName: _t
        mapping:
          TextMetadataInput: '#/components/schemas/IMetadataInputTextMetadataInput'
    IAssetInputExistingAssetInput:
      required:
      - name
      - _t
      properties:
        _t:
          enum:
          - ExistingAssetInput
          type: string
        name:
          type: string
        metadata:
          type: object
          oneOf:
          - $ref: '#/components/schemas/MetadataInputCollection'
          nullable: true
        identifier:
          type: string
          nullable: true
    IAssetModelFileAssetModel:
      required:
      - fileName
      - metadata
      - identifier
      - _t
      properties:
        _t:
          enum:
          - FileAsset
          type: string
        fileName:
          type: string
        metadata:
          $ref: '#/components/schemas/MetadataModelCollection'
        identifier:
          type: string
  securitySchemes:
    OpenIdConnect:
      type: openIdConnect
      description: OpenID Connect connection flow
      openIdConnectUrl: https://auth.rapidata.ai/.well-known/openid-configuration
x-tagGroups:
- name: Rapidata Asset API
  tags:
  - Asset
  - BatchUpload
- name: Rapidata Audience API
  tags:
  - Audience
  - Examples
- name: Rapidata Campaign API
  tags:
  - Cache
  - Campaign
  - ExternalAudience
- name: Rapidata Dataset API
  tags:
  - ContextShortening
  - Datapoints
  - Dataset
  - DatasetGroup
- name: Rapidata Flow API
  tags:
  - Flow
  - FlowItem
  - RankingFlow
  - RankingFlowItem
- name: Rapidata Identity API
  tags:
  - Rapidata.Identity.API
  - Client
  - Customer
  - Identity
  - Newsletter
  - Organization
  - Survey
- name: Rapidata Leaderboard API
  tags:
  - Benchmark
  - SampleGeneration
  - Faucet
  - Replicate
  - Leaderboard
  - Participant
  - Prompt
  - Sample
- name: Rapidata Order API
  tags:
  - Feedback
  - Job
  - Order
- name: Rapidata Payment API
  tags:
  - Billing
  - ExternalServicePrices
  - Reconciliation
  - Settings
  - VolumeDiscount
  - BillingAccount
  - Invoice
  - Payment
- name: Rapidata Pipeline API
  tags:
  - Pipeline
- name: Rapidata Rapid API
  tags:
  - CustomerRapid
  - GlobalText
  - Rapid
  - UserRapid
  - ValidationFeedback
- name: Rapidata Signal API
  tags:
  - Signal
- name: Rapidata Translation API
  tags:
  - Translation
- name: Rapidata Validation API
  tags:
  - ValidationSet
- name: Rapidata Workflow API
  tags:
  - Evaluation
  - GroupedRanking
  - Ranking
  - SimpleWorkflow
  - Workflow