{
  "info": {
    "name": "NeuroTrax API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Enroll patients, order tests, send patients their test link and read their results from your own system. Every request and response body is JSON.\n\nSet the collection's variables first: account, the account number to work in, and token.\n\nTo get a token, sign an assertion with your key and post it to /oauth/token (see the docs' \"Your first call\" tutorial), then paste the access token into the token variable. It lasts an hour."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.neurotrax.com"
    },
    {
      "key": "account",
      "value": "200001"
    },
    {
      "key": "token",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Create a token",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/oauth/token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "oauth",
                "token"
              ]
            },
            "description": "Issues an access token, following OAuth 2.1. Authenticate your client with a signed assertion made with your key (see Signed keys). Client secrets and HTTP Basic are not accepted. Then choose a grant:\n\n- `client_credentials`: your system signs in as itself. This is how integrations connect. The token lasts an hour, and there is no refresh token: ask for a new one when it expires.\n- `urn:ietf:params:oauth:grant-type:jwt-bearer`: act for a clinician (see Acting for a clinician). The signed `assertion` is the only credential sent. The token lasts 15 minutes.\n- `refresh_token`: trade a refresh token for a new access token and a new refresh token. Each refresh token works once. Always keep the newest one: an old one still works for 30 seconds, in case a response got lost, and after that using it signs out every token from that sign-in.\n- `password`: legacy, kept only for clients that already signed in with a username and password. OAuth 2.1 drops it and new clients can't use it.\n\nAdd `scope` (space-separated) to create a token with fewer scopes than your integration holds; the response's `scope` lists what the token carries. A refresh token stops working 12 hours after the sign-in it came from, however often it's refreshed. Send the access token on every other request as `Authorization: Bearer <token>`.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "client_credentials",
                  "type": "text"
                },
                {
                  "key": "client_assertion_type",
                  "value": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
                  "type": "text"
                },
                {
                  "key": "client_assertion",
                  "value": "{{CLIENT_ASSERTION}}",
                  "type": "text"
                }
              ]
            }
          }
        },
        {
          "name": "Revoke a token",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/oauth/revoke",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "oauth",
                "revoke"
              ]
            },
            "description": "Ends an access token or a refresh token straight away (RFC 7009). Revoking a refresh token also ends every token from the same sign-in. The answer is 200 even if the token was already invalid or unknown.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "token",
                  "value": "{{NEUROTRAX_TOKEN}}",
                  "type": "text"
                },
                {
                  "key": "client_assertion_type",
                  "value": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
                  "type": "text"
                },
                {
                  "key": "client_assertion",
                  "value": "{{CLIENT_ASSERTION}}",
                  "type": "text"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Accounts",
      "item": [
        {
          "name": "List your accounts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "accounts"
              ]
            },
            "description": "Lists the accounts your integration can work in, by account number: standalone\naccounts and sub-accounts, each with its `status`, and the master accounts over\nthem. A master account has `sub_accounts` (an empty list when none can be used\nright now); you never work in a master account itself, so never send its number\nin `X-Nx-Account`. Closed and suspended accounts aren't listed, nor are the\nsub-accounts of a closed or suspended master account. Acting for a clinician,\nthe list holds only the clinician's accounts.\n\nNo `X-Nx-Account` header is needed, and the request can't have a body or query\nparameters."
          }
        }
      ]
    },
    {
      "name": "Patients",
      "item": [
        {
          "name": "Enroll a patient",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/patients",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "patients"
              ]
            },
            "description": "Enrolls a patient in the account and gives them a new patient number. Only `dob` is always required. Each other field is accepted, and required, only when the account's patient form includes it. `middle_initial` is always optional.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"first_name\": \"Jane\",\n  \"middle_initial\": \"P\",\n  \"last_name\": \"Doe\",\n  \"dob\": \"1958-04-12\",\n  \"gender\": \"female\",\n  \"handedness\": \"right\",\n  \"native_language_id\": 1,\n  \"primary_language_id\": 1,\n  \"unique_external_id\": \"MRN-0048213\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a patient",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/patients/:number",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "patients",
                ":number"
              ],
              "variable": [
                {
                  "key": "number",
                  "value": "200001000417"
                }
              ]
            },
            "description": "Looks up a patient by patient number. To look one up by your own ID instead, pass `uextid:` followed by it, for example `/v1/patients/uextid:MRN-0048213`. That only works if the account's patient form has the unique external ID field. Removed patients aren't found."
          }
        },
        {
          "name": "Update a patient",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/patients/:number",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "patients",
                ":number"
              ],
              "variable": [
                {
                  "key": "number",
                  "value": "200001000417"
                }
              ]
            },
            "description": "Changes only the fields you send, and a field you send can't be blank. The account's patient form decides which fields are accepted, as it does for enrollment. `PATCH` does the same thing.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"last_name\": \"Doe-Harper\",\n  \"handedness\": \"left\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Orders",
      "item": [
        {
          "name": "List orders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/orders?status=completed",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "orders"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "completed",
                  "disabled": false
                },
                {
                  "key": "uploaded_after",
                  "value": "2026-09-01T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "uploaded_before",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "",
                  "disabled": true
                }
              ]
            },
            "description": "Lists the account's orders with the given status, oldest upload first, 30 per page. The upload-time filters return completed orders only. A filter time with no UTC offset is read as US Eastern time."
          }
        },
        {
          "name": "Order a test",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "orders"
              ]
            },
            "description": "Orders a test battery for a patient, taken in a web browser. For an in-clinic test the\nresponse includes its `launch_path`: open it for the clinician through a signed launch\n(see Opening NeuroTrax for a clinician). Set `telehealth` to true to let the patient test at home\ninstead: send them the `telehealth_url` and the `code` to\nsign in with. The account must have browser-based testing turned on.\n\nA patient can't have more than one order waiting at a time. Demographic fields\nare accepted, and required, only when the account's order form includes them.\n`years_of_education` is always required.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"patient_number\": \"200001000417\",\n  \"battery_id\": 400,\n  \"battery_translation_id\": 1,\n  \"years_of_education\": 16\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get an order",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/orders/:order_number",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "orders",
                ":order_number"
              ],
              "variable": [
                {
                  "key": "order_number",
                  "value": "200001-58"
                }
              ]
            },
            "description": "Gets one of the account's orders. Check `status` to see whether the patient has finished testing."
          }
        },
        {
          "name": "Cancel an order",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/orders/:order_number/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "orders",
                ":order_number",
                "cancel"
              ],
              "variable": [
                {
                  "key": "order_number",
                  "value": "200001-59"
                }
              ]
            },
            "description": "Cancels an order the patient hasn't started, for example one placed by mistake. The order stays on record with the status `cancelled`, and a telehealth link sent for it stops working. If the patient has a newer pending order, cancel that one first. Acting for a clinician, the clinician must be allowed to cancel orders in the portal."
          }
        }
      ]
    },
    {
      "name": "Reports",
      "item": [
        {
          "name": "Get a patient's results",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Nx-Account",
                "value": "{{account}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/data_reports/:report_id?patient_number=200001000417",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "data_reports",
                ":report_id"
              ],
              "query": [
                {
                  "key": "patient_number",
                  "value": "200001000417",
                  "disabled": false
                }
              ],
              "variable": [
                {
                  "key": "report_id",
                  "value": "1"
                }
              ]
            },
            "description": "Returns scores for all of a patient's completed orders that the report covers,\nkeyed by order number. The report must be set up for the account and for a battery\nthe patient has completed.\n\nA score that can't be given is `null`, and `reason_missing` says why:\n\n- `NAB` the battery doesn't include this test\n- `DI` there's no data for it\n- `FP` the patient failed the practice session\n- `PP` performance was too poor to score\n- `ZAC` there were no correct answers to score\n- `ND` the score doesn't apply here\n- `UNDEF` the score isn't defined for this test\n- `ERR` any other error"
          }
        }
      ]
    }
  ]
}
