Skip to content
Navigation

Create appointment

Use the organization gMedic account. No automatic write retries; reconcile an unknown outcome before repeating.

  • Scope: gmedic:appointments:write
  • Credentials: an API key, a client-credentials token or a person's access token
  • Effect: writes; not idempotent: check the outcome before you retry
  • Limits: request body up to 32 KB, response up to 256 KB
  • CLI: arbol gmedic appointments create · MCP tool: gmedic_appointments_create
POST
https://api.getarbol.com/v1/gmedic/appointments

Authorization

  • Authorization
    string
    required
    Bearer <token>, where the token is an API key, a client-credentials token or a person's access token with the scope gmedic:appointments:write. Get an API key.

Request body JSON required

  • data
    object
    required
    • title
      string
      required
      maxLength: 255
    • agendaId
      string
      required
      pattern: ^[1-9][0-9]{0,14}$
    • patientId
      string
      required
      pattern: ^[1-9][0-9]{0,14}$
    • description
      optional
      string
      maxLength: 255
    • allDay
      optional
      boolean
    • block
      optional
      boolean
    • startsAt
      optional
      string
      format: date-time
    • endsAt
      optional
      string
      format: date-time
    • startDate
      deprecated
      string

      Deprecated: use startsAt. Answered until 2027-01-28.

      maxLength: 20000 · pattern: ^[0-9]{8} [0-9]{2}:[0-9]{2}$
    • endDate
      deprecated
      string

      Deprecated: use endsAt. Answered until 2027-01-28.

      maxLength: 20000 · pattern: ^[0-9]{8} [0-9]{2}:[0-9]{2}$
    • desiredDate
      optional
      string
      maxLength: 20000 · pattern: ^[0-9]{8}$
    • branchOfficeId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • notificationMail
      optional
      string
      maxLength: 255
    • notificationNumber
      optional
      string
      maxLength: 255
    • colorId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • location
      optional
      string
      maxLength: 255
    • stateId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • modality
      optional
      string
      maxLength: 20000
    • serviceId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • authorization
      optional
      string
      maxLength: 255
    • medicalAuthorizationId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • authorizationSessions
      optional
      integer
      maximum: 9007199254740991 · minimum: 0
    • currentSessions
      optional
      string
      maxLength: 255
    • invoice
      optional
      string
      maxLength: 255
    • attentionTypeId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • cupCode
      optional
      string
      maxLength: 255
    • consultationPurposeId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • externalCauseId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • medicalServiceId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • servicesGroupId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • serviceModalityId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
    • viaEntryId
      optional
      string
      pattern: ^[1-9][0-9]{0,14}$
  • connectionId
    optional
    string
    pattern: ^con_[0-9A-Za-z]{26}$

Returns

200

Successful operation.

