openapi: 3.0.3
info:
  title: 'R1Disover API'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://api.r1learning.com'
tags:
  -
    name: 'Company Management'
    description: ''
  -
    name: 'Locations & Programs'
    description: ''
  -
    name: 'User Management'
    description: ''
  -
    name: 'Activity Results'
    description: ''
  -
    name: 'Metrics and Analytics'
    description: ''
  -
    name: 'Global Endpoints'
    description: ''
paths:
  /api/v2/companies:
    get:
      summary: 'List Companies'
      operationId: listCompanies
      description: ''
      parameters:
        -
          in: query
          name: companyId
          description: 'optional The id of the company (0 returns all companies).'
          example: 0
          required: false
          schema:
            type: integer
            description: 'optional The id of the company (0 returns all companies).'
            example: 0
        -
          in: query
          name: stripeCustomerId
          description: 'optional The Stripe customer ID to filter companies. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'optional The Stripe customer ID to filter companies. Example:'
            example: null
        -
          in: query
          name: stripeSubscriptionId
          description: 'optional The Stripe subscription ID to filter companies. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'optional The Stripe subscription ID to filter companies. Example:'
            example: null
        -
          in: query
          name: page
          description: 'optional The current page number, defaults to 1.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'optional Number of records to return, default 50, max 100.'
          example: 50
          required: false
          schema:
            type: integer
            description: 'optional Number of records to return, default 50, max 100.'
            example: 50
        -
          in: query
          name: sortby
          description: 'optional Sort companies by (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical), defaults to 1.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'optional Sort companies by (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical), defaults to 1.'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 2
                    total_pages: 1
                    current_page: 1
                    per_page: 50
                  company_list:
                    -
                      id: 11017
                      name: 'R1 Learning'
                      total_licenses: 200
                      assigned_licenses: 99
                      available_licenses: 101
                      license_renewal_date: '2025-12-31'
                      status: published
                    -
                      id: 12138
                      name: 'R2 Learning'
                      total_licenses: 100
                      assigned_licenses: 90
                      available_licenses: 10
                      license_renewal_date: '2025-09-30'
                      status: published
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 2
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                  company_list:
                    type: array
                    example:
                      -
                        id: 11017
                        name: 'R1 Learning'
                        total_licenses: 200
                        assigned_licenses: 99
                        available_licenses: 101
                        license_renewal_date: '2025-12-31'
                        status: published
                      -
                        id: 12138
                        name: 'R2 Learning'
                        total_licenses: 100
                        assigned_licenses: 90
                        available_licenses: 10
                        license_renewal_date: '2025-09-30'
                        status: published
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 11017
                        name:
                          type: string
                          example: 'R1 Learning'
                        total_licenses:
                          type: integer
                          example: 200
                        assigned_licenses:
                          type: integer
                          example: 99
                        available_licenses:
                          type: integer
                          example: 101
                        license_renewal_date:
                          type: string
                          example: '2025-12-31'
                        status:
                          type: string
                          example: published
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Company Management'
    post:
      summary: 'Create Company'
      operationId: createCompany
      description: ''
      parameters: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Company created successfully'
                  data:
                    id: 99
                    name: 'FB Test Comp 3'
                    address1: '15 North avenue'
                    address2: 'Suite 100'
                    city: Chicago
                    state: IL
                    zip: '60610'
                    country: US
                    status: published
                    total_licenses: '10'
                    email1: contact@example.com
                    license_renewal_date: '2025-10-01 00:41:10'
                properties:
                  message:
                    type: string
                    example: 'Company created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 99
                      name:
                        type: string
                        example: 'FB Test Comp 3'
                      address1:
                        type: string
                        example: '15 North avenue'
                      address2:
                        type: string
                        example: 'Suite 100'
                      city:
                        type: string
                        example: Chicago
                      state:
                        type: string
                        example: IL
                      zip:
                        type: string
                        example: '60610'
                      country:
                        type: string
                        example: US
                      status:
                        type: string
                        example: published
                      total_licenses:
                        type: string
                        example: '10'
                      email1:
                        type: string
                        example: contact@example.com
                      license_renewal_date:
                        type: string
                        example: '2025-10-01 00:41:10'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Company Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'The name of the company.'
                  example: 'Acme Corp'
                address1:
                  type: string
                  description: 'The primary address of the company.'
                  example: '123 Main St'
                address2:
                  type: string
                  description: 'The secondary address of the company.'
                  example: 'Suite 456'
                city:
                  type: string
                  description: 'The city of the company.'
                  example: 'New York'
                state:
                  type: string
                  description: 'The state of the company.'
                  example: NY
                zip:
                  type: string
                  description: 'The zip code of the company.'
                  example: '10001'
                country:
                  type: string
                  description: 'The country of the company.'
                  example: US
                phone:
                  type: string
                  description: 'The primary phone number of the company.'
                  example: 555-123-4567
                email:
                  type: string
                  description: 'The email of the company Super Admin.'
                  example: contact@r1.com
                status:
                  type: string
                  description: 'The status of the company (published, expired).'
                  example: published
                total_licenses:
                  type: integer
                  description: 'The total number of licenses.'
                  example: 100
                license_duration:
                  type: string
                  description: 'The duration of the license (1-month, 1-year).'
                  example: 1-year
                stripe_customer_id:
                  type: string
                  description: 'The Stripe customer ID. Example:'
                  example: null
                stripe_subscription_id:
                  type: string
                  description: 'The Stripe subscription ID. Example:'
                  example: null
                subscription_type:
                  type: string
                  description: 'The subscription type of the company (freemium, basic, professional, enterprise).'
                  example: basic
              required:
                - name
                - address1
                - city
                - state
                - zip
                - country
                - email
                - status
                - total_licenses
                - license_duration
  '/api/v2/companies/{id}':
    put:
      summary: 'Update Company'
      operationId: updateCompany
      description: ''
      parameters: []
      responses:
        201:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Company updated successfully'
                  data:
                    id: 10231
                    name: 'Example Company'
                    status: published
                    total_licenses: '11'
                    license_renewal_date: '2025-10-01'
                properties:
                  message:
                    type: string
                    example: 'Company updated successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 10231
                      name:
                        type: string
                        example: 'Example Company'
                      status:
                        type: string
                        example: published
                      total_licenses:
                        type: string
                        example: '11'
                      license_renewal_date:
                        type: string
                        example: '2025-10-01'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
        422:
          description: 'Validation Error'
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: 'Total licenses cannot be less than currently assigned licenses'
                  details: 'You have 198 licenses assigned, please unassign licenses to reduce the total below 198.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: 'Total licenses cannot be less than currently assigned licenses'
                  details:
                    type: string
                    example: 'You have 198 licenses assigned, please unassign licenses to reduce the total below 198.'
      tags:
        - 'Company Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  description: 'Update the status of the company (published, expired).'
                  example: published
                total_licenses:
                  type: integer
                  description: 'Update the total number of licenses.'
                  example: 10
                license_renewal_date:
                  type: string
                  description: 'Update the license renewal date.'
                  example: '2025-01-01'
                stripe_customer_id:
                  type: string
                  description: 'The Stripe customer ID. Example:'
                  example: null
                stripe_subscription_id:
                  type: string
                  description: 'The Stripe subscription ID. Example:'
                  example: null
                subscription_type:
                  type: string
                  description: 'The subscription type of the company (freemium, basic, professional, enterprise).'
                  example: individual
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the company to update.'
        example: 1234
        required: true
        schema:
          type: integer
  /api/v2/companies/topics:
    get:
      summary: 'List Company Topics'
      operationId: listCompanyTopics
      description: ''
      parameters:
        -
          in: query
          name: companyId
          description: 'The id of the company (0 returns all companies).'
          example: 0
          required: true
          schema:
            type: integer
            description: 'The id of the company (0 returns all companies).'
            example: 0
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: sortby
          description: 'Sort companies by (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'Sort companies by (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 2
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                  topic_list:
                    -
                      company_id: 17532
                      topics:
                        -
                          topic_id: 1123
                          name: 'Stages of Change (SUD)'
                          video_url: 'http://discover.r1learning.com/video-library/video/****'
                        -
                          topic_id: 3321
                          name: 'Healthy Boundaries'
                          video_url: 'http://discover.r1learning.com/video-library/video/****'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 2
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                  topic_list:
                    type: array
                    example:
                      -
                        company_id: 17532
                        topics:
                          -
                            topic_id: 1123
                            name: 'Stages of Change (SUD)'
                            video_url: 'http://discover.r1learning.com/video-library/video/****'
                          -
                            topic_id: 3321
                            name: 'Healthy Boundaries'
                            video_url: 'http://discover.r1learning.com/video-library/video/****'
                    items:
                      type: object
                      properties:
                        company_id:
                          type: integer
                          example: 17532
                        topics:
                          type: array
                          example:
                            -
                              topic_id: 1123
                              name: 'Stages of Change (SUD)'
                              video_url: 'http://discover.r1learning.com/video-library/video/****'
                            -
                              topic_id: 3321
                              name: 'Healthy Boundaries'
                              video_url: 'http://discover.r1learning.com/video-library/video/****'
                          items:
                            type: object
                            properties:
                              topic_id:
                                type: integer
                                example: 1123
                              name:
                                type: string
                                example: 'Stages of Change (SUD)'
                              video_url:
                                type: string
                                example: 'http://discover.r1learning.com/video-library/video/****'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Company Management'
  /api/v2/companies/activities:
    get:
      summary: 'List Company Activities'
      operationId: listCompanyActivities
      description: ''
      parameters:
        -
          in: query
          name: companyId
          description: 'The id of the company, default 0 returns all companies.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'The id of the company, default 0 returns all companies.'
            example: 0
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: sortby
          description: 'Sort companies by (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'Sort companies by (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 4
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                  data:
                    -
                      company_id: 3124
                      activity_list:
                        -
                          topic_id: 123
                          topic_name: 'Stages of Change (SUD)'
                          activities:
                            -
                              id: 71
                              name: 'Identify My Stage of Change'
                              type: sorting_cards
                              activity_url: 'http://discover.r1learning.com/activity****'
                            -
                              id: 98
                              name: 'Explore the Stages of Change Model'
                              type: overview_definition_cards
                              activity_url: 'http://discover.r1learning.com/activity****'
                        -
                          topic_id: 242
                          topic_name: 'Phases of Addiction'
                          activities:
                            -
                              id: 27
                              name: 'Identify My Phase of Addiction'
                              type: sorting_cards
                              activity_url: 'http://discover.r1learning.com/activity****'
                            -
                              id: 63
                              name: 'Explore the Phases of Addiction Model'
                              type: overview_definition_cards
                              activity_url: 'http://discover.r1learning.com/activity****'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 4
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                  data:
                    type: array
                    example:
                      -
                        company_id: 3124
                        activity_list:
                          -
                            topic_id: 123
                            topic_name: 'Stages of Change (SUD)'
                            activities:
                              -
                                id: 71
                                name: 'Identify My Stage of Change'
                                type: sorting_cards
                                activity_url: 'http://discover.r1learning.com/activity****'
                              -
                                id: 98
                                name: 'Explore the Stages of Change Model'
                                type: overview_definition_cards
                                activity_url: 'http://discover.r1learning.com/activity****'
                          -
                            topic_id: 242
                            topic_name: 'Phases of Addiction'
                            activities:
                              -
                                id: 27
                                name: 'Identify My Phase of Addiction'
                                type: sorting_cards
                                activity_url: 'http://discover.r1learning.com/activity****'
                              -
                                id: 63
                                name: 'Explore the Phases of Addiction Model'
                                type: overview_definition_cards
                                activity_url: 'http://discover.r1learning.com/activity****'
                    items:
                      type: object
                      properties:
                        company_id:
                          type: integer
                          example: 3124
                        activity_list:
                          type: array
                          example:
                            -
                              topic_id: 123
                              topic_name: 'Stages of Change (SUD)'
                              activities:
                                -
                                  id: 71
                                  name: 'Identify My Stage of Change'
                                  type: sorting_cards
                                  activity_url: 'http://discover.r1learning.com/activity****'
                                -
                                  id: 98
                                  name: 'Explore the Stages of Change Model'
                                  type: overview_definition_cards
                                  activity_url: 'http://discover.r1learning.com/activity****'
                            -
                              topic_id: 242
                              topic_name: 'Phases of Addiction'
                              activities:
                                -
                                  id: 27
                                  name: 'Identify My Phase of Addiction'
                                  type: sorting_cards
                                  activity_url: 'http://discover.r1learning.com/activity****'
                                -
                                  id: 63
                                  name: 'Explore the Phases of Addiction Model'
                                  type: overview_definition_cards
                                  activity_url: 'http://discover.r1learning.com/activity****'
                          items:
                            type: object
                            properties:
                              topic_id:
                                type: integer
                                example: 123
                              topic_name:
                                type: string
                                example: 'Stages of Change (SUD)'
                              activities:
                                type: array
                                example:
                                  -
                                    id: 71
                                    name: 'Identify My Stage of Change'
                                    type: sorting_cards
                                    activity_url: 'http://discover.r1learning.com/activity****'
                                  -
                                    id: 98
                                    name: 'Explore the Stages of Change Model'
                                    type: overview_definition_cards
                                    activity_url: 'http://discover.r1learning.com/activity****'
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: integer
                                      example: 71
                                    name:
                                      type: string
                                      example: 'Identify My Stage of Change'
                                    type:
                                      type: string
                                      example: sorting_cards
                                    activity_url:
                                      type: string
                                      example: 'http://discover.r1learning.com/activity****'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Company Management'
  '/api/v2/locations/{companyId}':
    get:
      summary: 'List Company Locations'
      operationId: listCompanyLocations
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: sortby
          description: 'Sort companies by (1: Oldest, 2: Newest).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'Sort companies by (1: Oldest, 2: Newest).'
            example: 1
        -
          in: query
          name: locationOrder
          description: 'Order of locations (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'Order of locations (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 2
                    total_pages: 1
                    current_page: 1
                    per_page: 50
                  location_list:
                    -
                      company_id: 12345
                      locations:
                        -
                          id: 1273
                          location_name: 'R1 Location 1'
                          status: published
                        -
                          id: 5692
                          location_name: 'R1 Location 2'
                          status: published
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 2
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                  location_list:
                    type: array
                    example:
                      -
                        company_id: 12345
                        locations:
                          -
                            id: 1273
                            location_name: 'R1 Location 1'
                            status: published
                          -
                            id: 5692
                            location_name: 'R1 Location 2'
                            status: published
                    items:
                      type: object
                      properties:
                        company_id:
                          type: integer
                          example: 12345
                        locations:
                          type: array
                          example:
                            -
                              id: 1273
                              location_name: 'R1 Location 1'
                              status: published
                            -
                              id: 5692
                              location_name: 'R1 Location 2'
                              status: published
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                                example: 1273
                              location_name:
                                type: string
                                example: 'R1 Location 1'
                              status:
                                type: string
                                example: published
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Locations & Programs'
    post:
      summary: 'Create/Update Location'
      operationId: createUpdateLocation
      description: ''
      parameters:
        -
          in: query
          name: id
          description: 'The ID of the location to update. Leave blank for creating a new location. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the location to update. Leave blank for creating a new location. Example:'
            example: null
        -
          in: query
          name: location_name
          description: 'The name of the location.'
          example: 'Main Office'
          required: true
          schema:
            type: string
            description: 'The name of the location.'
            example: 'Main Office'
        -
          in: query
          name: address1
          description: 'The primary address.'
          example: '123 Main St'
          required: false
          schema:
            type: string
            description: 'The primary address.'
            example: '123 Main St'
        -
          in: query
          name: address2
          description: 'The secondary address (optional).'
          example: 'Apt 4B'
          required: false
          schema:
            type: string
            description: 'The secondary address (optional).'
            example: 'Apt 4B'
        -
          in: query
          name: city
          description: 'The city where the facility is located.'
          example: 'New York'
          required: true
          schema:
            type: string
            description: 'The city where the facility is located.'
            example: 'New York'
        -
          in: query
          name: state
          description: 'The state where the facility is located.'
          example: NY
          required: true
          schema:
            type: string
            description: 'The state where the facility is located.'
            example: NY
        -
          in: query
          name: zip
          description: 'The zip code of the facility.'
          example: '10001'
          required: true
          schema:
            type: string
            description: 'The zip code of the facility.'
            example: '10001'
        -
          in: query
          name: country
          description: 'The 2-digit country code for the facility (See List Countries endpoint).'
          example: US
          required: true
          schema:
            type: string
            description: 'The 2-digit country code for the facility (See List Countries endpoint).'
            example: US
        -
          in: query
          name: phone1
          description: 'The contact phone number for the location.'
          example: 123-456-7890
          required: false
          schema:
            type: string
            description: 'The contact phone number for the location.'
            example: 123-456-7890
        -
          in: query
          name: email1
          description: 'The contact email for the location.'
          example: info@company.com
          required: false
          schema:
            type: string
            description: 'The contact email for the location.'
            example: info@company.com
        -
          in: query
          name: status
          description: 'The status of the location (published, pending, draft).'
          example: published
          required: true
          schema:
            type: string
            description: 'The status of the location (published, pending, draft).'
            example: published
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Location created successfully'
                  data:
                    id: 185672
                    location_name: 'Main Office'
                    company_item_id: '1234'
                    address1: '123 Main St'
                    address2: 'Apt 4B'
                    city: 'New York'
                    state: NY
                    zip: '10001'
                    country: US
                    phone1: 123-456-7890
                    email1: info@company.com
                    created_at: '2024-09-14T03:47:35.000000Z'
                    updated_at: '2024-09-14T03:47:35.000000Z'
                properties:
                  message:
                    type: string
                    example: 'Location created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 185672
                      location_name:
                        type: string
                        example: 'Main Office'
                      company_item_id:
                        type: string
                        example: '1234'
                      address1:
                        type: string
                        example: '123 Main St'
                      address2:
                        type: string
                        example: 'Apt 4B'
                      city:
                        type: string
                        example: 'New York'
                      state:
                        type: string
                        example: NY
                      zip:
                        type: string
                        example: '10001'
                      country:
                        type: string
                        example: US
                      phone1:
                        type: string
                        example: 123-456-7890
                      email1:
                        type: string
                        example: info@company.com
                      created_at:
                        type: string
                        example: '2024-09-14T03:47:35.000000Z'
                      updated_at:
                        type: string
                        example: '2024-09-14T03:47:35.000000Z'
        201:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Location updated successfully'
                  data: 1
                properties:
                  message:
                    type: string
                    example: 'Location updated successfully'
                  data:
                    type: integer
                    example: 1
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Locations & Programs'
    parameters:
      -
        in: path
        name: companyId
        description: 'The company id (0 returns all companies).'
        example: 0
        required: true
        schema:
          type: integer
  /api/v2/programs/parent:
    get:
      summary: 'List Parent Programs'
      operationId: listParentPrograms
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number. Default: 1.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The current page number. Default: 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return. Default: 50, Max: 100.'
          example: 50
          required: false
          schema:
            type: integer
            description: 'Number of records to return. Default: 50, Max: 100.'
            example: 50
        -
          in: query
          name: sortBy
          description: 'Order of programs (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'Order of programs (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 3
                    total_pages: 1
                    current_page: 1
                    per_page: 50
                  parent_program_list:
                    -
                      id: 1
                      name: 'ASAM Level .5 – Early Intervention'
                      status: published
                    -
                      id: 2
                      name: 'ASAM Level 1 – Outpatient'
                      status: published
                    -
                      id: 3
                      name: 'ASAM Level 2.1 – Intensive Outpatient'
                      status: published
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 3
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                  parent_program_list:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'ASAM Level .5 – Early Intervention'
                        status: published
                      -
                        id: 2
                        name: 'ASAM Level 1 – Outpatient'
                        status: published
                      -
                        id: 3
                        name: 'ASAM Level 2.1 – Intensive Outpatient'
                        status: published
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'ASAM Level .5 – Early Intervention'
                        status:
                          type: string
                          example: published
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Locations & Programs'
  '/api/v2/programs/{companyId}':
    get:
      summary: 'List Company Programs'
      operationId: listCompanyPrograms
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: sortby
          description: 'Sort companies by (1: Oldest, 2: Newest).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'Sort companies by (1: Oldest, 2: Newest).'
            example: 1
        -
          in: query
          name: programOrder
          description: 'Order of programs (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'Order of programs (1: Oldest, 2: Newest, 3: Alphabetical, 4: Reverse Alphabetical).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 2
                    total_pages: 1
                    current_page: 1
                    per_page: 50
                  program_list:
                    -
                      company_id: 1432
                      programs:
                        -
                          program_id: 1937
                          program_name: Detox
                          program_parent_id: 1
                          program_parent_name: 'ASAM Level .5 – Early Intervention'
                          status: published
                        -
                          program_id: 4526
                          program_name: PHP
                          program_parent_id: 4
                          program_parent_name: 'ASAM Level 2.5 – Partial Hospitalization'
                          status: published
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 2
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                  program_list:
                    type: array
                    example:
                      -
                        company_id: 1432
                        programs:
                          -
                            program_id: 1937
                            program_name: Detox
                            program_parent_id: 1
                            program_parent_name: 'ASAM Level .5 – Early Intervention'
                            status: published
                          -
                            program_id: 4526
                            program_name: PHP
                            program_parent_id: 4
                            program_parent_name: 'ASAM Level 2.5 – Partial Hospitalization'
                            status: published
                    items:
                      type: object
                      properties:
                        company_id:
                          type: integer
                          example: 1432
                        programs:
                          type: array
                          example:
                            -
                              program_id: 1937
                              program_name: Detox
                              program_parent_id: 1
                              program_parent_name: 'ASAM Level .5 – Early Intervention'
                              status: published
                            -
                              program_id: 4526
                              program_name: PHP
                              program_parent_id: 4
                              program_parent_name: 'ASAM Level 2.5 – Partial Hospitalization'
                              status: published
                          items:
                            type: object
                            properties:
                              program_id:
                                type: integer
                                example: 1937
                              program_name:
                                type: string
                                example: Detox
                              program_parent_id:
                                type: integer
                                example: 1
                              program_parent_name:
                                type: string
                                example: 'ASAM Level .5 – Early Intervention'
                              status:
                                type: string
                                example: published
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Locations & Programs'
    post:
      summary: 'Create/Update Program'
      operationId: createUpdateProgram
      description: ''
      parameters:
        -
          in: query
          name: id
          description: 'The ID of the program to update (if updating, leave blank to create). Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the program to update (if updating, leave blank to create). Example:'
            example: null
        -
          in: query
          name: name
          description: 'The name of the program.'
          example: '"New Program"'
          required: true
          schema:
            type: string
            description: 'The name of the program.'
            example: '"New Program"'
        -
          in: query
          name: parent_id
          description: 'The ID of the parent program.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The ID of the parent program.'
            example: 1
        -
          in: query
          name: status
          description: 'string The status of the program (published, pending, draft).'
          example: published
          required: true
          schema:
            type: string
            description: 'string The status of the program (published, pending, draft).'
            example: published
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The program "New Program" created successfully'
                  data:
                    id: 18827
                    company_id: '1432'
                    name: 'New Program'
                    parent_id: '2'
                    status: published
                    created_at: '2024-09-14T04:41:20.000000Z'
                    updated_at: '2024-09-14T04:41:20.000000Z'
                properties:
                  message:
                    type: string
                    example: 'The program "New Program" created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 18827
                      company_id:
                        type: string
                        example: '1432'
                      name:
                        type: string
                        example: 'New Program'
                      parent_id:
                        type: string
                        example: '2'
                      status:
                        type: string
                        example: published
                      created_at:
                        type: string
                        example: '2024-09-14T04:41:20.000000Z'
                      updated_at:
                        type: string
                        example: '2024-09-14T04:41:20.000000Z'
        201:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The program "New Program" updated successfully'
                  data: 1
                properties:
                  message:
                    type: string
                    example: 'The program "New Program" updated successfully'
                  data:
                    type: integer
                    example: 1
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Locations & Programs'
    parameters:
      -
        in: path
        name: companyId
        description: 'The company id (0 returns all companies).'
        example: 0
        required: true
        schema:
          type: integer
  '/api/v2/users/{companyId}':
    get:
      summary: 'List Company Users'
      operationId: listCompanyUsers
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: maxDays
          description: 'Pull records from last x days, default 0 which returns all records.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'Pull records from last x days, default 0 which returns all records.'
            example: 0
        -
          in: query
          name: userStatus
          description: '1 = active, 2 = inactive, default 0 which returns all users.'
          example: 0
          required: false
          schema:
            type: integer
            description: '1 = active, 2 = inactive, default 0 which returns all users.'
            example: 0
        -
          in: query
          name: uniqueID
          description: 'stringThe unique ID of the user from the integration partner system. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'stringThe unique ID of the user from the integration partner system. Example:'
            example: null
        -
          in: query
          name: location_id
          description: 'Pull users from a location, defaults blank to returns all records. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'Pull users from a location, defaults blank to returns all records. Example:'
            example: null
        -
          in: query
          name: program_id
          description: 'Pull users from a Program, defaults blank to returns all records. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'Pull users from a Program, defaults blank to returns all records. Example:'
            example: null
        -
          in: query
          name: sortby
          description: 'User order (1: Oldest, 2: Newest, 3: Least Recently Active, 4: Recently Active).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'User order (1: Oldest, 2: Newest, 3: Least Recently Active, 4: Recently Active).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 2
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                    max_days: '400'
                  user_list:
                    -
                      company_id: 127
                      users:
                        -
                          user_id: 29673
                          email: acase@example.com
                          username: acase@example.com
                          company_username: null
                          unique_id: compid-user-000000000000946
                          status: active
                          location_name: 'R1 Location 1'
                          program_name: 'Sample Program'
                          practitioner_email: practitioner@example.com
                          member_updated_at: '2023-07-20T14:21:17.000000Z'
                          last_activity_date: '2023-08-25T11:06:32.000000Z'
                    -
                      company_id: 393
                      users:
                        -
                          user_id: 21333
                          email: user@example.com
                          username: user@example.com
                          company_username: null
                          unique_id: compid-user-000000000002341
                          status: active
                          location_name: 'Company Location 2'
                          program_name: PHP
                          practitioner_email: practitioner@example.com
                          member_updated_at: '2023-06-11T13:06:59.000000Z'
                          last_activity_date: '2023-09-15T12:13:49.000000Z'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 2
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                      max_days:
                        type: string
                        example: '400'
                  user_list:
                    type: array
                    example:
                      -
                        company_id: 127
                        users:
                          -
                            user_id: 29673
                            email: acase@example.com
                            username: acase@example.com
                            company_username: null
                            unique_id: compid-user-000000000000946
                            status: active
                            location_name: 'R1 Location 1'
                            program_name: 'Sample Program'
                            practitioner_email: practitioner@example.com
                            member_updated_at: '2023-07-20T14:21:17.000000Z'
                            last_activity_date: '2023-08-25T11:06:32.000000Z'
                      -
                        company_id: 393
                        users:
                          -
                            user_id: 21333
                            email: user@example.com
                            username: user@example.com
                            company_username: null
                            unique_id: compid-user-000000000002341
                            status: active
                            location_name: 'Company Location 2'
                            program_name: PHP
                            practitioner_email: practitioner@example.com
                            member_updated_at: '2023-06-11T13:06:59.000000Z'
                            last_activity_date: '2023-09-15T12:13:49.000000Z'
                    items:
                      type: object
                      properties:
                        company_id:
                          type: integer
                          example: 127
                        users:
                          type: array
                          example:
                            -
                              user_id: 29673
                              email: acase@example.com
                              username: acase@example.com
                              company_username: null
                              unique_id: compid-user-000000000000946
                              status: active
                              location_name: 'R1 Location 1'
                              program_name: 'Sample Program'
                              practitioner_email: practitioner@example.com
                              member_updated_at: '2023-07-20T14:21:17.000000Z'
                              last_activity_date: '2023-08-25T11:06:32.000000Z'
                          items:
                            type: object
                            properties:
                              user_id:
                                type: integer
                                example: 29673
                              email:
                                type: string
                                example: acase@example.com
                              username:
                                type: string
                                example: acase@example.com
                              company_username:
                                type: string
                                example: null
                                nullable: true
                              unique_id:
                                type: string
                                example: compid-user-000000000000946
                              status:
                                type: string
                                example: active
                              location_name:
                                type: string
                                example: 'R1 Location 1'
                              program_name:
                                type: string
                                example: 'Sample Program'
                              practitioner_email:
                                type: string
                                example: practitioner@example.com
                              member_updated_at:
                                type: string
                                example: '2023-07-20T14:21:17.000000Z'
                              last_activity_date:
                                type: string
                                example: '2023-08-25T11:06:32.000000Z'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'User Management'
    post:
      summary: 'Create/Update User'
      operationId: createUpdateUser
      description: ''
      parameters: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 0
                  message: 'User created successfully'
                  data:
                    id: 67890
                    unique_id: abcxyz123456
                    username: johndoe
                    company_username: johndoe_company
                    first_name: John
                    last_name: Doe
                    client_email: johndoe@example.com
                properties:
                  error:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: 'User created successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 67890
                      unique_id:
                        type: string
                        example: abcxyz123456
                      username:
                        type: string
                        example: johndoe
                      company_username:
                        type: string
                        example: johndoe_company
                      first_name:
                        type: string
                        example: John
                      last_name:
                        type: string
                        example: Doe
                      client_email:
                        type: string
                        example: johndoe@example.com
        201:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 0
                  message: 'User updated successfully!'
                  data:
                    -
                      id: 123456
                      unique_id: test-user-1234
                      username: user123456
                      company_username: ''
                      first_name: User
                      last_name: Example
                      email: user123456@example.com
                      location: 'Sample Location'
                      practitioner: practitioner@example.com
                      program: 'Sample Program'
                      status: active
                properties:
                  error:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: 'User updated successfully!'
                  data:
                    type: array
                    example:
                      -
                        id: 123456
                        unique_id: test-user-1234
                        username: user123456
                        company_username: ''
                        first_name: User
                        last_name: Example
                        email: user123456@example.com
                        location: 'Sample Location'
                        practitioner: practitioner@example.com
                        program: 'Sample Program'
                        status: active
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 123456
                        unique_id:
                          type: string
                          example: test-user-1234
                        username:
                          type: string
                          example: user123456
                        company_username:
                          type: string
                          example: ''
                        first_name:
                          type: string
                          example: User
                        last_name:
                          type: string
                          example: Example
                        email:
                          type: string
                          example: user123456@example.com
                        location:
                          type: string
                          example: 'Sample Location'
                        practitioner:
                          type: string
                          example: practitioner@example.com
                        program:
                          type: string
                          example: 'Sample Program'
                        status:
                          type: string
                          example: active
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
        404:
          description: 'User Not Found'
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: 'User not found'
                  details: "The requested user with Unique ID 'abcxyz' does not exist or is not associated with the given company."
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: 'User not found'
                  details:
                    type: string
                    example: "The requested user with Unique ID 'abcxyz' does not exist or is not associated with the given company."
      tags:
        - 'User Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                client_id:
                  type: string
                  description: 'The unique ID of the user from the tech partner system.'
                  example: r1-user-123456-01
                username:
                  type: string
                  description: 'The user global username, leave blank to autogenerate.'
                  example: user123
                company_username:
                  type: string
                  description: 'The company specific username for the user.'
                  example: user123
                first_name:
                  type: string
                  description: 'The first name of the user.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the user.'
                  example: Doe
                initial_password:
                  type: string
                  description: 'The initial password for new users only, leave blank to autogenerate. Example:'
                  example: null
                client_email:
                  type: string
                  description: 'The email of the client.'
                  example: xyz@example.com
                client_location:
                  type: string
                  description: 'The location of the client.'
                  example: 'AZ Treatment Center'
                client_program:
                  type: string
                  description: 'The program of the client.'
                  example: 'Virtual Outatient'
                client_practitioner:
                  type: string
                  description: 'The practitioner of the client.'
                  example: practitioner_email@example.com
                client_status:
                  type: string
                  description: 'The status of the client (active/inactive).'
                  example: active
              required:
                - client_id
    parameters:
      -
        in: path
        name: companyId
        description: 'The company id (0 returns all companies).'
        example: 0
        required: true
        schema:
          type: integer
  /api/v2/admins/roles:
    get:
      summary: 'List Admin Roles'
      operationId: listAdminRoles
      description: ''
      parameters: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 4
                    total_pages: 1
                    current_page: 1
                    per_page: 50
                  admin_roles:
                    -
                      name: Admin
                      description: 'View, Edit, and Create Users at same Program & Location'
                    -
                      name: Admin-Read
                      description: 'View (not Edit) Users at same Program & Location'
                    -
                      name: 'Lead Admin'
                      description: 'View, Edit, and Create Admins and Users at same Program & Location'
                    -
                      name: 'Lead Admin - Read'
                      description: 'View (not Edit) Admins and Users at same Program & Location'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 4
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                  admin_roles:
                    type: array
                    example:
                      -
                        name: Admin
                        description: 'View, Edit, and Create Users at same Program & Location'
                      -
                        name: Admin-Read
                        description: 'View (not Edit) Users at same Program & Location'
                      -
                        name: 'Lead Admin'
                        description: 'View, Edit, and Create Admins and Users at same Program & Location'
                      -
                        name: 'Lead Admin - Read'
                        description: 'View (not Edit) Admins and Users at same Program & Location'
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: Admin
                        description:
                          type: string
                          example: 'View, Edit, and Create Users at same Program & Location'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'User Management'
  '/api/v2/admins/{companyId}':
    get:
      summary: 'List Company Admins'
      operationId: listCompanyAdmins
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: maxDays
          description: 'Pull records from last x days, default 0 which returns all records.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'Pull records from last x days, default 0 which returns all records.'
            example: 0
        -
          in: query
          name: userStatus
          description: '1 = active, 2 = inactive, default 0/blank which returns all users. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: '1 = active, 2 = inactive, default 0/blank which returns all users. Example:'
            example: null
        -
          in: query
          name: uniqueID
          description: 'The unique ID of the admin from the integration partner system. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'The unique ID of the admin from the integration partner system. Example:'
            example: null
        -
          in: query
          name: location_id
          description: 'Pull users from a location, defaults blank to returns all records. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'Pull users from a location, defaults blank to returns all records. Example:'
            example: null
        -
          in: query
          name: program_id
          description: 'Pull users from a Program, defaults blank to returns all records. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'Pull users from a Program, defaults blank to returns all records. Example:'
            example: null
        -
          in: query
          name: practitioners
          description: '1 = Pull only practitioners, 0/blank (default) returns all users. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: '1 = Pull only practitioners, 0/blank (default) returns all users. Example:'
            example: null
        -
          in: query
          name: sortby
          description: 'User order (1: Oldest, 2: Newest, 3: Least Recently Active, 4: Recently Active).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'User order (1: Oldest, 2: Newest, 3: Least Recently Active, 4: Recently Active).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 1
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                    max_days: '0'
                  admin_list:
                    -
                      company_id: 612
                      admins:
                        -
                          user_id: 12345
                          email: john.smith@r1.com
                          username: johnsmith
                          unique_id: admin-r1-000000000012345
                          admin_type: 'Company Admin'
                          role_name: 'Super Admin'
                          default_location: 'R1 Location 1'
                          default_program: PHP
                          status: active
                          member_updated_at: '2024-09-15T00:51:20.000000Z'
                          last_activity_date: '2024-01-07T16:50:19.000000Z'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 1
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                      max_days:
                        type: string
                        example: '0'
                  admin_list:
                    type: array
                    example:
                      -
                        company_id: 612
                        admins:
                          -
                            user_id: 12345
                            email: john.smith@r1.com
                            username: johnsmith
                            unique_id: admin-r1-000000000012345
                            admin_type: 'Company Admin'
                            role_name: 'Super Admin'
                            default_location: 'R1 Location 1'
                            default_program: PHP
                            status: active
                            member_updated_at: '2024-09-15T00:51:20.000000Z'
                            last_activity_date: '2024-01-07T16:50:19.000000Z'
                    items:
                      type: object
                      properties:
                        company_id:
                          type: integer
                          example: 612
                        admins:
                          type: array
                          example:
                            -
                              user_id: 12345
                              email: john.smith@r1.com
                              username: johnsmith
                              unique_id: admin-r1-000000000012345
                              admin_type: 'Company Admin'
                              role_name: 'Super Admin'
                              default_location: 'R1 Location 1'
                              default_program: PHP
                              status: active
                              member_updated_at: '2024-09-15T00:51:20.000000Z'
                              last_activity_date: '2024-01-07T16:50:19.000000Z'
                          items:
                            type: object
                            properties:
                              user_id:
                                type: integer
                                example: 12345
                              email:
                                type: string
                                example: john.smith@r1.com
                              username:
                                type: string
                                example: johnsmith
                              unique_id:
                                type: string
                                example: admin-r1-000000000012345
                              admin_type:
                                type: string
                                example: 'Company Admin'
                              role_name:
                                type: string
                                example: 'Super Admin'
                              default_location:
                                type: string
                                example: 'R1 Location 1'
                              default_program:
                                type: string
                                example: PHP
                              status:
                                type: string
                                example: active
                              member_updated_at:
                                type: string
                                example: '2024-09-15T00:51:20.000000Z'
                              last_activity_date:
                                type: string
                                example: '2024-01-07T16:50:19.000000Z'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'User Management'
    post:
      summary: 'Create/Update Admin'
      operationId: createUpdateAdmin
      description: ''
      parameters: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 0
                  message: 'Admin created successfully'
                  data:
                    unique_id: abcxyz
                    username: johndoe
                    first_name: John
                    last_name: Doe
                    admin_email: johndoe@example.com
                    admin_role: Admin-Read
                    admin_type: 'Company Admin'
                    admin_location: 'R1 Location 1'
                    admin_program: General
                    admin_status: active
                    created_at: '2024-08-30T14:30:00Z'
                properties:
                  error:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: 'Admin created successfully'
                  data:
                    type: object
                    properties:
                      unique_id:
                        type: string
                        example: abcxyz
                      username:
                        type: string
                        example: johndoe
                      first_name:
                        type: string
                        example: John
                      last_name:
                        type: string
                        example: Doe
                      admin_email:
                        type: string
                        example: johndoe@example.com
                      admin_role:
                        type: string
                        example: Admin-Read
                      admin_type:
                        type: string
                        example: 'Company Admin'
                      admin_location:
                        type: string
                        example: 'R1 Location 1'
                      admin_program:
                        type: string
                        example: General
                      admin_status:
                        type: string
                        example: active
                      created_at:
                        type: string
                        example: '2024-08-30T14:30:00Z'
        201:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 0
                  message: 'Admin updated successfully'
                  data:
                    -
                      unique_id: r1-admin-example
                      username: AdminExampele
                      first_name: Admin
                      last_name: Example
                      email: admin@example.com
                      role: Admin-Read
                      status: active
                properties:
                  error:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: 'Admin updated successfully'
                  data:
                    type: array
                    example:
                      -
                        unique_id: r1-admin-example
                        username: AdminExampele
                        first_name: Admin
                        last_name: Example
                        email: admin@example.com
                        role: Admin-Read
                        status: active
                    items:
                      type: object
                      properties:
                        unique_id:
                          type: string
                          example: r1-admin-example
                        username:
                          type: string
                          example: AdminExampele
                        first_name:
                          type: string
                          example: Admin
                        last_name:
                          type: string
                          example: Example
                        email:
                          type: string
                          example: admin@example.com
                        role:
                          type: string
                          example: Admin-Read
                        status:
                          type: string
                          example: active
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
        404:
          description: 'Admin Not Found'
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: 'Admin not found'
                  details: "The requested admin with UniqueID 'abcxyz' does not exist or is not associated with the given company."
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: 'Admin not found'
                  details:
                    type: string
                    example: "The requested admin with UniqueID 'abcxyz' does not exist or is not associated with the given company."
      tags:
        - 'User Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                admin_id:
                  type: string
                  description: 'The unique ID of the admin from the tech partner system.'
                  example: r1-admin-123456-01
                admin_email:
                  type: string
                  description: 'The email of the admin.'
                  example: xyz@example.com
                admin_username:
                  type: string
                  description: 'The username of the admin (OK to use email here also).'
                  example: admin123
                first_name:
                  type: string
                  description: 'The first name of the admin.'
                  example: John
                last_name:
                  type: string
                  description: 'The last name of the admin.'
                  example: Doe
                admin_role:
                  type: string
                  description: 'The role of the admin, default Admin-Read (See Admin Roles Endpoint).'
                  example: '"Admin-Read"'
                admin_type:
                  type: string
                  description: 'The admin type of the admin.'
                  example: Practitioner
                admin_location:
                  type: string
                  description: 'The location name.'
                  example: 'AZ Treatment Center'
                admin_program:
                  type: string
                  description: 'The program name.'
                  example: PHP
                admin_status:
                  type: string
                  description: 'The status of the admin (active or inactive).'
                  example: active
              required:
                - admin_id
    parameters:
      -
        in: path
        name: companyId
        description: 'The company id (0 returns all companies).'
        example: 0
        required: true
        schema:
          type: integer
  '/api/v2/users/{id}/uniqueId':
    post:
      summary: 'Update Admin/User Unique ID'
      operationId: updateAdminUserUniqueID
      description: ''
      parameters: []
      responses:
        201:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Unique ID Updated Successfully'
                  data:
                    id: 32687
                    unique_id: r1-admin-example
                properties:
                  message:
                    type: string
                    example: 'Unique ID Updated Successfully'
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 32687
                      unique_id:
                        type: string
                        example: r1-admin-example
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
        404:
          description: 'User Not Found'
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: 'User not found'
                  details: "User with R1 ID '123' does not exist or is associated with a company outside your access."
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: 'User not found'
                  details:
                    type: string
                    example: "User with R1 ID '123' does not exist or is associated with a company outside your access."
      tags:
        - 'User Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                unique_id:
                  type: string
                  description: 'The new unique ID (integration partner unique ID) for the member.'
                  example: r1-user-1234
              required:
                - unique_id
    parameters:
      -
        in: path
        name: id
        description: 'The R1 ID of the user/admin to update.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/v2/usernames/check/global/{username}':
    get:
      summary: 'Check Global Username'
      operationId: checkGlobalUsername
      description: ''
      parameters: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    username:
                      type: string
                      example: testUser
                    is_available:
                      type: boolean
                      example: false
                    message:
                      type: string
                      example: 'Username is not available'
                example:
                  -
                    username: testUser
                    is_available: false
                    message: 'Username is not available'
                  -
                    username: testUser2
                    is_available: true
                    message: 'Username is available'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'User Management'
    parameters:
      -
        in: path
        name: username
        description: 'Global username to check.'
        example: xyz123
        required: true
        schema:
          type: string
  '/api/v2/usernames/check/company/{companyId}/{companyUsername}':
    get:
      summary: 'Check Company Username'
      operationId: checkCompanyUsername
      description: ''
      parameters: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    company_id:
                      type: string
                      example: '1'
                    company_username:
                      type: string
                      example: FB1234
                    is_available:
                      type: boolean
                      example: true
                    message:
                      type: string
                      example: base.user_is_available_for_this_company
                example:
                  -
                    company_id: '1'
                    company_username: FB1234
                    is_available: true
                    message: base.user_is_available_for_this_company
                  -
                    company_id: '1'
                    company_username: FB12345
                    is_available: false
                    message: 'Username "FB12345" is already taken for this company'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'User Management'
    parameters:
      -
        in: path
        name: companyId
        description: 'The ID of the company.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: companyUsername
        description: 'Company-specific username to check.'
        example: xyz123
        required: true
        schema:
          type: string
  '/api/v2/activities/company/{companyId}/details':
    get:
      summary: 'List Activities'
      operationId: listActivities
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: maxDays
          description: 'Pull records from last x days, default 0 which returns all records.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'Pull records from last x days, default 0 which returns all records.'
            example: 0
        -
          in: query
          name: userId
          description: 'The R1 ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The R1 ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: uniqueId
          description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: userActivityId
          description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
            example: null
        -
          in: query
          name: userType
          description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
            example: 1
        -
          in: query
          name: activityType
          description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Explore.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Explore.'
            example: 0
        -
          in: query
          name: topicId
          description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
            example: null
        -
          in: query
          name: activityId
          description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
            example: null
        -
          in: query
          name: sortby
          description: 'User order (1: Oldest, 2: Newest).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'User order (1: Oldest, 2: Newest).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 1
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                    max_days: '0'
                    company_id: '4121'
                    '***comment': 'UserId/ActivityId visible if included in query'
                    user_id: '21267'
                    user_activity_id: '154340'
                  activities:
                    -
                      id: 154340
                      user_id: 21267
                      company_id: 4121
                      topic_name: 'Stages of Change (SUD)'
                      activity_id: 312
                      activity_name: 'Identify My Stage of Change'
                      activity_type: sorting_cards
                      created_at: '2024-04-20T15:03:11.000000Z'
                      updated_at: '2024-04-20T21:21:01.000000Z'
                      completed_date: '2024-04-20T21:21:01.000000Z'
                      completed_status: 'Activity Completed'
                      report_url: 'http://discover.r1learning.com/stages****'
                      video_completed: false
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 1
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                      max_days:
                        type: string
                        example: '0'
                      company_id:
                        type: string
                        example: '4121'
                      '***comment':
                        type: string
                        example: 'UserId/ActivityId visible if included in query'
                      user_id:
                        type: string
                        example: '21267'
                      user_activity_id:
                        type: string
                        example: '154340'
                  activities:
                    type: array
                    example:
                      -
                        id: 154340
                        user_id: 21267
                        company_id: 4121
                        topic_name: 'Stages of Change (SUD)'
                        activity_id: 312
                        activity_name: 'Identify My Stage of Change'
                        activity_type: sorting_cards
                        created_at: '2024-04-20T15:03:11.000000Z'
                        updated_at: '2024-04-20T21:21:01.000000Z'
                        completed_date: '2024-04-20T21:21:01.000000Z'
                        completed_status: 'Activity Completed'
                        report_url: 'http://discover.r1learning.com/stages****'
                        video_completed: false
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 154340
                        user_id:
                          type: integer
                          example: 21267
                        company_id:
                          type: integer
                          example: 4121
                        topic_name:
                          type: string
                          example: 'Stages of Change (SUD)'
                        activity_id:
                          type: integer
                          example: 312
                        activity_name:
                          type: string
                          example: 'Identify My Stage of Change'
                        activity_type:
                          type: string
                          example: sorting_cards
                        created_at:
                          type: string
                          example: '2024-04-20T15:03:11.000000Z'
                        updated_at:
                          type: string
                          example: '2024-04-20T21:21:01.000000Z'
                        completed_date:
                          type: string
                          example: '2024-04-20T21:21:01.000000Z'
                        completed_status:
                          type: string
                          example: 'Activity Completed'
                        report_url:
                          type: string
                          example: 'http://discover.r1learning.com/stages****'
                        video_completed:
                          type: boolean
                          example: false
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Activity Results'
    parameters:
      -
        in: path
        name: companyId
        description: 'The id of the company.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/v2/activities/company/{companyId}/cards':
    get:
      summary: 'List Activity Yes/No Cards'
      operationId: listActivityYesNoCards
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: maxDays
          description: 'Pull records from last x days, default 0 which returns all records.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'Pull records from last x days, default 0 which returns all records.'
            example: 0
        -
          in: query
          name: userId
          description: 'The R1 ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The R1 ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: uniqueId
          description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: userActivityId
          description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
            example: null
        -
          in: query
          name: userType
          description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
            example: 1
        -
          in: query
          name: activityType
          description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Definition.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Definition.'
            example: 0
        -
          in: query
          name: topicId
          description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
            example: null
        -
          in: query
          name: activityId
          description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
            example: null
        -
          in: query
          name: sortby
          description: 'User order (1: Oldest, 2: Newest).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'User order (1: Oldest, 2: Newest).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 1
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                    max_days: '0'
                    company_id: '1'
                  activities:
                    -
                      user_activity_id: 15205
                      user_id: 21123
                      company_id: 123123
                      topic_id: 111222
                      cards:
                        yes_cards:
                          -
                            selected_id: 1
                            model_definition: Maintenance
                            text: 'I practice mindfulness and patience to support my substance-free lifestyle'
                          -
                            selected_id: 2
                            model_definition: Maintenance
                            text: 'I am grateful for quitting and living a substance-free life'
                        no_cards:
                          -
                            selected_id: 1
                            model_definition: Preparation
                            text: 'I have recently told others about my plans to quit'
                          -
                            selected_id: 2
                            model_definition: 'Pre Contemplation'
                            text: 'There is nothing I really need to change about my drinking or using;I am a fairly normal drinker or user '
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 1
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                      max_days:
                        type: string
                        example: '0'
                      company_id:
                        type: string
                        example: '1'
                  activities:
                    type: array
                    example:
                      -
                        user_activity_id: 15205
                        user_id: 21123
                        company_id: 123123
                        topic_id: 111222
                        cards:
                          yes_cards:
                            -
                              selected_id: 1
                              model_definition: Maintenance
                              text: 'I practice mindfulness and patience to support my substance-free lifestyle'
                            -
                              selected_id: 2
                              model_definition: Maintenance
                              text: 'I am grateful for quitting and living a substance-free life'
                          no_cards:
                            -
                              selected_id: 1
                              model_definition: Preparation
                              text: 'I have recently told others about my plans to quit'
                            -
                              selected_id: 2
                              model_definition: 'Pre Contemplation'
                              text: 'There is nothing I really need to change about my drinking or using;I am a fairly normal drinker or user '
                    items:
                      type: object
                      properties:
                        user_activity_id:
                          type: integer
                          example: 15205
                        user_id:
                          type: integer
                          example: 21123
                        company_id:
                          type: integer
                          example: 123123
                        topic_id:
                          type: integer
                          example: 111222
                        cards:
                          type: object
                          properties:
                            yes_cards:
                              type: array
                              example:
                                -
                                  selected_id: 1
                                  model_definition: Maintenance
                                  text: 'I practice mindfulness and patience to support my substance-free lifestyle'
                                -
                                  selected_id: 2
                                  model_definition: Maintenance
                                  text: 'I am grateful for quitting and living a substance-free life'
                              items:
                                type: object
                                properties:
                                  selected_id:
                                    type: integer
                                    example: 1
                                  model_definition:
                                    type: string
                                    example: Maintenance
                                  text:
                                    type: string
                                    example: 'I practice mindfulness and patience to support my substance-free lifestyle'
                            no_cards:
                              type: array
                              example:
                                -
                                  selected_id: 1
                                  model_definition: Preparation
                                  text: 'I have recently told others about my plans to quit'
                                -
                                  selected_id: 2
                                  model_definition: 'Pre Contemplation'
                                  text: 'There is nothing I really need to change about my drinking or using;I am a fairly normal drinker or user '
                              items:
                                type: object
                                properties:
                                  selected_id:
                                    type: integer
                                    example: 1
                                  model_definition:
                                    type: string
                                    example: Preparation
                                  text:
                                    type: string
                                    example: 'I have recently told others about my plans to quit'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Activity Results'
    parameters:
      -
        in: path
        name: companyId
        description: 'The id of the company.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/v2/activities/company/{companyId}/final-cards':
    get:
      summary: 'List Activity Final Cards'
      operationId: listActivityFinalCards
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: maxDays
          description: 'Pull records from last x days, default 0 which returns all records.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'Pull records from last x days, default 0 which returns all records.'
            example: 0
        -
          in: query
          name: userId
          description: 'The R1 ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The R1 ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: uniqueId
          description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: userActivityId
          description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
            example: null
        -
          in: query
          name: userType
          description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
            example: 1
        -
          in: query
          name: activityType
          description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Explore.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Explore.'
            example: 0
        -
          in: query
          name: topicId
          description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
            example: null
        -
          in: query
          name: activityId
          description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
            example: null
        -
          in: query
          name: sortby
          description: 'User order (1: Oldest, 2: Newest).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'User order (1: Oldest, 2: Newest).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 1
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                    max_days: '0'
                    company_id: '4132'
                    '***comment': 'UserId/ActivityId visible if included in query'
                    user_id: '2157'
                    user_activity_id: '15026'
                  activities:
                    -
                      user_activity_id: 15026
                      user_id: 2157
                      company_id: 4132
                      cards:
                        -
                          pyramid_id: 1
                          model_category: Maintenance
                          card_detail: 'I love my substance-free life and act daily to keep it'
                        -
                          pyramid_id: 2
                          model_category: Maintenance
                          card_detail: 'I practice mindfulness and patience to support my substance-free lifestyle'
                        -
                          pyramid_id: 3
                          model_category: Maintenance
                          card_detail: 'I am grateful for quitting and living a substance-free life'
                        -
                          pyramid_id: 4
                          model_category: Maintenance
                          card_detail: 'I participate in healthy activities to avoid stress and reduce anxiety'
                        -
                          pyramid_id: 5
                          model_category: Maintenance
                          card_detail: 'I am managing risk situations and/or temptations (triggering people, places, things, and situations) '
                        -
                          pyramid_id: 6
                          model_category: Maintenance
                          card_detail: 'I am serving and supporting others who are not using substances'
                        -
                          pyramid_id: 7
                          model_category: Action
                          card_detail: 'I am asking others for help'
                        -
                          pyramid_id: 8
                          model_category: Action
                          card_detail: 'I am connecting with others and building a new network of healthy non-drinking or using friends'
                        -
                          pyramid_id: 9
                          model_category: Contemplation
                          card_detail: 'I can see the benefits of quitting more clearly'
                        -
                          pyramid_id: 10
                          model_category: Action
                          card_detail: 'I am not drinking or using, one day at a time'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 1
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                      max_days:
                        type: string
                        example: '0'
                      company_id:
                        type: string
                        example: '4132'
                      '***comment':
                        type: string
                        example: 'UserId/ActivityId visible if included in query'
                      user_id:
                        type: string
                        example: '2157'
                      user_activity_id:
                        type: string
                        example: '15026'
                  activities:
                    type: array
                    example:
                      -
                        user_activity_id: 15026
                        user_id: 2157
                        company_id: 4132
                        cards:
                          -
                            pyramid_id: 1
                            model_category: Maintenance
                            card_detail: 'I love my substance-free life and act daily to keep it'
                          -
                            pyramid_id: 2
                            model_category: Maintenance
                            card_detail: 'I practice mindfulness and patience to support my substance-free lifestyle'
                          -
                            pyramid_id: 3
                            model_category: Maintenance
                            card_detail: 'I am grateful for quitting and living a substance-free life'
                          -
                            pyramid_id: 4
                            model_category: Maintenance
                            card_detail: 'I participate in healthy activities to avoid stress and reduce anxiety'
                          -
                            pyramid_id: 5
                            model_category: Maintenance
                            card_detail: 'I am managing risk situations and/or temptations (triggering people, places, things, and situations) '
                          -
                            pyramid_id: 6
                            model_category: Maintenance
                            card_detail: 'I am serving and supporting others who are not using substances'
                          -
                            pyramid_id: 7
                            model_category: Action
                            card_detail: 'I am asking others for help'
                          -
                            pyramid_id: 8
                            model_category: Action
                            card_detail: 'I am connecting with others and building a new network of healthy non-drinking or using friends'
                          -
                            pyramid_id: 9
                            model_category: Contemplation
                            card_detail: 'I can see the benefits of quitting more clearly'
                          -
                            pyramid_id: 10
                            model_category: Action
                            card_detail: 'I am not drinking or using, one day at a time'
                    items:
                      type: object
                      properties:
                        user_activity_id:
                          type: integer
                          example: 15026
                        user_id:
                          type: integer
                          example: 2157
                        company_id:
                          type: integer
                          example: 4132
                        cards:
                          type: array
                          example:
                            -
                              pyramid_id: 1
                              model_category: Maintenance
                              card_detail: 'I love my substance-free life and act daily to keep it'
                            -
                              pyramid_id: 2
                              model_category: Maintenance
                              card_detail: 'I practice mindfulness and patience to support my substance-free lifestyle'
                            -
                              pyramid_id: 3
                              model_category: Maintenance
                              card_detail: 'I am grateful for quitting and living a substance-free life'
                            -
                              pyramid_id: 4
                              model_category: Maintenance
                              card_detail: 'I participate in healthy activities to avoid stress and reduce anxiety'
                            -
                              pyramid_id: 5
                              model_category: Maintenance
                              card_detail: 'I am managing risk situations and/or temptations (triggering people, places, things, and situations) '
                            -
                              pyramid_id: 6
                              model_category: Maintenance
                              card_detail: 'I am serving and supporting others who are not using substances'
                            -
                              pyramid_id: 7
                              model_category: Action
                              card_detail: 'I am asking others for help'
                            -
                              pyramid_id: 8
                              model_category: Action
                              card_detail: 'I am connecting with others and building a new network of healthy non-drinking or using friends'
                            -
                              pyramid_id: 9
                              model_category: Contemplation
                              card_detail: 'I can see the benefits of quitting more clearly'
                            -
                              pyramid_id: 10
                              model_category: Action
                              card_detail: 'I am not drinking or using, one day at a time'
                          items:
                            type: object
                            properties:
                              pyramid_id:
                                type: integer
                                example: 1
                              model_category:
                                type: string
                                example: Maintenance
                              card_detail:
                                type: string
                                example: 'I love my substance-free life and act daily to keep it'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Activity Results'
    parameters:
      -
        in: path
        name: companyId
        description: 'The id of the company.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/v2/activities/company/{companyId}/questions':
    get:
      summary: 'List Activity Q&As'
      operationId: listActivityQAs
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
        -
          in: query
          name: maxDays
          description: 'Pull records from last x days, default 0 which returns all records.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'Pull records from last x days, default 0 which returns all records.'
            example: 0
        -
          in: query
          name: userId
          description: 'The ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: uniqueId
          description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
          example: null
          required: false
          schema:
            type: string
            description: 'The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example:'
            example: null
        -
          in: query
          name: userActivityId
          description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the specific user activity. If provided, returns details for this activity only. Example:'
            example: null
        -
          in: query
          name: userType
          description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The type of user. 0 for all, 1 for Users, 2 for Admins.'
            example: 1
        -
          in: query
          name: activityType
          description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Definition.'
          example: 0
          required: false
          schema:
            type: integer
            description: 'The type of activity. 0 for all, 1 for Pyramid, 2 for Definition.'
            example: 0
        -
          in: query
          name: topicId
          description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the topic. If provided, returns all activities for this topic in the specified company. Example:'
            example: null
        -
          in: query
          name: activityId
          description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
          example: null
          required: false
          schema:
            type: integer
            description: 'The ID of the activity. If provided, returns all activities for this activity in the specified company. Example:'
            example: null
        -
          in: query
          name: sortby
          description: 'User order (1: Oldest, 2: Newest).'
          example: 1
          required: true
          schema:
            type: integer
            description: 'User order (1: Oldest, 2: Newest).'
            example: 1
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 109
                    total_pages: 3
                    current_page: '1'
                    per_page: '50'
                    max_days: '0'
                    company_id: '2296'
                    '***comment': 'UserId/ActivityId visible if included in query'
                    user_id: '32579'
                    user_activity_id: '276321'
                  activities:
                    -
                      user_activity_id: 276321
                      user_id: 32579
                      company_id: 2296
                      questions:
                        -
                          question_id: 1
                          question: 'What substance did you examine in this activity?'
                          question_type: radio
                          answer: 'Alcohol – beer, wine, liquor, hard cider, hard seltzer'
                        -
                          question_id: 2
                          question: "As you think about what you've learned and your results, which stage do you think you are in right now?"
                          question_type: radio
                          answer: Contemplation
                        -
                          question_id: 3
                          question: 'How long do you think you have been in this stage?'
                          question_type: radio
                          answer: '1 year'
                        -
                          question_id: 4
                          question: 'What will be the benefit for you and others as you change your pattern of behavior?'
                          question_type: textarea
                          answer: 'Less consequences in my life, probably happier.'
                        -
                          question_id: 5
                          question: 'What individuals, groups, or resources can you turn to for help and support?'
                          question_type: textarea
                          answer: 'My support group and friends.'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 109
                      total_pages:
                        type: integer
                        example: 3
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                      max_days:
                        type: string
                        example: '0'
                      company_id:
                        type: string
                        example: '2296'
                      '***comment':
                        type: string
                        example: 'UserId/ActivityId visible if included in query'
                      user_id:
                        type: string
                        example: '32579'
                      user_activity_id:
                        type: string
                        example: '276321'
                  activities:
                    type: array
                    example:
                      -
                        user_activity_id: 276321
                        user_id: 32579
                        company_id: 2296
                        questions:
                          -
                            question_id: 1
                            question: 'What substance did you examine in this activity?'
                            question_type: radio
                            answer: 'Alcohol – beer, wine, liquor, hard cider, hard seltzer'
                          -
                            question_id: 2
                            question: "As you think about what you've learned and your results, which stage do you think you are in right now?"
                            question_type: radio
                            answer: Contemplation
                          -
                            question_id: 3
                            question: 'How long do you think you have been in this stage?'
                            question_type: radio
                            answer: '1 year'
                          -
                            question_id: 4
                            question: 'What will be the benefit for you and others as you change your pattern of behavior?'
                            question_type: textarea
                            answer: 'Less consequences in my life, probably happier.'
                          -
                            question_id: 5
                            question: 'What individuals, groups, or resources can you turn to for help and support?'
                            question_type: textarea
                            answer: 'My support group and friends.'
                    items:
                      type: object
                      properties:
                        user_activity_id:
                          type: integer
                          example: 276321
                        user_id:
                          type: integer
                          example: 32579
                        company_id:
                          type: integer
                          example: 2296
                        questions:
                          type: array
                          example:
                            -
                              question_id: 1
                              question: 'What substance did you examine in this activity?'
                              question_type: radio
                              answer: 'Alcohol – beer, wine, liquor, hard cider, hard seltzer'
                            -
                              question_id: 2
                              question: "As you think about what you've learned and your results, which stage do you think you are in right now?"
                              question_type: radio
                              answer: Contemplation
                            -
                              question_id: 3
                              question: 'How long do you think you have been in this stage?'
                              question_type: radio
                              answer: '1 year'
                            -
                              question_id: 4
                              question: 'What will be the benefit for you and others as you change your pattern of behavior?'
                              question_type: textarea
                              answer: 'Less consequences in my life, probably happier.'
                            -
                              question_id: 5
                              question: 'What individuals, groups, or resources can you turn to for help and support?'
                              question_type: textarea
                              answer: 'My support group and friends.'
                          items:
                            type: object
                            properties:
                              question_id:
                                type: integer
                                example: 1
                              question:
                                type: string
                                example: 'What substance did you examine in this activity?'
                              question_type:
                                type: string
                                example: radio
                              answer:
                                type: string
                                example: 'Alcohol – beer, wine, liquor, hard cider, hard seltzer'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Activity Results'
    parameters:
      -
        in: path
        name: companyId
        description: 'The id of the company.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/v2/metrics/videos/companies/{companyId}':
    get:
      summary: 'List Company Video Metrics'
      operationId: listCompanyVideoMetrics
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The page number for pagination. Default: 1:'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The page number for pagination. Default: 1:'
            example: 1
        -
          in: query
          name: limit
          description: 'The number of records per page. Default: 50, Max: 100:'
          example: 50
          required: false
          schema:
            type: integer
            description: 'The number of records per page. Default: 50, Max: 100:'
            example: 50
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 1
                    total_pages: 1
                    current_page: 1
                    per_page: 50
                  data:
                    company_id: '1342'
                    video_metrics:
                      -
                        video_log_id: 1
                        video_url: ''
                        user_id: 19876
                        video_title: 'Explore the Stages of Change Model'
                        start_time_stamp: '2024-01-07T21:50:27.000000Z'
                        completion_time_stamp: '2024-01-07T21:50:53.000000Z'
                        watched_percentage: '100.00'
                        watched_duration: '126.92'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 1
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                  data:
                    type: object
                    properties:
                      company_id:
                        type: string
                        example: '1342'
                      video_metrics:
                        type: array
                        example:
                          -
                            video_log_id: 1
                            video_url: ''
                            user_id: 19876
                            video_title: 'Explore the Stages of Change Model'
                            start_time_stamp: '2024-01-07T21:50:27.000000Z'
                            completion_time_stamp: '2024-01-07T21:50:53.000000Z'
                            watched_percentage: '100.00'
                            watched_duration: '126.92'
                        items:
                          type: object
                          properties:
                            video_log_id:
                              type: integer
                              example: 1
                            video_url:
                              type: string
                              example: ''
                            user_id:
                              type: integer
                              example: 19876
                            video_title:
                              type: string
                              example: 'Explore the Stages of Change Model'
                            start_time_stamp:
                              type: string
                              example: '2024-01-07T21:50:27.000000Z'
                            completion_time_stamp:
                              type: string
                              example: '2024-01-07T21:50:53.000000Z'
                            watched_percentage:
                              type: string
                              example: '100.00'
                            watched_duration:
                              type: string
                              example: '126.92'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Metrics and Analytics'
    parameters:
      -
        in: path
        name: companyId
        description: 'The ID of the company.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/v2/metrics/videos/users/{userId}':
    get:
      summary: 'List User Video Metrics'
      operationId: listUserVideoMetrics
      description: ''
      parameters:
        -
          in: query
          name: page
          description: 'The page number for pagination. Default: 1:'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The page number for pagination. Default: 1:'
            example: 1
        -
          in: query
          name: limit
          description: 'The number of records per page. Default: 50, Max: 100:'
          example: 50
          required: false
          schema:
            type: integer
            description: 'The number of records per page. Default: 50, Max: 100:'
            example: 50
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 1
                    total_pages: 1
                    current_page: 1
                    per_page: 50
                  data:
                    user_id: '17434'
                    video_metrics:
                      -
                        video_log_id: 3
                        video_url: ''
                        user_id: 17434
                        video_title: 'Identify My Stage of Change'
                        start_time_stamp: '2024-01-07T21:56:34.000000Z'
                        completion_time_stamp: '2024-01-07T21:56:44.000000Z'
                        watched_percentage: '100.00'
                        watched_duration: '126.954666'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 1
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 50
                  data:
                    type: object
                    properties:
                      user_id:
                        type: string
                        example: '17434'
                      video_metrics:
                        type: array
                        example:
                          -
                            video_log_id: 3
                            video_url: ''
                            user_id: 17434
                            video_title: 'Identify My Stage of Change'
                            start_time_stamp: '2024-01-07T21:56:34.000000Z'
                            completion_time_stamp: '2024-01-07T21:56:44.000000Z'
                            watched_percentage: '100.00'
                            watched_duration: '126.954666'
                        items:
                          type: object
                          properties:
                            video_log_id:
                              type: integer
                              example: 3
                            video_url:
                              type: string
                              example: ''
                            user_id:
                              type: integer
                              example: 17434
                            video_title:
                              type: string
                              example: 'Identify My Stage of Change'
                            start_time_stamp:
                              type: string
                              example: '2024-01-07T21:56:34.000000Z'
                            completion_time_stamp:
                              type: string
                              example: '2024-01-07T21:56:44.000000Z'
                            watched_percentage:
                              type: string
                              example: '100.00'
                            watched_duration:
                              type: string
                              example: '126.954666'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Metrics and Analytics'
    parameters:
      -
        in: path
        name: userId
        description: 'The ID of the user.'
        example: 1
        required: true
        schema:
          type: integer
  /api/v2/system/endpoints:
    get:
      summary: 'List API Endpoints'
      operationId: listAPIEndpoints
      description: ''
      parameters: []
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 0
                  message: ''
                  data:
                    -
                      name: 'List Companies'
                      request:
                        url:
                          host: 'http://r1discoverapi.local'
                          path: api/v2/companies
                          query:
                            -
                              key: page
                              value: '1'
                              description: 'The current page number, defaults to 1.'
                              disabled: false
                            -
                              key: limit
                              value: '50'
                              description: 'Number of records to return default 50, max 100.'
                              disabled: false
                          raw: 'http://r1discoverapi.local/api/v2/companies?page=1&limit=50'
                        method: GET
                        header:
                          -
                            key: Content-Type
                            value: application/json
                          -
                            key: Accept
                            value: application/json
                          -
                            key: Authorization
                            value: 'Bearer {token}'
                        body: null
                        description: ''
                properties:
                  error:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: ''
                  data:
                    type: array
                    example:
                      -
                        name: 'List Companies'
                        request:
                          url:
                            host: 'http://r1discoverapi.local'
                            path: api/v2/companies
                            query:
                              -
                                key: page
                                value: '1'
                                description: 'The current page number, defaults to 1.'
                                disabled: false
                              -
                                key: limit
                                value: '50'
                                description: 'Number of records to return default 50, max 100.'
                                disabled: false
                            raw: 'http://r1discoverapi.local/api/v2/companies?page=1&limit=50'
                          method: GET
                          header:
                            -
                              key: Content-Type
                              value: application/json
                            -
                              key: Accept
                              value: application/json
                            -
                              key: Authorization
                              value: 'Bearer {token}'
                          body: null
                          description: ''
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: 'List Companies'
                        request:
                          type: object
                          properties:
                            url:
                              type: object
                              properties:
                                host:
                                  type: string
                                  example: 'http://r1discoverapi.local'
                                path:
                                  type: string
                                  example: api/v2/companies
                                query:
                                  type: array
                                  example:
                                    -
                                      key: page
                                      value: '1'
                                      description: 'The current page number, defaults to 1.'
                                      disabled: false
                                    -
                                      key: limit
                                      value: '50'
                                      description: 'Number of records to return default 50, max 100.'
                                      disabled: false
                                  items:
                                    type: object
                                    properties:
                                      key: { type: string, example: page }
                                      value: { type: string, example: '1' }
                                      description: { type: string, example: 'The current page number, defaults to 1.' }
                                      disabled: { type: boolean, example: false }
                                raw:
                                  type: string
                                  example: 'http://r1discoverapi.local/api/v2/companies?page=1&limit=50'
                            method:
                              type: string
                              example: GET
                            header:
                              type: array
                              example:
                                -
                                  key: Content-Type
                                  value: application/json
                                -
                                  key: Accept
                                  value: application/json
                                -
                                  key: Authorization
                                  value: 'Bearer {token}'
                              items:
                                type: object
                                properties:
                                  key:
                                    type: string
                                    example: Content-Type
                                  value:
                                    type: string
                                    example: application/json
                            body:
                              type: string
                              example: null
                              nullable: true
                            description:
                              type: string
                              example: ''
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        403:
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthorized
                  details: 'You do not have the necessary permissions to perform this action.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthorized
                  details:
                    type: string
                    example: 'You do not have the necessary permissions to perform this action.'
      tags:
        - 'Global Endpoints'
  /api/v2/system/countries:
    get:
      summary: 'List Countries'
      operationId: listCountries
      description: ''
      parameters:
        -
          in: query
          name: search
          description: 'optional Search term to filter countries.'
          example: united
          required: false
          schema:
            type: string
            description: 'optional Search term to filter countries.'
            example: united
        -
          in: query
          name: page
          description: 'The current page number, defaults to 1.'
          example: 1
          required: true
          schema:
            type: integer
            description: 'The current page number, defaults to 1.'
            example: 1
        -
          in: query
          name: limit
          description: 'Number of records to return default 50, max 100.'
          example: 50
          required: true
          schema:
            type: integer
            description: 'Number of records to return default 50, max 100.'
            example: 50
      responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                type: object
                example:
                  meta:
                    total_items: 2
                    total_pages: 1
                    current_page: '1'
                    per_page: '50'
                  country_list:
                    -
                      code: GB
                      name: 'United Kingdom'
                    -
                      code: US
                      name: 'United States'
                properties:
                  meta:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        example: 2
                      total_pages:
                        type: integer
                        example: 1
                      current_page:
                        type: string
                        example: '1'
                      per_page:
                        type: string
                        example: '50'
                  country_list:
                    type: array
                    example:
                      -
                        code: GB
                        name: 'United Kingdom'
                      -
                        code: US
                        name: 'United States'
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: GB
                        name:
                          type: string
                          example: 'United Kingdom'
        401:
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: Unauthenticated
                  details: 'Authentication is required to access this resource.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: Unauthenticated
                  details:
                    type: string
                    example: 'Authentication is required to access this resource.'
        500:
          description: 'Server Error'
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 1
                  message: 'An unexpected error occurred'
                  details: 'The server encountered an unexpected condition that prevented it from fulfilling the request. Please try again later or contact support if the problem persists.'
                properties:
                  error:
                    type: integer
                    example: 1
                  message:
                    type: string
                    example: 'An unexpected error occurred'
                  details:
                    type: string
                    example: 'The server encountered an unexpected condition that prevented it from fulfilling the request. Please try again later or contact support if the problem persists.'
      tags:
        - 'Global Endpoints'
