Entry Relationships

When you create a field that uses relationship as a field_type, you update your entry values using the Relationship endpoints.

post
Create Entry Relationship

https://api.moltin.com/v2/flows/:flowSlug/entries/:entryId/relationships/:fieldSlug
Create an Entry relationship to one or more resources. If any relationships already exist, the one's made in the request will be added to them.
Request
Response
Path Parameters
fieldSlug
required
string
The slug of the entry this field belongs to
entryId
required
string
The ID of the entry this field belongs to
flowSlug
required
string
The slug of the flow the entry belongs to
Headers
Authorization
required
string
The Bearer token used to access the API.
Body Parameters
data.id
optional
string
The ID of the related resource.
data.type
optional
string
Represents the resource type of the object
data
optional
object
Data to be stored
201: Created
{
"data": [
{
"type": "brand",
"id": "0d28e5b6-f615-4e1c-b038-275cfde97927"
}
]
}

Replace the relationships between an entry and a resource. Unlike a POST to this endpoint, a PUT overrides any existing relationships.

put
Update Entry Relationship(s)

https://api.moltin.com/v2/flows/:flowSlug/entries/:entryId/relationships/:fieldSlug
Replace the relationships between an entry and a resource. Unlike a POST to this endpoint, a PUT overrides any existing relationships
Request
Response
Path Parameters
fieldSlug
required
string
The slug of the Flow the entry belongs to
entryId
required
string
The ID of the entry this field belongs to
flowSlug
required
string
The slug of the entry this field belongs to
Headers
Authorization
required
string
The Bearer token used to access the API
Body Parameters
data.id
optional
string
The ID of the related resource
data.type
optional
string
Represents the resource type of the object
data
optional
object
Data to be stored
200: OK
{
"data": [
{
"type": "brand",
"id": "0d28e5b6-f615-4e1c-b038-275cfde97927"
}
]
}

Removing a relationship between an entry and resource(s) deletes the relationships specified in the payload.

delete
Delete Entry Relationships

https://api.moltin.com/v2/flows/:flowSlug/entries/:entryId/relationships/:fieldSlug
Remove all relationships between an entry and resources
Request
Response
Path Parameters
fieldSlug
required
string
The slug of the entry this field belongs to
entryId
required
string
The ID of the entry this field belongs to
flowSlug
required
string
The slug of the Flow the entry belongs to
Headers
Authorization
required
string
The Bearer token to grant access to the API
204: No Content
‚Äč