JSON
  • success
    true
    required
  • data
    object
    required
    • id
      string
      required
      pattern: ^[1-9][0-9]{0,14}$
    • key
      optional
      string | null
      maxLength: 20000
    • createdAt
      optional
      string | null
      maxLength: 20000
    • creationDate
      deprecated
      string | null

      Deprecated: use createdAt. Answered until 2027-01-28.

      maxLength: 20000
    • updatedAt
      optional
      string | null
      maxLength: 20000
    • modificationDate
      deprecated
      string | null

      Deprecated: use updatedAt. Answered until 2027-01-28.

      maxLength: 20000
    • title
      optional
      string | null
      maxLength: 20000
    • description
      optional
      string | null
      maxLength: 20000
    • allDay
      optional
      boolean | null
    • block
      optional
      boolean | null
    • readOnly
      optional
      boolean | null
    • startsAt
      optional
      string | null
      format: date-time
    • endsAt
      optional
      string | null
      format: date-time
    • startDate
      deprecated
      string | null

      Deprecated: use startsAt. Answered until 2027-01-28.

      maxLength: 20000
    • endDate
      deprecated
      string | null

      Deprecated: use endsAt. Answered until 2027-01-28.

      maxLength: 20000
    • desiredDate
      optional
      string | null
      maxLength: 20000
    • opportunityIndicator
      optional
      integer | null
      maximum: 2147483647 · minimum: -2147483648
    • mainAttendantId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • mainAttendantName
      optional
      string | null
      maxLength: 20000
    • mainAttendantIdentification
      optional
      string | null
      maxLength: 20000
    • mainAttendantDocumentType
      optional
      object | null
      • id
        string
        required
        pattern: ^[1-9][0-9]{0,14}$
      • name
        optional
        string | null
        maxLength: 20000
      • label
        optional
        string | null
        maxLength: 20000
      • value
        optional
        string | null
        maxLength: 20000
    • mainAttendantPhone
      optional
      string | null
      maxLength: 20000
    • mainAttendantMobile
      optional
      string | null
      maxLength: 20000
    • mainAttendantEmail
      optional
      string | null
      maxLength: 20000
    • appointmentColor
      optional
      object | null
      • id
        string
        required
        pattern: ^[1-9][0-9]{0,14}$
      • name
        optional
        string | null
        maxLength: 20000
      • label
        optional
        string | null
        maxLength: 20000
      • value
        optional
        string | null
        maxLength: 20000
    • status
      optional
      object | null
      • id
        string
        required
        pattern: ^[1-9][0-9]{0,14}$
      • name
        optional
        string | null
        maxLength: 20000
      • label
        optional
        string | null
        maxLength: 20000
      • value
        optional
        string | null
        maxLength: 20000
    • state
      deprecated
      object | null

      Deprecated: use status. Answered until 2027-01-28.

      • id
        string
        required
        pattern: ^[1-9][0-9]{0,14}$
      • name
        optional
        string | null
        maxLength: 20000
      • label
        optional
        string | null
        maxLength: 20000
      • value
        optional
        string | null
        maxLength: 20000
    • rejectReason
      optional
      object | null
      • id
        string
        required
        pattern: ^[1-9][0-9]{0,14}$
      • name
        optional
        string | null
        maxLength: 20000
      • label
        optional
        string | null
        maxLength: 20000
      • value
        optional
        string | null
        maxLength: 20000
    • modality
      optional
      FACE_TO_FACE
      or
      VIRTUAL
      or
      HOME_VISIT
      or
      NOT_APPLICABLE
      or
      null
    • videocallProvider
      optional
      string | null
      maxLength: 20000
    • meetURL
      optional
      string | null
      maxLength: 20000
    • agendaId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • agendaName
      optional
      string | null
      maxLength: 20000
    • selfServiceAllowCancel
      optional
      boolean | null
    • selfServiceAllowReschedule
      optional
      boolean | null
    • branchOffice
      optional
      string | null
      maxLength: 20000
    • location
      optional
      string | null
      maxLength: 20000
    • service
      optional
      string | null
      maxLength: 20000
    • serviceId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • authorization
      optional
      string | null
      maxLength: 20000
    • medicalAuthorizationId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • authorizationSessions
      optional
      integer | null
      maximum: 9007199254740991 · minimum: 0
    • currentSessions
      optional
      string | null
      maxLength: 20000
    • entidad
      optional
      string | null
      maxLength: 20000
    • invoice
      optional
      string | null
      maxLength: 20000
    • userType
      optional
      string | null
      maxLength: 20000
    • cupCode
      optional
      string | null
      maxLength: 20000
    • cupName
      optional
      string | null
      maxLength: 20000
    • mainDiagnosticCode
      optional
      string | null
      maxLength: 20000
    • mainDiagnosticName
      optional
      string | null
      maxLength: 20000
    • consultationPurposeId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • consultationPurposeCode
      optional
      string | null
      maxLength: 20000
    • consultationPurposeName
      optional
      string | null
      maxLength: 20000
    • externalCauseId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • externalCauseCode
      optional
      string | null
      maxLength: 20000
    • externalCauseName
      optional
      string | null
      maxLength: 20000
    • medicalServiceId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • medicalServiceCode
      optional
      string | null
      maxLength: 20000
    • medicalServiceName
      optional
      string | null
      maxLength: 20000
    • servicesGroupId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • servicesGroupCode
      optional
      string | null
      maxLength: 20000
    • servicesGroupName
      optional
      string | null
      maxLength: 20000
    • serviceModalityId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • serviceModalityCode
      optional
      string | null
      maxLength: 20000
    • serviceModalityName
      optional
      string | null
      maxLength: 20000
    • viaEntryId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • viaEntryCode
      optional
      string | null
      maxLength: 20000
    • viaEntryName
      optional
      string | null
      maxLength: 20000
    • userObjectId
      optional
      string | null
      pattern: ^[1-9][0-9]{0,14}$
    • personCreator
      optional
      string | null
      maxLength: 20000
    • date
      deprecated
      string | null

      Deprecated: use startsAt. Answered until 2027-01-28.

      maxLength: 20000
    • time
      deprecated
      string | null

      Deprecated: use startsAt. Answered until 2027-01-28.

      maxLength: 20000
  • error
    unknown
    required
  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

400

