exchange_code
Exchange a NinjaOne authorization code for a refresh token to enable persistent API access without re-authentication.
Instructions
Exchange a NinjaOne authorization code for a refresh token. Paste the code from the redirect URL after using get_auth_url. Save the returned refresh_token as NINJA_REFRESH_TOKEN in your MCP client config.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "exchange_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The authorization code from the redirect URL query parameter 'code' |