Organizations

18 endpoints in this category.

GET/organizations

Search Organizations

Search for organizations by name. Returns matching organizations with type and member count.

Authentication:Required — Authorization: Bearer <token>

Query Parameters

NameTypeRequiredDescription
searchstringNoSearch query

Response Fields

NameTypeRequiredDescription
dataOrganization[]YesArray of matching organizations

Error Codes

StatusMeaning
401Unauthorized

Code Examples

curl -X GET 'https://visitnote-api-production.up.railway.app/api/therapist/v1/organizations' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
GET/my-organization

Get My Organization

Get details of the authenticated user's current organization.

Authentication:Required — Authorization: Bearer <token>

Response Fields

NameTypeRequiredDescription
dataOrganizationYesOrganization details

Error Codes

StatusMeaning
404User is not in an organization

Code Examples

curl -X GET 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
POST/organizations/:uuid/join-request

Request to Join Organization

Submit a request to join an organization. The org admin must approve.

Authentication:Required — Authorization: Bearer <token>

Path Parameters

NameTypeRequiredDescription
uuidstringYesOrganization UUID

Error Codes

StatusMeaning
404Organization not found
409Already a member or pending request exists

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/organizations/:uuid/join-request' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
POST/my-organization/leave

Leave Organization

Leave the current organization. Subscription status may change from org_managed to expired.

Authentication:Required — Authorization: Bearer <token>

Error Codes

StatusMeaning
404Not in an organization

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization/leave' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
POST/organizations/request

Request New Organization

Request that a new organization be added to the platform.

Authentication:Required — Authorization: Bearer <token>

Request Body

NameTypeRequiredDescription
namestringYesOrganization name
typestringYesOrganization type (staffing_company, home_health_agency, clinic, private_practice, hospital)
emailstringNoContact email for the org

Error Codes

StatusMeaning
422Invalid organization type

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/organizations/request' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "your_name",
  "type": "your_type",
  "email": "your_email"
}'
GET/my-join-requests

Get My Join Requests

List all pending join requests for the authenticated user.

Authentication:Required — Authorization: Bearer <token>

Response Fields

NameTypeRequiredDescription
dataJoinRequest[]YesArray of join requests

Error Codes

StatusMeaning
401Unauthorized

Code Examples

curl -X GET 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-join-requests' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
GET/my-organization/config

Get Effective App Configuration

The server-side answer to "what should this clinician's app show?". Returns the effective feature flags and terminology for the caller: solo clinicians get solo defaults overlaid with their personal overrides; organization members get their org's type defaults overlaid with the org's stored overrides (personal overrides are ignored the moment a clinician takes a seat). Feature flags: billing_codes, icd10_suggestions, staffing_offers, earnings, coverage_areas, follow_ups, ai_conversation, ai_voice, copy_last_visit, credential_sync, coverage_sync.

Authentication:Required — Authorization: Bearer <token>
Solo defaults are billing-off: billing_codes and icd10_suggestions default to false until the clinician opts in (most independents document, they don't code). Organization type defaults: staffing_company turns on staffing_offers, earnings, coverage_areas, follow_ups, credential_sync, coverage_sync; home_health_agency turns on follow_ups; clinic, private_practice, and hospital match solo defaults. credential_sync / coverage_sync are additionally forced false unless the server is actually wired to that org's back office, so the app never renders a sync affordance that would silently no-op. Render from THIS endpoint's answer — not from client-side org checks.

Response Fields

NameTypeRequiredDescription
sourcestringYes"solo" (defaults + personal overrides) or "organization" (org decides)
featuresobjectYesAll 11 boolean feature flags, fully resolved
terminologyobjectYesDisplay terminology — defaults: patient, visit, note ("visit note"), organization

Code Examples

curl -X GET 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization/config' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
PUT/my-organization/config

Update Organization Configuration

Organization admins customize what their clinicians' apps show: override any feature flag or terminology entry. Overrides layer on top of the org type's defaults. Feature flags: billing_codes, icd10_suggestions, staffing_offers, earnings, coverage_areas, follow_ups, ai_conversation, ai_voice, copy_last_visit, credential_sync, coverage_sync.

Authentication:Required — Authorization: Bearer <token>
Requires an admin seat. A null feature value clears the stored override entirely (deep-merge delete).

Request Body

NameTypeRequiredDescription
featuresobjectNoMap of feature key → boolean, or null to clear a stored override (falls back to the org type default)
terminologyobjectNoMap of term key → display string (e.g. call patients "clients")

Response Fields

NameTypeRequiredDescription
featuresobjectYesThe recomputed effective feature flags
terminologyobjectYesThe recomputed effective terminology

Error Codes

StatusMeaning
403Caller is not an organization admin
422Unknown feature keys (listed in the message) or non-boolean values

Code Examples

curl -X PUT 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization/config' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "features": "{ \"billing_codes\": false }",
  "terminology": "{ \"patient\": \"client\" }"
}'
PUT/my-organization

Update Organization Profile

Organization admins update the org's own profile — name, contact details, and type.

Authentication:Required — Authorization: Bearer <token>
Changing type changes the org's default feature flags (stored overrides still win). The response includes the recomputed effective features so admin consoles can show exactly what changed.

