ReferenceFor engineers

Hosted sessions & pages

Start and complete Awell-hosted sessions and hosted pages for stakeholders to complete activities.

Start and complete Awell-hosted sessions and hosted pages for stakeholders to complete activities.

Queries

Returns the hosted pages link for a stakeholder in a care flow.

Arguments

ArgumentTypeRequiredDescription
pathway_idString!YesThe ID of the care flow
stakeholder_idString!YesThe ID of the stakeholder

Returns: HostedPagesLinkPayload!

Example

query HostedPagesLink($pathway_id: String!, $stakeholder_id: String!) {
  hostedPagesLink(pathway_id: $pathway_id, stakeholder_id: $stakeholder_id) {
    code
    hosted_pages_link {
      id
      pathway_id
      stakeholder_id
      url
    }
    success
  }
}

Variables:

{
  "pathway_id": "<string>",
  "stakeholder_id": "<string>"
}

Returns the hosted pages links for all stakeholders in a care flow.

Arguments

ArgumentTypeRequiredDescription
pathway_idString!YesThe ID of the care flow

Returns: HostedPagesLinksPayload!

Example

query HostedPagesLinks($pathway_id: String!) {
  hostedPagesLinks(pathway_id: $pathway_id) {
    code
    hosted_pages_links {
      id
      pathway_id
      stakeholder_definition_id
      stakeholder_id
      stakeholder_label
      url
    }
    success
  }
}

Variables:

{
  "pathway_id": "<string>"
}

hostedSession

Returns the current hosted session, including its branding, metadata, and session details.

Returns: HostedSessionPayload!

Example

query HostedSession {
  hostedSession {
    branding {
      accent_color
      custom_theme
      hosted_page_auto_progress
      hosted_page_autosave
      hosted_page_title
      logo_url
    }
    code
    metadata {
      pathway_definition_id
      tenant_id
    }
    session {
      cancel_url
      created_at
      expires_at
      id
      organization_slug
      pathway_id
      stakeholder {
        id
        name
        type
      }
      status
      success_url
      tracking {
        custom
        utm_campaign
        utm_content
        utm_medium
        utm_source
        utm_term
      }
      user_context {
        stytch_member_email
        stytch_member_id
      }
    }
    success
  }
}

hostedSessionActivities

Returns the activities for the current hosted session.

Arguments

ArgumentTypeRequiredDescription
only_stakeholder_activitiesBooleanNoWhether to return only the stakeholder's activities

Returns: HostedSessionActivitiesPayload!

Example

query HostedSessionActivities($only_stakeholder_activities: Boolean) {
  hostedSessionActivities(only_stakeholder_activities: $only_stakeholder_activities) {
    activities {
      action
      action_component {
        definition_id
        release_id
        title
      }
      container_name
      context {
        action_id
        agent_config_id
        agent_id
        agent_thread_id
        instance_id
        pathway_id
        run_id
        step_id
        track_id
      }
      date
      expires_at
      form {
        definition_id
        id
        key
        metadata
        release_id
        title
        trademark
      }
      form_display_mode
      icon_url
      id
      isUserActivity
      metadata
      public
      reference_id
      reference_type
      resolution
      session_id
      status
      stream_id
    }
    code
    success
  }
}

Variables:

{
  "only_stakeholder_activities": true
}

Mutations

completeSession

Completes a hosted session.

Arguments

ArgumentTypeRequiredDescription
inputCompleteSessionInput!YesThe input identifying the session to complete

Returns: CompleteSessionPayload!

Example

mutation CompleteSession($input: CompleteSessionInput!) {
  completeSession(input: $input) {
    code
    session {
      cancel_url
      created_at
      expires_at
      id
      organization_slug
      pathway_id
      stakeholder {
        id
        name
        type
      }
      status
      success_url
      tracking {
        custom
        utm_campaign
        utm_content
        utm_medium
        utm_source
        utm_term
      }
      user_context {
        stytch_member_email
        stytch_member_id
      }
    }
    success
  }
}

Variables:

{
  "input": {
    "session_id": "<string>"
  }
}

startHostedActivitySession

Starts a hosted activity session for a stakeholder in a care flow.

Arguments

ArgumentTypeRequiredDescription
inputStartHostedActivitySessionInput!YesThe input for starting the hosted activity session

Returns: StartHostedActivitySessionPayload!

Example

mutation StartHostedActivitySession($input: StartHostedActivitySessionInput!) {
  startHostedActivitySession(input: $input) {
    code
    language
    organization_slug
    session_id
    session_url
    success
    tracking {
      custom
      utm_campaign
      utm_content
      utm_medium
      utm_source
      utm_term
    }
    user_context {
      stytch_member_email
      stytch_member_id
    }
  }
}

Variables:

{
  "input": {
    "pathway_id": "<string>",
    "stakeholder_id": "<string>"
  }
}

Starts a hosted activity session from a hosted pages link.

Arguments

ArgumentTypeRequiredDescription
inputStartHostedActivitySessionViaHostedPagesLinkInput!YesThe input for starting the hosted activity session via a hosted pages link

Returns: StartHostedActivitySessionPayload!

Example

mutation StartHostedActivitySessionViaHostedPagesLink($input: StartHostedActivitySessionViaHostedPagesLinkInput!) {
  startHostedActivitySessionViaHostedPagesLink(input: $input) {
    code
    language
    organization_slug
    session_id
    session_url
    success
    tracking {
      custom
      utm_campaign
      utm_content
      utm_medium
      utm_source
      utm_term
    }
    user_context {
      stytch_member_email
      stytch_member_id
    }
  }
}

Variables:

{
  "input": {
    "hosted_pages_link_id": "<string>"
  }
}

startHostedPathwaySession

Start a hosted pathway session for a patient uniquely identified by patient_id or patient_identifier. If neither patient_id or patient_identifier is provided, a new anonymous patient will be created.

Arguments

ArgumentTypeRequiredDescription
inputStartHostedPathwaySessionInput!YesThe input for starting the hosted care flow session

Returns: StartHostedPathwaySessionPayload!

Example

mutation StartHostedPathwaySession($input: StartHostedPathwaySessionInput!) {
  startHostedPathwaySession(input: $input) {
    code
    organization_slug
    pathway_id
    session_id
    session_url
    stakeholder {
      id
      name
      type
    }
    success
    tracking {
      custom
      utm_campaign
      utm_content
      utm_medium
      utm_source
      utm_term
    }
    user_context {
      stytch_member_email
      stytch_member_id
    }
  }
}

Variables:

{
  "input": {
    "pathway_definition_id": "<string>"
  }
}

Starts a hosted care flow session from a link.

Arguments

ArgumentTypeRequiredDescription
inputStartHostedPathwaySessionFromLinkInput!YesThe input for starting the hosted care flow session from a link

Returns: StartHostedPathwaySessionFromLinkPayload!

Example

mutation StartHostedPathwaySessionFromLink($input: StartHostedPathwaySessionFromLinkInput!) {
  startHostedPathwaySessionFromLink(input: $input) {
    code
    organization_slug
    session_url
    success
    tracking {
      custom
      utm_campaign
      utm_content
      utm_medium
      utm_source
      utm_term
    }
  }
}

Variables:

{
  "input": {
    "id": "<string>"
  }
}

On this page