# Reference

## 1. Fetch Operations <a href="#fetch-operations" id="fetch-operations"></a>

### 1.1 Fetch Node <a href="#fetch-nodes" id="fetch-nodes"></a>

Fetch a single node’s info using its ID

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/fetchNode" method="get" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId:&#x20;
    * CoreModels projectId can be copied from the settings page
    * or it can be inferred from the URL:

<figure><img src="https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FudIAXKSG2rW9cCyttcGm%2FprojectId.png?alt=media&#x26;token=bb663c6d-1119-4180-bfac-48f981b33d74" alt=""><figcaption></figcaption></figure>

* Query parameters
  * NodeId: determines the node Id you want to get information about (required parameter).
  * AddRelations: will include node relations in the result (optional parameter, by default is false).
  * AddMixins: will include node mixins ( for existing values only ) in the result (optional parameter, by default is false).
* Response
  * success: determine if operation succeeded or not.
  * error: if any error occurred you'll get an error object, with&#x20;
    * isFata: to determine if this is a fatal error in the system, or it's a logical error.
    * message: if error is fatal: you'll get error message to contact the admin with specific error code for further tracking, else if the error is not fatal, then the error message will determine what is the logical error in the request.
  * data: contains info about the fetched node.
    * Id: node Id in CoreModels.
    * label: node label in CoreModels.
    * NodeType:  can be one of: Element, Type, Taxonomy, Exemplar, Component, Space, Tag, Mixin (case sensitive value).
    * spaceIds: in which space(s) this node is located.
    * relations: list all node relations, will be empty if AddRelations is false in the request, or node has no relations.
    * mixins: list all node mixins, will be empty is AddMixins is false in the request, or node has no mixins.

### 1.2 Fetch Nodes <a href="#fetch-nodes" id="fetch-nodes"></a>

