API resource
Code Snippets
Code Snippets are saved body-only PHP scripts for WordPress sites in your account. Use Code Snippets to save reusable PHP source, list or inspect saved snippets, remove snippets, and start background execution tasks across accessible sites.
List Code Snippets
Returns active Code Snippets in the authenticated account without their PHP source.
/code-snippets POSTCreate a Code Snippet
Creates a saved Code Snippet from body-only PHP source.
/code-snippets POSTValidate PHP source
Parses body-only PHP through the dedicated Dragoman validation boundary without executing
/code-snippets/validate GETList Code Snippet executions
Returns retained Code Snippet execution tasks visible to the authenticated account. Each
/code-snippets/executions GETShow a Code Snippet
Returns one active Code Snippet, including its decrypted current PHP source.
/code-snippets/{code_snippet_id} DELETEDelete a Code Snippet
Soft deletes one active Code Snippet. Deleted Code Snippets are no longer available through this API.
/code-snippets/{code_snippet_id} POSTUpdate a Code Snippet
Applies a partial update to one active Code Snippet. A changed `code` value creates the next
/code-snippets/{code_snippet_id}/update POSTValidate source for a saved Code Snippet
Applies the same stateless Dragoman parse-only validation as the collection route after
/code-snippets/{code_snippet_id}/validate POSTExecute a Code Snippet
Accepts a background task that executes the Code Snippet's current source on accessible sites.
/code-snippets/{code_snippet_id}/execute GETList Code Snippet versions
Returns every retained immutable version newest first, without PHP source.
/code-snippets/{code_snippet_id}/versions GETShow a Code Snippet version
Returns one retained immutable version including its decrypted PHP source.
/code-snippets/{code_snippet_id}/versions/{number} POSTRestore a Code Snippet version
Copies the selected historical PHP source into a new current version while retaining the
/code-snippets/{code_snippet_id}/versions/{number}/restore