> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Context.dev: Contextdev Create Webdb Collection

> Create a Context.dev WebDB collection that crawls target sites and keeps structured rows up to date from a schema. Includes SDK V2 examples, schemas, and cost.

Create a Context.dev WebDB collection that crawls target sites and keeps structured rows up to date from a schema.

> [!NOTE]
>
> Tool ID: `contextdev_create_webdb_collection`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'contextdev_create_webdb_collection',
  {
    "name": "Example",
    "schema": {},
    "targets": [
      {
        "type": "url",
        "seeds": [
          "https://example.com/resource"
        ]
      }
    ]
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute contextdev_create_webdb_collection --input '{
  "name": "Example",
  "schema": {},
  "targets": [
    {
      "type": "url",
      "seeds": [
        "https://example.com/resource"
      ]
    }
  ]
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "id": "id_123",
    "name": "Example",
    "schema": {},
    "eligibility": {
      "prefilter": {
        "url_match": [
          "https://example.com"
        ],
        "must_contain_any": [
          "example"
        ],
        "must_not_contain": [
          "example"
        ]
      },
      "semantic": {
        "condition": "example"
      }
    },
    "targets": [
      {}
    ],
    "sync": {
      "every": "example"
    },
    "change_tracking": {
      "enabled": true
    },
    "budgets": {},
    "on_disappear": "soft_delete",
    "stale_after": 123,
    "status": "active",
    "next_sync_at": "2026-01-15T12:00:00Z",
    "last_run_at": "2026-01-15T12:00:00Z",
    "last_error": {
      "code": "example",
      "message": "Example message"
    },
    "row_count": 123,
    "sync_count": 123,
    "created_at": "2026-01-15T12:00:00Z",
    "updated_at": "2026-01-15T12:00:00Z"
  }
}
```

Use `deepline describe contextdev_create_webdb_collection --json` for the latest machine-readable contract.

## Input reference

Settings for a new WebDB collection.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.name` | `string` | Yes | — | Collection name. Minimum length: 1. Maximum length: 200. |
| `payload.description` | `string` | No | — | Optional collection description. Maximum length: 2000. |
| `payload.schema` | `object` | Yes | — | JSON Schema for the fields extracted into each row. Zod users can pass the output of z.toJSONSchema(). |
| `payload.eligibility` | `object` | No | — | Rules that decide whether a page becomes a row. |
| `payload.targets` | `array` | Yes | — | Sources that provide pages for the collection. Minimum items: 1. Maximum items: 20. |
| `payload.sync` | `object` | No | — | Controls when pages are checked for updates. |
| `payload.change_tracking` | `object` | No | — | Controls row change history. |
| `payload.budgets` | `object` | No | — | Optional spending limits for a collection. |
| `payload.on_disappear` | `"soft_delete" \| "hard_delete" \| "keep"` | No | `"soft_delete"` | Action for rows whose source page disappears or becomes ineligible. Allowed: `soft_delete`, `hard_delete`, `keep`. |
| `payload.stale_after` | `integer` | No | `3` | Missed syncs before a row becomes stale. Minimum: 1. Maximum: 50. |
| `payload.tags` | `array` | No | — | Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. Maximum items: 20. |

