> ## 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 collection. Context.dev Contextdev Create Webdb Collection reference includes SDK V2 and CLI requests, input constraints, response fields,.

Create a collection.

<Info>
  Tool ID: `contextdev_create_webdb_collection`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
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={null}
deepline tools execute contextdev_create_webdb_collection --input '{
  "name": "Example",
  "schema": {},
  "targets": [
    {
      "type": "url",
      "seeds": [
        "https://example.com/resource"
      ]
    }
  ]
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "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 tools get 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.                       |

<Info>
  This input schema is too large to embed without slowing the page. Get the complete live contract with `deepline tools get contextdev_create_webdb_collection --json`.
</Info>

## 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={null}
  {
    "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](/docs/providers/contextdev/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
