---
title: "Test datasource credentials"
method: POST
path: "/api/v3/workspaces/datasource/test"
tags: ["Workspaces"]
---

# Test datasource credentials

`POST /api/v3/workspaces/datasource/test`

⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

Test datasource credentials without persisting anything.

Validates that the provided credentials can connect to the external source. Returns 200 if the connection succeeds, 400 otherwise. No datasource or import is created. Use this before `PATCH /api/v3/workspaces/{id}` with a `datasource` payload to surface connection errors before committing the conversion.

**Access:** any authenticated user.

Credentials per type:
- **googledrive**: `service_account_file` (JSON string of the service account key file)
- **sharepoint**: `client_id`, `client_secret`, `tenant_id`, `site_id` (optional), `site_name` (optional)
- **servicenow**: `instance_url`, `username`, `password`
- **webscrapper**: no credentials required

Filter criteria per type:
- **googledrive**: `folder_id` (required), `recursive` (optional)
- **sharepoint**: `folder_path` (required), `recursive` (optional)
- **servicenow**: `doc_type` (required, e.g. `knowledge`)
- **webscrapper**: `start_url` (required)

## Request body

- StandardWorkspaceDatasourceV3Request — Pydantic request model for datasource conversion and credential testing.
  - `type` 'googledrive' | 'sharepoint' | 'servicenow' | 'webscrapper', required
  - `name` string, required
  - `credentials` object
  - `filter_criteria` object

## Response `200`

Connection successful

## Other responses

- `400` — Bad Request - Invalid credentials, connection failure, or missing required fields
- `401` — Unauthenticated - Missing or invalid API key
- `422` — Request body is valid JSON but one or more fields failed validation

---

[API](https://skmtc.dev/lighton/apis/lighton-api.md) · [All operations](https://skmtc.dev/lighton/apis/lighton-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lighton/lighton-api/revisions/86c57e94ef15/schema)
