> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Put your first custom entity into the catalog with a few REST calls, and connect it to a warehouse table

This page puts one thing from a tool with no integration into the catalog, for example a
Kafka topic, and connects it to the warehouse table it is filled from. You need `curl`,
`jq` and about ten minutes.

Every call here is plain REST with JSON. The same API is also served over gRPC, which
[Building an integration](https://docs.synq.io/custom-integrations/building-an-integration.md) uses for a full program.

## 1. Get a token

In Settings > API, add an API client with the
scopes **Edit Entity Types**, **Edit Entities** and **Edit Lineage**. Only an Admin can grant
them.

Exchange the client id and secret for a token:

```bash theme={null}
export TOKEN=$(curl -s -X POST https://developer.synq.io/oauth2/token \
  -d grant_type=client_credentials \
  --data-urlencode "client_id=$QUALITY_CLIENT_ID" \
  --data-urlencode "client_secret=$QUALITY_CLIENT_SECRET" \
  | jq -r .access_token)
```

## 2. Add a type

A type is a kind of thing in your tool, such as "Kafka topic". It gives its entities an icon
and tells the catalog how to show them.

The quickest way is the app: open
Settings > Integrations > Custom entities,
select **Add type**, and choose a name, a number from 1 to 1000 and an SVG icon.

Or send it from a script, with the icon as base64:

```bash theme={null}
curl -X POST https://developer.synq.io/api/entities/custom/v1/types \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": {
      "typeId": 20,
      "name": "Kafka topic",
      "svgIcon": "'"$(base64 < topic.svg | tr -d '\n')"'"
    }
  }'
```

## 3. Add an entity

An entity is one thing of that type. Its `id` is yours to choose, and sending the same `id`
again updates the entity, so you can run the call as often as you like.

```bash theme={null}
curl -X POST https://developer.synq.io/api/entities/custom/v1/entities \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "entity": {
      "id": { "custom": { "id": "kafka-orders" } },
      "typeId": 20,
      "name": "orders",
      "description": "Order events from the checkout service"
    }
  }'
```

## 4. Connect it to a warehouse table

Lineage points at other entities by their `entity_id`, the id every entity in the catalog
has. Get the id of the table the topic is filled from in one of these ways.

**Copy it from the app.** Open the table in the catalog. The page address is
`<app host>/catalog/<entity_id>/overview`, so the id is the part between `/catalog/` and the
tab.

**Look it up by its SQL name**, as your tool reports it:

```bash theme={null}
export TABLE_ID=$(curl -s -X POST https://developer.synq.io/api/coordinates/v1/database/by-fqn \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "sqlFqn": ["analytics.public.orders"] }' \
  | jq -r '.matchedCoordinates[0].candidates[0].synqPaths[0]')
```

**Or search the catalog by name:**

```bash theme={null}
curl -s -G https://developer.synq.io/api/entities/v1/search \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "query=orders" \
  | jq '.hits[] | { name, entityType, entityId: .entityId.entityId }'
```

Then add the edge. The upstream is the table, given by its `entity_id`. The downstream is
your topic, given by the `id` you chose in step 3:

```bash theme={null}
curl -X POST https://developer.synq.io/api/entities/custom/v1/relationships \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "relationships": [{
      "upstream": { "synqPath": { "path": "'"$TABLE_ID"'" } },
      "downstream": { "custom": { "id": "kafka-orders" } }
    }]
  }'
```

The upstream can be any entity in the catalog, for example a dbt model, a dashboard or
another custom entity.

## 5. Find it in the app

Search the catalog for `orders`. The topic shows with its icon, and its Lineage tab shows
the `ORDERS` table upstream. From here it works like any other entity: you can give it an
owner, put it in a data product and alert on it.

## Where to go next

> [card] [Modelling your tool](https://docs.synq.io/custom-integrations/modelling.md)
>
> Which types and traits to use, and which kind of lineage fits each step of your tool

> [card] [Building an integration](https://docs.synq.io/custom-integrations/building-an-integration.md)
>
> A full program with schemas, SQL, checks and run status, in Go and Python

> [card] [API surface](https://docs.synq.io/custom-integrations/api-surface.md)
>
> Every endpoint, the scope it needs, and the limits

> [card] [REST API reference](https://docs.synq.io/api-reference/getting-started.md)
>
> Tokens, regions, and the generated reference for every endpoint


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.