PHP2Shell: Is Your Joomla Site Safe? What to Do Today Introducing Next Boards: Kanban project and task boards for Joomla Next Exams 6.2.0: Exam Studio, six visual question types, exam embeds and six new languages Building the Future of Joomla Extensions
NextSoftware

Update Tag

PATCH /v1/nextexams/tags/{id}

Update a tag

Changes only the fields you send. Scope questions:write.

Request

PATCH https://your-site.example/api/index.php/v1/nextexams/tags/{id}

Parameters

Name Type In Required Description
id integer path Yes The record's id. (min 1)

Request body

Content type: application/json

Field Type Required Description
title string No Required on create.
alias string No
published integer No One of 0, 1.
{
    "title": "string",
    "alias": "string",
    "published": 0
}

Responses

200 — Saved.

{
    "data": {
        "id": 1
    }
}
Field Type Meaning
data.id integer

Errors

Status Code When
400 BAD_REQUEST The body failed validation, or is not a JSON object (INVALID_JSON).
401 INVALID_TOKEN No token (MISSING_TOKEN), or one that is wrong, expired, revoked, or whose owner can no longer sign in (INVALID_TOKEN).
403 MISSING_SCOPE The token is valid but this request is not allowed, and code says why: MISSING_SCOPE (the token lacks the scope), FORBIDDEN (the owner's role does not allow it), ACCESS_DENIED (the owner cannot manage Next Exams), API_DISABLED (the API Tokens app is off), APP_DISABLED (the feature's app is off — meta.app names it), ACCOUNT_UNUSABLE (the owner is blocked or must reset their password), DEMO_LOCKED (a demo site).
404 NOT_FOUND No record has this id.

Examples

curl

curl -s -X PATCH "https://your-site.example/api/index.php/v1/nextexams/tags/1" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"string","alias":"string","published":0}'

PHP

<?php
$ch = curl_init('https://your-site.example/api/index.php/v1/nextexams/tags/1');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('API_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => '{"title":"string","alias":"string","published":0}',
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

JavaScript

const API_TOKEN = process.env.API_TOKEN;

const response = await fetch("https://your-site.example/api/index.php/v1/nextexams/tags/1", {
  method: 'PATCH',
  headers: {
    "Authorization": `Bearer ${API_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "title": "string",
    "alias": "string",
    "published": 0
  }),
});
const data = await response.json();

All Extensions