Entry Relationships

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

Create Entry Relationship

POST 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.

Path Parameters

NameTypeDescription

fieldSlug

string

The slug of the entry this field belongs to

entryId

string

The ID of the entry this field belongs to

flowSlug

string

The slug of the flow the entry belongs to

Headers

NameTypeDescription

Authorization

string

The Bearer token used to access the API.

Request Body

NameTypeDescription

data.id

string

The ID of the related resource.

data.type

string

Represents the resource type of the object

data

object

Data to be stored

{
    "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.

Update Entry Relationship(s)

PUT 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

Path Parameters

NameTypeDescription

fieldSlug

string

The slug of the Flow the entry belongs to

entryId

string

The ID of the entry this field belongs to

flowSlug

string

The slug of the entry this field belongs to

Headers

NameTypeDescription

Authorization

string

The Bearer token used to access the API

Request Body

NameTypeDescription

data.id

string

The ID of the related resource

data.type

string

Represents the resource type of the object

data

object

Data to be stored

{
    "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 Entry Relationships

DELETE https://api.moltin.com/v2/flows/:flowSlug/entries/:entryId/relationships/:fieldSlug

Remove all relationships between an entry and resources

Path Parameters

NameTypeDescription

fieldSlug

string

The slug of the entry this field belongs to

entryId

string

The ID of the entry this field belongs to

flowSlug

string

The slug of the Flow the entry belongs to

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

Last updated