openapi: 3.0.3 info: title: AgStack Asset Registry api Field Registration (POST) API version: 1.0.0 description: 'Welcome to the **AgStack Asset Registry** developer portal. --- ## 🔐 Authentication Guide | Service Zone | HTTP Method | Credential Type | | :--- | :---: | :--- | | **Authentication** | `GET/POST` | **Bearer Token** (where applicable) | | **Field Registration** | `POST` | **Bearer Token** | | **Field Retrieval** | `GET/POST`| **Bearer Token** (where applicable) | > 🚀 **Quick Start Guide** > 1. Login via `/login` to get an `access_token` and `refresh_token`. > 2. Use `Bearer_Token` (Lock Icon) to authorize protected routes. ' servers: - url: https://api-ar.agstack.org description: Production Server tags: - name: Field Registration (POST) paths: /register-field-boundary: post: tags: - Field Registration (POST) summary: 📍 Register Field Boundary (WKT) security: - Bearer_Token: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegisterFieldWKTRequest' responses: '200': description: Field Boundary registered successfully or already exists. '400': $ref: '#/components/responses/ErrorResponse' /register-field-boundaries-geojson: post: tags: - Field Registration (POST) summary: 📂 Bulk Register Field Boundaries (GeoJSON File) description: "Bulk register Field Boundaries using a GeoJSON FeatureCollection. \nSupports both multipart file upload (`.geojson`) and raw JSON body.\n" security: - Bearer_Token: [] requestBody: required: true content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: Upload a valid .geojson file responses: '200': description: Bulk registration completed content: application/json: schema: type: object properties: message: type: string results: type: array items: type: object '400': $ref: '#/components/responses/ErrorResponse' /register-point: post: tags: - Field Registration (POST) summary: 🎯 Register a Point security: - Bearer_Token: [] requestBody: required: true content: application/json: schema: type: object required: - wkt properties: wkt: type: string example: POINT(75.78209 30.90706) s2_index: type: string example: 8,13 responses: '200': description: Point registered successfully '400': $ref: '#/components/responses/ErrorResponse' /register-points-geojson: post: tags: - Field Registration (POST) summary: 📂 Bulk Register Points (GeoJSON) description: "Bulk register points using a GeoJSON FeatureCollection. \nSupports both multipart file upload (`.geojson`) and raw JSON body.\n" security: - Bearer_Token: [] requestBody: required: true content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: Upload a valid .geojson file containing Point features. application/json: schema: $ref: '#/components/schemas/GeoJSONFeatureCollection' responses: '200': description: Bulk point registration completed content: application/json: schema: type: object properties: message: type: string example: Bulk point registration completed results: type: array items: $ref: '#/components/schemas/BulkPointResult' '400': $ref: '#/components/responses/ErrorResponse' components: schemas: RegisterFieldWKTRequest: type: object required: - wkt properties: wkt: type: string example: POLYGON((75.78209 30.90706, 75.78211 30.90645, 75.78270 30.90654, 75.78262 30.90714, 75.78209 30.90706)) threshold: type: integer default: 95 description: Percentage overlap threshold return_s2_indices: type: boolean default: false s2_index: type: string example: 8,13 description: Comma-separated list of resolution levels GeoJSONFeatureCollection: type: object required: - type - features properties: type: type: string enum: - FeatureCollection features: type: array items: type: object required: - geometry properties: type: type: string example: Feature geometry: type: object required: - type - coordinates properties: type: type: string enum: - Point coordinates: type: array items: type: number example: - 75.78209 - 30.90706 properties: type: object description: Optional properties like s2_index properties: s2_index: type: string example: 8,13 BulkPointResult: type: object properties: status: type: string example: created message: type: string example: Point registered successfully. Geo Id: type: string Geo JSON: type: object responses: ErrorResponse: description: Generic Error Response content: application/json: schema: type: object properties: message: type: string example: Error description error: type: string example: Detailed exception message securitySchemes: Bearer_Token: type: http scheme: bearer bearerFormat: JWT description: '**Required for most operations.** 1. Login via `/login` to get token. 2. Paste access token here. '