Sites
Sites
@toothfairyai/sdk@latest…Site Management Module Handles site CRUD operations for website crawling.
Accessed via client.sites.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
delete | DELETE | DELETE /site/delete/{id} |
get | GET | GET /site/get/{id} |
list | GET | GET /site/list |
update | POST | POST /site/update |
delete
Delete a site
async delete(siteId: string): Promise<
Endpoint: DELETE /site/delete/{id} · API service
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Operation success status |
data | object | Response data |
message | string | Optional success message |
Example
const result = await client.sites.delete('agent-id');
get
Get a site by ID
async get(siteId: string)
Endpoint: GET /site/get/{id} · API service
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the site |
name | string | Name of the resource |
description | string | Site description |
url | string | Public URL of the website to crawl/index |
customSitemap | string | Custom sitemap URL for crawling |
workspaceID | string | Unique workspace identifier (UUID v4) |
topics | object | Associated topics |
status | string | Current status of the resource |
Allowed: noDomain, noAnswer, active, syncing, inactive, invalidToken, failed, pending, inProgress, validationTokenCreationError, readyForValidation, tokenRequested, noSitemap |
| lastValidationDate | string | Last validation timestamp |
| lastValidationRequested | string | Date validation was last requested |
| validationToken | string | Site validation token |
| allowedPaths | array<string> | Allowed crawling paths |
| siteTree | object | JSON-encoded site tree structure |
| lastScraped | string | Date the site was last scraped |
| skipOwnerValidation | boolean | Whether domain ownership validation is skipped |
| useProxy | boolean | Whether a proxy is used for crawling |
| completion_percentage | number | Site processing completion percentage |
| extractImages | boolean | Whether images are extracted during crawling |
| freeRoaming | boolean | Whether the crawler can roam beyond allowed paths |
| scrapingCycle | integer | Scraping cycle in hours: 0 (never), 24 (daily), 72 (3-day), or 168 (weekly) |
| imgRetrievalPrompt | string | Prompt used for image retrieval/extraction |
| metadata | object | Arbitrary metadata key-value pairs (JSON) |
| createdBy | string | ID of the user who created this resource |
| updatedBy | string | ID of the user who last updated this resource |
| scapablePages | integer | Number of pages that can be scraped |
| scrapedPagesCount | integer | Number of pages scraped |
| createdAt | string | Timestamp when this resource was created |
| updatedAt | string | Timestamp when this resource was last updated |
Example
const result = await client.sites.get('agent-id');
list
List all sites in the workspace
async list(limit?: number, offset?: number)
Endpoint: GET /site/list · API service
Example
const result = await client.sites.list();
update
Update an existing site
async update(
siteId: string,
options: {
name?: string;
url?: string;
status?: string;
allowedPaths?: string[];
} = {}
)
Endpoint: POST /site/update · API service
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique identifier |
workspaceid | string | no | Unique workspace identifier (UUID v4) |
description | string | no | Detailed description of purpose and capabilities |
name | string | no | Name of the resource |
freeRoaming | boolean | no | Whether the crawler can roam beyond allowed paths |
useProxy | boolean | no | Whether a proxy is used for crawling |
extractImages | boolean | no | Whether images are extracted during crawling |
imgRetrievalPrompt | string | no | Prompt used for image retrieval/extraction |
scrapingCycle | string | no | Scraping cycle in hours: 0 (never), 24 (daily), 72 (3-day), or 168 (weekly) |
Allowed: 0, 24, 72, 168 |
| url | string | no | Public URL of the website to crawl/index |
| customSitemap | string | no | Custom sitemap URL for crawling |
| topics | string | no | JSON-encoded list of topics associated with the chat |
| metadata | string | no | Arbitrary metadata key-value pairs (JSON) |
| allowedPaths | string | no | List of URL paths allowed for crawling |
| status | string | no | Current status of the resource
Allowed: active, inactive, pending, syncing, readyForValidation, inProgress |
| validationToken | string | no | Token used for domain ownership validation |
| skipOwnerValidation | boolean | no | Whether domain ownership validation is skipped |
| lastValidationDate | string | no | Date of the last domain validation |
| lastValidationRequested | string | no | Date validation was last requested |
| siteTree | string | no | JSON-encoded site tree structure |
| lastScraped | string | no | Date the site was last scraped |
| completion_percentage | string | no | Percentage of site indexing completion |
| scapablePages | integer | no | Number of pages that can be scraped |
| scrapedPagesCount | integer | no | Number of pages scraped |
| createdBy | string | no | ID of the user who created this resource |
| updatedBy | string | no | ID of the user who last updated this resource |
Response
Returns the Site object — fields documented in the get section above.
Example
const result = await client.sites.update('agent-id');