/api/v1/object/data/{objectSlug}/{dataSlug}/relations/{relationSlug}List the records linked to one record through one relation.
List the records linked to one record through one relation.
A relation cell on a record read holds one page of linked records. When
its pagination.nextPage is not null, call this route for the rest.
relationSlug is the key of that cell in the record's relations.
Linked records come newest first, in the same order as the cell, so the
first page starts with the records the cell already showed. Only linked
records the credential can see are returned.
relation_type at the top level is belongsTo or hasMany. A belongs-to
relation returns at most one record. An item carries columns, keyed by
field slug, when the relation has display columns set.
Query parameters:
page— page number, from 1. Default1.limit— records per page, up to200. Default25.
Scope: read.<object slug>, for example read.contacts.
Errors:
400— no active object has that slug.400—Data with slug '9f2c4b7a1e03' not found: the record does not exist or the credential cannot see it.403— the credential lacksread.<object slug>.404—Relation 'deals-mpoc4k2z' not found on object 'contacts'.422— a query parameter is invalid, for examplelimitis above200.
Response 200:
{
"status": 200,
"message": "Relation page retrieved successfully",
"data": [
{
"type": "relation",
"name": "Office renewal",
"label": "Office renewal",
"slug": "c81f5a0d3e97",
"random_id": "5b2e8d14",
"object_slug": "deals",
"object_name": "Deals",
"object_icon": "briefcase"
}
],
"pagination": {
"total": 26,
"page": 2,
"limit": 25,
"totalPages": 2,
"nextPage": null,
"prevPage": 1
},
"relation_type": "hasMany"
}
Send request
Use the documented inputs to call this endpoint directly.
Parameters
Values are applied to the request and the example on the right.
Responses
Successful response
{
"type": "string",
"name": "string",
"label": "string",
"slug": "string",
"random_id": "",
"object_slug": "string",
"object_name": "string",
"object_icon": "string",
"columns": "string"
}Display text for slug. Same value as name, under the key every
other slug-bearing shape on the wire uses for its human text.
The partner OBJECT's icon — a record has none of its own. "" when the
object never got one, so the client keeps its per-direction fallback.
The relation's configured display columns for THIS linked record, keyed by
the target field's slug, in the admin's configured order
(RelationOptions.display_columns).
Each value is already in the shape a normal record read emits for that
field type — option-backed fields arrive as {id,value,label,color,icon}[],
never a raw option id — so the client renders a mirrored cell with the same
renderer it uses on the Data Table, keyed off the field's own type.
Absent, not empty, when the relation has no columns configured or the feature is off. Clients must treat a missing key as "no columns", which is also what every client written before this key did.
Bad request
{
"status": 1,
"message": "string",
"code": "string",
"data": {}
}The HTTP status code of the response.
What went wrong. Several validation messages are joined with ", ".
A stable, machine-readable reason. Only some errors set it.
Extra detail about the error. Only some errors set it.
Unauthorized
{
"status": 1,
"message": "string",
"code": "string",
"data": {}
}The HTTP status code of the response.
What went wrong. Several validation messages are joined with ", ".
A stable, machine-readable reason. Only some errors set it.
Extra detail about the error. Only some errors set it.
Internal server error
{
"status": 1,
"message": "string",
"code": "string",
"data": {}
}The HTTP status code of the response.
What went wrong. Several validation messages are joined with ", ".
A stable, machine-readable reason. Only some errors set it.
Extra detail about the error. Only some errors set it.
Powered by heyo-docs