Skip to main content
PATCH
/
knowledge
/
{knowledge_id}
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
knowledge = client.knowledge.update(
    knowledge_id="knowledge_id",
)
print(knowledge.id)
{
  "object": "knowledge",
  "id": "<string>",
  "name": "<string>",
  "teamspace_id": "<string>",
  "scope": "teamspace",
  "parent": {
    "type": "page",
    "page_id": "<string>"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "status": "pending",
  "last_error": {
    "code": "out_of_credits",
    "message": "<string>"
  },
  "row_counts": {
    "total": 123,
    "completed": 123,
    "failed": 123
  },
  "credits": {
    "consumed": 123
  },
  "sync": {
    "connection_id": "config_123abc",
    "enabled": true,
    "trigger": {
      "type": "cron",
      "cron_expression": "0 0 * * *",
      "timezone": "America/New_York",
      "description": "<string>"
    }
  },
  "updated_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://developers.datagrid.com/llms.txt

Use this file to discover all available pages before exploring further.

Upload size limits

Files added in a multipart update must respect your plan’s per-file size limit. Oversized files receive 413 (payload_too_large); see Knowledge upload limits for typical caps and strategies.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

knowledge_id
string
required

The id of the knowledge to update.

Body

multipart/form-data
name
string | null

The new name for the knowledge.

scope
enum<string> | null

The visibility scope of the knowledge. 'teamspace' means visible only within the owning teamspace. 'organization' means visible across all teamspaces in the same organization.

Available options:
teamspace,
organization
parent
object

The parent page reference, indicating where this page is nested

files
file[] | null

The files to replace existing knowledge. When provided, all existing data will be removed from the knowledge and replaced with these files. Supported media types are pdf, json, csv, text, png, jpeg, excel, google sheets, docx, pptx. Cannot be used together with sync in the same request.

sync
object

Sync configuration updates for knowledge created from a connection. Note: For multipart/form-data, this should be sent as a JSON string. Cannot be used together with files in the same request.

Response

Successfully updated knowledge

The knowledge object represents knowledge that an agent may leverage to respond.

object
enum<string>
required

The object type, which is always knowledge.

Available options:
knowledge
id
string
required

The knowledge identifier, which can be referenced in the API endpoints.

name
string
required

The name of the knowledge.

teamspace_id
string
required

The ID of the teamspace that owns this knowledge.

scope
enum<string>
required

The visibility scope of the knowledge. 'teamspace' means visible only within the owning teamspace. 'organization' means visible across all teamspaces in the same organization.

Available options:
teamspace,
organization
parent
object
required

The parent page reference, indicating where this page is nested

created_at
string<date-time>
required

The ISO string for when the knowledge was created.

status
enum<string>
required

The current knowledge status. pending indicates that processing has started but no rows have been learned yet. partial indicates that some rows are available, but processing is either still running or ended with incomplete results. ready indicates that processing finished successfully and the knowledge is fully available. failed indicates that no rows are currently available and the knowledge reached a terminal failure state, either because the latest asynchronous processing or re-index run ended unsuccessfully before any rows became available, or because every row ended in a persistent failed state.

Available options:
pending,
partial,
ready,
failed
last_error
object
required

The last terminal processing error for this knowledge, if any. Present when the latest asynchronous processing or re-index run ended unsuccessfully; null when the knowledge is failed only because every row ended in a persistent failed state.

row_counts
object
required

Row count statistics for the knowledge.

credits
object
required

Credit consumption for this knowledge. null when the knowledge is still being processed and the final cost is not yet known (e.g. immediately after creation or reindexing), or when the credit lookup fails. When present, consumed is the current summed spend for the knowledge's active tables — it is not necessarily the cost of the most recent request, nor the full lifetime spend.

sync
object
required

Sync information for knowledge that syncs data from a connection

updated_at
string<date-time>

The ISO string for when the knowledge was last updated.