action

Create a plan action

post/action

Request

  • Base URL
    https://api.twinehealth.com/pub
  • Auth
    none declared

Request body

Example request

{
  "data": {
    "type": "action",
    "attributes": {
      "effective_from": "2017-02-20T11:12:13.000Z",
      "title": "Record Blood Pressure",
      "type": "blood_pressure",
      "frequency_goal": {
        "weeks": {
          "days": [
            0
          ]
        }
      },
      "metrics": [
        {
          "metric_type": "blood_pressure",
          "unit": "mmHg",
          "goal": {
            "data": {
              "systolic": {
                "value": 150,
                "unit": "mmHg"
              },
              "diastolic": {
                "value": 95,
                "unit": "mmHg"
              }
            }
          }
        }
      ]
    },
    "relationships": {
      "plan": {
        "data": {
          "type": "patient_plan_summary",
          "id": "58aacf0d076adcef394bac35"
        }
      },
      "bundles": {
        "data": [
          {
            "type": "bundle",
            "id": "58aacf0d076adcef394bac30"
          }
        ]
      }
    }
  }
}

Response

OK

Example response

{
  "data": {
    "type": "action",
    "id": "58aacf0d076adcef394bac36",
    "attributes": {
      "_thread": "blood_pressure",
      "adherence": {
        "due": 0,
        "complete": 0,
        "streak": {
          "count": 0
        }
      },
      "effective_from": "2017-02-20T11:12:13.000Z",
      "frequency_goal": {
        "weeks": {
          "days": [
            0
          ]
        }
      },
      "frequency_goal_prorated": 0,
      "identifiers": [],
      "metric_required": false,
      "metrics": [
        {
          "metric_type": "blood_pressure",
          "unit": "mmHg",
          "goal": {
            "data": {
              "diastolic": {
                "unit": "mmHg",
                "value": 95
              },
              "systolic": {
                "unit": "mmHg",
                "value": 150
              }
            }
          },
          "_id": "58aacf0d076adcef394bac37",
          "accepted_values": []
        }
      ],
      "title": "Record Blood Pressure",
      "tracking": true,
      "windows": [],
      "type": "blood_pressure",
      "options": [],
      "created_at": "2017-02-20T11:12:13.000Z",
      "created_by": "596541ec076adcef394bac2d",
      "updated_at": "2017-02-20T11:12:13.000Z",
      "updated_by": "596541ec076adcef394bac2d"
    },
    "links": {
      "self": "/action/58aacf0d076adcef394bac36"
    },
    "relationships": {
      "plan": {
        "links": {
          "related": "/action/58aacf0d076adcef394bac36/plan"
        },
        "data": {
          "type": "patient_plan_summary",
          "id": "58aacf0d076adcef394bac35"
        }
      },
      "bundles": {
        "links": {
          "related": "/action/58aacf0d076adcef394bac36/bundles"
        },
        "data": [
          {
            "type": "bundle",
            "id": "58aacf0d076adcef394bac30"
          }
        ]
      }
    }
  },
  "included": [],
  "meta": {
    "req_id": "014ea6d2-4717-4915-b4bc-98454180614e"
  }
}

Changes

    • breaking

      removed the success response with the status

    • info

      added the success response with the status