openapi: 3.0.0 info: title: API Kode Wilayah Indonesia version: 1.0.0 description: REST API untuk mengakses data kode wilayah pemerintahan Indonesia servers: - url: http://localhost/api/v1 description: Development server components: securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: AuthRequest: type: object required: - public_key - private_key properties: public_key: type: string example: pk_test_12345 private_key: type: string example: sk_test_67890 AuthResponse: type: object properties: success: type: boolean token: type: string expires_in: type: integer WilayahResponse: type: object properties: success: type: boolean data: type: array items: type: object properties: kode: type: string nama: type: string pagination: type: object properties: page: type: integer limit: type: integer total: type: integer total_pages: type: integer rate_limit: type: object properties: limit: type: integer remaining: type: integer paths: /auth: post: summary: Generate JWT Token tags: - Authentication requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AuthRequest' responses: '200': description: Token generated successfully content: application/json: schema: $ref: '#/components/schemas/AuthResponse' '401': description: Invalid credentials /wilayah: get: summary: Get wilayah data tags: - Wilayah security: - BearerAuth: [] parameters: - name: type in: query schema: type: string enum: [provinsi, kabupaten, kecamatan, kelurahan] default: provinsi - name: search in: query schema: type: string description: Search by nama - name: parent_id in: query schema: type: string description: Filter by parent kode - name: page in: query schema: type: integer default: 1 - name: limit in: query schema: type: integer default: 10 maximum: 100 responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/WilayahResponse' '401': description: Unauthorized '429': description: Rate limit exceeded