---     
tags: 
  - Users
description: Creates a new user.
parameters:
  - in: header
    name: Authorization
    type: string
    required: true
  - in: body
    name: body
    type: object
    required: true
    schema:
      example: {
          "id": 1,
          "user_name": "Test User",
          "role": self.role.value,
          "email": "test@satsense.com",
          "phone": "09876 54321",
          "expiry_date": "20240730",
          "created_at": "2025-01-01 00:00:00 GMT",
          "last_logged_in": null,
          "layers": ["asc", "desc"],
          "map_start": null,
          "sector": null,
          "api_key": "api_key",
          "orders": [],
          "regions": [],
          "created_regions": [],
          "categories": [],
          "last_read_at": null,
          "subscriptions": 0
        }
produces: 
  - 'application/json'
responses:
  201:
    schema:
      type: object
      example: {
          "id": 5
      }
  400:
    schema:
      type: object
      example: {
        "message": "invalid portal layer"
      }
  401:
    schema:
      type: object
      properties:
        error:
          type: string
          example: 'Unauthorised'
  409:
    schema:
      type: object
      example: {
        "message": "User already exists for email.",
      }

