/services/platforms/v1/mcp-tokens/create
Auth
Create a USER-LEVEL, MCP-ONLY API token for the external MCP server (POST /api/mcp/wemasy). Two deliberate properties: - project_id stays NULL -> NOT locked to one project, so the agent can target ANY of the user's projects per call (multi-project). A project-scoped token would be hard-locked by AddProjectToRequestMiddleware and cannot switch. - abilities = ['mcp'] -> rejected on the rest of the API by AddProjectToRequestMiddleware (mcp ability but not '*'), so a leaked MCP token is useless outside the MCP endpoint. Least privilege. Gated by the per-user `mcp_enabled` flag (User::canUseMcp). The plaintext token is returned ONCE.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
name |
string
max: 255 |
Yes |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
Retry-After |
integer | Seconds until the rate limit resets | 60 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
curl -X POST "https://api.wemasy.nl/api/services/platforms/v1/mcp-tokens/create" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'
fetch('https://api.wemasy.nl/api/services/platforms/v1/mcp-tokens/create', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
->accept('application/json')
->post('https://api.wemasy.nl/api/services/platforms/v1/mcp-tokens/create', {
"name": "string"
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"name": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/platforms/v1/mcp-tokens/create", headers=headers, json=data)
print(r.json())