View .md

Spells endpoints (Admin API)

15 FeatherPanel Admin API endpoints from admin/spells.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Last synced from FeatherPanel 15b94e9 on .

On this page

Defined in backend/app/routes/admin/spells.php. Authentication used here: Admin. Read Authentication for how to send credentials and Rate limits and errors for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

Endpoints

GET/api/admin/spells

Auth: AdminPermission: admin.spells.viewRoute name: admin-spellsController: SpellsController::indexroute source

Get all spells Retrieve a paginated list of all spells with optional filtering by realm and search functionality.

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter spells by name, author, or description
realm_idqueryintegernoFilter spells by realm ID
Response data fieldTypeDescription
spellsSpell[]
paginationSpellPagination
searchobject
curl -X GET "$PANEL_URL/api/admin/spells" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Spells retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions

GET/api/admin/spells/{id}

Auth: AdminPermission: admin.spells.viewRoute name: admin-spells-showController: SpellsController::showroute source

Get spell by ID Retrieve a specific spell by its ID with realm information.

ParameterInTypeRequiredDescription
idpathintegeryesSpell ID
Response data fieldTypeDescription
spellSpell
curl -X GET "$PANEL_URL/api/admin/spells/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Spell retrieved successfully · 400 Bad request - Invalid spell ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Spell not found

PATCH/api/admin/spells/{id}

Auth: AdminPermission: admin.spells.editRoute name: admin-spells-updateController: SpellsController::updateroute source

Update spell Update an existing spell with comprehensive validation including JSON field validation, UUID validation, and activity logging.

ParameterInTypeRequiredDescription
idpathintegeryesSpell ID

Request body: SpellUpdate (application/json)

Body fieldTypeRequiredDescription
realm_idintegernoRealm ID
authorstringnoSpell author
namestringnoSpell name
descriptionstringnoSpell description
featuresstringnoSpell features (JSON)
docker_imagesstringnoDocker images (JSON)
default_docker_imagestringnoDefault Docker image used on new server installs
file_denyliststringnoFile denylist (JSON)
update_urlstringnoUpdate URL
config_filesstringnoConfig files
config_startupstringnoConfig startup
config_logsstringnoConfig logs
config_stopstringnoConfig stop
startupstringnoStartup command
script_containerstringnoScript container
script_entrystringnoScript entry point
script_is_privilegedbooleannoScript is privileged
script_installstringnoInstallation script
force_outgoing_ipbooleannoForce outgoing IP
config_fromintegernoConfig from spell ID
copy_script_fromintegernoCopy script from spell ID
uuidstringnoSpell UUID
Response data fieldTypeDescription
spellSpell
curl -X PATCH "$PANEL_URL/api/admin/spells/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"realm_id":0,"author":"","name":"","description":"","features":"","docker_images":"","default_docker_image":"","file_denylist":"","update_url":"","config_files":"","config_startup":"","config_logs":"","config_stop":"","startup":"","script_container":"","script_entry":"","script_is_privileged":false,"script_install":"","force_outgoing_ip":false,"config_from":0,"copy_script_from":0,"uuid":""}'

Plugin events: featherpanel:admin:spells:spell:updated

Responses: 200 Spell updated successfully · 400 Bad request - Invalid JSON, no data provided, invalid data types, validation errors, invalid realm, invalid UUID format, or UUID already exists · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Spell or realm not found

DELETE/api/admin/spells/{id}

Auth: AdminPermission: admin.spells.deleteRoute name: admin-spells-deleteController: SpellsController::deleteroute source

Delete spell Permanently delete a spell. Checks for references from other spells before deletion.

ParameterInTypeRequiredDescription
idpathintegeryesSpell ID
Response data fieldTypeDescription
messagestringSuccess message
curl -X DELETE "$PANEL_URL/api/admin/spells/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:admin:spells:spell:deleted

Responses: 200 Spell deleted successfully · 400 Bad request - Spell is referenced by other spells or failed to delete · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Spell not found

PUT/api/admin/spells

Auth: AdminPermission: admin.spells.createRoute name: admin-spells-createController: SpellsController::createroute source

Create new spell Create a new spell with comprehensive validation including JSON field validation, UUID generation, and activity logging.

Request body: SpellCreate (application/json)

