{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenAPI Plant Store",
    "description": "A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://sandbox.mintlify.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/plants": {
      "get": {
        "description": "Returns all plants from the system that the user has access to",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of results to return",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plant response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Plant"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Creates a new plant in the store",
        "requestBody": {
          "description": "Plant to add to the store",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPlant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "plant response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plant"
                }
              }
            }
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/plants/{id}": {
      "delete": {
        "description": "Deletes a single plant based on the ID supplied",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of plant to delete",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Plant deleted",
            "content": {}
          },
          "400": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/core/voice_agent/start_phone_call": {
      "post": {
        "description": "Starts a phone call using the voice agent system",
        "tags": [
          "Phone Call"
        ],
        "requestBody": {
          "description": "Phone call request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneCallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Phone call request made",
            "content": {}
          },
          "400": {
            "description": "Bad request - invalid input parameters. Make sure required fields are provided and formatted correctly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/core/book_meeting": {
      "post": {
        "description": "Schedules a meeting using the Atonom voice agent system",
        "tags": [
          "Meeting"
        ],
        "requestBody": {
          "description": "Schedule Meeting request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleMeetingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Meeting scheduled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleMeetingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid input parameters. Make sure required fields are provided and formatted correctly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/core/contact": {
      "post": {
        "description": "Create or update a contact in Atonom",
        "tags": [
          "Contacts"
        ],
        "requestBody": {
          "description": "Contact information",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Contact"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contact created or updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ScheduleMeetingRequest": {
        "type": "object",
        "required": [
          "data"
        ],
        "example": {
          "data": {
            "attributes": {
              "team_id": 123,
              "agent_id": 123,
              "meeting_type_id": 123,
              "attendee_email": "john.doe@example.com",
              "start_time": "1716489600"
            }
          }
        },
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "attributes"
            ],
            "properties": {
              "attributes": {
                "type": "object",
                "required": [
                  "meeting_type_id",
                  "start_time"
                ],
                "properties": {
                  "team_id": {
                    "type": "integer",
                    "description": "The team ID to schedule the meeting for"
                  },
                  "agent_id": {
                    "type": "integer",
                    "description": "The agent ID to schedule the meeting for"
                  },
                  "meeting_type_id": {
                    "type": "integer",
                    "description": "The meeting type ID to schedule the meeting for"
                  },
                  "attendee_email": {
                    "type": "string",
                    "description": "The email address of the attendee to schedule the meeting for"
                  },
                  "start_time": {
                    "type": "string",
                    "description": "The start time of the meeting in Unix seconds (stringified)"
                  }
                }
              }
            }
          }
        }
      },
      "ScheduleMeetingResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "example": {
          "data": {
            "id": "abc",
            "attributes": {
              "meeting_id": "abc",
              "team_id": 123,
              "agent_id": 123,
              "meeting_type_id": 123,
              "attendee_email": "john.doe@example.com",
              "start_time": "1716489600"
            }
          }
        },
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "attributes",
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The ID of the meeting"
              },
              "attributes": {
                "type": "object",
                "required": [
                  "meeting_type_id",
                  "start_time"
                ],
                "properties": {
                  "team_id": {
                    "type": "string",
                    "description": "The team ID to schedule the meeting for"
                  },
                  "agent_id": {
                    "type": "string",
                    "description": "The agent ID to schedule the meeting for"
                  },
                  "meeting_type_id": {
                    "type": "string",
                    "description": "The meeting type ID to schedule the meeting for"
                  },
                  "attendee_email": {
                    "type": "string",
                    "description": "The email address of the attendee to schedule the meeting for"
                  },
                  "start_time": {
                    "type": "string",
                    "description": "The start time of the meeting in Unix seconds (stringified)"
                  }
                }
              }
            }
          }
        }
      },
      "PhoneCallRequest": {
        "type": "object",
        "required": [
          "data"
        ],
        "example": {
          "data": {
            "attributes": {
              "from_number": "+12025550123",
              "to_number": "+12025550789",
              "override_agent_id": "123",
              "dynamic_variables": {
                "first_name": "John",
                "last_name": "Doe"
              }
            }
          }
        },
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "attributes"
            ],
            "properties": {
              "attributes": {
                "type": "object",
                "required": [
                  "from_number",
                  "to_number"
                ],
                "properties": {
                  "from_number": {
                    "type": "string",
                    "description": "The Cloud Employee's phone number to call from (must include country code)"
                  },
                  "to_number": {
                    "type": "string",
                    "description": "The phone number to call to (must include country code)"
                  },
                  "override_agent_id": {
                    "type": "string",
                    "description": "Optional agent ID override"
                  },
                  "dynamic_variables": {
                    "type": "object",
                    "description": "Map of dynamic variables for the call",
                    "example": {
                      "first_name": "John",
                      "last_name": "Doe"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Plant": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the plant",
            "type": "string"
          },
          "tag": {
            "description": "Tag to specify the type",
            "type": "string"
          }
        }
      },
      "NewPlant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Plant"
          },
          {
            "required": [
              "id"
            ],
            "type": "object",
            "properties": {
              "id": {
                "description": "Identification number of the plant",
                "type": "integer",
                "format": "int64"
              }
            }
          }
        ]
      },
      "Error": {
        "type": "object",
        "required": [
          "errors"
        ],
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "status",
                "title"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "description": "HTTP status code as a string"
                },
                "title": {
                  "type": "string",
                  "description": "A short, human-readable summary of the error"
                },
                "detail": {
                  "type": "string",
                  "description": "A human-readable explanation specific to this occurrence of the error"
                },
                "source": {
                  "type": "string",
                  "description": "A reference to the source of the error"
                }
              }
            }
          }
        }
      },
      "Contact": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "attributes"
            ],
            "properties": {
              "attributes": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The contact's full name"
                  },
                  "email": {
                    "type": "string",
                    "description": "The contact's primary email address"
                  },
                  "other_email": {
                    "type": "string",
                    "description": "The contact's secondary email address"
                  },
                  "first_name": {
                    "type": "string",
                    "description": "The contact's first name"
                  },
                  "middle_name": {
                    "type": "string",
                    "description": "The contact's middle name"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "The contact's last name"
                  },
                  "preferred_name": {
                    "type": "string",
                    "description": "The contact's preferred name"
                  },
                  "honorific": {
                    "type": "string",
                    "description": "The contact's honorific (e.g., Mr., Mrs., Dr.)"
                  },
                  "title": {
                    "type": "string",
                    "description": "The contact's job title"
                  },
                  "role": {
                    "type": "string",
                    "description": "The contact's role in the organization"
                  },
                  "seniority": {
                    "type": "string",
                    "description": "The contact's seniority level"
                  },
                  "bio": {
                    "type": "string",
                    "description": "The contact's biography"
                  },
                  "description": {
                    "type": "string",
                    "description": "Additional description of the contact"
                  },
                  "avatar_url": {
                    "type": "string",
                    "description": "URL to the contact's avatar image"
                  },
                  "birth_date": {
                    "type": "string",
                    "description": "The contact's birth date"
                  },
                  "phone": {
                    "type": "string",
                    "description": "The contact's primary phone number"
                  },
                  "other_phone": {
                    "type": "string",
                    "description": "The contact's secondary phone number"
                  },
                  "home_phone": {
                    "type": "string",
                    "description": "The contact's home phone number"
                  },
                  "mobile_phone": {
                    "type": "string",
                    "description": "The contact's mobile phone number"
                  },
                  "linkedin_handle": {
                    "type": "string",
                    "description": "The contact's LinkedIn handle"
                  },
                  "twitter_handle": {
                    "type": "string",
                    "description": "The contact's Twitter handle"
                  },
                  "facebook_handle": {
                    "type": "string",
                    "description": "The contact's Facebook handle"
                  },
                  "instagram_handle": {
                    "type": "string",
                    "description": "The contact's Instagram handle"
                  },
                  "city": {
                    "type": "string",
                    "description": "The contact's city"
                  },
                  "state": {
                    "type": "string",
                    "description": "The contact's state"
                  },
                  "country": {
                    "type": "string",
                    "description": "The contact's country"
                  },
                  "company_name": {
                    "type": "string",
                    "description": "The name of the contact's company"
                  },
                  "company_website": {
                    "type": "string",
                    "description": "The contact's company website"
                  },
                  "company_industry": {
                    "type": "string",
                    "description": "The contact's company industry"
                  },
                  "company_employee_count": {
                    "type": "string",
                    "description": "The contact's company employee count"
                  },
                  "company_revenue": {
                    "type": "string",
                    "description": "The contact's company revenue"
                  },
                  "company_sector": {
                    "type": "string",
                    "description": "The contact's company sector"
                  },
                  "company_phone": {
                    "type": "string",
                    "description": "The contact's company phone number"
                  },
                  "company_description": {
                    "type": "string",
                    "description": "Description of the contact's company"
                  },
                  "company_location": {
                    "type": "string",
                    "description": "Location of the contact's company"
                  },
                  "company_timezone": {
                    "type": "string",
                    "description": "Timezone of the contact's company"
                  },
                  "company_twitter_handle": {
                    "type": "string",
                    "description": "Twitter handle of the contact's company"
                  },
                  "company_linkedin_handle": {
                    "type": "string",
                    "description": "LinkedIn handle of the contact's company"
                  },
                  "company_avatar_url": {
                    "type": "string",
                    "description": "URL to the company's avatar image"
                  },
                  "company_is_icp": {
                    "type": "boolean",
                    "description": "Whether the company is an Ideal Customer Profile (ICP)"
                  },
                  "company_tech": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of technologies used by the company"
                  },
                  "lead_source": {
                    "type": "string",
                    "description": "Source of the lead"
                  },
                  "lead_score": {
                    "type": "integer",
                    "description": "Score of the lead"
                  },
                  "domain": {
                    "type": "string",
                    "description": "Domain associated with the contact"
                  },
                  "source": {
                    "type": "string",
                    "description": "Source of the contact"
                  },
                  "type": {
                    "type": "string",
                    "description": "Type of the contact"
                  },
                  "form": {
                    "type": "string",
                    "description": "Form associated with the contact"
                  },
                  "play": {
                    "type": "string",
                    "description": "Play associated with the contact"
                  },
                  "traffic_source": {
                    "type": "string",
                    "description": "Source of traffic"
                  },
                  "last_seen": {
                    "type": "string",
                    "description": "Last time the contact was seen"
                  },
                  "visits": {
                    "type": "integer",
                    "description": "Number of visits"
                  },
                  "chats": {
                    "type": "integer",
                    "description": "Number of chats"
                  },
                  "meetings": {
                    "type": "integer",
                    "description": "Number of meetings"
                  },
                  "persona": {
                    "type": "string",
                    "description": "Persona associated with the contact"
                  },
                  "custom_fields": {
                    "type": "object",
                    "description": "Custom fields associated with the contact"
                  },
                  "enriched_fields": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of enriched fields"
                  },
                  "enriched_timestamp": {
                    "type": "string",
                    "description": "Timestamp of enrichment"
                  }
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}