---
openapi: 3.0.3
info:
  title: Integration Connector API
  version: 0.0.1
paths:
  "/v1/calendar/book-meeting":
    post:
      tags:
      - CalendarService
      summary: Book Meeting
      operationId: bookCalendarMeeting
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/BookMeetingRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/BookMeetingResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/calendar/cancel-meeting":
    post:
      tags:
      - CalendarService
      summary: Cancel Meeting
      operationId: cancelCalendarMeeting
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/CancelMeetingRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/CancelMeetingResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/calendar/create-event":
    post:
      tags:
      - CalendarService
      operationId: CalendarService_CreateEvent
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/CreateEventRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/CreateEventResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/calendar/get-available-times":
    post:
      tags:
      - CalendarService
      summary: Get Available Times
      operationId: getCalendarAvailableTimes
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/GetAvailableTimesRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/GetAvailableTimesResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/calendar/list-calendars":
    post:
      tags:
      - CalendarService
      summary: List Calendars
      operationId: listCalendars
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/ListCalendarsRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ListCalendarsResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/calendar/list-events":
    post:
      tags:
      - CalendarService
      operationId: CalendarService_ListEvents
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/ListEventsRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ListEventsResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/calendar/update-meeting":
    post:
      tags:
      - CalendarService
      operationId: CalendarService_UpdateMeeting
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/UpdateMeetingRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/UpdateMeetingResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/calendar/verify-calendar-connection":
    post:
      tags:
      - CalendarService
      summary: Verify Calendar Connection
      operationId: verifyCalendarConnection
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/VerifyCalendarConnectionRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/VerifyCalendarConnectionResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/crm/get-account":
    post:
      tags:
      - CrmService
      summary: Get Account
      operationId: getCrmAccount
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/GetAccountRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/GetAccountResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/inventory/get-by-serial":
    post:
      tags:
      - InventoryService
      summary: Get Inventory Item By Serial
      operationId: getInventoryBySerial
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/GetBySerialRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/GetBySerialResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/routing/estimated-wait-time":
    post:
      tags:
      - RoutingService
      summary: Get Estimated Wait Time
      operationId: getEstimatedWaitTime
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/EstimatedWaitTimeRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/EstimatedWaitTimeResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/routing/get-routing-entities":
    post:
      tags:
      - RoutingService
      summary: Get Routing Entities
      operationId: getRoutingEntities
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/GetRoutingEntitiesRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/GetRoutingEntitiesResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/routing/get-routing-policies":
    post:
      tags:
      - RoutingService
      summary: Get Routing Policies
      operationId: getRoutingPolicies
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/GetRoutingPoliciesRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/GetRoutingPoliciesResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/routing/route-agent":
    post:
      tags:
      - RoutingService
      summary: Route Agent
      operationId: routeAgent
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/RouteAgentRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/RouteAgentResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/tickets/create-ticket":
    post:
      tags:
      - TicketsService
      summary: Create Ticket
      operationId: createSupportTicket
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/CreateTicketRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/CreateTicketResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/tickets/get-ticket":
    post:
      tags:
      - TicketsService
      summary: Get Ticket
      operationId: getTicketByNumber
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/GetTicketRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/GetTicketResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
  "/v1/tickets/update-ticket":
    post:
      tags:
      - TicketsService
      summary: Update Ticket
      operationId: updateSupportTicket
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/UpdateTicketRequest"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/UpdateTicketResponse"
        default:
          description: Default error response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Status"
      x-mint:
        metadata:
          playground: none
