Contents
On this page

Update Category - Plugixa Recipe

PUT /plugixa-recipe/v1/categories/{id}

Change the fields you send and leave the rest as they are.

Needs the plugixa_recipe_edit capability, or WordPress’s edit_posts (Contributor and up).

Note. A name that is sent empty is stored empty: only create checks that a name is there.

Request

PUT https://your-site.example/wp-json/plugixa-recipe/v1/categories/3

Path parameters

Name Type Description
id integer The category’s id

Request body

Content type: application/json

Any field of Create Category, none of them required. An empty slug is made again from the name. Send image_id as 0 to remove the image.

{
  "description": "Pancakes, eggs and everything before noon."
}

Responses

200 OK. data is the updated category.

{
  "success": true,
  "message": "",
  "data": {
    "id": "3",
    "language_code": "",
    "translation_group": "",
    "name": "Breakfast",
    "slug": "breakfast",
    "description": "Pancakes, eggs and everything before noon.",
    "image_id": null,
    "display_order": "0",
    "created_at": "2026-11-01 08:00:00",
    "recipe_count": 6
  }
}
Field Type Meaning
data.id string The category’s id
data.slug string Unique among categories
data.description string|null Plain text
data.image_id string|null Attachment id. image_url is added when set
data.display_order string Manual position
data.recipe_count integer Recipes linked to it, in any status
data.language_code, data.translation_group string|null For multilingual sites

Errors

Status Code When
404 rest_error No category with that id.
400 rest_error The body names none of the fields above.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-recipe/v1/categories/3" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"description":"Pancakes, eggs and everything before noon."}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/categories/3');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'description' => 'Pancakes, eggs and everything before noon.',
    ]),
]);
$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/categories/3', {
  method: 'PUT',
  headers: {
    'Authorization': auth,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"description": "Pancakes, eggs and everything before noon."}),
});
const { data } = await response.json();

Quick Links

Share