Skip to content
getgeolens.com

Create Dataset Relationship

POST
/datasets/{dataset_id}/relationships/
curl --request POST \
--url https://example.com/api/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/relationships/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "target_dataset_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "source_column": "example", "target_column": "gid", "label": "example" }'

Create a new FK relationship. Editor+ required.

dataset_id
required
Dataset Id
string format: uuid
Media type application/json
DatasetRelationshipCreate
object
target_dataset_id
required
Target Dataset Id

UUID of the dataset to link to

string format: uuid
source_column
required
Source Column

Join column in the source dataset

string
<= 63 characters
target_column
Target Column

Join column in the target dataset

string
default: gid <= 63 characters
label
Any of:
string
<= 500 characters

Successful Response

Media type application/json
DatasetRelationshipResponse
object
id
required
Id
string format: uuid
source_dataset_id
required
Source Dataset Id
string format: uuid
target_dataset_id
required
Target Dataset Id
string format: uuid
source_column
required
Source Column
string
target_column
required
Target Column
string
relationship_type
required
Relationship Type
string
label
required
Any of:
string
target_dataset_title
Any of:
string
Example generated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"source_dataset_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"target_dataset_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"source_column": "example",
"target_column": "example",
"relationship_type": "example",
"label": "example",
"target_dataset_title": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}