Body fieldTypeRequiredDescription
realm_idintegeryesRealm ID
authorstringyesSpell author
namestringyesSpell name
descriptionstringnoSpell description
featuresstringnoSpell features (JSON)
docker_imagesstringnoDocker images (JSON)
default_docker_imagestringnoDefault Docker image used on new server installs
file_denyliststringnoFile denylist (JSON)
update_urlstringnoUpdate URL
config_filesstringnoConfig files
config_startupstringnoConfig startup
config_logsstringnoConfig logs
config_stopstringnoConfig stop
startupstringnoStartup command
script_containerstringnoScript container
script_entrystringnoScript entry point
script_is_privilegedbooleannoScript is privileged
script_installstringnoInstallation script
force_outgoing_ipbooleannoForce outgoing IP
config_fromintegernoConfig from spell ID
copy_script_fromintegernoCopy script from spell ID
uuidstringnoSpell UUID (auto-generated if not provided)
idintegernoOptional spell ID (useful for migrations from other platforms)
Response data fieldTypeDescription
spellSpell
curl -X PUT "$PANEL_URL/api/admin/spells" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"realm_id":0,"author":"","name":"","description":"","features":"","docker_images":"","default_docker_image":"","file_denylist":"","update_url":"","config_files":"","config_startup":"","config_logs":"","config_stop":"","startup":"","script_container":"","script_entry":"","script_is_privileged":false,"script_install":"","force_outgoing_ip":false,"config_from":0,"copy_script_from":0,"uuid":"","id":0}'

Plugin events: featherpanel:admin:spells:spell:created

Responses: 201 Spell created successfully · 400 Bad request - Invalid JSON, missing required fields, invalid data types, validation errors, invalid realm, invalid UUID format, or UUID already exists · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Realm not found

POST/api/admin/spells/reorder

Auth: AdminPermission: admin.spells.editRoute name: admin-spells-reorderController: SpellsController::reorderroute source

Reorder spells within a realm Update the display sort order of spells in a realm (e.g. Node.js first, then Python, then Java).

Body fieldTypeRequiredDescription
realm_idintegeryes
spellsobject[]yes
curl -X POST "$PANEL_URL/api/admin/spells/reorder" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"realm_id":0,"spells":[]}'

Plugin events: featherpanel:admin:spells:reordered

Responses: 200 Spells reordered successfully · 400 Bad request · 404 Realm not found · 500 Internal server error

GET/api/admin/spells/realm/{realmId}

Auth: AdminPermission: admin.spells.viewRoute name: admin-spells-by-realmController: SpellsController::getByRealmroute source

Get spells by realm Retrieve all spells belonging to a specific realm with pagination and search functionality.

ParameterInTypeRequiredDescription
realmIdpathintegeryesRealm ID
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter spells
Response data fieldTypeDescription
spellsSpell[]
realmobjectRealm information
paginationobject
curl -X GET "$PANEL_URL/api/admin/spells/realm/$REALM_ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Spells for realm retrieved successfully · 400 Bad request - Invalid realm ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Realm not found

POST/api/admin/spells/import

Auth: AdminPermission: admin.spells.createRoute name: admin-spells-importController: SpellsController::importroute source

Import spell from file Import a spell from a JSON file with comprehensive validation, variable import, and metadata preservation.

Request body: SpellImport (multipart/form-data)

Body fieldTypeRequiredDescription
realm_idintegeryesRealm ID
filestring (binary)noSpell JSON file
Response data fieldTypeDescription
spellSpell
curl -X POST "$PANEL_URL/api/admin/spells/import" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -F "realm_id=" \
  -F "file=@./file"

Responses: 201 Spell imported successfully · 400 Bad request - Invalid realm ID, no file uploaded, file upload error, file read error, invalid JSON format, or failed to create spell · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Realm not found

GET/api/admin/spells/{id}/export

Auth: AdminPermission: admin.spells.viewRoute name: admin-spells-exportController: SpellsController::exportroute source

Export spell to file Export a spell to a JSON file with complete metadata, variables, and FeatherPanel-specific information.

ParameterInTypeRequiredDescription
idpathintegeryesSpell ID
curl -X GET "$PANEL_URL/api/admin/spells/$ID/export" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Spell exported successfully · 400 Bad request - Invalid spell ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Spell not found

GET/api/admin/spells/{spellId}/variables

Auth: AdminPermission: admin.spells.viewRoute name: admin-spell-variables-listController: SpellsController::listVariablesroute source

List spell variables Retrieve all variables for a specific spell.

