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
    date-time
    Description

    Timestamp (in ISO 8601 format) of when the peer group was created.

  • Name
    last_updated_at
    Type
    date-time
    Description

    Timestamp (in ISO 8601 format) 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": "2024-04-10T13:20:21.724Z",
    "last_updated_at": "2024-04-10T13:20:21.724Z"
}


POST/v2/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

    Request

    POST
    /v2/peer_groups
    curl -X POST "https://{{base_subdomain}}.avonhealth.com/v2/peer_groups" \
      -H "Authorization: Bearer {{token}}" \
      -H "x-jwt: {{jwt}}" \
      -H "Content-Type: application/json" \
      --data '{
        "name": "Example",
        "members": []
      }'
    

    Response

        {
            "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
            "object": "peer_group",
            "name": "Diabetes",
            "members": [
              "user_Z1zXZKvqrpwxbznuW6lJ",
              "user_IsW3SoxZQxW0agHKyP2V",
              "user_o14kEdLdUloOyS4RGkII",
            ],
            "created_by": "user_xeDpGyt67wTor93qKtS7",
            "created_at": "2024-04-10T13:20:21.724Z",
            "last_updated_at": "2024-04-10T13:20:21.724Z"
        }
    
    

    GET/v2/peer_groups/:id

    Retrieve a peer group

    Retrieves the specified peer group.

    Request

    GET
    /v2/peer_groups/:id
    curl "https://{{base_subdomain}}.avonhealth.com/v2/peer_groups/:id" \
      -H "Authorization: Bearer {{token}}" \
      -H "x-jwt: {{jwt}}"
    

    Response

        {
            "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
            "object": "peer_group",
            "name": "Diabetes",
            "members": [
              "user_Z1zXZKvqrpwxbznuW6lJ",
              "user_IsW3SoxZQxW0agHKyP2V",
              "user_o14kEdLdUloOyS4RGkII",
            ],
            "created_by": "user_xeDpGyt67wTor93qKtS7",
            "created_at": "2024-04-10T13:20:21.724Z",
            "last_updated_at": "2024-04-10T13:20:21.724Z"
        }
    
    

    POST/v2/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. Will replace the existing list with the new list.

    • Name
      new_members
      Type
      array of strings
      Description

      List of all the patients to add to the peer group.

    • Name
      remove_members
      Type
      array of strings
      Description

      List of all the patients to remove from the peer group.

    Optional attributes

      Request

      POST
      /v2/peer_groups/:id
      curl -X POST "https://{{base_subdomain}}.avonhealth.com/v2/peer_groups/:id" \
        -H "Authorization: Bearer {{token}}" \
        -H "x-jwt: {{jwt}}" \
        -H "Content-Type: application/json" \
        --data '{
          "name": "Example",
          "members": [],
          "new_members": [],
          "remove_members": []
        }'
      

      Response

      
          {
              "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
              "object": "peer_group",
              "name": "Diabetes",
              "members": [
                "user_Z1zXZKvqrpwxbznuW6lJ",
              ],
              "created_by": "user_xeDpGyt67wTor93qKtS7",
              "created_at": "2024-04-10T13:20:21.724Z",
              "last_updated_at": "2024-04-10T13:20:21.724Z"
          }
      
      

      GET/v2/peer_groups

      List all peer groups

      Returns a list of all peer groups.

      Request

      GET
      /v2/peer_groups
      curl "https://{{base_subdomain}}.avonhealth.com/v2/peer_groups" \
        -H "Authorization: Bearer {{token}}" \
        -H "x-jwt: {{jwt}}"
      

      Response

          {
            "object": "list",
            "data": [{
              "id": "pgrp_zRX1SV0oK7vQ5f0j8Vjk",
              "object": "peer_group",
              "name": "Diabetes",
              "members": [
                "user_Z1zXZKvqrpwxbznuW6lJ",
              ],
              "created_by": "user_xeDpGyt67wTor93qKtS7",
              "created_at": "2024-04-10T13:20:21.724Z",
              "last_updated_at": "2024-04-10T13:20:21.724Z"
            }]
          }
      

      DELETE/v2/peer_groups/:id

      Delete a peer group

      Deletes the specified peer group.

      Required attributes

        Optional attributes

          Request

          DELETE
          /v2/peer_groups/:id
          curl -X DELETE "https://{{base_subdomain}}.avonhealth.com/v2/peer_groups/:id" \
            -H "Authorization: Bearer {{token}}" \
            -H "x-jwt: {{jwt}}"
          

          Response

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