Create Dataset Relationship
POST
/datasets/{dataset_id}/relationships/
const url = 'https://example.com/api/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/relationships/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"target_dataset_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","source_column":"example","target_column":"gid","label":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” dataset_id
required
Dataset Id
string format: uuid
Request Body required
Section titled “Request Body required ” Media type application/json
DatasetRelationshipCreate
Responses
Section titled “ Responses ”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
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>
ValidationErrorobject
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": {} } ]}