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

# Atualizar uma conta de médico

> Atualiza uma conta de médico da instituição autenticada, identificada pelo seu `publicId` (`acc_*`) ou `internalCode`. Envie apenas os campos que deseja alterar: `nameFull`, `doctorSpecialties` (substitui a lista) ou `internalCode`. Qualquer outro campo é rejeitado com 400. `internalCode` só pode ser definido em uma conta que não tem um, como uma conta criada por convite; um valor diferente em uma conta que já tem um retorna 409, e um código que outra conta ou um convite pendente da sua instituição usa retorna 409. Requer uma chave de API institucional com permissão de escrita; uma chave de médico é rejeitada com 403. Retorna a conta atualizada.



## OpenAPI

````yaml /pt-BR/scribe-api/openapi-institutional.json patch /v1/institutional/accounts/{account_id}
openapi: 3.1.0
info:
  title: Scribe Public API
  description: >-
    API REST externa para integração com a plataforma Telepatia. Autentique-se
    com chaves de API, defina o contexto da consulta e busque sessões de scribe.
  version: 0.1.0
servers:
  - url: https://scribe-api.telepatia.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /v1/institutional/accounts/{account_id}:
    patch:
      tags:
        - Institutional
      summary: Atualizar uma conta de médico
      description: >-
        Atualiza uma conta de médico da instituição autenticada, identificada
        pelo seu `publicId` (`acc_*`) ou `internalCode`. Envie apenas os campos
        que deseja alterar: `nameFull`, `doctorSpecialties` (substitui a lista)
        ou `internalCode`. Qualquer outro campo é rejeitado com 400.
        `internalCode` só pode ser definido em uma conta que não tem um, como
        uma conta criada por convite; um valor diferente em uma conta que já tem
        um retorna 409, e um código que outra conta ou um convite pendente da
        sua instituição usa retorna 409. Requer uma chave de API institucional
        com permissão de escrita; uma chave de médico é rejeitada com 403.
        Retorna a conta atualizada.
      operationId: >-
        api_institutional_account_updated_v1_institutional_accounts__account_id__patch
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
            title: Account Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccountRequest'
            example:
              doctorSpecialties:
                - cardiology
              internalCode: DOC-001
              nameFull: Dr. Juan Pérez
      responses:
        '200':
          description: Resposta bem-sucedida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountResponse'
              example:
                createdAt: '2024-01-15T10:30:00Z'
                doctorSpecialties:
                  - cardiology
                email: dr.juan@clinica.com
                enabled: true
                id: acc_a1b2c3d4e5f6g7h8
                internalCode: DOC-001
                nameFull: Dr. Juan Pérez
                roles:
                  - doctor
        '400':
          description: >-
            Requisição inválida — parâmetros inválidos, falhas de validação ou
            campos ausentes.
          content:
            application/json:
              examples:
                parameter_missing:
                  summary: Missing required field
                  value:
                    error:
                      type: invalid_request_error
                      code: parameter_missing
                      message: name is required.
                      param: name
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                parameter_invalid:
                  summary: Invalid field value
                  value:
                    error:
                      type: invalid_request_error
                      code: parameter_invalid
                      message: >-
                        idCountry must be a valid country name, ISO alpha-2, or
                        ISO alpha-3 code.
                      param: idCountry
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                account_invalid:
                  summary: Invalid account
                  value:
                    error:
                      type: invalid_request_error
                      code: account_invalid
                      message: Account has no valid authId.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Não autorizado — chave de API ausente ou inválida.
          content:
            application/json:
              examples:
                authentication_required:
                  summary: Invalid or missing API key
                  value:
                    error:
                      type: authentication_error
                      code: authentication_required
                      message: Invalid API key.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Proibido — a chave de API não pode executar esta operação.
          content:
            application/json:
              examples:
                permission_denied:
                  summary: Caller lacks permission for this resource
                  value:
                    error:
                      type: permission_error
                      code: permission_denied
                      message: You do not have permission to access this resource.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
                permission_denied_role:
                  summary: API key's account role is not allowed this operation
                  value:
                    error:
                      type: permission_error
                      code: permission_denied
                      message: >-
                        Your API key is not allowed to create accounts. Account
                        creation requires an institutional API key; this key is
                        scoped to a doctor account.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Não encontrado — o recurso solicitado não existe.
          content:
            application/json:
              examples:
                resource_not_found:
                  summary: Resource not found
                  value:
                    error:
                      type: invalid_request_error
                      code: resource_not_found
                      message: No session scribe found for the given consultation ID.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflito — o recurso já existe ou está em estado conflitante.
          content:
            application/json:
              examples:
                resource_conflict:
                  summary: Resource conflict
                  value:
                    error:
                      type: invalid_request_error
                      code: resource_conflict
                      message: >-
                        consultationInternalId is already in use by a different
                        consultation.
                      param: consultationInternalId
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Serviço indisponível — uma dependência externa está indisponível.
          content:
            application/json:
              examples:
                service_unavailable:
                  summary: External service unavailable
                  value:
                    error:
                      type: api_error
                      code: service_unavailable
                      message: >-
                        The service is temporarily unavailable. Please try again
                        later.
                      requestId: 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateAccountRequest:
      properties:
        nameFull:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Namefull
          examples:
            - Dr. Juan Pérez
        doctorSpecialties:
          anyOf:
            - items:
                $ref: '#/components/schemas/MedicalSpecialty'
              type: array
              minItems: 1
            - type: 'null'
          title: Doctorspecialties
          description: >-
            Replaces the account's specialties. Accepts either the specialty key
            ('CARDIOLOGY') or value ('cardiology'); always persisted as the
            value.
          examples:
            - - cardiology
        internalCode:
          anyOf:
            - type: string
              maxLength: 128
              minLength: 1
            - type: 'null'
          title: Internalcode
          description: >-
            Your institution's code for this account. It can be set only on an
            account that has no internalCode, for example an account created
            through an invitation. Sending the stored value again changes
            nothing. A different value returns 409: contact Telepatia support to
            change a stored code. Each internalCode identifies one account of
            your institution.
          examples:
            - DOC-001
      additionalProperties: false
      type: object
      title: UpdateAccountRequest
      description: |-
        Request body for updating an institutional doctor account. Send only the
        fields to change; any other field is rejected with 400.
      examples:
        - doctorSpecialties:
            - cardiology
          internalCode: DOC-001
          nameFull: Dr. Juan Pérez
    GetAccountResponse:
      properties:
        id:
          type: string
          title: Id
          description: Account publicId (acc_*).
          examples:
            - acc_a1b2c3d4e5f6g7h8
        email:
          type: string
          title: Email
          examples:
            - dr.juan@clinica.com
        nameFull:
          anyOf:
            - type: string
            - type: 'null'
          title: Namefull
          examples:
            - Dr. Juan Pérez
        doctorSpecialties:
          items:
            $ref: '#/components/schemas/MedicalSpecialty'
          type: array
          title: Doctorspecialties
          examples:
            - - cardiology
        enabled:
          type: boolean
          title: Enabled
          examples:
            - true
        internalCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Internalcode
          examples:
            - DOC-001
        roles:
          items:
            type: string
          type: array
          title: Roles
          description: Account roles, e.g. doctor or institutional.
          examples:
            - - doctor
        createdAt:
          type: string
          title: Createdat
          examples:
            - '2024-01-15T10:30:00Z'
      type: object
      required:
        - id
        - email
        - doctorSpecialties
        - enabled
        - createdAt
      title: GetAccountResponse
      description: Response body for fetching an institutional doctor account.
      examples:
        - createdAt: '2024-01-15T10:30:00Z'
          doctorSpecialties:
            - cardiology
          email: dr.juan@clinica.com
          enabled: true
          id: acc_a1b2c3d4e5f6g7h8
          internalCode: DOC-001
          nameFull: Dr. Juan Pérez
          roles:
            - doctor
    ErrorResponse:
      description: Envelope padronizado de resposta de erro.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetailWithRequestId'
      required:
        - error
      title: ErrorResponse
      type: object
    MedicalSpecialty:
      type: string
      enum:
        - acupuncture
        - alternativeMedicine
        - ayurvedicMedicine
        - chiropractic
        - herbalMedicine
        - homeopathy
        - naturopathy
        - traditionalChineseMedicine
        - cosmeticDentistry
        - dentistry
        - developmentalBehavioralPediatrics
        - endodontics
        - forensicDentistry
        - maxillofacialProsthodontics
        - oralMaxillofacialSurgery
        - oralMedicine
        - oralPathology
        - oralSurgery
        - orthodontics
        - pediatricDentistry
        - periodontics
        - prosthodontics
        - addictionPsychiatry
        - adolescentMedicine
        - aerospaceMedicine
        - allergyImmunology
        - andrology
        - anesthesiology
        - anesthesiologyCriticalCare
        - bariatricSurgery
        - breastRadiology
        - breastSurgery
        - cardiacSurgery
        - cardiovascularSurgery
        - cardiology
        - cardiovascularDisease
        - cardiovascularRiskProgram
        - childAbusePediatrics
        - childAdolescentPsychiatry
        - childNeurology
        - childWelfareSocialWork
        - clinicalNeurophysiology
        - clinicalSocialWork
        - colorectalSurgery
        - communityMedicine
        - communitySocialWork
        - consultationLiaisonPsychiatry
        - cosmeticDermatology
        - craniofacialTrauma
        - dermatology
        - dermoscopy
        - diabetes
        - diagnosticRadiology
        - electrophysiology
        - emergencyCriticalCare
        - emergencyMedicine
        - emergencyPsychiatry
        - endocrineSurgery
        - endocrinology
        - epilepsy
        - facialPlasticSurgery
        - familyMedicine
        - familySocialWork
        - footAnkleSurgery
        - forensicPsychiatry
        - forensicSocialWork
        - gastroenterology
        - generalMedicine
        - generalMedicinePsychiatry
        - generalSurgery
        - geriatricMedicine
        - geriatricPsychiatry
        - geriatricSocialWork
        - ginecology
        - gynecologicOncology
        - gynecologicSurgery
        - gynecology
        - handSurgery
        - headNeckSurgery
        - headacheMedicine
        - heartFailureTransplantCardiology
        - hematology
        - hepatobiliarySurgery
        - hipKneeSurgery
        - hospitalist
        - infectiousDisease
        - internalCriticalCare
        - internalMedicine
        - interventionalCardiology
        - interventionalRadiology
        - maternalFetalMedicine
        - medicalSocialWork
        - militarySocialWork
        - minimallyInvasiveGynecologicSurgery
        - mohsSurgery
        - musculoskeletalRadiology
        - neonatology
        - nephrology
        - neurocriticalCare
        - neuroimmunology
        - neurology
        - neuromuscularMedicine
        - neuroradiology
        - neurorehabilitation
        - neurosurgery
        - neurotology
        - nuclearMedicine
        - obstetrics
        - obstetricsGynecology
        - occupationalMedicine
        - occupationalSocialWork
        - oculoplasticSurgery
        - oncology
        - oncologySocialWork
        - ophthalmology
        - orthopedicHandSurgery
        - orthopedicSportsMedicine
        - orthopedicTrauma
        - orthopedics
        - otolaryngology
        - painMedicine
        - palliativeMedicine
        - palliativeSocialWork
        - pediatricAllergyImmunology
        - pediatricAnesthesiology
        - pediatricCardiology
        - pediatricCriticalCare
        - pediatricDermatology
        - pediatricEmergencyMedicine
        - pediatricEndocrinology
        - pediatricENT
        - pediatricGastroenterology
        - pediatricHematologyOncology
        - pediatricInfectiousDisease
        - pediatricNephrology
        - pediatricNeurology
        - pediatricCardiacSurgery
        - pediatricOncology
        - pediatricOphthalmology
        - pediatricOrthopedics
        - pediatricPalliativeCare
        - pediatricPulmonology
        - pediatricRadiology
        - pediatricRheumatology
        - pediatricSocialWork
        - pediatricSurgery
        - pediatricTrauma
        - pediatricUrology
        - pediatrics
        - perinatalPsychiatry
        - physicalMedicineRehab
        - plasticSurgery
        - prenatalCareProgram
        - preventiveMedicine
        - psychiatricSocialWork
        - psychiatry
        - psychosomaticMedicine
        - publicHealth
        - pulmonaryDisease
        - pulmonology
        - radiationOncologist
        - radiationOncology
        - reproductiveEndocrinology
        - retinaSurgery
        - rheumatology
        - riasProgram
        - manager
        - schoolSocialWork
        - shoulderElbowSurgery
        - sleepMedicine
        - socialWork
        - spinalCordInjury
        - spinalTrauma
        - spineSurgery
        - sportsMedicine
        - substanceAbuseSocialWork
        - surgicalOncology
        - telemedicine
        - thoracicSurgery
        - transplantHepatology
        - transplantSurgery
        - traumaSurgery
        - traumatology
        - triage
        - unknown
        - urgentCare
        - urologicOncology
        - urology
        - vascularSurgery
        - nursing
        - clinicalNutrition
        - eatingDisorderNutrition
        - gastroenterologicNutrition
        - geriatricNutrition
        - nutrition
        - oncologyNutrition
        - pediatricNutrition
        - renalNutrition
        - sportsNutrition
        - clinicalPsychology
        - counselingPsychology
        - developmentalPsychology
        - forensicPsychology
        - geropsychology
        - healthPsychology
        - industrialOrganizationalPsychology
        - militaryPsychology
        - neuropsychology
        - positivePsychology
        - psychology
        - rehabilitationPsychology
        - schoolPsychology
        - sportsPsychology
        - occupationalTherapy
        - physicalTherapy
        - respiratoryTherapy
        - speechTherapy
        - therapy
        - other
      title: MedicalSpecialty
    ErrorDetailWithRequestId:
      description: >-
        Top-level error object: :class:`ErrorDetail` plus the request
        correlation id.


        Kept as a subclass rather than a field on ``ErrorDetail`` because
        ``ErrorDetail`` is

        also the per-item error shape inside the batch account-creation response

        (``BatchAccountResult.error``), which is serialized with nulls included.
        Adding the

        field there would publish ``"requestId": null`` on an HTTP 200, and
        there is only

        ever one request id per batch anyway -- batch callers read the
        ``X-Request-ID``

        response header.
      properties:
        type:
          description: Broad error category for high-level handling.
          examples:
            - invalid_request_error
          title: Type
          type: string
        code:
          description: Machine-readable error code. Clients should switch on this value.
          examples:
            - parameter_invalid
          title: Code
          type: string
        message:
          description: Human-readable error message ending with a period.
          examples:
            - >-
              idCountry must be a valid country name, ISO alpha-2, or ISO
              alpha-3 code.
          title: Message
          type: string
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The request field that caused the error, if applicable.
          examples:
            - idCountry
          title: Param
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          description: Optional structured, machine-readable context for the error.
          examples:
            - pendingConsultations:
                - sessionId: abc123
                  url: https://...
          title: Details
        requestId:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Unique id for this request, identical to the X-Request-ID response
            header. Quote it when contacting support.
          examples:
            - 3f9a1c2e-5b7d-4a21-9f0c-8e6d4b2a1c30
          title: Requestid
      required:
        - type
        - code
        - message
      title: ErrorDetailWithRequestId
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Chave de API enviada como token Bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.