{"templateId":"openapi_docs","sharedDataIds":{"openAPIDocsStore":"oas-apis/current.json","sidebar":"sidebar-sidebar.yaml__apis_current"},"props":{"definitionId":"apis/current.json","dynamicMarkdocComponents":[],"baseSlug":"/apis/current","seo":{"title":"xCures API","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"itemId":"","disableAutoScroll":true,"metadata":{"type":"openapi","title":"xCures API","description":"# Authentication\nOur API requires a Bearer Token in the `Authorization` header for auth. Most of our endpoints also require a `ProjectId` header to set the context of the request. It must be one of the projects the api client has permissions to.\n\n### Getting a token\nTo get a token, use your `client_id` and `client_secret` to execute a client credentials exchange.\n\n#### Example CURL command:\n\n    curl --request POST \\\n        --url https://partner.xcures.com/oauth/token \\\n        --header 'content-type: application/json' \\\n        --data '{\"client_id\":\"{your_client_id}\",\"client_secret\":\"{your_client_secret}\",\"grant_type\":\"client_credentials\"}'\n        \n#### Response:\n\n    {\n        \"access_token\": \"{your_temporary_access_token}\",\n        \"token_type\": \"Bearer\"\n    }\n\n### Using the token with our API:\nNow just include that bearer token in the `Authorization` header of your requests to our API.\n\n#### Example authorized request:\n\n    curl --request GET \\\n        --url https://partner.xcures.com/api/v1/patient-registry/subject \\\n        --header 'ProjectId: {your_project_id}' \\\n        --header 'authorization: Bearer {your_temporary_access_token}'"},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"docs.xcures.com","port":4000,"ipAddress":"216.73.216.46"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"main"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/apis/current","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}