Contents
On this page

Create Tag - Plugixa Exam

POST /plugixa-exam/v1/tags

Create a tag to label questions with.

Scope questions:write; the token’s user needs the questions:create permission.

The Tags app must be on in Plugixa Exam -> App Manager. With it off, this endpoint answers 404 rest_no_route.

Request

POST https://your-site.example/wp-json/plugixa-exam/v1/tags

Request body

Content type: application/json

Field Type Required Description
title string Yes Must not be blank. Surrounding spaces are trimmed.

The slug is made from the title and made unique (tag when the title gives nothing usable). A new tag is always published, with ordering 0. Any other field sent is ignored: set published or ordering afterwards with Update Tag.

{
  "title": "Final exam"
}

Responses

201 Created. data is the new tag.

{
  "success": true,
  "data": {
    "id": 9,
    "title": "Final exam",
    "slug": "final-exam",
    "published": true,
    "ordering": 0,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 09:30:00",
    "created_by": 1,
    "modified_by": 1,
    "deleted_at": null
  }
}
Field Type Meaning
data.id integer The new tag’s id
data.slug string Unique slug, made from the title
data.published boolean Always true for a new tag
data.ordering integer Always 0 for a new tag
data.created_at string UTC datetime

Errors

Status Code When
400 rest_missing_callback_param title is missing.
400 plugixa_exam_title_required title is blank.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-exam/v1/tags" \
  -H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Final exam"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/tags');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('PLUGIXA_EXAM_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'title' => 'Final exam',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-exam/v1/tags', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ title: 'Final exam' }),
});
const { data } = await response.json();

Quick Links

Share