> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decodahealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Sso Url

> Generate a Single Sign-On URL for DoseSpot Jumpstart integration.

This endpoint creates a signed SSO URL that allows users to seamlessly access DoseSpot
from within your application without requiring separate login credentials.

The URL can be used to:
- Launch DoseSpot in a new window/tab
- Embed DoseSpot in an iframe
- Deep link to specific patients or encounters

Args:
    request: SSO URL generation request containing location_id, user_id and optional parameters
    session: Database session
    tenant: Current tenant
    current_provider: Current authenticated provider

Returns:
    SSOUrlResponse containing the generated signed SSO URL

Raises:
    HTTPException: If location_id, user_id is missing or invalid, or location not configured



## OpenAPI

````yaml post /dosespot/sso
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /dosespot/sso:
    post:
      tags:
        - provider
        - dosespot
        - sso
      summary: Generate Sso Url
      description: >-
        Generate a Single Sign-On URL for DoseSpot Jumpstart integration.


        This endpoint creates a signed SSO URL that allows users to seamlessly
        access DoseSpot

        from within your application without requiring separate login
        credentials.


        The URL can be used to:

        - Launch DoseSpot in a new window/tab

        - Embed DoseSpot in an iframe

        - Deep link to specific patients or encounters


        Args:
            request: SSO URL generation request containing location_id, user_id and optional parameters
            session: Database session
            tenant: Current tenant
            current_provider: Current authenticated provider

        Returns:
            SSOUrlResponse containing the generated signed SSO URL

        Raises:
            HTTPException: If location_id, user_id is missing or invalid, or location not configured
      operationId: generate_sso_url_dosespot_sso_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SSOUrlRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOUrlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SSOUrlRequest:
      properties:
        locationId:
          type: string
          title: Locationid
          description: Location ID - used to retrieve DoseSpot Clinic ID and Clinic Key
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
          description: >-
            Optional internal patient ID. If provided, patient will be synced to
            DoseSpot first (if not already synced), then SSO URL will include
            DoseSpot Patient ID for deep linking
        userId:
          anyOf:
            - type: string
            - type: 'null'
          title: Userid
          description: >-
            Optional DoseSpot User ID. If not provided, will be looked up from
            the current provider's dosespot_user_id field
        onBehalfOfUserId:
          anyOf:
            - type: string
            - type: 'null'
          title: Onbehalfofuserid
          description: Optional User ID when prescribing on behalf of another provider
        encounterId:
          anyOf:
            - type: string
            - type: 'null'
          title: Encounterid
          description: Optional Encounter ID to link prescription to specific encounter
        supervisorId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supervisorid
          description: Optional Supervisor User ID for supervision workflows
        refillsErrors:
          type: boolean
          title: Refillserrors
          description: If True, shows refill errors screen
          default: false
      type: object
      required:
        - locationId
      title: SSOUrlRequest
      description: Request schema for generating DoseSpot SSO URL
    SSOUrlResponse:
      properties:
        url:
          type: string
          title: Url
          description: The signed SSO URL to launch DoseSpot
      type: object
      required:
        - url
      title: SSOUrlResponse
      description: Response schema containing the generated DoseSpot SSO URL
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````