---
updatedAt: 2026-07-13T13:58:38.000Z
agentTools:
  projectIndex: https://developer.livehealthily.com/llms.txt
---

# Accept legal policies

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Healthily API documentation",
    "version": "1.0.0-RC1"
  },
  "servers": [
    {
      "url": "https://portal.your.md",
      "description": "Production server url"
    },
    {
      "url": "http://localhost:8080",
      "description": "Local testing url"
    }
  ],
  "tags": [
    {
      "name": "Legal",
      "description": "The Legal Policies API"
    }
  ],
  "paths": {
    "/api/v1/terms": {
      "post": {
        "tags": [
          "Legal"
        ],
        "summary": "Accept legal policies",
        "operationId": "acceptPolicies",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Bearer your-token"
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your-api-key"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TermsAcceptanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully accepted legal terms",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TermsAcceptanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Choice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal id of question choice.",
            "example": "C0011849"
          },
          "text": {
            "type": "string",
            "description": "Choice text"
          },
          "symptom_definition": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Message"
              },
              {
                "description": "Optional plain-language definition of the symptom/conditionality behind this choice, to be shown as supporting/helper copy under the choice label. Reuses the standard message shape (value/type/format); render according to its format. Omitted entirely when the underlying symptom/conditionality has no definition."
              }
            ]
          }
        },
        "description": "Question choice"
      },
      "ErrorResponse": {
        "required": [
          "error",
          "message"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "description": "Basic error response"
      },
      "LoginResponse": {
        "required": [
          "access_token",
          "expires_in",
          "token_type"
        ],
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Access token to be used in subsequent calls",
            "example": "eyJRA.....3TQ"
          },
          "token_type": {
            "type": "string",
            "description": "Type of token, defaults to bearer",
            "example": "bearer"
          },
          "expires_in": {
            "type": "integer",
            "description": "Token validity expressed in seconds until expiry",
            "format": "int32",
            "example": 1860
          }
        },
        "description": "Login response body"
      },
      "Message": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Question message to be shown to the user.",
            "example": "Have you ever been diagnosed or suffer with any of the following?"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageTypeEnum"
              },
              {
                "description": "Type of message, hints at where it should be displayed, check MessageTypeEnum for possible values.",
                "example": "HEADER"
              }
            ]
          },
          "format": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MessageFormatEnum"
              },
              {
                "description": "Format of the message, check MessageFormatEnum for possible values",
                "example": "PLAIN_TEXT"
              }
            ]
          }
        },
        "description": "Question message"
      },
      "MessageFormatEnum": {
        "type": "string",
        "enum": [
          "PLAIN_TEXT",
          "HTML",
          "MARKDOWN"
        ]
      },
      "MessageTypeEnum": {
        "type": "string",
        "enum": [
          "HEADER",
          "PARAGRAPH",
          "INPUT_HINT",
          "BULLET_POINT",
          "OTHER"
        ]
      },
      "Question": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          },
          "constraints": {
            "$ref": "#/components/schemas/QuestionConstraints"
          }
        },
        "description": "Question"
      },
      "QuestionConstraints": {
        "type": "object",
        "properties": {
          "min_selections": {
            "maximum": 999,
            "minimum": 0,
            "type": "integer",
            "description": "Minimum number of choices to be selected.",
            "format": "int32",
            "nullable": true
          },
          "max_selections": {
            "maximum": 999,
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of choices to be selected.",
            "format": "int32",
            "nullable": true
          }
        },
        "description": "Question constraints"
      },
      "TermsAcceptanceRequest": {
        "required": [
          "all_policies_accepted",
          "content_version"
        ],
        "type": "object",
        "properties": {
          "content_version": {
            "type": "string"
          },
          "all_policies_accepted": {
            "type": "boolean"
          }
        },
        "description": "Initial request"
      },
      "TermsAcceptanceResponse": {
        "required": [
          "login_response",
          "onboarding_response"
        ],
        "type": "object",
        "properties": {
          "login_response": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LoginResponse"
              },
              {
                "description": "Contains updated JWT token, used by the rest of the consultation flow"
              }
            ]
          },
          "onboarding_response": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TermsAcceptanceResponse.OnboardingResponse"
              },
              {
                "description": "Contains the onboarding information for the first questions."
              }
            ]
          }
        },
        "description": "Terms acceptance response"
      },
      "TermsAcceptanceResponse.OnboardingResponse": {
        "type": "object",
        "properties": {
          "age_question": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Question"
              },
              {
                "description": "Age question for the user. Use the provided messages and constraints to implement your UI."
              }
            ]
          },
          "gender_question": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Question"
              },
              {
                "description": "Gender question for the user. Use the provided messages and constraints to implement your UI."
              }
            ]
          },
          "symptoms_question": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Question"
              },
              {
                "description": "Symptoms question for the user. Use the provided messages and constraints to implement your UI."
              }
            ]
          }
        },
        "description": "Contains the onboarding information for the first questions."
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
```