{
  "openapi": "3.1.0",
  "info": {
    "title": "Efazi Marketplace API",
    "version": "1.0.0",
    "description": "Search the Efazi marketplace and manage your own scoped assistant connection."
  },
  "servers": [
    {
      "url": "https://efazi.com"
    }
  ],
  "paths": {
    "/agent-api/v1/catalog/{kind}": {
      "get": {
        "operationId": "searchCatalog",
        "summary": "Find marketplace listings",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "service",
                "job",
                "software"
              ]
            },
            "description": "Listing type"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Words in the listing title"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 5
            },
            "description": "Maximum results"
          },
          {
            "name": "min",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000
            },
            "description": "min listing price"
          },
          {
            "name": "max",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000
            },
            "description": "max listing price"
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      },
                      "seller": {
                        "type": "string"
                      },
                      "price_from": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/catalog/{kind}/{id}": {
      "get": {
        "operationId": "getListing",
        "summary": "Read a marketplace listing",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "service",
                "job",
                "software"
              ]
            },
            "description": "Listing type"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Numeric record ID"
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "seller": {
                      "type": "string"
                    },
                    "price_from": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": {
                      "type": "string"
                    },
                    "delivery_days": {
                      "type": "integer"
                    },
                    "extras": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "price": {}
                        }
                      }
                    },
                    "review_count": {
                      "type": "integer"
                    },
                    "seller_payment_blocked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/member/account": {
      "get": {
        "operationId": "readAccount",
        "summary": "Read your profile",
        "parameters": [],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "username": {
                      "type": "string"
                    },
                    "level": {}
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/member/orders": {
      "get": {
        "operationId": "readOrders",
        "summary": "List your recent orders",
        "parameters": [],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "order_number": {
                        "type": "string"
                      },
                      "service_id": {},
                      "software_id": {},
                      "quantity": {
                        "type": "integer"
                      },
                      "final_price": {},
                      "status": {},
                      "working_status": {},
                      "created_at": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/member/balance": {
      "get": {
        "operationId": "readBalance",
        "summary": "Read your balance",
        "parameters": [],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balance": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/member/inbox": {
      "get": {
        "operationId": "readInbox",
        "summary": "List your conversations",
        "parameters": [],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "created_at": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/member/alerts": {
      "get": {
        "operationId": "readAlerts",
        "summary": "Read notification history",
        "parameters": [],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "notification_type": {
                        "type": "string"
                      },
                      "created_at": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/member/orders/{id}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Read one of your orders",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Numeric record ID"
          }
        ],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "order_number": {
                      "type": "string"
                    },
                    "service_id": {},
                    "software_id": {},
                    "quantity": {
                      "type": "integer"
                    },
                    "final_price": {},
                    "status": {},
                    "working_status": {},
                    "created_at": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/member/inbox/{id}": {
      "get": {
        "operationId": "readThread",
        "summary": "Read recent messages in your conversation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Numeric record ID"
          }
        ],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "sender_id": {
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      },
                      "created_at": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      }
    },
    "/agent-api/v1/conversations/{id}/reply": {
      "post": {
        "operationId": "replyToConversation",
        "summary": "Send a reply in your existing conversation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Numeric record ID"
          }
        ],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "type": "integer"
                    },
                    "conversation_id": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "text",
                  "request_id"
                ]
              }
            }
          }
        },
        "x-openai-isConsequential": true
      }
    },
    "/agent-api/v1/connection": {
      "get": {
        "operationId": "inspectConnection",
        "summary": "Read this key’s label, permissions and expiry",
        "parameters": [],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "expires_at": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        }
      },
      "delete": {
        "operationId": "disconnectAgent",
        "summary": "Revoke the current assistant key",
        "parameters": [],
        "security": [
          {
            "EfaziKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. See the error and status code."
          }
        },
        "x-openai-isConsequential": true
      }
    }
  },
  "components": {
    "securitySchemes": {
      "EfaziKey": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}