Collections

These endpoints allow you to retrieve, create, update, and delete Collection(s).


List all collections

This query allows you to retrieve a paginated list of all your collections. By default, a maximum of 25 collections are shown per page.

Arguments

  • Name
    query
    Type
    String!
    Description

    Supported filter parameters: order_by order_dir

  • Name
    after
    Type
    String
    Description

    Returns the elements that come after the specified cursor.

  • Name
    first
    Type
    String
    Description

    Returns up to the first n elements from the list.

Fields

Request

POST
https://services.lightfunnels.com/api/v2
query collectionsQuery($first: Int, $after: String, $query: String!){
	collections(query: "order_by:id order_dir:desc last_month", after: "WzVE4OTA5LDEe/4OTA5XQ==", first: 10){
		edges{
			node{
				id
				type
				name
				created_at				
				...
			}
			cursor
		}
		pageInfo{
			endCursor
			hasNextPage
		}
	}
}

Response

{
		"data": {
			"pagination": {
				"edges": [{
					"node": {
						"id": "col_tDs_sAQZrq9RIrPS-BkyD",
						"type": "specific_funnels",
						"name": "My Collection",
						"created_at": "a few seconds ago",
						"__typename": "Collection"
						...
					},
					"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
				}],
				"pageInfo": {
					"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
					"hasNextPage": false
				}
			}
		}
	}

Create a collection

This query allows you to add a new collection.

Arguments

Fields

Request

POST
https://services.lightfunnels.com/api/v2
mutation mutationName($node: CollectionInput!) {
	createCollection(node: $node){
		# Collection type fields
	}
}

Response

{
		"data": {
			"pagination": {
				"edges": [{
					"node": {
						"id": "col_tDs_sAQZrq9RIrPS-BkyD",
						"type": "specific_funnels",
						"name": "My Collection",
						"created_at": "a few seconds ago",
						"__typename": "Collection"
						...
					},
					"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
				}],
				"pageInfo": {
					"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
					"hasNextPage": false
				}
			}
		}
	}

Retrieve a collection

This query allows you to retrieve a collection by providing its id.

Arguments

  • Name
    id
    Type
    ID!
    Description

    The collection id.

Fields

Request

POST
https://services.lightfunnels.com/api/v2
	query collectionQuery($id: ID!){
		node(id: $id){
			... on Collection{
				# Collection type fields
			}
		}
	}

Response

{
		"data": {
			"pagination": {
				"edges": [{
					"node": {
						"id": "col_tDs_sAQZrq9RIrPS-BkyD",
						"type": "specific_funnels",
						"name": "My Collection",
						"created_at": "a few seconds ago",
						"__typename": "Collection"
						...
					},
					"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
				}],
				"pageInfo": {
					"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
					"hasNextPage": false
				}
			}
		}
	}

Update a Collection

This query allows you to perform an update on a Collection.

Arguments

Fields

Request

Post
https://services.lightfunnels.com/api/v2
mutation updateCollectionMutation($node: CollectionUpdateInput!, $id: ID!){
		updateCollection(node: $node, id: $id){
			# Collection type fields
		}
	}

Response

{
		"data": {
			"pagination": {
				"edges": [{
					"node": {
						"id": "col_tDs_sAQZrq9RIrPS-BkyD",
						"type": "specific_funnels",
						"name": "My Collection",
						"created_at": "a few seconds ago",
						"__typename": "Collection"
						...
					},
					"cursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ=="
				}],
				"pageInfo": {
					"endCursor": "W251bGwsImNvbF90RHNfc0FRWnJxOVJJclBTLUJreUQiXQ==",
					"hasNextPage": false
				}
			}
		}
	}

Delete a Collection

This query allows you to delete collections.

Arguments

  • Name
    ids
    Type
    [ID!]!
    Description

    The collection ids.

Fields

  • Name
    [ID]
    Description

    List of collection ids.

Request

POST
https://services.lightfunnels.com/api/v2
	mutation deleteCollectionsMutation($ids: [ID!]!){
		deleteCollections(ids: $ids){
			# [ID] type field
		}
	}

Response

{
	"data": {
		"deleteCollections": [
			"UHJvZHVjdDoxNTUxMQ==",
			"UHJvZHVjdFKWATUxMQ=="
		]
	}
}