Request Body

NameTypeRequiredDescription
namestringNoOrganization display name
emailstringNoContact email
phonestringNoContact phone
addressstringNoMailing address
typestringNoOne of: staffing_company, home_health_agency, clinic, private_practice, hospital

Error Codes

StatusMeaning
403Caller is not an organization admin
422Invalid organization type

Code Examples

curl -X PUT 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "your_name",
  "email": "your_email",
  "phone": "your_phone",
  "address": "your_address",
  "type": "home_health_agency"
}'
POST/my-organization/invitations

Invite a Clinician

Organization admins invite a clinician by email. If the email has no VisitNote account, the invitee receives a deep link to create one; if they already have a solo account, the invitation appears in their app under Organization.

Authentication:Required — Authorization: Bearer <token>
One open invitation per (organization, email).

Request Body

NameTypeRequiredDescription
emailstringYesInvitee email address
rolestringNo'member' (default) or 'admin'
first_namestringNoInvitee first name (used in the email)
last_namestringNoInvitee last name

Error Codes

StatusMeaning
403Caller is not an organization admin
422Email already belongs to a member of another organization, or an open invite already exists

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization/invitations' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "pt@example.com",
  "role": "member",
  "first_name": "your_first_name",
  "last_name": "your_last_name"
}'
GET/my-organization/invitations

List Sent Invitations

Organization admins list every invitation the org has sent, with status.

Authentication:Required — Authorization: Bearer <token>

Error Codes

StatusMeaning
403Caller is not an organization admin

Code Examples

curl -X GET 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization/invitations' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
DELETE/my-organization/invitations/:uuid

Revoke an Invitation

Organization admins revoke a pending invitation.

Authentication:Required — Authorization: Bearer <token>

Path Parameters

NameTypeRequiredDescription
uuidstringYesInvitation UUID

Error Codes

StatusMeaning
403Caller is not an organization admin
404Invitation not found

Code Examples

curl -X DELETE 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-organization/invitations/:uuid' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
GET/my-invitations

My Pending Invitations

Pending organization invitations addressed to the authenticated user's email.

Authentication:Required — Authorization: Bearer <token>

Code Examples

curl -X GET 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-invitations' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
POST/my-invitations/:uuid/accept

Accept an Invitation

Accept a pending organization invitation. Seats the user as a member of the organization in a single transaction (same writes as a join-request approval).

Authentication:Required — Authorization: Bearer <token>

Path Parameters

NameTypeRequiredDescription
uuidstringYesInvitation UUID

Error Codes

StatusMeaning
404Invitation not found or not addressed to this user
422User already belongs to an organization

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-invitations/:uuid/accept' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
POST/my-invitations/:uuid/decline

Decline an Invitation

Decline a pending organization invitation.

Authentication:Required — Authorization: Bearer <token>

Path Parameters

NameTypeRequiredDescription
uuidstringYesInvitation UUID

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/my-invitations/:uuid/decline' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN'
POST/organizations/invite

Invite Your Organization

A clinician invites their organization to VisitNote. Creates a private (unlisted) organization record and emails the contact a claim link — when the org contact claims it, they become the org admin and the inviting clinician is seated automatically.

Authentication:Required — Authorization: Bearer <token>
Duplicate invites are deduplicated by organization name + contact email against open claims.

Request Body

NameTypeRequiredDescription
organization_namestringYesOrganization name
organization_typestringNoOne of: staffing_company, home_health_agency, clinic, private_practice, hospital
contact_namestringNoName of the org contact to email
contact_emailstringYesOrg contact email — receives the claim link
messagestringNoOptional personal note included in the email

Error Codes

StatusMeaning
422An open claim already exists for this organization/contact

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/organizations/invite' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_name": "Sunrise Home Health",
  "organization_type": "your_organization_type",
  "contact_name": "your_contact_name",
  "contact_email": "admin@sunrisehh.com",
  "message": "your_message"
}'
GET/organizations/claim/:token

Preview an Organization Claim

Public, unauthenticated preview of a claim link — who invited which organization, and whether the token has expired. Contains no PHI.

Authentication:Not required

Path Parameters

NameTypeRequiredDescription
tokenstringYesClaim token from the invitation email

Response Fields

NameTypeRequiredDescription
organization_namestringYesThe organization being claimed
inviter_first_namestringYesFirst name of the inviting clinician
expiredbooleanYesWhether the token is no longer valid

Code Examples

curl -X GET 'https://visitnote-api-production.up.railway.app/api/therapist/v1/organizations/claim/:token' \
  -H 'Accept: application/json'
POST/organizations/claim

Claim an Organization

The invited org contact — after registering or logging in — claims the organization. In one transaction: the org is approved and listed, the claimer is seated as admin, and the inviting clinician is seated as a member (if still org-less). Both parties are emailed.

Authentication:Required — Authorization: Bearer <token>

Request Body

NameTypeRequiredDescription
tokenstringYesClaim token from the invitation email

Error Codes

StatusMeaning
404Unknown or already-consumed token
422Token expired, or claimer already belongs to an organization

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/organizations/claim' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "your_token"
}'