---
agentTools:
  projectIndex: https://docs.qdelivery.app/llms.txt
---

# Create

Example Request Data

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Integration",
    "version": "1.6.1"
  },
  "servers": [
    {
      "url": "https://api.dev.qdelivery.app/api/integration"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/hubs": {
      "post": {
        "summary": "Create",
        "description": "",
        "operationId": "create-hub",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "address",
                  "lat",
                  "lng"
                ],
                "properties": {
                  "integration_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "address_building": {
                    "type": "string"
                  },
                  "address_floor": {
                    "type": "string"
                  },
                  "address_apartment": {
                    "type": "string"
                  },
                  "lat": {
                    "type": "number",
                    "description": "Example: 43.223643 Must be 6 decimals as in the example.",
                    "format": "float"
                  },
                  "lng": {
                    "type": "number",
                    "description": "Example: 43.223643 Must be 6 decimals as in the example.",
                    "format": "float"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "teams": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "tags": {
                          "type": "array",
                          "default": [],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "name"
                      ],
                      "type": "object"
                    }
                  },
                  "default_service_time": {
                    "type": "integer",
                    "description": "Min: 1",
                    "format": "int32"
                  },
                  "default_tag": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                }
              },
              "examples": {
                "Example Request Data": {
                  "value": {
                    "integration_id": "364",
                    "name": "Ataşehir 1034",
                    "address": "Alanaldı Cad. Aldemir Sk. No:3/1 İçerenköy, İçerenköy, 34752 Ataşehir/İstanbul, Türkiye",
                    "address_building": "1",
                    "address_apartment": "1",
                    "address_floor": "1",
                    "lat": 40.972091,
                    "lng": 29.109985,
                    "tags": [
                      "İstanbul",
                      "Ataşehir",
                      "İçerenköy"
                    ],
                    "teams": [
                      {
                        "name": "Team2",
                        "tags": [
                          "Merhaba",
                          "Dünya"
                        ]
                      }
                    ],
                    "default_service_time": 1,
                    "default_tag": "default tag"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"id\": 11,\n  \"integration_id\": \"364\",\n\t\"name\": \"Ataşehir 1034\",\n\t\"address\": \"Alanaldı Cad. Aldemir Sk. No:3\\/1 İçerenköy, İçerenköy, 34752 Ataşehir\\/İstanbul, Türkiye\",\n\t\"address_building\": \"1\",\n\t\"address_apartment\": \"1\",\n\t\"address_floor\": \"1\",\n\t\"lat\": 40.972091,\n\t\"lng\": 29.109985,\n\t\"teams_count\": 1,\n\t\"created_at\": \"2022-05-11T12:53:19.000000Z\",\n\t\"updated_at\": \"2022-05-11T12:53:19.000000Z\",\n\t\"teams\": [\n\t\t{\n\t\t\t\"id\": 40,\n\t\t\t\"hub_id\": 11,\n\t\t\t\"name\": \"Team2\",\n\t\t\t\"couriers_count\": 0,\n\t\t\t\"tags\": [],\n\t\t\t\"created_at\": \"2022-05-11T12:53:19.000000Z\",\n\t\t\t\"updated_at\": \"2022-05-11T12:53:19.000000Z\"\n\t\t}\n\t],\n\t\"tags\":[\"İstanbul\",\"Ataşehir\",\"İçerenköy\"],\n  \"default_service_time\": 1,\n  \"default_tag\": \"default tag\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "example": 11,
                      "default": 0
                    },
                    "integration_id": {
                      "type": "string",
                      "example": "364"
                    },
                    "name": {
                      "type": "string",
                      "example": "Ataşehir 1034"
                    },
                    "address": {
                      "type": "string",
                      "example": "Alanaldı Cad. Aldemir Sk. No:3/1 İçerenköy, İçerenköy, 34752 Ataşehir/İstanbul, Türkiye"
                    },
                    "address_building": {
                      "type": "string",
                      "example": "1"
                    },
                    "address_apartment": {
                      "type": "string",
                      "example": "1"
                    },
                    "address_floor": {
                      "type": "string",
                      "example": "1"
                    },
                    "lat": {
                      "type": "number",
                      "example": 40.972091,
                      "default": 0
                    },
                    "lng": {
                      "type": "number",
                      "example": 29.109985,
                      "default": 0
                    },
                    "teams_count": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2022-05-11T12:53:19.000000Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2022-05-11T12:53:19.000000Z"
                    },
                    "teams": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 40,
                            "default": 0
                          },
                          "hub_id": {
                            "type": "integer",
                            "example": 11,
                            "default": 0
                          },
                          "name": {
                            "type": "string",
                            "example": "Team2"
                          },
                          "couriers_count": {
                            "type": "integer",
                            "example": 0,
                            "default": 0
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {}
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "example": "2022-05-11T12:53:19.000000Z"
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2022-05-11T12:53:19.000000Z"
                          }
                        }
                      }
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "İstanbul"
                      }
                    },
                    "default_service_time": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "default_tag": {
                      "type": "string",
                      "example": "default tag"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6602b1495613fc002042a788:6602b14a5613fc002042a7ab"
}
```