ParameterInTypeRequiredDescription
spellIdpathintegeryesSpell ID
Response data fieldTypeDescription
variablesSpellVariable[]
curl -X GET "$PANEL_URL/api/admin/spells/$SPELL_ID/variables" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Variables retrieved successfully · 400 Bad request - Invalid spell ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Spell not found

POST/api/admin/spells/{spellId}/variables

Auth: AdminPermission: admin.spells.editRoute name: admin-spell-variables-createController: SpellsController::createVariableroute source

Create spell variable Create a new variable for a specific spell with validation.

ParameterInTypeRequiredDescription
spellIdpathintegeryesSpell ID

Request body: SpellVariableCreate (application/json)

Body fieldTypeRequiredDescription
namestringyesVariable name
env_variablestringyesEnvironment variable name
descriptionstringyesVariable description
default_valuestringyesDefault value
user_viewablebooleannoUser viewable flag
user_editablebooleannoUser editable flag
rulesstringnoValidation rules
field_typestringnoField type
Response data fieldTypeDescription
variableSpellVariable
curl -X POST "$PANEL_URL/api/admin/spells/$SPELL_ID/variables" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","env_variable":"","description":"","default_value":"","user_viewable":false,"user_editable":false,"rules":"","field_type":""}'

Plugin events: featherpanel:admin:spells:variable:created

Responses: 201 Variable created successfully · 400 Bad request - Invalid JSON, missing required fields, or failed to create variable · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Spell not found

PATCH/api/admin/spell-variables/{id}

Auth: AdminPermission: admin.spells.editRoute name: admin-spell-variables-updateController: SpellsController::updateVariableroute source

Update spell variable Update an existing spell variable.

ParameterInTypeRequiredDescription
idpathintegeryesVariable ID

Request body: SpellVariableUpdate (application/json)

Body fieldTypeRequiredDescription
namestringnoVariable name
env_variablestringnoEnvironment variable name
descriptionstringnoVariable description
default_valuestringnoDefault value
user_viewablebooleannoUser viewable flag
user_editablebooleannoUser editable flag
rulesstringnoValidation rules
field_typestringnoField type
Response data fieldTypeDescription
variableSpellVariable
curl -X PATCH "$PANEL_URL/api/admin/spell-variables/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","env_variable":"","description":"","default_value":"","user_viewable":false,"user_editable":false,"rules":"","field_type":""}'

Plugin events: featherpanel:admin:spells:variable:updated

Responses: 200 Variable updated successfully · 400 Bad request - Invalid JSON or failed to update variable · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Variable not found

DELETE/api/admin/spell-variables/{id}

Auth: AdminPermission: admin.spells.editRoute name: admin-spell-variables-deleteController: SpellsController::deleteVariableroute source

Delete spell variable Delete an existing spell variable.

ParameterInTypeRequiredDescription
idpathintegeryesVariable ID
Response data fieldTypeDescription
messagestringSuccess message
curl -X DELETE "$PANEL_URL/api/admin/spell-variables/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:admin:spells:variable:deleted

Responses: 200 Variable deleted successfully · 400 Bad request - Failed to delete variable · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Variable not found

GET/api/admin/spells/online/list

Auth: AdminPermission: admin.spells.viewRoute name: admin-spells-online-listController: SpellsController::onlineListroute source

List online spells Retrieve spells from the online FeatherPanel spell registry with search and pagination.

ParameterInTypeRequiredDescription
qquerystringnoSearch query
pagequeryintegernoPage number for pagination
per_pagequeryintegernoNumber of records per page
Response data fieldTypeDescription
spellsOnlineSpell[]
paginationobjectPagination information
curl -X GET "$PANEL_URL/api/admin/spells/online/list" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Online spells retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 500 Failed to fetch online spell list or invalid response

POST/api/admin/spells/online/install

Auth: AdminPermission: admin.spells.createRoute name: admin-spells-online-installController: SpellsController::onlineInstallroute source

Install spell from online registry Install a spell from the online FeatherPanel spell registry with comprehensive validation, variable import, and metadata preservation.

Request body: OnlineSpellInstall (application/json)

Body fieldTypeRequiredDescription
identifierstringyesSpell identifier
realm_idintegeryesRealm ID
Response data fieldTypeDescription
spellSpell
curl -X POST "$PANEL_URL/api/admin/spells/online/install" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"identifier":"","realm_id":0}'

Responses: 201 Spell installed successfully from online repository · 400 Bad request - Invalid identifier, invalid realm ID, invalid JSON format, or failed to create spell · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Realm not found or spell not found in registry · 500 Failed to download spell JSON