Delete Knowledge Base Data Lookup

Delete a pipe-scoped knowledge base data lookup

Before You Begin

🔗 Use the GraphQL Playground to execute the queries in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Prerequisites

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
  2. Permissions: You must be admin of the pipe where the data lookup was created.
  3. Data Lookup ID: The id returned when the data lookup was created. See Create Knowledge Base Data Lookup.

⚠️

Deletion is permanent. A deleted data lookup cannot be recovered. Any AI agents that reference the data lookup will no longer have access to it.

Delete a Knowledge Base Data Lookup

Use the deleteAiKnowledgeBaseDataLookup mutation to permanently delete a data lookup from a pipe's knowledge base.

Inputs

  • pipeUuid: UUID of the pipe the data lookup belongs to (required).
  • dataLookupId: ID of the knowledge base data lookup to delete (required).
mutation {
  deleteAiKnowledgeBaseDataLookup(
    input: { pipeUuid: "pipe-uuid-123", dataLookupId: "data-lookup-uuid-789" }
  ) {
    success
    errors
  }
}

Response:

{
  "data": {
    "deleteAiKnowledgeBaseDataLookup": {
      "success": true,
      "errors": []
    }
  }
}

Response explained

  • success: true when the data lookup was successfully deleted, false otherwise.
  • errors: Array of error messages when the deletion fails. Empty on success.

Error handling

If the deletion fails (e.g., permission denied or pipe not found), you'll receive an error response:

{
  "data": {
    "deleteAiKnowledgeBaseDataLookup": null
  },
  "errors": [
    {
      "message": "Permission denied",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": ["deleteAiKnowledgeBaseDataLookup"]
    }
  ]
}

Error response explained

  • data.deleteAiKnowledgeBaseDataLookup: Returns null when the operation fails.
  • errors: Array containing error details when the operation fails.
  • errors[].message: Human-readable error description. Common messages:
    • "Permission denied" — the authenticated user is not an admin of the pipe.
    • "Pipe not found with id: <uuid>" — the pipeUuid does not match an existing pipe.
    • "Field 'deleteAiKnowledgeBaseDataLookup' doesn't exist on type 'Mutation'" — the feature flag is not enabled for the organization.

Tips

  • Agent references: Deleting a data lookup automatically removes it from all agents and behaviors that reference it.
  • Finding your data lookup ID: The id is returned by the createAiKnowledgeBaseDataLookup mutation. See Create Knowledge Base Data Lookup.