openapi: 3.1.0 info: title: LangWatch Agents Dataset API version: 1.0.0 description: LangWatch openapi spec servers: - url: https://app.langwatch.ai security: - project_api_key: [] tags: - name: Dataset paths: /api/dataset: get: responses: {} operationId: getApiDataset parameters: - in: query name: page schema: type: integer exclusiveMinimum: 0 default: 1 - in: query name: limit schema: type: integer exclusiveMinimum: 0 maximum: 1000 default: 50 description: List all non-archived datasets for the project (paginated) tags: - Dataset post: responses: {} operationId: postApiDataset parameters: [] description: Create a new dataset requestBody: content: application/json: schema: type: object properties: name: type: string minLength: 1 columnTypes: type: array items: type: object properties: name: type: string type: anyOf: - type: string const: string - type: string const: boolean - type: string const: number - type: string const: date - type: string const: list - type: string const: json - type: string const: spans - type: string const: rag_contexts - type: string const: chat_messages - type: string const: annotations - type: string const: evaluations - type: string const: image required: - name - type default: [] required: - name tags: - Dataset /api/dataset/upload: post: responses: {} operationId: postApiDatasetUpload parameters: [] description: Create a new dataset from an uploaded file (CSV, JSON, JSONL) tags: - Dataset /api/dataset/{slugOrId}: get: responses: '200': description: Success content: application/json: schema: type: object properties: data: type: array items: type: object properties: id: type: string datasetId: type: string projectId: type: string entry: type: object additionalProperties: {} createdAt: type: string updatedAt: type: string required: - id - datasetId - projectId - entry - createdAt - updatedAt required: - data '400': description: Bad Request content: application/json: schema: type: object properties: error: type: string message: type: string required: - error '401': description: Unauthorized content: application/json: schema: type: object properties: error: type: string message: type: string required: - error '404': description: Dataset not found content: application/json: schema: type: object properties: error: type: string message: type: string required: - error '422': description: Unprocessable Entity content: application/json: schema: type: object properties: error: type: string message: type: string required: - error '500': description: Internal Server Error content: application/json: schema: type: object properties: error: type: string message: type: string required: - error operationId: getApiDatasetBySlugOrId parameters: - schema: type: string in: path name: slugOrId required: true description: Get a dataset by its slug or id. tags: - Dataset patch: responses: {} operationId: patchApiDatasetBySlugOrId parameters: - schema: type: string in: path name: slugOrId required: true description: Update a dataset by its slug or id requestBody: content: application/json: schema: type: object properties: name: type: string minLength: 1 columnTypes: type: array items: type: object properties: name: type: string type: anyOf: - type: string const: string - type: string const: boolean - type: string const: number - type: string const: date - type: string const: list - type: string const: json - type: string const: spans - type: string const: rag_contexts - type: string const: chat_messages - type: string const: annotations - type: string const: evaluations - type: string const: image required: - name - type tags: - Dataset delete: responses: {} operationId: deleteApiDatasetBySlugOrId parameters: - schema: type: string in: path name: slugOrId required: true description: Archive a dataset (soft-delete) tags: - Dataset /api/dataset/{slugOrId}/records: post: responses: {} operationId: postApiDatasetBySlugOrIdRecords parameters: - schema: type: string in: path name: slugOrId required: true description: Create records in a dataset in batch requestBody: content: application/json: schema: type: object properties: entries: type: array items: type: object additionalProperties: {} minItems: 1 maxItems: 1000 required: - entries tags: - Dataset get: responses: {} operationId: getApiDatasetBySlugOrIdRecords parameters: - in: query name: page schema: type: integer exclusiveMinimum: 0 default: 1 - in: query name: limit schema: type: integer exclusiveMinimum: 0 maximum: 1000 default: 50 - schema: type: string in: path name: slugOrId required: true description: List records for a dataset (paginated) tags: - Dataset delete: responses: {} operationId: deleteApiDatasetBySlugOrIdRecords parameters: - schema: type: string in: path name: slugOrId required: true description: Delete records from a dataset by IDs requestBody: content: application/json: schema: type: object properties: recordIds: type: array items: type: string minItems: 1 maxItems: 1000 required: - recordIds tags: - Dataset /api/dataset/{slugOrId}/records/{recordId}: patch: responses: {} operationId: patchApiDatasetBySlugOrIdRecordsByRecordId parameters: - schema: type: string in: path name: slugOrId required: true - schema: type: string in: path name: recordId required: true description: Update or create a record in a dataset requestBody: content: application/json: schema: type: object properties: entry: type: object additionalProperties: {} required: - entry tags: - Dataset /api/dataset/{slugOrId}/upload: post: responses: {} operationId: postApiDatasetBySlugOrIdUpload parameters: - schema: type: string in: path name: slugOrId required: true description: Upload a file (CSV, JSON, JSONL) to an existing dataset tags: - Dataset /api/dataset/{slug}/entries: post: responses: {} operationId: postApiDatasetBySlugEntries parameters: - schema: type: string in: path name: slug required: true description: Add entries to a dataset requestBody: content: application/json: schema: $ref: '#/components/schemas/DatasetPostEntries' tags: - Dataset components: schemas: DatasetPostEntries: type: object properties: entries: type: array items: type: object additionalProperties: {} example: - input: hi output: Hello, how can I help you today? required: - entries securitySchemes: project_api_key: type: apiKey in: header name: X-Auth-Token description: 'Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.' admin_api_key: type: http scheme: bearer description: 'Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.'