{
  "openapi": "3.1.0",
  "info": {
    "title": "Speq public API",
    "version": "1.0.0",
    "summary": "What Speq is, the kinds of request it runs, the fields it covers and what it costs.",
    "description": "A read-only API over Speq's public catalogue. No key, no rate limit worth mentioning, nothing private. Requests, bids, organizations and the opportunity feed are not exposed here: those are visible to signed-in suppliers in the application, and a machine asking does not change who may see them.",
    "contact": {
      "name": "Speq",
      "email": "contact@speq.pro",
      "url": "https://speq.co.il/he"
    },
    "license": {
      "name": "Content is Speq's own",
      "url": "https://speq.co.il/he/terms"
    }
  },
  "servers": [
    {
      "url": "https://speq.co.il",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Developer documentation",
    "url": "https://speq.co.il/he/docs"
  },
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "getIndex",
        "summary": "Index of the available resources.",
        "responses": {
          "200": {
            "description": "Resource index."
          }
        }
      }
    },
    "/api/v1/summary": {
      "get": {
        "operationId": "getSummary",
        "summary": "What Speq is and how a request works, in four steps.",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Response language. Hebrew is the default, as the site is Hebrew first.",
            "schema": {
              "type": "string",
              "enum": [
                "he",
                "en"
              ],
              "default": "he"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A plain description of the service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Summary"
                }
              }
            }
          },
          "400": {
            "description": "A JSON error with the same shape at every status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/request-kinds": {
      "get": {
        "operationId": "listRequestKinds",
        "summary": "The three kinds of request and what each is decided on.",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Response language. Hebrew is the default, as the site is Hebrew first.",
            "schema": {
              "type": "string",
              "enum": [
                "he",
                "en"
              ],
              "default": "he"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every request kind.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestKinds": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RequestKind"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A JSON error with the same shape at every status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fields": {
      "get": {
        "operationId": "listFields",
        "summary": "Fields with a page of their own, and what a request in each looks like.",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Response language. Hebrew is the default, as the site is Hebrew first.",
            "schema": {
              "type": "string",
              "enum": [
                "he",
                "en"
              ],
              "default": "he"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every documented field.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fields": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Field"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A JSON error with the same shape at every status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fields/{slug}": {
      "get": {
        "operationId": "getField",
        "summary": "One field, with an example request and what to put in it.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Field identifier, for example public-relations.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Response language. Hebrew is the default, as the site is Hebrew first.",
            "schema": {
              "type": "string",
              "enum": [
                "he",
                "en"
              ],
              "default": "he"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Field"
                }
              }
            }
          },
          "404": {
            "description": "A JSON error with the same shape at every status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/plans": {
      "get": {
        "operationId": "getPlans",
        "summary": "What each side pays, including the launch offer while it runs.",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Response language. Hebrew is the default, as the site is Hebrew first.",
            "schema": {
              "type": "string",
              "enum": [
                "he",
                "en"
              ],
              "default": "he"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pricing for buyers and suppliers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plans"
                }
              }
            }
          },
          "400": {
            "description": "A JSON error with the same shape at every status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "status",
              "code",
              "message"
            ],
            "properties": {
              "status": {
                "type": "integer",
                "example": 404
              },
              "code": {
                "type": "string",
                "example": "field_not_found"
              },
              "message": {
                "type": "string"
              },
              "detail": {
                "description": "Whatever helps the caller recover, such as the valid values."
              }
            }
          }
        }
      },
      "RequestKind": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "priced_items",
              "budget_brief",
              "proposal"
            ]
          },
          "decidedOn": {
            "type": "string",
            "description": "What suppliers compete on for this kind."
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "Field": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "requestKind": {
            "type": "string",
            "enum": [
              "priced_items",
              "budget_brief",
              "proposal"
            ]
          },
          "decidedOn": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "putInTheRequest": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "exampleRequest": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "lines": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Summary": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "areaServed": {
            "type": "string"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "howItWorks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "contact": {
            "type": "string"
          }
        }
      },
      "Plans": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "example": "ILS"
          },
          "buyer": {
            "type": "object"
          },
          "supplier": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}