INVALID_INPUT: The request does not match the published schema.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    The request does not match the published schema.

    • code
      INVALID_INPUT
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required
      • issues
        optional
        array of
        object
        • path
          string
          required

          RFC 6901 JSON Pointer to the refused field; empty for the whole input.

          maxLength: 256
        • message
          string
          required
          maxLength: 256
  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

401

UNAUTHORIZED: A valid access token is required.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    A valid access token is required.

    • code
      UNAUTHORIZED
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

403

FORBIDDEN: The token does not authorize this operation.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    The token does not authorize this operation.

    • code
      FORBIDDEN
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

404

  • CONNECTION_NOT_FOUND: This organization has no gMedic connection with this id.
  • RECORD_NOT_FOUND: gMedic has no record with one of the ids sent.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    required

    One of the following:

    • GmedicConnectionNotFoundFailure
      CONNECTION_NOT_FOUND
      • code
        CONNECTION_NOT_FOUND
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        false
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

    • GmedicRecordNotFoundFailure
      RECORD_NOT_FOUND
      • code
        RECORD_NOT_FOUND
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        false
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

409

NOT_CONFIGURED: This organization has no verified gMedic connection.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    This organization has no verified gMedic connection.

    • code
      NOT_CONFIGURED
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

413

REQUEST_TOO_LARGE: The request exceeds the allowed size.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    The request exceeds the allowed size.

    • code
      REQUEST_TOO_LARGE
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

415

UNSUPPORTED_MEDIA_TYPE: The request content type is not supported.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    The request content type is not supported.

    • code
      UNSUPPORTED_MEDIA_TYPE
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

422

PROVIDER_INPUT_REJECTED: gMedic rejected the supplied fields.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    gMedic rejected the supplied fields.

    • code
      PROVIDER_INPUT_REJECTED
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

429

RATE_LIMITED: The request rate limit was exceeded. Try again later.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    The request rate limit was exceeded. Try again later.

    • code
      RATE_LIMITED
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      true
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

500

INTERNAL_ERROR: The service could not complete the operation.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    The service could not complete the operation.

    • code
      INTERNAL_ERROR
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      false
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

502

  • OUTCOME_UNKNOWN: The operation may have been applied; check its result before repeating it.
  • PROVIDER_ACCESS_REJECTED: The configured gMedic account did not authorize this operation.
  • PROVIDER_RESPONSE_INVALID: gMedic returned an unexpected response.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    required

    One of the following:

    • OutcomeUnknownFailure
      OUTCOME_UNKNOWN
      • code
        OUTCOME_UNKNOWN
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        false
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

    • GmedicProviderAccessRejectedFailure
      PROVIDER_ACCESS_REJECTED
      • code
        PROVIDER_ACCESS_REJECTED
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        false
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

    • GmedicProviderResponseInvalidFailure
      PROVIDER_RESPONSE_INVALID
      • code
        PROVIDER_RESPONSE_INVALID
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        false
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

503

  • UPSTREAM_UNAVAILABLE: The upstream service could not complete the request.
  • CATALOG_SEARCH_INCOMPLETE: The service catalog search could not be completed within its limits. Service absence cannot be concluded.
  • PROVIDER_UNAVAILABLE: gMedic is temporarily unavailable.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    required

    One of the following:

    • UpstreamUnavailableFailure
      UPSTREAM_UNAVAILABLE
      • code
        UPSTREAM_UNAVAILABLE
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        true
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

    • GmedicCatalogSearchIncompleteFailure
      CATALOG_SEARCH_INCOMPLETE
      • code
        CATALOG_SEARCH_INCOMPLETE
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        false
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

    • GmedicProviderUnavailableFailure
      PROVIDER_UNAVAILABLE
      • code
        PROVIDER_UNAVAILABLE
        required

        The failure code, stable across releases.

      • message
        string
        required

        What went wrong, for people; it never contains input values.

      • retryable
        true
        required

        Whether repeating the same request may succeed.

      • data
        object
        required

        No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

504

UPSTREAM_TIMEOUT: The upstream service did not respond before its deadline.
JSON
  • success
    false
    required
  • data
    unknown
    required
  • error
    object
    required

    The upstream service did not respond before its deadline.

    • code
      UPSTREAM_TIMEOUT
      required

      The failure code, stable across releases.

    • message
      string
      required

      What went wrong, for people; it never contains input values.

    • retryable
      true
      required

      Whether repeating the same request may succeed.

    • data
      object
      required

      No fields.

  • metadata
    object
    required

    What every answer carries besides its data or error.

    • requestId
      string
      required

      Request correlation identifier, also sent as X-Request-Id.

Escribe para buscar…

↑↓ navegar↵ seleccionarEsc cerrar