Peer Group

A peer group is a grouping of patients that can be used to tailor their experience on the platform.

The peer group model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the peer group.

  • Name
    object
    Type
    string
    Description

    Always 'peer_group'.

  • Name
    name
    Type
    string
    Description

    Name of the peer group. Patients can't see this name.

  • Name
    members
    Type
    array of strings
    Description

    List of all the patients in the peer group.

  • Name
    created_by
    Type
    string
    Description

    Creator of the peer group.

  • Name
    created_at
    Type
    number
    Description

    Timestamp (in Unix epoch time in milliseconds) of when the peer group was created.

  • Name
    last_updated_at
    Type
    number
    Description

    Timestamp (in Unix epoch time in milliseconds) of when the peer group was last updated.

Response

{
    "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
    "object": "peer_group",
    "name": "Diabetes",
    "members": [
      "user_Z1zXZKvqrpwxbznuW6lJ",
      "user_IsW3SoxZQxW0agHKyP2V",
      "user_o14kEdLdUloOyS4RGkII",
    ],
    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}


POST/v1/peer_groups

Create a peer group

Creates a new peer group.

Required attributes

  • Name
    name
    Type
    string
    Description

    Name of the peer group. Patients can't see this name.

  • Name
    members
    Type
    array of strings
    Description

    List of all the patients in the peer group.

Optional attributes

    Response

    {
        "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
        "object": "peer_group",
        "name": "Diabetes",
        "members": [
          "user_Z1zXZKvqrpwxbznuW6lJ",
          "user_IsW3SoxZQxW0agHKyP2V",
          "user_o14kEdLdUloOyS4RGkII",
        ],
        "created_by": "user_xeDpGyt67wTor93qKtS7",
        "created_at": 1653798303000,
        "last_updated_at": 1653798303000
    }
    
    

    GET/v1/peer_groups/:id

    Retrieve a peer group

    Retrieves the specified peer group.

    Response

    {
       "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
       "object": "peer_group",
       "name": "Diabetes",
       "members": [
         "user_Z1zXZKvqrpwxbznuW6lJ",
         "user_IsW3SoxZQxW0agHKyP2V",
         "user_o14kEdLdUloOyS4RGkII",
       ],
       "created_by": "user_xeDpGyt67wTor93qKtS7",
       "created_at": 1653798303000,
       "last_updated_at": 1653798303000
    }
    
    

    POST/v1/peer_groups/:id

    Update a peer group

    Updates the specified peer group object by setting the values of the parameters passed. Any other parameters not provided will not be modified.

    Required attributes

    • Name
      name
      Type
      string
      Description

      Name of the peer group. Patients can't see this name.

    • Name
      members
      Type
      array of strings
      Description

      List of all the patients in the peer group.

    Optional attributes

      Response

      
      {
          "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
          "object": "peer_group",
          "name": "Diabetes",
          "members": [
            "user_Z1zXZKvqrpwxbznuW6lJ",
          ],
          "created_by": "user_xeDpGyt67wTor93qKtS7",
          "created_at": 1653798303000,
          "last_updated_at": 1653798303000
      }
      
      

      GET/v1/peer_groups

      List all peer groups

      Returns a list of all peer group IDs.

      Response

      {
        "object": "list",
        "data": ["pgrp_zRX1SV0oK7vQ5f0j8Vjk", "pgrp_7vQ5f0j8zRX1SV0oKVjk"]
      }
      

      DELETE/v1/peer_groups/:id

      Delete a peer group

      Deletes the specified peer group.

      Required attributes

        Optional attributes

          Response

          {
              "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
              "object": "peer_group",
              "delete": true
          }