.env
file with the name WRITER_API_KEY
.type
set to web
. To create a Knowledge Graph with the web
type, you must create the Knowledge Graph in AI Studio and select “Add Website” as the way you want to add content to the Knowledge Graph. See Setting up Knowledge Graph web connectors for more information.You can see the type of a Knowledge Graph in the Knowledge Graph details or in the Knowledge Graph list endpoints.urls
array in your request replaces the entire existing list of URLs attached to the Knowledge Graph. To add a new URL, include both the existing URLs and the new one in your request. To remove a URL, send a request with all URLs except the one you want to remove.urls
array in your request body. Each URL object has the following parameters:
Parameter | Type | Description |
---|---|---|
url | string | The URL you want to add to your Knowledge Graph |
type | string | How you want to process the URL: either single_page (just this URL) or sub_pages (this URL and linked pages) |
exclude_urls | array | Optional. Any URLs you want to exclude from processing if type is sub_pages |
status
object. The status
object has the following parameters:
Parameter | Type | Description |
---|---|---|
status | string | The current processing status: validating , success , or error |
error_type | string | If there was an error, what type of error occurred |
invalid_url
: The URL format is not validnot_searchable
: The content cannot be accessed or processednot_found
: The URL returns a 404 errorpaywall_or_login_page
: The content requires authenticationunexpected_error
: An unspecified error occurred