deepset Cloud API - Files
Uploads, lists, and deletes files in a workspace, updates file metadata, and manages chunked upload sessions for indexing into pipelines and indexes.
Uploads, lists, and deletes files in a workspace, updates file metadata, and manages chunked upload sessions for indexing into pipelines and indexes.
openapi: 3.0.1
info:
title: deepset Cloud API (deepset AI Platform)
description: >-
Hosted REST API for the deepset AI Platform (deepset Cloud), the commercial
product built on the open-source Haystack framework. The API lets you manage
workspaces, create and deploy Haystack pipelines, upload and index files, and
run searches against deployed pipelines. All resource endpoints are prefixed
with /api/v1 and authenticated with a Bearer API key generated in the platform
UI. The open-source Haystack framework itself is a Python library, not a hosted
REST API; this specification models only the documented deepset Cloud REST
endpoints.
termsOfService: https://www.deepset.ai/terms-of-service
contact:
name: deepset Support
url: https://docs.cloud.deepset.ai
version: '1.0'
servers:
- url: https://api.cloud.deepset.ai
description: European deployment
- url: https://api.us.deepset.ai
description: US deployment
security:
- bearerAuth: []
tags:
- name: Workspaces
description: Manage workspaces that isolate pipelines and data.
- name: Pipelines
description: Create, list, deploy, and undeploy Haystack pipelines.
- name: Search
description: Run queries against deployed pipelines.
- name: Files
description: Upload, list, delete, and annotate files; manage upload sessions.
paths:
/api/v1/workspaces:
get:
operationId: listWorkspaces
tags:
- Workspaces
summary: List workspaces
description: Returns the workspaces available to the authenticated organization.
responses:
'200':
description: A list of workspaces.
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceList'
post:
operationId: createWorkspace
tags:
- Workspaces
summary: Create a workspace
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateWorkspaceRequest'
responses:
'201':
description: The created workspace.
content:
application/json:
schema:
$ref: '#/components/schemas/Workspace'
/api/v1/workspaces/{workspace_name}:
get:
operationId: getWorkspace
tags:
- Workspaces
summary: Get a workspace
parameters:
- $ref: '#/components/parameters/WorkspaceName'
responses:
'200':
description: The requested workspace.
content:
application/json:
schema:
$ref: '#/components/schemas/Workspace'
delete:
operationId: deleteWorkspace
tags:
- Workspaces
summary: Delete a workspace
parameters:
- $ref: '#/components/parameters/WorkspaceName'
responses:
'204':
description: Workspace deleted.
/api/v1/workspaces/{workspace_name}/pipelines:
get:
operationId: listPipelines
tags:
- Pipelines
summary: List pipelines
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- name: limit
in: query
schema:
type: integer
- name: page_number
in: query
schema:
type: integer
responses:
'200':
description: A paginated list of pipelines.
content:
application/json:
schema:
$ref: '#/components/schemas/PipelineList'
post:
operationId: createPipeline
tags:
- Pipelines
summary: Create a pipeline
description: >-
Creates a pipeline in the workspace from a Haystack pipeline YAML
definition supplied as the binary request body.
parameters:
- $ref: '#/components/parameters/WorkspaceName'
requestBody:
required: true
content:
application/x-yaml:
schema:
type: string
format: binary
responses:
'201':
description: The created pipeline.
content:
application/json:
schema:
$ref: '#/components/schemas/Pipeline'
/api/v1/workspaces/{workspace_name}/pipelines/{pipeline_name}:
get:
operationId: getPipeline
tags:
- Pipelines
summary: Get a pipeline
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/PipelineName'
responses:
'200':
description: The requested pipeline.
content:
application/json:
schema:
$ref: '#/components/schemas/Pipeline'
delete:
operationId: deletePipeline
tags:
- Pipelines
summary: Delete a pipeline
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/PipelineName'
responses:
'204':
description: Pipeline deleted.
/api/v1/workspaces/{workspace_name}/pipelines/{pipeline_name}/deploy:
post:
operationId: deployPipeline
tags:
- Pipelines
summary: Deploy a pipeline
description: Deploys the pipeline so it can serve search requests.
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/PipelineName'
responses:
'200':
description: Deployment accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/Pipeline'
/api/v1/workspaces/{workspace_name}/pipelines/{pipeline_name}/undeploy:
post:
operationId: undeployPipeline
tags:
- Pipelines
summary: Undeploy a pipeline
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/PipelineName'
responses:
'200':
description: Undeployment accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/Pipeline'
/api/v1/workspaces/{workspace_name}/pipelines/{pipeline_name}/search:
post:
operationId: searchPipeline
tags:
- Search
summary: Run a search
description: >-
Runs one or more queries against a deployed pipeline and returns answers
and the documents retrieved by the pipeline.
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/PipelineName'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SearchRequest'
responses:
'200':
description: Search results.
content:
application/json:
schema:
$ref: '#/components/schemas/SearchResponse'
/api/v1/workspaces/{workspace_name}/files:
get:
operationId: listFiles
tags:
- Files
summary: List files
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- name: limit
in: query
schema:
type: integer
responses:
'200':
description: A paginated list of files.
content:
application/json:
schema:
$ref: '#/components/schemas/FileList'
post:
operationId: uploadFile
tags:
- Files
summary: Upload a file
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- name: write_mode
in: query
description: How to handle a file that already exists, e.g. OVERWRITE.
schema:
type: string
enum:
- KEEP
- OVERWRITE
- FAIL
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/FileUpload'
responses:
'201':
description: The uploaded file.
content:
application/json:
schema:
$ref: '#/components/schemas/File'
/api/v1/workspaces/{workspace_name}/files/{file_id}:
delete:
operationId: deleteFile
tags:
- Files
summary: Delete a file
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/FileId'
responses:
'204':
description: File deleted.
/api/v1/workspaces/{workspace_name}/files/{file_id}/meta:
patch:
operationId: updateFileMeta
tags:
- Files
summary: Update file metadata
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/FileId'
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: true
responses:
'200':
description: Updated file metadata.
content:
application/json:
schema:
$ref: '#/components/schemas/File'
/api/v1/workspaces/{workspace_name}/upload_sessions:
post:
operationId: createUploadSession
tags:
- Files
summary: Create an upload session
description: Opens a session for chunked uploads of many files.
parameters:
- $ref: '#/components/parameters/WorkspaceName'
responses:
'201':
description: The created upload session.
content:
application/json:
schema:
$ref: '#/components/schemas/UploadSession'
/api/v1/workspaces/{workspace_name}/upload_sessions/{session_id}:
get:
operationId: getUploadSession
tags:
- Files
summary: Get upload session details
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/SessionId'
responses:
'200':
description: Upload session details.
content:
application/json:
schema:
$ref: '#/components/schemas/UploadSession'
put:
operationId: closeUploadSession
tags:
- Files
summary: Close an upload session
parameters:
- $ref: '#/components/parameters/WorkspaceName'
- $ref: '#/components/parameters/SessionId'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
status:
type: string
enum:
- CLOSED
responses:
'200':
description: The closed upload session.
content:
application/json:
schema:
$ref: '#/components/schemas/UploadSession'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: API key generated in the deepset AI Platform UI, sent as a Bearer token.
parameters:
WorkspaceName:
name: workspace_name
in: path
required: true
schema:
type: string
PipelineName:
name: pipeline_name
in: path
required: true
schema:
type: string
FileId:
name: file_id
in: path
required: true
schema:
type: string
format: uuid
SessionId:
name: session_id
in: path
required: true
schema:
type: string
format: uuid
schemas:
WorkspaceList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Workspace'
total:
type: integer
Workspace:
type: object
properties:
workspace_id:
type: string
format: uuid
name:
type: string
languages:
type: object
additionalProperties: true
CreateWorkspaceRequest:
type: object
required:
- name
properties:
name:
type: string
PipelineList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Pipeline'
total:
type: integer
Pipeline:
type: object
properties:
pipeline_id:
type: string
format: uuid
name:
type: string
status:
type: string
description: Deployment status, e.g. DEPLOYED, UNDEPLOYED, FAILED.
created_at:
type: string
format: date-time
SearchRequest:
type: object
required:
- queries
properties:
queries:
type: array
items:
type: string
filters:
type: object
additionalProperties: true
description: Optional metadata filters (field, operator, value).
params:
type: object
additionalProperties: true
description: Optional per-component runtime parameters.
debug:
type: boolean
SearchResponse:
type: object
properties:
query_id:
type: string
format: uuid
results:
type: array
items:
type: object
properties:
query:
type: string
answers:
type: array
items:
$ref: '#/components/schemas/Answer'
documents:
type: array
items:
$ref: '#/components/schemas/Document'
Answer:
type: object
properties:
answer:
type: string
score:
type: number
document_ids:
type: array
items:
type: string
Document:
type: object
properties:
id:
type: string
content:
type: string
score:
type: number
meta:
type: object
additionalProperties: true
FileList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/File'
total:
type: integer
File:
type: object
properties:
file_id:
type: string
format: uuid
name:
type: string
size:
type: integer
meta:
type: object
additionalProperties: true
created_at:
type: string
format: date-time
FileUpload:
type: object
properties:
file:
type: string
format: binary
meta:
type: string
description: JSON string of metadata to attach to the file.
UploadSession:
type: object
properties:
session_id:
type: string
format: uuid
status:
type: string
enum:
- OPEN
- CLOSED
created_at:
type: string
format: date-time