Skip to content

Tools Web Resources

Ryan James edited this page Aug 17, 2026 · 2 revisions

Web Resources tools

This page is generated from the code by scripts/gen_wiki_tools.py — do not edit by hand.

5 tools · category token webresources · enable with DATAVERSE_TOOLS=webresources (unset enables every category)

Tool-Index · Home

Write tools additionally require DATAVERSE_ALLOW_WRITE=true; delete tools require DATAVERSE_ALLOW_DELETE=true.


dataverse_create_web_resource

Write · non-idempotent · category webresources

Create a webresource record and return the new record's GUID.

Required fields: name (with publisher prefix, e.g. 'new_/scripts/app.js'), web_resource_type (1=HTML, 2=CSS, 3=JScript, 4=XML, 5=PNG, 6=JPG, 7=GIF, 8=XAP, 9=XSL, 10=ICO, 11=SVG, 12=RESX), and content (base64-encoded bytes). Optional: display_name, description.

IMPORTANT: Creating a web resource does NOT publish it automatically. Call dataverse_publish_customizations after this tool to make the resource visible to users. Requires DATAVERSE_ALLOW_WRITE=true.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
name str yes Unique name for the web resource. Must include a publisher prefix (e.g., 'new_/scripts/myscript.js'). The prefix must match a registered publisher customization prefix in the environment. (min_len=1)
web_resource_type int yes Type of web resource (webresourcetype Picklist, required on create). 1=HTML, 2=CSS, 3=JScript, 4=XML, 5=PNG, 6=JPG, 7=GIF, 8=Silverlight(XAP), 9=StyleSheet(XSL), 10=ICO, 11=Vector(SVG), 12=String(RESX).
content str yes Base64-encoded content of the web resource. For text files (HTML/CSS/JS), encode the UTF-8 bytes. For binary files (PNG/JPG/GIF/ICO), encode the raw bytes. (min_len=1)
display_name str | None no None Optional friendly display name shown in the maker portal.
description str | None no None Optional description of the web resource.

Returns {"created": ..., "id": ...}. Errors return {"error": true, "message": "..."}.


dataverse_delete_web_resource

Delete · idempotent · category webresources

Permanently delete a webresource record by its GUID.

This is irreversible. Managed web resources (ismanaged=true) cannot be deleted directly — they must be uninstalled via their parent solution. Requires DATAVERSE_ALLOW_DELETE=true.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
web_resource_id str yes GUID of the webresource record to delete (e.g., 'a1b2c3d4-1234-5678-abcd-ef0123456789').

Returns {"deleted": ..., "id": ...}. Errors return {"error": true, "message": "..."}.


dataverse_get_web_resource

Read · idempotent · category webresources

Retrieve a single webresource record by its GUID.

Returns webresourceid, name, displayname, webresourcetype (+ label), description, languagecode, ismanaged, iscustomizable, createdon, modifiedon. Set include_content=true to also retrieve the base64-encoded content field (may be large for images and script bundles — a 5 MB cap applies).

IMPORTANT: this returns the PUBLISHED version of the web resource. Edits made via dataverse_update_web_resource are saved to the unpublished draft and will NOT appear here until you call dataverse_publish_customizations for this web resource. (Use dataverse_retrieve_unpublished with entity_set_name='webresourceset' to read the draft before publishing.)

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
web_resource_id str yes GUID of the webresource record to retrieve (e.g., 'a1b2c3d4-1234-5678-abcd-ef0123456789').
include_content bool no False When true, include the base64-encoded content field in the response. Content can be large; omit unless needed.

Returns {"record": ...}. Errors return {"error": true, "message": "..."}.


dataverse_list_web_resources

Read · idempotent · category webresources

List webresource records in the Dataverse environment.

Returns webresourceid, name, displayname, webresourcetype (+ label), description, languagecode, ismanaged, iscustomizable, createdon, modifiedon. Content is excluded from list results (it can be very large); use dataverse_get_web_resource with include_content=true to retrieve it. Filter by web_resource_type (1=HTML, 2=CSS, 3=JScript, 4=XML, 5=PNG, 6=JPG, 7=GIF, 8=XAP, 9=XSL, 10=ICO, 11=SVG, 12=RESX) and/or name_contains for a case-sensitive substring match on the name field. After creating or updating a web resource, call dataverse_publish_customizations to make changes live.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
web_resource_type int | None no None Filter by webresourcetype Picklist value. 1=HTML, 2=CSS, 3=JScript, 4=XML, 5=PNG, 6=JPG, 7=GIF, 8=Silverlight(XAP), 9=StyleSheet(XSL), 10=ICO, 11=Vector(SVG), 12=String(RESX).
name_contains str | None no None Substring to filter web resource names (case-sensitive OData contains). E.g., 'new_/' to find resources from the 'new' publisher.
top int no 50 Maximum number of records to return (1–5000). (ge=1, le=5000)
select list[str] | None no None Columns to return. Defaults to webresourceid, name, displayname, webresourcetype, description, languagecode, ismanaged, iscustomizable, createdon, modifiedon.

Returns {"records": ..., "count": ..., "has_more": ...}. Errors return {"error": true, "message": "..."}.


dataverse_update_web_resource

Write · idempotent · category webresources

Partially update a webresource record (PATCH) — only supplied fields change.

Provide web_resource_id and at least one of: content (base64), display_name, description.

IMPORTANT: Updating a web resource does NOT publish it automatically. The PATCH succeeds (HTTP 204) and saves to the UNPUBLISHED draft, but a normal dataverse_get_web_resource still returns the previously published content until you call dataverse_publish_customizations for this web resource. Requires DATAVERSE_ALLOW_WRITE=true.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
web_resource_id str yes GUID of the webresource record to update (e.g., 'a1b2c3d4-1234-5678-abcd-ef0123456789').
content str | None no None Updated base64-encoded content. Omit to leave the current content unchanged.
display_name str | None no None Updated friendly display name. Omit to leave unchanged.
description str | None no None Updated description. Omit to leave unchanged.

Returns {"updated": ..., "id": ...}. Errors return {"error": true, "message": "..."}.


Clone this wiki locally