webdbs

Update a collection

Changed on

Changes collection settings. New extraction rules apply on future syncs.

patch/webdbs/collections/{collection_id}

Request

  • Base URL
    https://api.context.dev/v1
  • URL
    https://api.context.dev/v1/webdbs/collections/{collection_id}
  • Auth
    HTTP bearer

Path parameters

collection_idstring required

Collection ID.

Example:col_123

Request body

namestring

Collection name.

descriptionstring

Optional collection description.

schemaWebdbsSchema

JSON Schema for the fields extracted into each row. Zod users can pass the output of z.toJSONSchema().

on_disappear'soft_delete' | 'hard_delete' | 'keep'

Action for rows whose source page disappears or becomes ineligible.

stale_afterinteger

Missed syncs before a row becomes stale.

status'active' | 'paused'

Pause or resume syncing.

tagsstring[]

Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

Example request

{
  "schema": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Product name."
      },
      "price": {
        "type": "number",
        "description": "Current price."
      }
    },
    "required": [
      "title"
    ],
    "additionalProperties": false
  },
  "eligibility": {
    "prefilter": {
      "url_match": [
        "https://shop.com/products/:product_id",
        "https://foo.com/item?id=*",
        "https://foo.com/bar/*",
        "**/events/**"
      ]
    }
  },
  "targets": [
    {
      "id": "tgt_123",
      "sync": {
        "every": "6h"
      },
      "eligibility": {
        "prefilter": {
          "url_match": [
            "https://shop.com/products/:product_id",
            "https://foo.com/item?id=*",
            "https://foo.com/bar/*",
            "**/events/**"
          ]
        }
      }
    }
  ],
  "sync": {
    "every": "6h"
  },
  "tags": [
    "production",
    "team-alpha"
  ]
}

Response

Updated collection

idstring required

Collection ID.

namestring required

Collection name.

descriptionstring nullable

Optional collection description.

schemaWebdbsSchema required

JSON Schema for the fields extracted into each row. Zod users can pass the output of z.toJSONSchema().

on_disappear'soft_delete' | 'hard_delete' | 'keep' required

Action when a source page disappears or becomes ineligible.

stale_afterinteger required

Missed syncs before a row becomes stale.

status'active' | 'paused' | 'failed' required

Current collection status.

next_sync_atstring date-time nullable required

Next scheduled sync time.

last_run_atstring date-time nullable required

Time the latest run started.

row_countinteger required

Current number of rows.

credits_consumed_totalinteger required

Total credits used by this collection.

sync_countinteger required

Number of completed syncs.

created_atstring date-time required

Time the collection was created.

updated_atstring date-time required

Time the collection was last updated.

Example response

{
  "id": "col_123",
  "schema": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Product name."
      },
      "price": {
        "type": "number",
        "description": "Current price."
      }
    },
    "required": [
      "title"
    ],
    "additionalProperties": false
  },
  "eligibility": {
    "prefilter": {
      "url_match": [
        "https://shop.com/products/:product_id",
        "https://foo.com/item?id=*",
        "https://foo.com/bar/*",
        "**/events/**"
      ]
    }
  },
  "targets": [
    {
      "id": "tgt_123",
      "sync": {
        "every": "6h"
      },
      "eligibility": {
        "prefilter": {
          "url_match": [
            "https://shop.com/products/:product_id",
            "https://foo.com/item?id=*",
            "https://foo.com/bar/*",
            "**/events/**"
          ]
        }
      }
    }
  ],
  "sync": {
    "every": "6h"
  }
}

Changes

    • warning

      added the new WEBSITE_BLOCKED enum value to the response property for the response status

    • warning

      added the new WEBSITE_BLOCKED enum value to the response property for the response status

    • warning

      added the new WEBSITE_BLOCKED enum value to the response property for the response status

    • warning

      added the new COLD_DOMAIN_TIMEOUT_TOO_LOW enum value to the response property for the response status

    • warning

      added the new COLD_DOMAIN_TIMEOUT_TOO_LOW enum value to the response property for the response status

    • warning

      added the new COLD_DOMAIN_TIMEOUT_TOO_LOW enum value to the response property for the response status