OAuth2 Token Exchange Run in API Explorer

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://developer.pattern.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Hub API MCP server": {
    "url": "https://developer.pattern.com/mcp"
  }
}

Close
POST /login

Exchange client credentials for an access token using OAuth2 client credentials grant flow.

application/json

Body

  • grant_type string Required

    The grant type - must be "client_credentials"

  • client_id string Required

    The client identifier issued to the client

  • client_secret string Required

    The client secret issued to the client

Responses

  • 200 application/json

    Access token issued successfully

    Hide response attributes Show response attributes object
    • access_token string

      The access token to use for authenticated requests

    • token_type string

      The token type (typically "Bearer")

    • expires_in integer

      The lifetime of the access token in seconds

  • 400 application/json

    Invalid request parameters

    Hide response attributes Show response attributes object
    • error string

      Error code

    • error_description string

      Human-readable error description

  • 401 application/json

    Invalid client credentials

    Hide response attributes Show response attributes object
    • error string

      Error code

    • error_description string

      Human-readable error description

POST /login
curl \
 --request POST 'https://api.pattern.com/hub/login' \
 --header "Content-Type: application/json" \
 --data '{"grant_type":"client_credentials","client_id":"\u003cclient_id\u003e","client_secret":"\u003cclient_secret\u003e"}'
Request examples
{
  "grant_type": "client_credentials",
  "client_id": "<client_id>",
  "client_secret": "<client_secret>"
}
Response examples (200)
{
  "access_token": "string",
  "token_type": "Bearer",
  "expires_in": 3600
}
Response examples (400)
{
  "error": "invalid_grant",
  "error_description": "The provided credentials are invalid"
}
Response examples (401)
{
  "error": "invalid_client",
  "error_description": "Client authentication failed"
}