Skip to content
Docs

API reference / Operations by tag

mcp

Operations tagged mcp.

15 operations. Base URL https://api.metrixed.com/v1; see authentication, errors and pagination.

Operations

MethodPathSummary
POST/mcpMCP 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-tokensEvery 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/usageMCP usage across the workspace (staff with api_keys read)
GET/mcp/.well-known/oauth-protected-resourceRFC 9728 protected-resource metadata for the MCP endpoint (the 401 WWW-Authenticate header points here)
GET/mcp/oauth/.well-known/oauth-authorization-serverRFC 8414 authorization-server metadata (issuer /v1/mcp/oauth)
GET/mcp/oauth/.well-known/openid-configurationAuthorization-server metadata at the OIDC path-append location (same document)
GET/mcp/oauth/authorizeOAuth 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/registerRFC 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/tokenOAuth 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-infoMCP setup for the signed-in user: endpoint, audience, grantable scopes, tool reference, rate limit
GET/me/mcp-tokensMCP tokens of the signed-in user's account (staff: own; partner/advertiser: the party's)
POST/me/mcp-tokensCreate 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-usageMCP 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

FieldTypeFlagsDescription
jsonrpcenum: 2.0required
idobject (free-form)
methodstringrequired
paramsobject (free-form)
StatusDescriptionBody
200okapplication/json McpJsonRpcResult
defaulterrorapplication/json Error
bash
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:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpTokenList
defaulterrorapplication/json Error
bash
curl 'https://api.metrixed.com/v1/mcp-tokens' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 200 response:

json
{
  "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.

ParameterInTypeRequiredDescription
idpathstringyes
StatusDescriptionBody
204okapplication/json Ok
defaulterrorapplication/json Error
bash
curl -X DELETE 'https://api.metrixed.com/v1/mcp-tokens/<id>' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 204 response:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpUsage
defaulterrorapplication/json Error
bash
curl 'https://api.metrixed.com/v1/mcp-tokens/usage' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 200 response:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpResourceMetadata
defaulterrorapplication/json Error
bash
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:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpAuthServerMetadata
defaulterrorapplication/json Error
bash
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:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpAuthServerMetadata
defaulterrorapplication/json Error
bash
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:

json
{
  "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.

ParameterInTypeRequiredDescription
response_typequerystringyes
client_idquerystringyes
redirect_uriquerystringno
code_challengequerystringyes
code_challenge_methodquerystringyes
statequerystringno
scopequerystringno
resourcequerystringno
StatusDescriptionBody
200okapplication/json Ok
defaulterrorapplication/json Error
bash
curl 'https://api.metrixed.com/v1/mcp/oauth/authorize' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 200 response:

json
{
  "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

FieldTypeFlagsDescription
client_namestring
redirect_urisarray of stringrequired
token_endpoint_auth_methodenum: none
grant_typesarray of string
StatusDescriptionBody
201okapplication/json McpClient
defaulterrorapplication/json Error
bash
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:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpOAuthToken
defaulterrorapplication/json Error
bash
curl -X POST 'https://api.metrixed.com/v1/mcp/oauth/token' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 200 response:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpInfo
defaulterrorapplication/json Error
bash
curl 'https://api.metrixed.com/v1/me/mcp-info' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 200 response:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpTokenList
defaulterrorapplication/json Error
bash
curl 'https://api.metrixed.com/v1/me/mcp-tokens' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 200 response:

json
{
  "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

FieldTypeFlagsDescription
namestringrequired
scopesarray of enum: reports:read, entities:read, logs:read, billing:read, fraud:read, offers:write, approvals:write, conversions:write, links:write, postbacks:writerequired
expires_in_daysinteger
StatusDescriptionBody
201okapplication/json McpTokenCreated
defaulterrorapplication/json Error
bash
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:

json
{
  "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.

ParameterInTypeRequiredDescription
idpathstringyes
StatusDescriptionBody
204okapplication/json Ok
defaulterrorapplication/json Error
bash
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:

json
{
  "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.

StatusDescriptionBody
200okapplication/json McpUsage
defaulterrorapplication/json Error
bash
curl 'https://api.metrixed.com/v1/me/mcp-usage' \
  -H "Authorization: Bearer $DT_API_KEY" \
  -H 'Accept: application/json'

Example 200 response:

json
{
  "tools": [
    {}
  ],
  "tokens": [
    {}
  ],
  "recent": [
    {}
  ],
  "window_days": 0
}