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

# Initiate Connection

> This endpoint will generate a state value and redirect the user to their healthcare provider Patient Portal to authenticate with the healthcare provider's EHR.

On completion, Fasten Connect will redirect the user back to your redirect_uri with an `org_connection_id` and `endpoint_id` query parameter.

If an error occurred during the authentication process, Fasten Connect will redirect the user back with an `error` and `error_description` query parameter.

<Warning>
If you have configured more than one Redirect URL in the Fasten Connect Portal, you **MUST** include the `redirect_uri` query parameter in the request.
This is done automatically by the [Stitch SDK](stitch/v4/introduction) widget.
</Warning>


In `test` mode, you can use the following credentials to test the Fasten Stitch component:

<AccordionGroup>
  <Accordion icon="lock" title="Test Credentials">
    | Source                       | Credentials / Sandbox Status                                                                       | Link                                                                                                                                                  |
    | ---------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
    | AdvancedMD                   | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | Aetna                        | Username: `VTETestUser01` <br />Password: `FHIRdemo2020`                                           | [test accounts](https://developerportal.aetna.com/sandbox_v2_test_member_logins_and_test_data_v2.1.xlsx)                                              |
    | AllScripts                   | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | Anthem                       | Username: `HOSPatient` <br />Password: `HOSPatient2023`                                            |                                                                                                                                                       |
    | AthenaHealth                 | Username: `phrtest_preview@mailinator.com` <br />Password: `Password1`                             | [test accounts](https://docs.athenahealth.com/api/guides/onboarding-overview)                                                                         |
    | CareEvolution                | Username: `CEPatient` <br />Password: `CEPatient2018`                                              | [test accounts](https://fhir.careevolution.com/TestPatientAccounts.html)                                                                              |
    | Cerner                       | Username: `nancysmart` <br />Password: `Cerner01`                                                  | [test accounts](https://docs.google.com/document/d/10RnVyF1etl_17pyCyK96tyhUWRbrTyEcqpwzW-Z-Ybs/edit)                                                 |
    | Cigna                        | Username: `syntheticuser05` <br />Password: `5ynthU5er5`                                           | [test accounts](https://developer.cigna.com/service-apis/patient-access/sandbox#How-to-Use-the-Sandbox-Sandbox-Test-Users)                            |
    | DynamicHealthIT              | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | eClinicalWorks/Healow        | Username: `AdultFemaleFHIR` <br />Password: `e@CWFHIR1`                                            | [test accounts](https://connect4.healow.com/apps/jsp/dev/r4/fhirClinicalDocumentation.jsp#SandboxTestingGuidelines)                                   |
    | Epic                         | Username: `fhircamila` <br />Password: `epicepic1`                                                 | [test accounts](https://fhir.epic.com/Documentation?docId=testpatients)                                                                               |
    | Flatiron/OncoEMR             | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | HealthIT                     | Username: `demouser` <br />Password: `Demouser1!`                                                  | [test accounts](https://fhirsandbox.healthit.gov/secure/r4/view/userlogin.html)                                                                       |
    | Humana                       | Username: `HUser00001` <br />Password: `PW00001!`                                                  |                                                                                                                                                       |
    | Kaiser                       | Username: `Pvaluser1` <br />Password: `V@lidation1`                                                |                                                                                                                                                       |
    | Logica                       | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | MaximEyes                    | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | Medhost                      | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | Medicare                     | Username: `BBUser00000` <br />Password: `PW00000!`                                                 | [test accounts](https://bluebutton.cms.gov/developers/#developer-guidelines)                                                                          |
    | Meditech                     | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | Netsmart                     | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | NextGen                      | Username: `patientapitest` <br />Password: `Password1!`                                            | [test accounts](https://www.nextgen.com/-/media/files/api/nge-patient-api-auth-guide.pdf)                                                             |
    | PracticeFusion/PatientFusion | Username: <br />Password:                                                                          |                                                                                                                                                       |
    | VA Health                    | Provider: ID.me<br />Username: `va.api.user+101-2024@gmail.com` <br />Password: `Password12345!!!` | [test accounts](https://developer.va.gov/explore/api/patient-health/test-users/3617/7058f75892b845dbbd3f371703cc066f398c336a87bb51d73128f1bac24e3105) |
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml GET /bridge/connect
openapi: 3.0.1
info:
  title: Fasten Connect
  description: >-
    Useful links:

    - [Fasten Connect API
    repository](https://github.com/fastenhealth/fasten-connect-api)

    - [Fasten Connect Developer
    Portal](https://github.com/fastenhealth/fasten-connect-app)
  termsOfService: https://www.fastenhealth.com/
  contact:
    email: connect@fastenhealth.com
  license:
    name: Private
  version: 1.0.11
servers:
  - url: https://api.connect.fastenhealth.com/v1/
    description: Use this server for both live and test mode.
security: []
tags:
  - name: auth
    description: Portal Authentication & Signup
  - name: user
    description: Operations about user
  - name: org
    description: Operations about organization
  - name: bridge
    description: Customer (organization) facing APIs
  - name: catalog
    description: Catalog APIs
externalDocs:
  description: Find out more about Fasten Connect
  url: https://www.fastenhealth.com/
paths:
  /bridge/connect:
    get:
      tags:
        - bridge
      description: >
        This endpoint will generate a state value and redirect the user to their
        healthcare provider Patient Portal to authenticate with the healthcare
        provider's EHR.


        On completion, Fasten Connect will redirect the user back to your
        redirect_uri with an `org_connection_id` and `endpoint_id` query
        parameter.


        If an error occurred during the authentication process, Fasten Connect
        will redirect the user back with an `error` and `error_description`
        query parameter.


        <Warning>

        If you have configured more than one Redirect URL in the Fasten Connect
        Portal, you **MUST** include the `redirect_uri` query parameter in the
        request.

        This is done automatically by the [Stitch SDK](stitch/v4/introduction)
        widget.

        </Warning>
      parameters:
        - name: public_id
          in: query
          description: Public Key for Organization Credential
          required: true
          schema:
            type: string
        - name: endpoint_id
          in: query
          description: Catalog Endpoint Id
          required: true
          example: f4ea79fc-9a1b-43f0-be95-24247d666514
          schema:
            type: string
        - name: brand_id
          in: query
          description: Catalog Brand Id
          required: true
          example: 5e3839ed-6ae1-472b-b4b8-b5df098443c7
          schema:
            type: string
        - name: portal_id
          in: query
          description: Catalog Portal Id
          required: true
          example: d26f0b1c-82e7-4cb5-a4c4-55e73d48c016
          schema:
            type: string
        - name: redirect_uri
          in: query
          description: >-
            Redirect URI (where the user will be redirected after
            authentication). Must match a `redirect_uri` provided in the Fasten
            Connect Portal.
          required: true
          example: https://www.example.com
          schema:
            type: string
            format: uri
        - name: external_id
          in: query
          description: >-
            An Opaque identifier, used to identify the patient in your system.
            This value will be returned in the Redirect URL response.
          required: false
          schema:
            type: string
        - name: external_state
          in: query
          description: >-
            An Opaque identifier, used to identify the connection request. This
            value should be unique. This value will be returned in the Redirect
            URL response.
          required: false
          schema:
            type: string
      responses:
        '302':
          description: Redirect
          headers:
            location:
              description: Setup state based redirect
              schema:
                oneOf:
                  - type: string
                    description: >-
                      If configuration is correct and valid for endpoint,
                      catalog, brand and public id, Fasten Connect will redirect
                      to given redirect url

````