{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml","api-docs-apis/client-management-api-v1.json":"api-docs-apis/client-management-api-v1.json"},"props":{"metadata":{"markdoc":{"tagList":["split","openapi-code-sample","openapi-response-sample"]},"type":"markdown"},"seo":{"title":"Client Management API Authentication Management Guide","description":"RAI Partners API."},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"client-management-api-authentication-management-guide","__idx":0},"children":["Client Management API Authentication Management Guide"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Client Management Authentication api allows you to retrieve a JWT token to use with the authenticated Client Management api endpoints."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With the Client Maangement Authentication API, you can:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Retrieve a JWT token to authenticate your Client Management api calls."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Rotate your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["One must pay attention to the token expiry, a token is valid for the entiity of its life."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authenticate","__idx":2},"children":["Authenticate"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you can call any API endpoint, you must authenticate using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]}," originally provided by your RAI Partners' Client Success representative."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call Example:"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-apis/client-management-api-v1.json","operationId":"authenticateClient","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://api.raipartners.com/client-management/auth/token \\\n  -H 'API-Version: 1.0.0' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"client_id\": \"my-client-id\",\n    \"client_secret\": \"my-super-auth-secret\"\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const resp = await fetch(\n  `https://api.raipartners.com/client-management/auth/token`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'API-Version': '1.0.0'\n    },\n    body: JSON.stringify({\n      client_id: 'my-client-id',\n      client_secret: 'my-super-auth-secret'\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://api.raipartners.com/client-management/auth/token`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'API-Version': '1.0.0'\n      },\n      body: JSON.stringify({\n        client_id: 'my-client-id',\n        client_secret: 'my-super-auth-secret'\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://api.raipartners.com/client-management/auth/token\"\n\npayload = {\n  \"client_id\": \"my-client-id\",\n  \"client_secret\": \"my-super-auth-secret\"\n}\n\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"API-Version\": \"1.0.0\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"client_id\\\": \\\"my-client-id\\\",\"\n      , \" \\\"client_secret\\\": \\\"my-super-auth-secret\\\"\"\n      , \"}\"\n    );\n\n    var host = \"https://api.raipartners.com\";\n    var pathname = \"/client-management/auth/token\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .header(\"API-Version\", \"1.0.0\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"API-Version\", \"1.0.0\"},\n      }\n    };\n\n    string json = JsonSerializer.Serialize(new\n    {\n      client_id = \"my-client-id\",\n      client_secret = \"my-super-auth-secret\"\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n    using HttpResponseMessage request = await client.PostAsync(\"https://api.raipartners.com/client-management/auth/token\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\n$payload = array(\n  \"client_id\" => \"my-client-id\",\n  \"client_secret\" => \"my-super-auth-secret\"\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"API-Version: 1.0.0\",\n    \"Content-Type: application/json\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://api.raipartners.com/client-management/auth/token\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://api.raipartners.com/client-management/auth/token\"\n  var data = []byte(`{\n    \"client_id\": \"my-client-id\",\n    \"client_secret\": \"my-super-auth-secret\"\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"API-Version\", \"1.0.0\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://api.raipartners.com/client-management/auth/token')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest['API-Version'] = '1.0.0'\nrequest.body = {\n  client_id: 'my-client-id',\n  client_secret: 'my-super-auth-secret'\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"client_id\": \"my-client-id\",\n   \"client_secret\": \"my-super-auth-secret\"\n}'\n\nurl = \"https://api.raipartners.com/client-management/auth/token\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\", \"API-Version\" = \"1.0.0\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"client_id\": \"my-client-id\",\n  \"client_secret\": \"my-super-auth-secret\"\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call Response Example:"]}]},{"$$mdtype":"Tag","name":"OpenApiResponseSample","attributes":{"descriptionFile":"api-docs-apis/client-management-api-v1.json","operationId":"authenticateClient","responseSamplesResolved":[{"lang":"json","title":"200 application/json","source":"{\n  \"scope\": \"read:user write:user\",\n  \"access_token\": \"eyo.....\",\n  \"expires_in\": 300,\n  \"token_type\": \"Bearer\",\n  \"not-before-policy\": 0,\n  \"refresh_expires_in\": 300\n}"},{"lang":"json","title":"400 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:validation:invalid-data\",\n  \"title\": \"Bad Request\",\n  \"status\": 400,\n  \"detail\": \"One or more fields are invalid.\"\n}"},{"lang":"json","title":"404 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:not-found\",\n  \"title\": \"Not Found\",\n  \"status\": 404,\n  \"detail\": \"Resource not found.\"\n}"},{"lang":"json","title":"500 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:internal\",\n  \"title\": \"Internal Server Error\",\n  \"status\": 500,\n  \"detail\": \"An unexpected error occurred.\"\n}"},{"lang":"json","title":"503 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:internal\",\n  \"title\": \"Service unavailable Error\",\n  \"status\": 503,\n  \"detail\": \"Service is unavailable.\"\n}"}]},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Split","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"rotating-your-secret","__idx":3},"children":["Rotating your secret"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Trigger a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]}," rotation per your company's policy"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A successful response confirms that the secret has been rotated and provides new secret value."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call Example:"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-apis/client-management-api-v1.json","operationId":"rotateClientSecret","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://api.raipartners.com/client-management/auth/client-secret/rotation \\\n  -H 'API-Version: 1.0.0' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>'"},{"lang":"javascript","title":"JavaScript","source":"const resp = await fetch(\n  `https://api.raipartners.com/client-management/auth/client-secret/rotation`,\n  {\n    method: 'POST',\n    headers: {\n      'API-Version': '1.0.0',\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    }\n  }\n);\n\nconst data = await resp.text();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://api.raipartners.com/client-management/auth/client-secret/rotation`,\n    {\n      method: 'POST',\n      headers: {\n        'API-Version': '1.0.0',\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      }\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://api.raipartners.com/client-management/auth/client-secret/rotation\"\n\nheaders = {\n  \"API-Version\": \"1.0.0\",\n  \"Authorization\": \"Bearer <YOUR_JWT_HERE>\"\n}\n\nresponse = requests.post(url, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://api.raipartners.com\";\n    var pathname = \"/client-management/auth/client-secret/rotation\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(\"some body text\"))\n      .uri(URI.create(host + pathname ))\n      .header(\"API-Version\", \"1.0.0\")\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"API-Version\", \"1.0.0\"},\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n    using HttpResponseMessage request = await client.PostAsync(\"https://api.raipartners.com/client-management/auth/client-secret/rotation\", null);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"API-Version: 1.0.0\",\n    \"Authorization: Bearer <YOUR_JWT_HERE>\"\n  ],\n  CURLOPT_URL => \"https://api.raipartners.com/client-management/auth/client-secret/rotation\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://api.raipartners.com/client-management/auth/client-secret/rotation\"\n  req, err := http.NewRequest(\"POST\", reqUrl, nil)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"API-Version\", \"1.0.0\")\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://api.raipartners.com/client-management/auth/client-secret/rotation')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['API-Version'] = '1.0.0'\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nurl = \"https://api.raipartners.com/client-management/auth/client-secret/rotation\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"API-Version\" = \"1.0.0\", \"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  verbose()\n)\n\ncontent(data_req)"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Call Response Example:"]}]},{"$$mdtype":"Tag","name":"OpenApiResponseSample","attributes":{"descriptionFile":"api-docs-apis/client-management-api-v1.json","operationId":"rotateClientSecret","responseSamplesResolved":[{"lang":"json","title":"200 application/json","source":"{\n  \"secret\": \"PX4eWb9rcRT1RBqvLw4GtuqyoUFWoGLr\"\n}"},{"lang":"json","title":"400 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:validation:invalid-data\",\n  \"title\": \"Bad Request\",\n  \"status\": 400,\n  \"detail\": \"One or more fields are invalid.\"\n}"},{"lang":"json","title":"401 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:authorization:unauthorized\",\n  \"title\": \"Unauthorized\",\n  \"status\": 401,\n  \"detail\": \"You are not authorized to perform this action.\"\n}"},{"lang":"json","title":"403 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:authorization:forbidden\",\n  \"title\": \"Forbidden\",\n  \"status\": 403,\n  \"detail\": \"You are forbidden to perform this action.\"\n}"},{"lang":"json","title":"404 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:not-found\",\n  \"title\": \"Not Found\",\n  \"status\": 404,\n  \"detail\": \"Resource not found.\"\n}"},{"lang":"json","title":"500 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:internal\",\n  \"title\": \"Internal Server Error\",\n  \"status\": 500,\n  \"detail\": \"An unexpected error occurred.\"\n}"},{"lang":"json","title":"503 application/json","source":"{\n  \"type\": \"urn:raipartners:api:clientmanagement:errors:internal\",\n  \"title\": \"Service unavailable Error\",\n  \"status\": 503,\n  \"detail\": \"Service is unavailable.\"\n}"}]},"children":[]}]}]},"headings":[{"value":"Client Management API Authentication Management Guide","id":"client-management-api-authentication-management-guide","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Authenticate","id":"authenticate","depth":2},{"value":"Rotating your secret","id":"rotating-your-secret","depth":2}],"frontmatter":{"seo":{"title":"Client Management API Authentication Management Guide"}},"lastModified":"2026-08-18T19:21:11.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/client-management-api/v1/authentication","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}