Contents
Create Collection - Plugixa Recipe
POST /plugixa-recipe/v1/collections
Create a collection, cookbook or meal plan, owned by the caller.
Needs the plugixa_recipe_edit capability, or WordPress’s edit_posts (Contributor and up). Needs Plugixa Recipe Pro with the Collections app on.
Request
POST https://your-site.example/wp-json/plugixa-recipe/v1/collections
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
title |
string |
Yes | The name. name is accepted instead. Must not be blank. |
type |
string |
No | collection (the default), cookbook, meal_plan or favorites. Anything else becomes collection. |
slug |
string |
No | Made from the name when empty. Made unique by appending -2, -3, … |
description |
string |
No | Plain text. |
image_id |
integer |
No | Attachment id of a cover image. |
status |
string |
No | active (the default) or inactive. |
is_public |
boolean |
No | Shown in the public list when true (the default). Or send visibility as public or private. |
is_featured |
integer |
No | 1 or 0. |
display_order |
integer |
No | Manual position. |
Add recipes afterwards with Add Recipe to Collection.
{
"title": "Weekday Dinners",
"type": "collection",
"description": "Quick dinners for busy evenings.",
"is_public": true
}
Responses
200 OK. data is the new collection.
{
"success": true,
"message": "",
"data": {
"id": "4",
"name": "Weekday Dinners",
"slug": "weekday-dinners",
"description": "Quick dinners for busy evenings.",
"image_id": null,
"type": "collection",
"status": "active",
"is_featured": false,
"display_order": "0",
"user_id": "1",
"visibility": "public",
"created_at": "2026-11-12 09:30:00",
"modified_at": null,
"title": "Weekday Dinners",
"is_public": true,
"recipes": [],
"recipe_count": 0
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
string |
The collection’s id |
data.name, data.title |
string |
The name, twice: title is a copy |
data.type |
string |
collection, cookbook, meal_plan or favorites |
data.status |
string |
active or inactive |
data.visibility |
string |
public or private |
data.is_public |
boolean |
visibility as a boolean |
data.is_featured |
boolean |
Featured flag |
data.user_id |
string|null |
The user who created it |
data.recipes |
object[] |
Recipes in it, in order, with day_number and meal_type for a meal plan |
data.recipe_count |
integer |
Entries in recipes |
The status is 200, not 201.
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_error |
title and name are both missing or blank. |
500 |
rest_error |
The collection could not be written. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-recipe/v1/collections" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"title":"Weekday Dinners","description":"Quick dinners for busy evenings."}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/collections');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Weekday Dinners',
'description' => 'Quick dinners for busy evenings.',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-recipe/v1/collections', {
method: 'POST',
headers: {
'Authorization': auth,
'Content-Type': 'application/json',
},
body: JSON.stringify({"title": "Weekday Dinners", "description": "Quick dinners for busy evenings."}),
});
const { data } = await response.json();
Quick Links
Share