API reference / Operations by tag
mcp
Operations tagged mcp.
15 operations. Base URL https://api.metrixed.com/v1; see authentication, errors and pagination.
Operations
| Method | Path | Summary |
|---|---|---|
| POST | /mcp | MCP endpoint (Model Context Protocol, Streamable HTTP, stateless, JSON responses). Authorization: Bearer <MCP token dtm_…>; the token's audience (network, partner, advertiser) and scopes select the tools. Sessions and API keys are refused (401) |
| GET | /mcp-tokens | Every MCP token of the workspace (staff with api_keys read) |
| DELETE | /mcp-tokens/{id} | Revoke any MCP token of the workspace (staff with api_keys write) |
| GET | /mcp-tokens/usage | MCP usage across the workspace (staff with api_keys read) |
| GET | /mcp/.well-known/oauth-protected-resource | RFC 9728 protected-resource metadata for the MCP endpoint (the 401 WWW-Authenticate header points here) |
| GET | /mcp/oauth/.well-known/oauth-authorization-server | RFC 8414 authorization-server metadata (issuer /v1/mcp/oauth) |
| GET | /mcp/oauth/.well-known/openid-configuration | Authorization-server metadata at the OIDC path-append location (same document) |
| GET | /mcp/oauth/authorize | OAuth authorization endpoint: consent page (HTML) for the signed-in portal user, or a redirect to the portal's /login?next=…; response_type=code, PKCE S256 required |
| POST | /mcp/oauth/register | RFC 7591 dynamic client registration (public clients, PKCE; redirect URIs https, loopback http or a native-app scheme). The client_id is a sealed copy of the registration |
| POST | /mcp/oauth/token | OAuth token endpoint (application/x-www-form-urlencoded): authorization_code + code_verifier, or refresh_token (rotating). Access tokens are MCP tokens (1 h), revocable on the AI & MCP page |
| GET | /me/mcp-info | MCP setup for the signed-in user: endpoint, audience, grantable scopes, tool reference, rate limit |
| GET | /me/mcp-tokens | MCP tokens of the signed-in user's account (staff: own; partner/advertiser: the party's) |
| POST | /me/mcp-tokens | Create an MCP token (signed-in, non-impersonated sessions only; scopes capped at the user's role; expiry 1-365 days, default 90). The token is returned once |
| DELETE | /me/mcp-tokens/{id} | Revoke an MCP token (portal non-admins: only their own) |
| GET | /me/mcp-usage | MCP usage of the account's tokens: calls per tool and per token (30 days) and the latest audited calls |
POST /mcp
MCP endpoint (Model Context Protocol, Streamable HTTP, stateless, JSON responses). Authorization: Bearer <MCP token dtm_…>; the token's audience (network, partner, advertiser) and scopes select the tools. Sessions and API keys are refused (401)
Operation postMcp. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): McpJsonRpc
| Field | Type | Flags | Description |
|---|---|---|---|
jsonrpc | enum: 2.0 | required | |
id | object (free-form) | ||
method | string | required | |
params | object (free-form) |
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json McpJsonRpcResult |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/mcp' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":""}'
Example 200 response:
{
"jsonrpc": "",
"id": {},
"result": {},
"error": {}
}
GET /mcp-tokens
Every MCP token of the workspace (staff with api_keys read) Every MCP token of the workspace (staff with api_keys read). WP-67: naturally small; returns at most 500 rows and capped: true when that cap is hit.
Operation getMcpTokens. Auth: API key (Bearer) or session cookie.
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json McpTokenList |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/mcp-tokens' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"data": [
{}
],
"page": {}
}
DELETE /mcp-tokens/{id}
Revoke any MCP token of the workspace (staff with api_keys write)
Operation deleteMcpTokensId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
curl -X DELETE 'https://api.metrixed.com/v1/mcp-tokens/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 204 response:
{
"ok": false
}
GET /mcp-tokens/usage
MCP usage across the workspace (staff with api_keys read)
Operation getMcpTokensUsage. Auth: API key (Bearer) or session cookie.
curl 'https://api.metrixed.com/v1/mcp-tokens/usage' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"tools": [
{}
],
"tokens": [
{}
],
"recent": [
{}
],
"window_days": 0
}
GET /mcp/.well-known/oauth-protected-resource
RFC 9728 protected-resource metadata for the MCP endpoint (the 401 WWW-Authenticate header points here)
Operation getMcp.wellKnownOauthProtectedResource. Auth: API key (Bearer) or session cookie.
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json McpResourceMetadata |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/mcp/.well-known/oauth-protected-resource' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"resource": "",
"resource_name": "",
"scopes_supported": [
""
],
"bearer_methods_supported": [
""
]
}
GET /mcp/oauth/.well-known/oauth-authorization-server
RFC 8414 authorization-server metadata (issuer /v1/mcp/oauth)
Operation getMcpOauth.wellKnownOauthAuthorizationServer. Auth: API key (Bearer) or session cookie.
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json McpAuthServerMetadata |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/mcp/oauth/.well-known/oauth-authorization-server' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"issuer": "",
"authorization_endpoint": "",
"token_endpoint": "",
"registration_endpoint": ""
}
GET /mcp/oauth/.well-known/openid-configuration
Authorization-server metadata at the OIDC path-append location (same document)
Operation getMcpOauthOpenidConfiguration. Auth: API key (Bearer) or session cookie.
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json McpAuthServerMetadata |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/mcp/oauth/.well-known/openid-configuration' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"issuer": "",
"authorization_endpoint": "",
"token_endpoint": "",
"registration_endpoint": ""
}
GET /mcp/oauth/authorize
OAuth authorization endpoint: consent page (HTML) for the signed-in portal user, or a redirect to the portal's /login?next=…; response_type=code, PKCE S256 required
Operation getMcpOauthAuthorize. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
response_type | query | string | yes | |
client_id | query | string | yes | |
redirect_uri | query | string | no | |
code_challenge | query | string | yes | |
code_challenge_method | query | string | yes | |
state | query | string | no | |
scope | query | string | no | |
resource | query | string | no |
curl 'https://api.metrixed.com/v1/mcp/oauth/authorize' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"ok": false
}
POST /mcp/oauth/register
RFC 7591 dynamic client registration (public clients, PKCE; redirect URIs https, loopback http or a native-app scheme). The client_id is a sealed copy of the registration
Operation postMcpOauthRegister. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): McpClientRegistration
| Field | Type | Flags | Description |
|---|---|---|---|
client_name | string | ||
redirect_uris | array of string | required | |
token_endpoint_auth_method | enum: none | ||
grant_types | array of string |
curl -X POST 'https://api.metrixed.com/v1/mcp/oauth/register' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"redirect_uris":[""]}'
Example 201 response:
{
"client_id": "",
"client_id_issued_at": 0,
"client_name": "",
"redirect_uris": [
""
]
}
POST /mcp/oauth/token
OAuth token endpoint (application/x-www-form-urlencoded): authorization_code + code_verifier, or refresh_token (rotating). Access tokens are MCP tokens (1 h), revocable on the AI & MCP page
Operation postMcpOauthToken. Auth: API key (Bearer) or session cookie.
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json McpOAuthToken |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/mcp/oauth/token' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"access_token": "",
"token_type": "",
"expires_in": 0,
"refresh_token": ""
}
GET /me/mcp-info
MCP setup for the signed-in user: endpoint, audience, grantable scopes, tool reference, rate limit
Operation getMeMcpInfo. Auth: API key (Bearer) or session cookie.
curl 'https://api.metrixed.com/v1/me/mcp-info' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"audience": "",
"endpoint": "",
"endpoint_path": "",
"scopes": [
{}
]
}
GET /me/mcp-tokens
MCP tokens of the signed-in user's account (staff: own; partner/advertiser: the party's) MCP tokens of the signed-in user's account (staff: own; partner/advertiser: the party's). WP-67: naturally small; returns at most 500 rows and capped: true when that cap is hit.
Operation getMeMcpTokens. Auth: API key (Bearer) or session cookie.
| Status | Description | Body |
|---|---|---|
| 200 | ok | application/json McpTokenList |
| default | error | application/json Error |
curl 'https://api.metrixed.com/v1/me/mcp-tokens' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"data": [
{}
],
"page": {}
}
POST /me/mcp-tokens
Create an MCP token (signed-in, non-impersonated sessions only; scopes capped at the user's role; expiry 1-365 days, default 90). The token is returned once
Operation postMeMcpTokens. Auth: API key (Bearer) or session cookie.
Request body (application/json, required): McpTokenCreate
| Field | Type | Flags | Description |
|---|---|---|---|
name | string | required | |
scopes | array of enum: reports:read, entities:read, logs:read, billing:read, fraud:read, offers:write, approvals:write, conversions:write, links:write, postbacks:write | required | |
expires_in_days | integer |
| Status | Description | Body |
|---|---|---|
| 201 | ok | application/json McpTokenCreated |
| default | error | application/json Error |
curl -X POST 'https://api.metrixed.com/v1/me/mcp-tokens' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"","scopes":["reports:read"]}'
Example 201 response:
{
"id": "",
"name": "",
"token": "",
"key_prefix": ""
}
DELETE /me/mcp-tokens/{id}
Revoke an MCP token (portal non-admins: only their own)
Operation deleteMeMcpTokensId. Auth: API key (Bearer) or session cookie.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
curl -X DELETE 'https://api.metrixed.com/v1/me/mcp-tokens/<id>' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 204 response:
{
"ok": false
}
GET /me/mcp-usage
MCP usage of the account's tokens: calls per tool and per token (30 days) and the latest audited calls
Operation getMeMcpUsage. Auth: API key (Bearer) or session cookie.
curl 'https://api.metrixed.com/v1/me/mcp-usage' \
-H "Authorization: Bearer $DT_API_KEY" \
-H 'Accept: application/json'
Example 200 response:
{
"tools": [
{}
],
"tokens": [
{}
],
"recent": [
{}
],
"window_days": 0
}