MechaMental
Api reference

Sources

List sources

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Query Parameters

scope?|

Filter by scope

namespace_id?|

Filter by namespace

include_parent_scopes?Include Parent Scopes

Include workspace sources when filtering by namespace

Defaultfalse
status?|

Filter by processing status

tags?|

Filter by tags (comma-separated)

limit?Limit

Maximum number of items to return (1-200)

Default50
Range1 <= value <= 200
cursor?|

Cursor for pagination (from previous response's next_cursor)

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/sources"
{
  "total": 0,
  "has_more": false,
  "next_cursor": "string",
  "sources": [
    {
      "source_id": "string",
      "workspace_id": "string",
      "namespace_id": "string",
      "source_scope": "workspace",
      "name": "string",
      "description": "string",
      "source_type": "pdf",
      "current_version_id": "string",
      "current_version_number": 0,
      "total_versions": 0,
      "processing_status": "created",
      "total_chunks": 0,
      "is_indexed": true,
      "indexed_at": "string",
      "index_error": "string",
      "index_attempts": 0,
      "embedding_model_id": "string",
      "summary": "string",
      "keywords": [
        "string"
      ],
      "last_used_at": "string",
      "usage_count": 0,
      "tags": [
        "string"
      ],
      "metadata": {},
      "created_at": "string",
      "updated_at": "string",
      "created_by": "string"
    }
  ]
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Create a new source

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "message": "string",
  "source": {
    "source_id": "string",
    "workspace_id": "string",
    "namespace_id": "string",
    "source_scope": "workspace",
    "name": "string",
    "description": "string",
    "source_type": "pdf",
    "current_version_id": "string",
    "current_version_number": 0,
    "total_versions": 0,
    "processing_status": "created",
    "total_chunks": 0,
    "is_indexed": true,
    "indexed_at": "string",
    "index_error": "string",
    "index_attempts": 0,
    "embedding_model_id": "string",
    "summary": "string",
    "keywords": [
      "string"
    ],
    "last_used_at": "string",
    "usage_count": 0,
    "tags": [
      "string"
    ],
    "metadata": {},
    "created_at": "string",
    "updated_at": "string",
    "created_by": "string"
  }
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Ingest raw text directly

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/ingest-text

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources/ingest-text" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "content": "string"  }'
{
  "message": "string",
  "source": {
    "source_id": "string",
    "workspace_id": "string",
    "namespace_id": "string",
    "source_scope": "workspace",
    "name": "string",
    "description": "string",
    "source_type": "pdf",
    "current_version_id": "string",
    "current_version_number": 0,
    "total_versions": 0,
    "processing_status": "created",
    "total_chunks": 0,
    "is_indexed": true,
    "indexed_at": "string",
    "index_error": "string",
    "index_attempts": 0,
    "embedding_model_id": "string",
    "summary": "string",
    "keywords": [
      "string"
    ],
    "last_used_at": "string",
    "usage_count": 0,
    "tags": [
      "string"
    ],
    "metadata": {},
    "created_at": "string",
    "updated_at": "string",
    "created_by": "string"
  }
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Request multi-file upload URLs

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/multi-upload

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources/multi-upload" \  -H "Content-Type: application/json" \  -d '{    "files": [      {}    ]  }'
{
  "uploads": [
    {
      "source_id": "string",
      "version_id": "string",
      "upload_url": "string",
      "upload_expires_at": "string",
      "s3_key": "string"
    }
  ],
  "total_files": 0
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Direct file upload

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/upload

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Header Parameters

authorization?string|null

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources/upload" \  -F file="string"
{
  "message": "string",
  "source": {
    "source_id": "string",
    "workspace_id": "string",
    "namespace_id": "string",
    "source_scope": "workspace",
    "name": "string",
    "description": "string",
    "source_type": "pdf",
    "current_version_id": "string",
    "current_version_number": 0,
    "total_versions": 0,
    "processing_status": "created",
    "total_chunks": 0,
    "is_indexed": true,
    "indexed_at": "string",
    "index_error": "string",
    "index_attempts": 0,
    "embedding_model_id": "string",
    "summary": "string",
    "keywords": [
      "string"
    ],
    "last_used_at": "string",
    "usage_count": 0,
    "tags": [
      "string"
    ],
    "metadata": {},
    "created_at": "string",
    "updated_at": "string",
    "created_by": "string"
  },
  "version_id": "string",
  "processing_started": true
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Get source details

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Query Parameters

include_versions?Include Versions

Include version history

Defaulttrue

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/sources/string"
{
  "source_id": "string",
  "workspace_id": "string",
  "namespace_id": "string",
  "source_scope": "workspace",
  "name": "string",
  "description": "string",
  "source_type": "pdf",
  "current_version_id": "string",
  "current_version_number": 0,
  "total_versions": 0,
  "processing_status": "created",
  "total_chunks": 0,
  "is_indexed": true,
  "indexed_at": "string",
  "index_error": "string",
  "index_attempts": 0,
  "embedding_model_id": "string",
  "summary": "string",
  "keywords": [
    "string"
  ],
  "last_used_at": "string",
  "usage_count": 0,
  "tags": [
    "string"
  ],
  "metadata": {},
  "created_at": "string",
  "updated_at": "string",
  "created_by": "string",
  "default_processing_options": {
    "extraction_method": "direct",
    "enable_ocr": true,
    "enable_layout_extraction": true,
    "chunking_strategy": "fixed_size",
    "chunk_size": 512,
    "chunk_overlap": 50,
    "smart_chunking": false,
    "enable_summarization": false,
    "enable_keyword_extraction": false,
    "indexing_level": "standard"
  },
  "versions": [
    {
      "version_id": "string",
      "source_id": "string",
      "version_number": 0,
      "is_latest": true,
      "file_name": "string",
      "file_size_bytes": 0,
      "content_type": "string",
      "is_raw_text": false,
      "processing_status": "created",
      "processing_error": "string",
      "extraction_method": "direct",
      "total_pages": 0,
      "total_chunks": 0,
      "total_tokens": 0,
      "total_characters": 0,
      "summary": "string",
      "keywords": [
        "string"
      ],
      "processing_options": {
        "extraction_method": "direct",
        "enable_ocr": true,
        "enable_layout_extraction": true,
        "chunking_strategy": "fixed_size",
        "chunk_size": 512,
        "chunk_overlap": 50,
        "smart_chunking": false,
        "enable_summarization": false,
        "enable_keyword_extraction": false,
        "indexing_level": "standard"
      },
      "created_at": "string",
      "processed_at": "string",
      "created_by": "string"
    }
  ]
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Delete source

DELETE
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/v1/orgs/string/workspaces/string/sources/string"
{
  "message": "string",
  "deleted_chunks": 0
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Update source metadata

PUT
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[key: string]?any

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://loading/v1/orgs/string/workspaces/string/sources/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "message": "string",
  "source": {
    "source_id": "string",
    "workspace_id": "string",
    "namespace_id": "string",
    "source_scope": "workspace",
    "name": "string",
    "description": "string",
    "source_type": "pdf",
    "current_version_id": "string",
    "current_version_number": 0,
    "total_versions": 0,
    "processing_status": "created",
    "total_chunks": 0,
    "is_indexed": true,
    "indexed_at": "string",
    "index_error": "string",
    "index_attempts": 0,
    "embedding_model_id": "string",
    "summary": "string",
    "keywords": [
      "string"
    ],
    "last_used_at": "string",
    "usage_count": 0,
    "tags": [
      "string"
    ],
    "metadata": {},
    "created_at": "string",
    "updated_at": "string",
    "created_by": "string"
  }
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

List source versions

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}/versions

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/sources/string/versions"
[
  {
    "version_id": "string",
    "source_id": "string",
    "version_number": 0,
    "is_latest": true,
    "file_name": "string",
    "file_size_bytes": 0,
    "content_type": "string",
    "is_raw_text": false,
    "processing_status": "created",
    "processing_error": "string",
    "extraction_method": "direct",
    "total_pages": 0,
    "total_chunks": 0,
    "total_tokens": 0,
    "total_characters": 0,
    "summary": "string",
    "keywords": [
      "string"
    ],
    "processing_options": {
      "extraction_method": "direct",
      "enable_ocr": true,
      "enable_layout_extraction": true,
      "chunking_strategy": "fixed_size",
      "chunk_size": 512,
      "chunk_overlap": 50,
      "smart_chunking": false,
      "enable_summarization": false,
      "enable_keyword_extraction": false,
      "indexing_level": "standard"
    },
    "created_at": "string",
    "processed_at": "string",
    "created_by": "string"
  }
]
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Get specific version

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}/versions/{version_id}

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id
version_id*Version Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/sources/string/versions/string"
{
  "version_id": "string",
  "source_id": "string",
  "version_number": 0,
  "is_latest": true,
  "file_name": "string",
  "file_size_bytes": 0,
  "content_type": "string",
  "is_raw_text": false,
  "processing_status": "created",
  "processing_error": "string",
  "extraction_method": "direct",
  "total_pages": 0,
  "total_chunks": 0,
  "total_tokens": 0,
  "total_characters": 0,
  "summary": "string",
  "keywords": [
    "string"
  ],
  "processing_options": {
    "extraction_method": "direct",
    "enable_ocr": true,
    "enable_layout_extraction": true,
    "chunking_strategy": "fixed_size",
    "chunk_size": 512,
    "chunk_overlap": 50,
    "smart_chunking": false,
    "enable_summarization": false,
    "enable_keyword_extraction": false,
    "indexing_level": "standard"
  },
  "created_at": "string",
  "processed_at": "string",
  "created_by": "string"
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Request upload URL

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}/upload

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources/string/upload" \  -H "Content-Type: application/json" \  -d '{    "source_id": "string",    "file_name": "string",    "content_type": "string",    "file_size_bytes": 0  }'
{
  "source_id": "string",
  "version_id": "string",
  "upload_url": "string",
  "upload_expires_at": "string",
  "s3_key": "string"
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Confirm upload and start processing

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}/confirm

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Query Parameters

version_id*Version Id

Version ID from upload response

async_processing?Async Processing

Process asynchronously

Defaulttrue
callback_url?|

Webhook URL for completion notification

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources/string/confirm?version_id=string"
null
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Re-index source

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}/reindex

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources/string/reindex" \  -H "Content-Type: application/json" \  -d '{}'
null
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Get processing status

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}/status

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/sources/string/status"
null
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Get download URL

GET
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/{source_id}/download

Path Parameters

org_id*Org Id
workspace_id*Workspace Id
source_id*Source Id

Query Parameters

version_id?|

Specific version to download (defaults to current)

expires_in?Expires In

URL expiration in seconds (1 min to 24 hours)

Default3600
Range60 <= value <= 86400

Header Parameters

authorization?string|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/v1/orgs/string/workspaces/string/sources/string/download"
{
  "source_id": "string",
  "version_id": "string",
  "download_url": "string",
  "expires_in": 0,
  "file_name": "string",
  "content_type": "string",
  "file_size_bytes": 0
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}

Query sources

POST
/v1/orgs/{org_id}/workspaces/{workspace_id}/sources/query

Path Parameters

org_id*Org Id
workspace_id*Workspace Id

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/v1/orgs/string/workspaces/string/sources/query" \  -H "Content-Type: application/json" \  -d '{    "query": "string",    "workspace_id": "string"  }'
{
  "query": "string",
  "results": [
    {
      "source_id": "string",
      "source_name": "string",
      "version_id": "string",
      "chunk_id": "string",
      "chunk_index": 0,
      "content": "string",
      "score": 0,
      "page_number": 0,
      "section_title": "string",
      "chunk_summary": "string",
      "chunk_keywords": [
        "string"
      ],
      "metadata": {}
    }
  ],
  "total_results": 0,
  "combined_context": "string",
  "token_count": 0
}
{
  "error": "AUTHENTICATION_FAILED",
  "message": "Authentication required",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 401
}
{
  "error": "FORBIDDEN",
  "message": "You don't have permission to perform this action",
  "details": {
    "required_permission": "resource:action"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 403
}
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "The requested resource was not found",
  "details": {
    "resource_type": "example",
    "resource_id": "xxx"
  },
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 404
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {},
  "timestamp": "2025-01-01T00:00:00.000000",
  "status_code": 500
}