Paginated fetch and search operation for any node in CoreModels.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/fetchNodes" method="get" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters:
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Query parameters:

  * NodeType: see [#fetch-nodes](#fetch-nodes "mention").
  * NodeIds: node Ids you want to search for.
  * Expression: search by part of the node name.

  Note: you've to provide at least one of NodeType, NodeIds, and Expression, but also you can use any combination of them to perform more complex filter for your search.&#x20;

  * SpaceIds: in which space(s) you want to search, if empty it means the main space.
  * AddRelations: add node relations to the result  see[#fetch-nodes](#fetch-nodes "mention").
  * AddMixins: add node mixins to the result see [#fetch-nodes](#fetch-nodes "mention").
  * SortAttr: Label, CreationTime, or UpdateTime (sort the results base on the selected criteria).
  * sortDesc: true for sort results descending (default false if not provided).
  * pageSize: the page size of the fetch paginated search operation: must be in range (1,250) default 50 if not provided.
  * pagingToken: the pagination token. see the response parameters section below.
  * indeludeRelationsFromAllSpaces: default to false, if send true: the relations of all spaces will be returned with node result.
* Response:
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data
    * nodes: the result nodes.
    * lastPage: true if this is the last page of the result.
    * pagingToken: if lastPage is false, then use the pagingToken value when you send the next request to get the next page. so you'll send the same request again with same parameters but set pagingToken to the new value to get the next page.\
      known limitation: we don't return page count of the fetch result.

## 2. Nodes Operations <a href="#nodes-operations" id="nodes-operations"></a>

### 2.1 Create Node <a href="#create-node" id="create-node"></a>

Creates Type, Element, Taxonomy, Exemplar, Component (view), Space, Tag, or Mixin in CoreModels.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/node" method="post" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* path parameters:
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Request Body:
  * Id: NodeId you want to create, if left empty it'll be generated for you, and returned in the result. We prefer GUID shaped values if you want to provide it.
  * label: node label.
  * nodeType: for accepted node types see [#fetch-nodes](#fetch-nodes "mention")
  * checkBeforeCreate: if true, we'll check for the label if used by any other node, and return the check result in checkResult object of the result.\
    Note: even if the node label already exists the new node will be created.
  * spaceIds: the space(s) where you want to locate the newly created node, if left empty it'll be created in the main spaec.
* Response:
  * Id: the created node Id.
  * checkResult: if checkBeforeCreate set to true in the request, this will hold list of checkResult objects.
    * checkResult content: result of check as string.
    * level: warning always.

### 2.2 Update Node <a href="#update-node" id="update-node"></a>

Update a node’s label and space (optionally) using its ID.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/node" method="put" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters:
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Request body
  * Id: Id of node you want to edit.
  * label: new label value.
  * spaceIds: (optional) set the new spaces for the node, if left empty: the spaces will be kept as is.
* Resposnse
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: always empty for now.

### 2.3 Remove Node <a href="#remove-node" id="remove-node"></a>

Remove a node using its ID.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/node/{id}" method="delete" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
  * Id: node Id to remove (soft delete).
* Reponse
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: always empty for now.

## 3. Relations <a href="#relations" id="relations"></a>

### 3.1 Relation Groups info <a href="#relation-groups-info" id="relation-groups-info"></a>

In CoreModels there are default relation groups, and user also can add custom relation groups. In order to create any relation between two nodes in CoreModels you need the relation Group Id to determine the type of this relation. We suggest you to retrieve the Relation Groups info using this API, store their info for later usage with relation operations.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/relationGroupsInfo" method="get" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Reposnse
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: array of relation info, each object consists of
    * label: relation group name (label).
    * relationGroupId: the Id of the relation Group, this is important because we work with Ids when we want to create any relation.
    * from: the accepted types for the ***From*** node part of the relation. ( can by one or more of NodeTypes).
    * to: the accepted types for the ***To*** part of the relation. (can be one or more of NodeTypes).
    * secondLevelFrom & secondLevelTo: not used for now.

### 3.2 Create Relation <a href="#create-relation" id="create-relation"></a>

to create a new relations between two nodes in CoreModels, please provide: *from* node Id, *to* node Id, and relation Group Id (explained in the previous section).

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/relation" method="post" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Request body
  * Id: required Id of the newly create relation we suggest to use GUID shaped values for all Ids, if this value not provided we'll create the new Id and return it in the result.
  * fromNodeId: node Id where relations starts.
  * toNodeId: node Id where relation ends.
  * relationGroupId: the Id of relation group (which determine the type of the relation).
  * value: not used for now.
* Resposen
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * date:
    * Id: the Id of the created relation.

Note: there will be a validation step before creating the required relation, if both (from, to) nodes fulfill the relation group, the relation will be created else an error is returned with the appropriate message.

### 3.3 Remove Relation <a href="#remove-relation" id="remove-relation"></a>

Remove a relation using its info.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/relation" method="delete" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Request body
  * same value when relation created, see [#create-relation](#create-relation "mention")
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: empty for now.

## 4. Mixins <a href="#mixins" id="mixins"></a>

### 4.1 Get Mixins Info <a href="#get-mixins-info" id="get-mixins-info"></a>

In CoreModels there are default Mixins, and user also can add custom mixins. In order to add/update/remove a mixin for any node in CoreModels you need the Mixin Id, and It's columns Ids. We suggest you to retrieve the Mixins info using this API, store their info for later usage with mixins operations.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/mixinsInfo" method="get" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: list of mixin, each mixin consists of
    * Id: the mixin Id.
    * label: mixin name (label)
    * type: mixin type: multi level mixin, attribute mixin, or normal mixin.
    * columns: list of mixin column; to represents the columns in this mixin, each column has this properties:
      * Id: column Id.
      * Label: column name (label).

### 4.2 Create Mixin <a href="#create-mixins" id="create-mixins"></a>

This sets the mixin value for a specific node.

You need to determine the Mixin Id, and then what are the columns you need to set values (using column Id, and the needed new value for the column).

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/mixinValue" method="post" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Request body
  * target Node Id: for what node you want to set the mixin value.
  * mixinId: which mixin you want to change.
  * mixinColumns: determine the columns, and therir new values. by using the columnId, and set the new value in each mixin column.
* Resposen
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: empty for now.

### 4.3 Remove Mixin <a href="#remove-mixins" id="remove-mixins"></a>

Delete Mixin value for specific node.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/mixinValue" method="delete" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters:
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Request body
  * targetNodeId: for what node you want to remove the mixin value(s).
  * mixinId: which mixin you want to remove.
  * mixinColumnIds: which column(s) to remove their value(s).

## 5. Bulk Operations <a href="#bulk-operations" id="bulk-operations"></a>

### 5.1 Bulk Create <a href="#bulk-create" id="bulk-create"></a>

You can create nodes, relations, and mixins in one shot using this API.

{% openapi src="<https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media&token=af841846-b523-4730-8786-06a610594050>" path="/v1/{projectId}/bulkCreate" method="post" %}
[IntegrationAPIs\_swagger.json](https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FpxfoVjThTXTnUREdTUmZ%2FIntegrationAPIs_swagger.json?alt=media\&token=af841846-b523-4730-8786-06a610594050)
{% endopenapi %}

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Request body
  * nodes: (optional): array of nodes to be created: see [#create-node](#create-node "mention")
  * relations: (optional): array of relations to be created: see [#create-relation](#create-relation "mention")
  * mixins: (optional): array of mixins to be created: see [#create-mixins](#create-mixins "mention")
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: contains  nodes cretae result, and relation create result
    * nodes create result: see [#create-node](#create-node "mention")
    * relation create result: see [#create-relation](#create-relation "mention")

## 6. Export JSON-LD <a href="#export-jsonld" id="export-jsonld"></a>

### 6.1 Fetch JSON-LD Import Profiles <a href="#fetch-import-profiles" id="fetch-import-profiles"></a>

Returns the set of profiles that can be used in the export process.

To export data from CoreModels as JSON-LD you need to use export profile. Using this API you can retrieve all import profiles you have for later use in the export operation.

## GET /v1/{projectId}/fetchJsonLdImportProfiles

>

```json
{"openapi":"3.1.1","info":{"title":"Integration API","version":"v1"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token in the text input below."}},"schemas":{"ObjectApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"$ref":"#/components/schemas/ErrorDetail"},"data":{}},"additionalProperties":false},"ErrorDetail":{"type":"object","properties":{"isFatal":{"type":"boolean"},"message":{"type":"string"}},"additionalProperties":false}}},"paths":{"/v1/{projectId}/fetchJsonLdImportProfiles":{"get":{"tags":["IntegrationApi"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ObjectApiResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ObjectApiResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ObjectApiResponse"}}}}}}}}}
```

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: list of objets each object consists of
    * Id: profile Id
    * label: profile name (label).

### 6.2 Export JSON-LD <a href="#export-json-ld" id="export-json-ld"></a>

Export types, and/or elements, and/or taxonomies from a certain space using a specific configuration profile.<br>

## GET /v1/{projectId}/exportJsonLd

>

```json
{"openapi":"3.1.1","info":{"title":"Integration API","version":"v1"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token in the text input below."}},"schemas":{"StringApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"$ref":"#/components/schemas/ErrorDetail"},"data":{"type":"string"}},"additionalProperties":false},"ErrorDetail":{"type":"object","properties":{"isFatal":{"type":"boolean"},"message":{"type":"string"}},"additionalProperties":false}}},"paths":{"/v1/{projectId}/exportJsonLd":{"get":{"tags":["IntegrationApi"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"query","name":"spaceId"},{"schema":{"type":"string"},"in":"query","name":"configTypeId"},{"schema":{"type":"boolean","default":true},"in":"query","name":"exportTypes"},{"schema":{"type":"boolean","default":false},"in":"query","name":"exportElements"},{"schema":{"type":"boolean","default":false},"in":"query","name":"exportTaxonomies"},{"schema":{"type":"boolean","default":false},"in":"query","name":"exportDataTypes"},{"schema":{"type":"boolean","default":false},"in":"query","name":"includeSpace"},{"schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true,"in":"query","name":"nodeIds"},{"schema":{"type":"boolean","default":true},"in":"query","name":"graphBased"},{"schema":{"type":"boolean","default":false},"in":"query","name":"useDefaultType"}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/StringApiResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/StringApiResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/StringApiResponse"}}}}}}}}}
```

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Query parameters
  * spaceId: determine the space Id to use in export process.
  * configTypeId: determine profile Id to use in export process, to get the full list of available profiles in a project see [#fetch-import-profiles](#fetch-import-profiles "mention")
  * exportTypes: (optional), default to false, if set to true types will be exported.
  * exportElements: (optional), default to false, if set to true elements will be exported.
  * exportTaxonomies: (optional) default to false, if set to true taxonomies will be exported.
  * includeSpace: (optional) include space info in the exported result, the space will be added in a special key `CoreModels_Space`.
  * graphBased: (optional - default is true) controls whether the export is using the `@graph` array or will be exporting a single node
  * useDefaultType: (optional) controls whether the export will automatically add `rdfs:Class` for types and `rdfs:Property` for elements
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: the exported Json-Ld data

## 7. Merge JSON-LD

Imports new updates into a CoreModels space, this API triggers the same merge process that can be done through the user interface, you can add a URL or the github info.<br>

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Query parameters
  * SpaceId: The space id that will be imported into, to get the spaces in a project, refer to [#fetch-nodes-1](#fetch-nodes-1 "mention"), and use NodeType='Space'.
  * ConfigTypeId: the configuration profile Id that the merge process will use to map the JSON-LD file properties into to CoreModels mixins and relations, to get the full list of available profiles in a project see [#fetch-import-profiles](#fetch-import-profiles "mention")
  * SourceDtos: an array of the sources, you can either add the github info or the file url.
    * Owner: The github repository owner of the source file.
    * Repository: The github repository name of the source file.
    * Branch: The github repository branch name of the source file.
    * FilePath: The target file path in the github repositry.
    * FileUrl: The target jsonld file absolute url.&#x20;
  * OverrideNewPropertiesWarning (optional flag):\
    If the github file had unmapped properties, CoreModels will return an error, this flag will skip the error.\
    Note: this will happen if the file is not compatible with the configuration profile, we recommend creating a new import profile or manually verifying the profile.
  * OverrideDifferentSourceWarning (optional flag):\
    CoreModels will verify that the space was originally linked to the provided information, and will return an error if the arguments referred to different source, this flag will skip this error.
  * OverrideOverwriteWarning (optional flag):\
    CoreModels will check if any local changes in the space, and return an error (so the user wouldn't overwrite the changes) this flag will skip this error.
  * OnlyAddAndUpdate (optional flag):\
    When using this flag, CoreModels will only add new nodes and update existing nodes (according to how they match the current schema), but it will not remove any node from the space.
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: the status of the import response.
* Example:\
  if we are synchronizing the following file <https://github.com/ModarAlNacharA/my-sample-repository/blob/main/sample-folder/JSON-LD%20sample%20file.json>\
  We would use the following github information:
  * Owner: ModarAlNacharA
  * Repository: my-sample-repository
  * Branch: main
  * FilePath: sample-folder/JSON-LD sample file.json
* Alternativly: we could use the raw url provided by github as the FileUrl: <https://raw.githubusercontent.com/ModarAlNacharA/my-sample-repository/refs/heads/main/sample-folder/JSON-LD%20sample%20file.json>

<figure><img src="https://28873597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5zETMIhAAEnOrjJUwaUj%2Fuploads%2FbkoeaTiY6zSnTUeHBWtM%2Fimage.png?alt=media&#x26;token=6b71af14-3c9e-4ddd-9ee9-5024691a274a" alt=""><figcaption></figcaption></figure>

## 8. Export JSON Schema <a href="#export-jsonld" id="export-jsonld"></a>

### 8.1 Fetch JSON Schema Import Profiles

Returns the set of profiles that can be used in the export process.

To export data from CoreModels as JSON Schema you need to use export profile. Using this API you can retrieve all the JSON Schema import profiles you have for later use in the export operation.

## GET /v1/{projectId}/fetchJsonSchemaImportProfiles

>

```json
{"openapi":"3.1.1","info":{"title":"Integration API","version":"v1"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token in the text input below."}},"schemas":{"ObjectApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"$ref":"#/components/schemas/ErrorDetail"},"data":{}},"additionalProperties":false},"ErrorDetail":{"type":"object","properties":{"isFatal":{"type":"boolean"},"message":{"type":"string"}},"additionalProperties":false}}},"paths":{"/v1/{projectId}/fetchJsonSchemaImportProfiles":{"get":{"tags":["IntegrationApi"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ObjectApiResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ObjectApiResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ObjectApiResponse"}}}}}}}}}
```

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: list of objets each object consists of
    * Id: profile Id
    * label: profile name (label).

### 8.2 Export JSON Schema

Export types, and/or elements, and/or taxonomies from a certain space using a specific configuration profile.

## GET /v1/{projectId}/exportJsonSchema

>

```json
{"openapi":"3.1.1","info":{"title":"Integration API","version":"v1"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token in the text input below."}},"schemas":{"StringApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"$ref":"#/components/schemas/ErrorDetail"},"data":{"type":"string"}},"additionalProperties":false},"ErrorDetail":{"type":"object","properties":{"isFatal":{"type":"boolean"},"message":{"type":"string"}},"additionalProperties":false}}},"paths":{"/v1/{projectId}/exportJsonSchema":{"get":{"tags":["IntegrationApi"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"query","name":"configTypeId"},{"schema":{"type":"string"},"in":"query","name":"spaceId"},{"schema":{"type":"string"},"in":"query","name":"rootNodeId"},{"schema":{"type":"boolean","default":true},"in":"query","name":"useAnchorForRef"}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/StringApiResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/StringApiResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/StringApiResponse"}}}}}}}}}
```

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Query parameters
  * spaceId: determine the space Id to use in export process.
  * configTypeId: determine profile Id to use in export process, to get the full list of available profiles in a project see [#id-8.1-fetch-import-profiles](#id-8.1-fetch-import-profiles "mention")
  * rootNodeId: the root node id to use for export operation, this is the node that will be used as the root of the JSON Schema.
  * useAnchorForRef: if true, the exported JSON Schema will use the `$anchor` if available, other wise it will always use the JSON Path when referencing JSON Schemas in the `$ref` - default true
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: the exported Json schema data

## 9. Merge JSON Schema

Imports new updates into a CoreModels space, this API triggers the same merge process that can be done through the user interface, you can add a url or the github info.

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Query parameters
  * SpaceId: The space id that will be imported into, to get the spaces in a project, refer to [#fetch-nodes-1](#fetch-nodes-1 "mention"), and use NodeType='Space'.
  * ConfigTypeId: the configuration profile Id that the merge process will use to map the JSON-Schema file properties into to CoreModels mixins and relations, to get the full list of available profiles in a project see [#id-8.1-fetch-import-profiles](#id-8.1-fetch-import-profiles "mention")
  * SourceDtos: an array of the sources, you can either add the github info or the file url.
    * Owner: The github repository owner of the source file.
    * Repository: The github repository name of the source file.
    * Branch: The github repository branch name of the source file.
    * FilePath: The target file path in the github repositry.
    * FileUrl: The target jsonld file absolute url.&#x20;
  * OverrideNewPropertiesWarning (optional flag):\
    If the github file had unmapped properties, CoreModels will return an error, this flag will skip the error.\
    Note: this will happen if the file is not compatible with the configuration profile, we recommend creating a new import profile or manually verifying the profile.
  * OverrideDifferentSourceWarning (optional flag):\
    CoreModels will verify that the space was originally linked to the provided information, and will return an error if the arguments referred to different source, this flag will skip this error.
  * OverrideOverwriteWarning (optional flag):\
    CoreModels will check if any local changes in the space, and return an error (so the user wouldn't overwrite the changes) this flag will skip this error.
  * OnlyAddAndUpdate (optional flag):\
    When using this flag, CoreModels will only add new nodes and update existing nodes (according to how they match the current schema), but it will not remove any node from the space.
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data: the status of the import response.
* Example:\
  if we are synchronizing the following file <https://github.com/ModarAlNacharA/my-sample-repository/blob/main/sample-folder/SampleJsonSchema.json>\
  We would use the following github information:
  * Owner: ModarAlNacharA
  * Repository: my-sample-repository
  * Branch: main
  * FilePath: sample-folder/SampleJsonSchema.json
* Alternativly: we could use the raw url provided by github as the FileUrl: <https://raw.githubusercontent.com/ModarAlNacharA/my-sample-repository/refs/heads/main/sample-folder/SampleJsonSchema.json>

## 10. Validate JSON Schema

Validates a json string against a specific JSON Schema.

## GET /v1/{projectId}/validateJSON

>

```json
{"openapi":"3.1.1","info":{"title":"Integration API","version":"v1"},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token in the text input below."}},"schemas":{"JsonSchemaValidationResultApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"$ref":"#/components/schemas/ErrorDetail"},"data":{"$ref":"#/components/schemas/JsonSchemaValidationResult"}},"additionalProperties":false},"ErrorDetail":{"type":"object","properties":{"isFatal":{"type":"boolean"},"message":{"type":"string"}},"additionalProperties":false},"JsonSchemaValidationResult":{"type":"object","properties":{"isValid":{"type":"boolean"},"jsonSchemaValidationErrors":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"paths":{"/v1/{projectId}/validateJSON":{"get":{"tags":["IntegrationApi"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"projectId","required":true},{"schema":{"type":"string"},"in":"query","name":"configTypeId"},{"schema":{"type":"string"},"in":"query","name":"jsonString"},{"schema":{"type":"string"},"in":"query","name":"spaceId"},{"schema":{"type":"string"},"in":"query","name":"rootNodeId"}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/JsonSchemaValidationResultApiResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/JsonSchemaValidationResultApiResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/JsonSchemaValidationResultApiResponse"}}}}}}}}}
```

* Path parameters
  * projectId: see [#fetch-nodes](#fetch-nodes "mention")
* Query parameters
  * configTypeId: determine profile Id to use in export process, to get the full list of available profiles in a project see [#id-8.1-fetch-import-profiles](#id-8.1-fetch-import-profiles "mention")
  * jsonString: the json that needs to be validated against the schema.
  * spaceId: (optional) The Space where the schema exists.
  * rootNodeId: (optional) the node that represents the JSON Schema. (use either the spaceId or the rootNodeId)
* Response
  * success: see [#fetch-nodes](#fetch-nodes "mention")
  * error: see [#fetch-nodes](#fetch-nodes "mention")
  * data:
    * IsValid: if the json string is valid against the schema
    * JsonSchemaValidationErrors: the validation errors


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.coremodels.io/user-guides/integration-apis/reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