components:
  schemas:
    Account:
      type: object
      properties:
        id:
          type: string
          description: Stable account identifier in the CRM.
        name:
          type: string
          description: Display name of the company or account.
        domain:
          type: string
          description: Primary email domain for the account (e.g. example.com).
        website:
          type: string
          description: Public website URL when known.
        address:
          type: string
          description: Street or mailing address line.
        city:
          type: string
          description: City or locality.
        state:
          type: string
          description: State, province, or region.
        zip:
          type: string
          description: Postal or ZIP code.
        country:
          type: string
          description: Country name or code.
        owner_id:
          type: string
          description: CRM user id of the account owner when assigned.
    BookMeetingRequest:
      type: object
      properties:
        title:
          type: string
          description: Meeting title shown to attendees.
        description:
          type: string
          description: Agenda or body text when provided.
        start_time:
          type: string
          description: Meeting start instant.
          format: date-time
        end_time:
          type: string
          description: Meeting end instant.
          format: date-time
        timezone:
          type: string
          description: IANA timezone for the meeting.
        attendee_emails:
          type: array
          items:
            type: string
        selected_calendar_ids:
          type: array
          items:
            type: string
        conferencing_type:
          type: string
          description: 'Mirrors meeting_info.conferencing_type: "provider" = auto-generate;
            "url" = personal link. Legacy "cronofy" accepted at runtime.'
        location_url:
          type: string
    BookMeetingResponse:
      type: object
      properties:
        event:
          allOf:
          - "$ref": "#/components/schemas/CalendarEventResult"
          description: Created or updated event metadata.
    CalendarAttendee:
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        type:
          type: string
        response_status:
          type: string
    CalendarBusyInterval:
      type: object
      properties:
        start:
          type: string
          description: Interval start (inclusive).
          format: date-time
        end:
          type: string
          description: Interval end (exclusive).
          format: date-time
      description: |-
        Busy window [start, end): start inclusive, end exclusive (half-open). Instants are
         google.protobuf.Timestamp; in JSON they are RFC 3339 strings (UTC from provider when Z).
    CalendarEvent:
      type: object
      properties:
        event_id:
          type: string
        subject:
          type: string
        start_time:
          type: string
          format: date-time
        end_time:
          type: string
          format: date-time
        organizer_email:
          type: string
        attendees:
          type: array
          items:
            "$ref": "#/components/schemas/CalendarAttendee"
        event_url:
          type: string
        is_cancelled:
          type: boolean
      description: CalendarEvent is a row returned by ListEvents (provider calendar
        view).
    CalendarEventResult:
      type: object
      properties:
        event_id:
          type: string
          description: Provider event id for follow-up calls.
        event_url:
          type: string
          description: Deep link to open the event in the provider when available.
        start_time:
          type: string
          description: Populated after UpdateMeeting when the provider returns or
            resolves the scheduled window.
          format: date-time
        end_time:
          type: string
          format: date-time
    CalendarListEntry:
      type: object
      properties:
        id:
          type: string
          description: Provider calendar id.
        name:
          type: string
          description: Display name shown in the provider UI.
    CancelMeetingRequest:
      type: object
      properties:
        event_id:
          type: string
          description: Event id to cancel as returned by a prior create or book call.
        calendar_id:
          type: string
          description: Calendar id hosting the event when required by the provider.
    CancelMeetingResponse:
      type: object
      properties:
        ok:
          type: boolean
          description: True when the provider reports cancellation succeeded.
        event_id:
          type: string
          description: Echo of the cancelled event id when available.
    CreateEventRequest:
      type: object
      properties:
        calendar_id:
          type: string
          description: Target calendar id.
        title:
          type: string
          description: Event title.
        description:
          type: string
          description: Event body or notes when provided.
        start_time:
          type: string
          description: Event start instant.
          format: date-time
        end_time:
          type: string
          description: Event end instant.
          format: date-time
        timezone:
          type: string
          description: IANA timezone for the event.
        show_as:
          type: string
          description: Busy/free display hint (provider-specific, e.g. busy, free,
            tentative).
    CreateEventResponse:
      type: object
      properties:
        event:
          "$ref": "#/components/schemas/CalendarEventResult"
    CreateTicketRequest:
      type: object
      properties:
        subject:
          type: string
          description: Short title or subject line for the ticket.
        description:
          type: string
          description: Initial description or body text.
        priority:
          type: string
          description: Priority label or level when set.
        status:
          type: string
          description: Initial status when set.
        owner_id:
          type: string
          description: Assignee user id when set.
        account_id:
          type: string
          description: Related account id when set.
        contact_id:
          type: string
          description: Related contact id when set.
    CreateTicketResponse:
      type: object
      properties:
        ticket:
          allOf:
          - "$ref": "#/components/schemas/Ticket"
          description: Created ticket as stored in the CRM.
    EstimatedWaitTimeRequest:
      type: object
      properties:
        id:
          type: string
          description: Queue or routing entity id to estimate wait for.
    EstimatedWaitTimeResponse:
      type: object
      properties:
        duration:
          pattern: "^-?(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,9})?s$"
          type: string
          description: Estimated wait as a duration from now.
        is_available:
          type: boolean
          description: Whether the routing entity is available to handle new tickets.
            If false, the routing entity is not accepting new tickets.
    GetAccountRequest:
      type: object
      properties:
        id:
          type: string
          description: Look up by account id when set.
        name:
          type: string
          description: Look up by account name when set.
        domain:
          type: string
          description: Look up by primary domain when set.
    GetAccountResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            "$ref": "#/components/schemas/Account"
          description: Accounts matching the search criteria.
    GetAvailableTimesRequest:
      type: object
      properties:
        start_time:
          type: string
          format: date-time
        end_time:
          type: string
          format: date-time
        timezone:
          type: string
        selected_calendar_ids:
          type: array
          items:
            type: string
    GetAvailableTimesResponse:
      type: object
      properties:
        busy_windows:
          type: array
          items:
            "$ref": "#/components/schemas/CalendarBusyInterval"
    GetBySerialRequest:
      type: object
      properties:
        serial_number:
          type: string
          description: Serial number to resolve to an inventory item.
    GetBySerialResponse:
      type: object
      properties:
        item:
          "$ref": "#/components/schemas/InventoryItem"
    GetRoutingEntitiesRequest:
      type: object
      properties: {}
    GetRoutingEntitiesResponse:
      type: object
      properties:
        entities:
          type: array
          items:
            "$ref": "#/components/schemas/RoutableEntity"
    GetRoutingPoliciesRequest:
      type: object
      properties: {}
    GetRoutingPoliciesResponse:
      type: object
      properties:
        policies:
          type: array
          items:
            "$ref": "#/components/schemas/Policy"
    GetTicketRequest:
      type: object
      properties:
        ticket_number:
          type: string
          description: Ticket number to fetch.
    GetTicketResponse:
      type: object
      properties:
        ticket:
          allOf:
          - "$ref": "#/components/schemas/Ticket"
          description: Ticket matching the ticket number.
    GoogleProtobufAny:
      type: object
      properties:
        "@type":
          type: string
          description: The type of the serialized message.
      additionalProperties: true
      description: Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
    InventoryItem:
      type: object
      properties:
        id:
          type: string
          description: Unique id of the inventory record in the CRM.
        contact_id:
          type: string
          description: Related contact id when linked.
        account_id:
          type: string
          description: Related account id when linked.
        product_code:
          type: string
          description: Manufacturer or internal product code.
        is_competitor_product:
          type: boolean
          description: True if the item is a competitor product.
        created_date:
          type: string
          description: When the record was created in the source system.
          format: date-time
        created_by_id:
          type: string
          description: User id who created the record.
        last_modified_date:
          type: string
          description: When the record was last modified.
          format: date-time
        last_modified_by_id:
          type: string
          description: User id who last modified the record.
        name:
          type: string
          description: Human-readable product or asset name.
        serial_number:
          type: string
          description: Serial number used for lookup and identification.
        install_date:
          type: string
          description: When the item was installed at the customer.
          format: date-time
        purchase_date:
          type: string
          description: When the item was purchased.
          format: date-time
        usage_end_date:
          type: string
          description: When usage, warranty, or entitlement ends.
          format: date-time
        lifecycle_start_date:
          type: string
          description: Start of the supported lifecycle window.
          format: date-time
        lifecycle_end_date:
          type: string
          description: End of the supported lifecycle window.
          format: date-time
        status:
          type: string
          description: Status label from the CRM (e.g. active, retired).
        price:
          type: number
          description: Unit or list price when present.
          format: double
        quantity:
          type: string
          description: Quantity on hand or under contract.
        description:
          type: string
          description: Long-form description or notes.
        owner_id:
          type: string
          description: Owning user or team id in the CRM.
    ListCalendarsRequest:
      type: object
      properties: {}
    ListCalendarsResponse:
      type: object
      properties:
        calendars:
          type: array
          items:
            "$ref": "#/components/schemas/CalendarListEntry"
          description: Writable or selectable calendars for the connected user.
    ListEventsRequest:
      type: object
      properties:
        start_time:
          type: string
          format: date-time
        end_time:
          type: string
          format: date-time
        timezone:
          type: string
        selected_calendar_ids:
          type: array
          items:
            type: string
    ListEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            "$ref": "#/components/schemas/CalendarEvent"
    Policy:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
    RoutableEntity:
      type: object
      properties:
        type:
          enum:
          - ROUTABLE_ENTITY_TYPE_UNSPECIFIED
          - ROUTABLE_ENTITY_TYPE_AGENT
          - ROUTABLE_ENTITY_TYPE_TEAM
          type: string
          description: The type of entity.
          format: enum
        id:
          type: string
          description: Unique identifier of the entity.
        name:
          type: string
      description: Represents an entity that can be routed to.
    RouteAgentRequest:
      type: object
      properties:
        source:
          type: string
          description: 'System or integration that initiated the routing request.
            E.g: "chat", "inbound_phone", or "email".'
        source_id:
          type: string
          description: Source-system identifier for the entity being routed. Typically
            the "Dialogue" integer ID.
        reason:
          type: string
          description: Human-readable reason or context for routing.
        routing_policy:
          type: string
          description: The strategy to do routing with.
        routable_entities:
          type: array
          items:
            "$ref": "#/components/schemas/RoutableEntity"
          description: A list of all routable entities.
        metadata:
          type: object
          description: Additional routing context for provider-specific decisions.
    RouteAgentResponse:
      type: object
      properties:
        routed_agents:
          type: array
          items:
            "$ref": "#/components/schemas/RoutedAgent"
          description: |-
            Agents that were routed, if any. Teams are converted to agents.
             These agents must represent Atonom agent/user IDs.
        status:
          type: string
          description: The status of the route. Can be useful for communicating queued,
            etc statuses.
    RoutedAgent:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
        phone:
          type: string
          description: Phone number in E.164 format (e.g. +14155552671).
    Status:
      type: object
      properties:
        code:
          type: integer
          description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
          format: int32
        message:
          type: string
          description: A developer-facing error message, which should be in English.
            Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details]
            field, or localized by the client.
        details:
          type: array
          items:
            "$ref": "#/components/schemas/GoogleProtobufAny"
          description: A list of messages that carry the error details.  There is
            a common set of message types for APIs to use.
      description: 'The `Status` type defines a logical error model that is suitable
        for different programming environments, including REST APIs and RPC APIs.
        It is used by [gRPC](https://github.com/grpc). Each `Status` message contains
        three pieces of data: error code, error message, and error details. You can
        find out more about this error model and how to work with it in the [API Design
        Guide](https://cloud.google.com/apis/design/errors).'
    Ticket:
      type: object
      properties:
        id:
          type: string
          description: Unique ticket id in the CRM.
        ticket_number:
          type: string
          description: Human-readable ticket number for lookup.
        subject:
          type: string
          description: Current subject or title.
        description:
          type: string
          description: Full description or thread summary.
        status:
          type: string
          description: Workflow status label.
        priority:
          type: string
          description: Priority label or level.
        owner_id:
          type: string
          description: Current assignee user id.
        account_id:
          type: string
          description: Related account id.
        contact_id:
          type: string
          description: Related contact id.
        created_at:
          type: string
          description: When the ticket was opened.
          format: date-time
        closed_at:
          type: string
          description: When the ticket was closed, if applicable.
          format: date-time
        resolved_at:
          type: string
          description: When the ticket was marked resolved, if applicable.
          format: date-time
        updated_at:
          type: string
          description: Last update time on the ticket record.
          format: date-time
        last_comment:
          type: string
          description: Most recent public comment or note snippet.
    UpdateMeetingRequest:
      type: object
      properties:
        event_id:
          type: string
        title:
          type: string
        description:
          type: string
        start_time:
          type: string
          description: Omit both to preserve the existing window; omit one and the
            integrations service may GET the event to fill gaps.
          format: date-time
        end_time:
          type: string
          format: date-time
        timezone:
          type: string
        attendee_emails:
          type: array
          items:
            type: string
        selected_calendar_ids:
          type: array
          items:
            type: string
    UpdateMeetingResponse:
      type: object
      properties:
        event:
          "$ref": "#/components/schemas/CalendarEventResult"
    UpdateTicketRequest:
      type: object
      properties:
        id:
          type: string
          description: Ticket id to update.
        subject:
          type: string
          description: New subject when provided.
        description:
          type: string
          description: New description when provided.
        priority:
          type: string
          description: New priority when provided.
        status:
          type: string
          description: New status when provided.
        owner_id:
          type: string
          description: New assignee user id when provided.
        account_id:
          type: string
          description: New related account id when provided.
        contact_id:
          type: string
          description: New related contact id when provided.
    UpdateTicketResponse:
      type: object
      properties:
        ticket:
          allOf:
          - "$ref": "#/components/schemas/Ticket"
          description: Ticket after applying updates.
    VerifyCalendarConnectionRequest:
      type: object
      properties: {}
    VerifyCalendarConnectionResponse:
      type: object
      properties:
        ok:
          type: boolean
          description: True when credentials are valid and the provider responds successfully.
        email:
          type: string
          description: Primary calendar email for the connected account when returned
            by the provider.
tags:
- name: CalendarService
- name: CrmService
- name: InventoryService
- name: RoutingService
- name: TicketsService
