---
title: "REST API, Abilities & Constants"
description: "Routes under shapetranslate/v1 and wp-config.php constants."
url: "https://shapetranslate.com/docs/dev-rest/"
updated: "2026-11-16"
category: Developer Guide
---

# REST API, Abilities & Constants

Routes under `shapetranslate/v1` and `wp-config.php` constants.

## REST API (`shapetranslate/v1`)

| Route | Method | Permission |
| --- | --- | --- |
| `/navigation-menus/{translation|language|link|candidates}` | POST, DELETE, GET | manage capability + `edit_theme_options` |
| `/template-parts/…`, `/templates/…` (block themes only) | POST, DELETE, GET | manage capability + `edit_theme_options` |
| `/site-editor/panel?postType=&slug=` | GET | manage capability |

Core REST collections accept `lang` and `lang_fallback`.

## WooCommerce routes Pro

| Route | Method | Permission |
| --- | --- | --- |
| `/products/{id}/translate` (body: `lang`) | POST | `edit_products` + edit rights on the product |
| `/products/untranslated?lang=&page=&per_page=` | GET | `edit_products` |

`/wc/v3` products, variations, orders and terms gain `lang`; products, variations and terms gain `translations` (`{lang: id}`, `0` unlinks). `?lang=xx` filters lists. `wc_get_products( array( 'lang' => 'fr' ) )` works as in Polylang. PHP helpers: `shapetranslate_get_order_language()`, `shapetranslate_get_customer_language()`, `shapetranslate_set_customer_language()`.

## Abilities for AI agents (MCP) Pro

On WordPress 6.9+, Pro registers read-only abilities in the category **Multilingual (ShapeTranslate)**. With the MCP Adapter plugin, AI agents can call them as MCP tools. None of them changes content or starts a translation.

| Ability | Returns | Permission |
| --- | --- | --- |
| `shapetranslate/list-languages` | Languages (`include_disabled` optional) | `edit_posts` |
| `shapetranslate/get-post-translations` | A post's language and its translations with ID, title, status and edit link | `edit_post` |
| `shapetranslate/get-term-translations` | A term's translations | `edit_term` |
| `shapetranslate/find-missing-translations` | Missing translations by language, post type and search (paged, max 100) | `edit_posts` |
| `shapetranslate/get-translation-coverage` | Per language: originals missing a translation out of the total | `edit_posts` |

Filter `shapetranslate_abilities` removes an ability or hides it from MCP. AI filters: `shapetranslate_ai_provider`, `shapetranslate_ai_restrict_capability`, `shapetranslate_ai_translatable_meta_keys`, `shapetranslate_ai_elementor_widget_fields`, `shapetranslate_ai_block_attribute_rules`. WooCommerce filters: `shapetranslate_wc_translate_catalog`, `shapetranslate_wc_shared_product_props`, `shapetranslate_wc_shared_product_meta`, `shapetranslate_wc_email_language_id`, `shapetranslate_wc_store_pages`, `shapetranslate_wc_install_language_packs`, `shapetranslate_wc_duplicate_translations`.

## Constants

| Constant | Use |
| --- | --- |
| `SHAPETRANSLATE_DEEPL_API_KEY` Pro | DeepL API key. Wins over a key saved on the AI Translation screen. |
| `OPENROUTER_API_KEY` Pro | OpenRouter key for the built-in OpenRouter connector. |
| `SHAPETRANSLATE_WPML_CONFIG` | Set to `false` to ignore `wpml-config.xml` files. |
| `SHAPETRANSLATE_VERSION`, `SHAPETRANSLATE_PATH`, `SHAPETRANSLATE_URL`, `SHAPETRANSLATE_FILE`, `SHAPETRANSLATE_BASENAME` | Read-only plugin info. |
| `SHAPETRANSLATE_LOCAL_DIR` | `wp-content/shapetranslate`. Place your own `wpml-config.xml` files here. |

There are no WP-CLI commands in version 1.0.1.
