> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postcode.gov.ng/llms.txt
> Use this file to discover all available pages before exploring further.

# Assemble segments into a canonical postcode



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/assembly/assemble
openapi: 3.1.0
info:
  title: NIPOST Postcode Gateway — Public API
  version: 0.1.0
  description: >
    Public API for Nigeria's national postcode system. Search and Lookup L1 are
    free; Lookup L2–L4 are commercial (credits); L5 is restricted. Authenticate
    with an API key.
servers:
  - url: https://api.postcode.gov.ng
    description: Production
  - url: http://localhost:8081
    description: Local gateway
security:
  - ApiKeyAuth: []
paths:
  /v1/assembly/assemble:
    post:
      summary: Assemble segments into a canonical postcode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Segments'
      responses:
        '200':
          description: Assembled postcode
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      postcode:
                        type: string
                        example: EK-01-A03-FK-01
                      display:
                        type: string
                        example: EK 01 A03 FK 01
                      compact:
                        type: string
                        example: EK01A03FK01
components:
  schemas:
    Segments:
      type: object
      required:
        - state
        - lga
        - district
        - area
        - unit
      properties:
        state:
          type: string
          example: EK
        lga:
          type: string
          example: '01'
        district:
          type: string
          example: A03
        area:
          type: string
          example: FK
        unit:
          type: string
          example: '01'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````