> ## 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.

# Sync Gfes

> Import GFEs from SpaKinect for matched patients.

Creates GoodFaithExam records linking SpaKinect GFEs to local patients.
If a PDF link is provided, the PDF is downloaded and attached as a document.

Can also create new patients for unmatched GFEs if requested.



## OpenAPI

````yaml post /spakinect/gfe/location/{location_id}/sync
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /spakinect/gfe/location/{location_id}/sync:
    post:
      tags:
        - provider
        - spakinect
      summary: Sync Gfes
      description: >-
        Import GFEs from SpaKinect for matched patients.


        Creates GoodFaithExam records linking SpaKinect GFEs to local patients.

        If a PDF link is provided, the PDF is downloaded and attached as a
        document.


        Can also create new patients for unmatched GFEs if requested.
      operationId: sync_gfes_spakinect_gfe_location__location_id__sync_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
        - name: location_id
          in: path
          required: true
          schema:
            type: string
            title: Location Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GFESyncRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GFESyncResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GFESyncRequest:
      properties:
        gfesToImport:
          items:
            $ref: '#/components/schemas/GFESyncImportItem'
          type: array
          title: Gfestoimport
        gfesToCreatePatients:
          items:
            $ref: '#/components/schemas/GFESyncCreatePatientItem'
          type: array
          title: Gfestocreatepatients
          default: []
      type: object
      required:
        - gfesToImport
      title: GFESyncRequest
      description: Request to sync/import GFEs
    GFESyncResponse:
      properties:
        imported:
          items:
            $ref: '#/components/schemas/GFESyncImportedItem'
          type: array
          title: Imported
          default: []
        createdWithPatients:
          items:
            $ref: '#/components/schemas/GFESyncCreatedPatientItem'
          type: array
          title: Createdwithpatients
          default: []
        failed:
          items:
            $ref: '#/components/schemas/GFESyncFailedItem'
          type: array
          title: Failed
          default: []
      type: object
      title: GFESyncResponse
      description: Response from sync import endpoint
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GFESyncImportItem:
      properties:
        spakinectGfeId:
          type: string
          title: Spakinectgfeid
        patientId:
          type: string
          title: Patientid
        pdfLink:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdflink
      type: object
      required:
        - spakinectGfeId
        - patientId
      title: GFESyncImportItem
      description: Single GFE to import
    GFESyncCreatePatientItem:
      properties:
        spakinectGfeId:
          type: string
          title: Spakinectgfeid
        patientDetails:
          $ref: '#/components/schemas/SpaKinectPatientInfo'
        pdfLink:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdflink
      type: object
      required:
        - spakinectGfeId
        - patientDetails
      title: GFESyncCreatePatientItem
      description: Unmatched GFE to import by creating a new patient
    GFESyncImportedItem:
      properties:
        spakinectGfeId:
          type: string
          title: Spakinectgfeid
        localGfeId:
          type: string
          title: Localgfeid
        patientId:
          type: string
          title: Patientid
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
      type: object
      required:
        - spakinectGfeId
        - localGfeId
        - patientId
      title: GFESyncImportedItem
      description: Successfully imported GFE
    GFESyncCreatedPatientItem:
      properties:
        spakinectGfeId:
          type: string
          title: Spakinectgfeid
        patientId:
          type: string
          title: Patientid
        localGfeId:
          type: string
          title: Localgfeid
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
      type: object
      required:
        - spakinectGfeId
        - patientId
        - localGfeId
      title: GFESyncCreatedPatientItem
      description: Successfully created patient and imported GFE
    GFESyncFailedItem:
      properties:
        spakinectGfeId:
          type: string
          title: Spakinectgfeid
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
        error:
          type: string
          title: Error
      type: object
      required:
        - spakinectGfeId
        - error
      title: GFESyncFailedItem
      description: Failed to import GFE
    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
    SpaKinectPatientInfo:
      properties:
        firstName:
          type: string
          title: Firstname
        lastName:
          type: string
          title: Lastname
        dob:
          anyOf:
            - type: string
            - type: 'null'
          title: Dob
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
      type: object
      required:
        - firstName
        - lastName
      title: SpaKinectPatientInfo
      description: Patient info from SpaKinect GFE for sync preview

````