Skip to main content
REST One HTTPS request.
Added in Python SDK 0.9.0 and JavaScript and TypeScript SDK 0.9.0. In TypeScript, pass one options object; every option is accepted in snake_case or camelCase (customer_id or customerId). The result is returned as the server sends it, with snake_case fields, typed as Record<string, unknown>.
Ask Synap what it knows in a scope, in a form you can build a knowledge.query from. Call it first: it lists the types you can name as a target, the properties you can filter on with the operators each accepts, and the relations you can follow.
Enabled per instance, and needs a Pro plan or above. Where it is not enabled the call raises ContextNotFoundError. A plan without it raises FeatureNotInPlanError. Each call uses credits.

Parameters

string
The user you ask as. The answer covers that user’s documents and client-wide documents, and the customer’s documents too when you also pass customer_id.
string
The customer you ask as. Without user_id, the answer covers that customer’s documents and client-wide documents. Not accepted on B2C.
dict[str, str]
The deeper scope level you ask at, as level name to id.
With none of the three, the answer covers client-wide documents only. Use the same ids you use with context.fetch.

Returns

list[dict]
Where documents came from, each as {"system": ..., "documents": count}. Only documents with a recorded source appear.
dict[str, int]
How many documents of each document type the scope can see.
list[dict]
The kinds of fact Synap extracts from documents: Obligation, Commitment, Transaction and Decision. Each has name, the document_types it is extracted from, its properties and its relations (PARTY and COUNTERPARTY).
list[dict]
The kinds of entity: the types your instance defines plus the core types. Each has name, core_type, properties and the relations your instance declares.
Every property is listed as {"name": ..., "type": ..., "operators": [...]}. type is text, enum, number, date or bool, and an enum also lists its values, for example the statuses of an obligation. operators names the conditions where accepts for that property.
dict
The limits a query works within: hops, page size and the size of a complete set.

Example

Raises

  • ContextNotFoundError: when the feature is not enabled on your instance.
  • FeatureNotInPlanError: when your plan does not include knowledge queries.
  • CustomerIdNotAcceptedError: when customer_id is passed on a B2C instance.
  • InvalidInputError: when scope is not a flat dict of strings.

See also