/v1/user

Update a user

Update a user's properties. If a field is not provided, it will not be updated. If you need to unset a field, pass an explicit null value. Only optional fields can be unset.

Phone numbers can be updated for organizations that don't manage onboarding through Counsel. Updates may return 409 if your organization enforces phone-number uniqueness and the new number is already taken.

To grant or extend a user's access (set access_expires_at), use POST /v1/user/{userId}/enable instead — this endpoint does not accept access_expires_at.

This API will not deep-merge nested fields. Instead it operates on the top-level fields only.

{
  medical_profile: {
    conditions: ["condition1", "condition2"],
    medications: ["medication1", "medication2"],
  }
}

This will replace the existing medical_profile object with the new one provided in the request body.

patch/v1/user/{userId}/

Request

  • Base URL
    https://api.counselhealth.com (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Path parameters

userIdstring required

Headers

Idempotency-Keystring
Example:550e8400-e29b-41d4-a716-446655440000

Optional idempotency key. Repeat requests with the same key and body return the original result.

Request body

dobstring

date of birth in YYYY-MM-DD format (ISO 8601). Must be between 18 and 120 years old

phonestring nullable

US phone number. Supported formats: 8007006000, 800-700-6000, +1 800-700-6000, +18007006000, +1(800)7006000, (800)700-6000

sex_assigned_at_birth'Male' | 'Female'
gender'Male' | 'Female' | 'Other' nullable
racestring[] nullable
emailstring email nullable

email address

metadataobject nullable

Custom key-value metadata for external users. Max 25 keys, each value ≤ 1800 characters. Keys must be alphanumeric with underscores/hyphens only.

first_namestring

Legal given name(s)

last_namestring

Legal family name

preferred_namestring nullable

Preferred name

Example request

{
  "dob": "1990-01-01",
  "phone": "+18007006000",
  "addresses": [
    {
      "line1": "123 Main St",
      "line2": "Apt 2",
      "city": "San Francisco",
      "state": "CA",
      "zip": "12345"
    }
  ],
  "race": [
    "White",
    "Asian"
  ],
  "medical_profile": {
    "conditions": [
      "Diabetes"
    ],
    "medications": [
      "Metformin"
    ],
    "medication_allergies": [
      "Tylenol"
    ],
    "surgeries": [
      "Appendectomy"
    ],
    "family_history": [
      "Diabetes"
    ],
    "doctors": {
      "pcp_name": "Dr. Joe Doe",
      "specialist_types": [
        "Cardiologist"
      ]
    },
    "additional_details": {}
  },
  "email": "john.doe@example.com",
  "metadata": {
    "plan": "pro",
    "external_id": "1234567890"
  },
  "first_name": "John",
  "last_name": "Doe",
  "preferred_name": "Bob"
}

Response

Default Response

OR

Example response

{
  "created_at": "2030-01-01T00:00:00Z",
  "dob": "1990-01-01",
  "phone": "+18007006000",
  "addresses": [
    {
      "line1": "123 Main St",
      "line2": "Apt 2",
      "city": "San Francisco",
      "state": "CA",
      "zip": "12345"
    }
  ],
  "race": [
    "White",
    "Asian"
  ],
  "medical_profile": {
    "conditions": [
      "Diabetes"
    ],
    "medications": [
      "Metformin"
    ],
    "medication_allergies": [
      "Tylenol"
    ],
    "surgeries": [
      "Appendectomy"
    ],
    "family_history": [
      "Diabetes"
    ],
    "doctors": {
      "pcp_name": "Dr. Joe Doe",
      "specialist_types": [
        "Cardiologist"
      ]
    },
    "additional_details": {}
  },
  "access_expires_at": "2030-01-01T00:00:00Z",
  "email": "john.doe@example.com",
  "metadata": {
    "plan": "pro",
    "external_id": "1234567890"
  },
  "onboarded_at": "2030-01-01T00:00:00Z",
  "external_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
}

Changes

No recorded changes to this operation across all 1 revision of this API.