> [!NOTE]
>
> This input schema is too large for an inline display. Read the complete live contract with `deepline describe contextdev_create_webdb_collection --json`.

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.id` | `string` | Yes | — | — |
| `result.data.name` | `string` | Yes | — | — |
| `result.data.description` | `string \| null` | No | — | — |
| `result.data.schema` | `record` | Yes | — | — |
| `result.data.eligibility` | `object \| null` | Yes | — | — |
| `result.data.eligibility.prefilter` | `object` | No | — | — |
| `result.data.eligibility.prefilter.url_match` | `array` | No | — | Maximum items: 50. |
| `result.data.eligibility.prefilter.must_contain_any` | `array` | No | — | Maximum items: 50. |
| `result.data.eligibility.prefilter.must_not_contain` | `array` | No | — | Maximum items: 50. |
| `result.data.eligibility.semantic` | `object` | No | — | — |
| `result.data.eligibility.semantic.condition` | `string` | Yes | — | Minimum length: 1. Maximum length: 4000. |
| `result.data.eligibility.semantic.min_score` | `number` | No | — | Minimum: 0. Maximum: 1. |
| `result.data.targets` | `array` | Yes | — | — |
| `result.data.sync` | `object` | Yes | — | — |
| `result.data.sync.every` | `string` | Yes | — | — |
| `result.data.sync.mode` | `"incremental" \| "full"` | No | — | Allowed: `incremental`, `full`. |
| `result.data.change_tracking` | `object` | Yes | — | — |
| `result.data.change_tracking.enabled` | `boolean` | Yes | — | — |
| `result.data.change_tracking.granularity` | `"field"` | No | — | Allowed: `field`. |
| `result.data.change_tracking.retention` | `string` | No | — | Pattern: `^(\d+)(s\|m\|h\|d)$`. |
| `result.data.budgets` | `object \| null` | Yes | — | — |
| `result.data.on_disappear` | `"soft_delete" \| "hard_delete" \| "keep"` | Yes | — | Allowed: `soft_delete`, `hard_delete`, `keep`. |
| `result.data.stale_after` | `integer` | Yes | — | — |
| `result.data.status` | `"active" \| "paused" \| "failed"` | Yes | — | Allowed: `active`, `paused`, `failed`. |
| `result.data.next_sync_at` | `string \| null` | Yes | — | Format: `date-time`. |
| `result.data.last_run_at` | `string \| null` | Yes | — | Format: `date-time`. |
| `result.data.last_error` | `object \| null` | Yes | — | — |
| `result.data.last_error.code` | `string` | Yes | — | — |
| `result.data.last_error.message` | `string` | Yes | — | — |
| `result.data.row_count` | `integer` | Yes | — | — |
| `result.data.sync_count` | `integer` | Yes | — | — |
| `result.data.created_at` | `string` | Yes | — | Format: `date-time`. |
| `result.data.updated_at` | `string` | Yes | — | Format: `date-time`. |
| `result.data.key_metadata` | `object` | No | — | — |
| `result.meta` | `object` | No | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "schema": {
            "type": "object",
            "additionalProperties": true
          },
          "eligibility": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "prefilter": {
                "type": "object",
                "properties": {
                  "url_match": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    }
                  },
                  "must_contain_any": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    }
                  },
                  "must_not_contain": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "semantic": {
                "type": "object",
                "properties": {
                  "condition": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "min_score": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "condition"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "sync": {
            "type": "object",
            "properties": {
              "every": {
                "type": "string"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "incremental",
                  "full"
                ]
              }
            },
            "required": [
              "every"
            ],
            "additionalProperties": false
          },
          "change_tracking": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "granularity": {
                "type": "string",
                "enum": [
                  "field"
                ]
              },
              "retention": {
                "type": "string",
                "pattern": "^(\\d+)(s|m|h|d)$"
              }
            },
            "required": [
              "enabled"
            ],
            "additionalProperties": false
          },
          "budgets": {
            "type": [
              "object",
              "null"
            ],
            "properties": {},
            "additionalProperties": false
          },
          "on_disappear": {
            "type": "string",
            "enum": [
              "soft_delete",
              "hard_delete",
              "keep"
            ]
          },
          "stale_after": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "failed"
            ]
          },
          "next_sync_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_run_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          },
          "row_count": {
            "type": "integer"
          },
          "sync_count": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "key_metadata": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "name",
          "schema",
          "eligibility",
          "targets",
          "sync",
          "change_tracking",
          "budgets",
          "on_disappear",
          "stale_after",
          "status",
          "next_sync_at",
          "last_run_at",
          "last_error",
          "row_count",
          "sync_count",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Context.dev provider guide](https://deepline.com/docs/providers/contextdev/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.