name: Authentication
description: |-

  API endpoints for user authentication and token management
endpoints:
  -
    custom: []
    httpMethods:
      - POST
    uri: api/v1/auth/login
    metadata:
      custom: []
      groupName: Authentication
      groupDescription: |-

        API endpoints for user authentication and token management
      subgroup: ''
      subgroupDescription: ''
      title: Login
      description: 'Authenticate user and generate API token'
      authenticated: true
      deprecated: false
    headers:
      Authorization: 'Bearer YOUR_TOKEN_HERE'
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters:
      email:
        custom: []
        name: email
        description: "User's email address."
        required: true
        example: waiter@restaurant.com
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
      password:
        custom: []
        name: password
        description: "User's password."
        required: true
        example: password123
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
      device_name:
        custom: []
        name: device_name
        description: 'optional Device name for token identification.'
        required: false
        example: 'iPad POS Station 1'
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: true
        deprecated: false
    cleanBodyParameters:
      email: waiter@restaurant.com
      password: password123
      device_name: 'iPad POS Station 1'
    fileParameters: []
    responses:
      -
        custom: []
        status: 200
        content: |-
          {
            "success": true,
            "message": "Login successful",
            "data": {
              "user": {
                "id": 1,
                "name": "John Doe",
                "email": "waiter@restaurant.com",
                "role": "waiter",
                "tenant_id": "uuid"
              },
              "token": "1|abc123...",
              "token_type": "Bearer"
            }
          }
        headers: []
        description: ''
      -
        custom: []
        status: 401
        content: |-
          {
            "success": false,
            "message": "Invalid credentials",
            "error_code": "UNAUTHORIZED"
          }
        headers: []
        description: ''
    responseFields: []
    auth:
      - headers
      - Authorization
      - 'Bearer 6g43cv8PD1aE5beadkZfhV6'
    controller: null
    method: null
    route: null
  -
    custom: []
    httpMethods:
      - POST
    uri: api/v1/auth/register
    metadata:
      custom: []
      groupName: Authentication
      groupDescription: |-

        API endpoints for user authentication and token management
      subgroup: ''
      subgroupDescription: ''
      title: Register
      description: 'Register a new staff member (requires existing tenant)'
      authenticated: true
      deprecated: false
    headers:
      Authorization: 'Bearer YOUR_TOKEN_HERE'
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters:
      tenant_id:
        custom: []
        name: tenant_id
        description: 'Tenant/Restaurant ID.'
        required: true
        example: uuid
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
      name:
        custom: []
        name: name
        description: "User's full name."
        required: true
        example: 'Jane Smith'
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
      email:
        custom: []
        name: email
        description: "User's email address."
        required: true
        example: jane@restaurant.com
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
      password:
        custom: []
        name: password
        description: "User's password (min 8 characters)."
        required: true
        example: password123
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
      phone:
        custom: []
        name: phone
        description: "optional User's phone number."
        required: false
        example: '+1234567890'
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: true
        deprecated: false
      role:
        custom: []
        name: role
        description: "User's role."
        required: true
        example: waiter
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
    cleanBodyParameters:
      tenant_id: uuid
      name: 'Jane Smith'
      email: jane@restaurant.com
      password: password123
      phone: '+1234567890'
      role: waiter
    fileParameters: []
    responses:
      -
        custom: []
        status: 201
        content: |-
          {
            "success": true,
            "message": "Registration successful",
            "data": {
              "user": {
                "id": 2,
                "name": "Jane Smith",
                "email": "jane@restaurant.com"
              }
            }
          }
        headers: []
        description: ''
    responseFields: []
    auth:
      - headers
      - Authorization
      - 'Bearer 6g43cv8PD1aE5beadkZfhV6'
    controller: null
    method: null
    route: null
  -
    custom: []
    httpMethods:
      - GET
    uri: api/v1/auth/me
    metadata:
      custom: []
      groupName: Authentication
      groupDescription: |-

        API endpoints for user authentication and token management
      subgroup: ''
      subgroupDescription: ''
      title: 'Get Current User'
      description: "Get authenticated user's profile information"
      authenticated: true
      deprecated: false
    headers:
      Authorization: 'Bearer YOUR_TOKEN_HERE'
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        custom: []
        status: 200
        content: |-
          {
            "success": true,
            "data": {
              "id": 1,
              "name": "John Doe",
              "email": "waiter@restaurant.com",
              "role": "waiter",
              "tenant_id": "uuid",
              "status": "active"
            }
          }
        headers: []
        description: ''
    responseFields: []
    auth:
      - headers
      - Authorization
      - 'Bearer 6g43cv8PD1aE5beadkZfhV6'
    controller: null
    method: null
    route: null
  -
    custom: []
    httpMethods:
      - POST
    uri: api/v1/auth/logout
    metadata:
      custom: []
      groupName: Authentication
      groupDescription: |-

        API endpoints for user authentication and token management
      subgroup: ''
      subgroupDescription: ''
      title: Logout
      description: 'Revoke current access token'
      authenticated: true
      deprecated: false
    headers:
      Authorization: 'Bearer YOUR_TOKEN_HERE'
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        custom: []
        status: 200
        content: |-
          {
            "success": true,
            "message": "Logout successful"
          }
        headers: []
        description: ''
    responseFields: []
    auth:
      - headers
      - Authorization
      - 'Bearer 6g43cv8PD1aE5beadkZfhV6'
    controller: null
    method: null
    route: null
  -
    custom: []
    httpMethods:
      - POST
    uri: api/v1/auth/refresh
    metadata:
      custom: []
      groupName: Authentication
      groupDescription: |-

        API endpoints for user authentication and token management
      subgroup: ''
      subgroupDescription: ''
      title: 'Refresh Token'
      description: 'Generate a new token and revoke the current one'
      authenticated: true
      deprecated: false
    headers:
      Authorization: 'Bearer YOUR_TOKEN_HERE'
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters:
      device_name:
        custom: []
        name: device_name
        description: 'optional New device name.'
        required: false
        example: 'iPad POS Station 1'
        type: string
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
    cleanBodyParameters:
      device_name: 'iPad POS Station 1'
    fileParameters: []
    responses:
      -
        custom: []
        status: 200
        content: |-
          {
            "success": true,
            "message": "Token refreshed successfully",
            "data": {
              "token": "2|xyz789...",
              "token_type": "Bearer"
            }
          }
        headers: []
        description: ''
    responseFields: []
    auth:
      - headers
      - Authorization
      - 'Bearer 6g43cv8PD1aE5beadkZfhV6'
    controller: null
    method: null
    route: null
  -
    custom: []
    httpMethods:
      - GET
    uri: api/v1/auth/devices
    metadata:
      custom: []
      groupName: Authentication
      groupDescription: |-

        API endpoints for user authentication and token management
      subgroup: ''
      subgroupDescription: ''
      title: 'List Devices'
      description: 'Get list of all active tokens/devices for the user'
      authenticated: true
      deprecated: false
    headers:
      Authorization: 'Bearer YOUR_TOKEN_HERE'
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        custom: []
        status: 200
        content: |-
          {
            "success": true,
            "data": [
              {
                "id": 1,
                "name": "iPad POS Station 1",
                "last_used_at": "2025-11-11T10:30:00Z",
                "created_at": "2025-11-10T09:00:00Z"
              }
            ]
          }
        headers: []
        description: ''
    responseFields: []
    auth:
      - headers
      - Authorization
      - 'Bearer 6g43cv8PD1aE5beadkZfhV6'
    controller: null
    method: null
    route: null
  -
    custom: []
    httpMethods:
      - DELETE
    uri: 'api/v1/auth/devices/{tokenId}'
    metadata:
      custom: []
      groupName: Authentication
      groupDescription: |-

        API endpoints for user authentication and token management
      subgroup: ''
      subgroupDescription: ''
      title: 'Revoke Device Token'
      description: 'Logout from a specific device by revoking its token'
      authenticated: true
      deprecated: false
    headers:
      Authorization: 'Bearer YOUR_TOKEN_HERE'
      Content-Type: application/json
      Accept: application/json
    urlParameters:
      tokenId:
        custom: []
        name: tokenId
        description: 'The token ID to revoke.'
        required: true
        example: 1
        type: integer
        enumValues: []
        exampleWasSpecified: true
        nullable: false
        deprecated: false
    cleanUrlParameters:
      tokenId: 1
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        custom: []
        status: 200
        content: |-
          {
            "success": true,
            "message": "Device token revoked successfully"
          }
        headers: []
        description: ''
    responseFields: []
    auth:
      - headers
      - Authorization
      - 'Bearer 6g43cv8PD1aE5beadkZfhV6'
    controller: null
    method: null
    route: null
