> ## Documentation Index
> Fetch the complete documentation index at: https://developers.nexspace365.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create new staff member

> Add a new staff member to the system. **Required API-key scope:** `staff:write`



## OpenAPI

````yaml https://api.nexspace365.com/api/openapi.json post /api/staff
openapi: 3.0.3
info:
  title: NexSpace 365 API
  description: >
    Multi-industry enterprise workforce management platform — scheduling, HR,

    payroll, CRM, AI, and messaging suites.


    ## Authentication

    Three schemes: session cookie, JWT bearer, or API key (`nex_live_…` /

    `nex_test_…` / `nex_pat_…`). AI agents should use API keys with appropriate

    scopes.


    ## Authorization

    Endpoints require specific permissions via the RBAC system:

    - **Internal team**: Full platform access

    - **Facility users**: Scoped to their org/facilities

    - **Staff**: Limited to own data


    ## Error Contract

    All errors return `{ error: { message, code?, suggestion?, retryable? },
    requestId? }`.

    The `suggestion` field hints at how to fix the request; `retryable` signals
    whether

    retry-with-backoff is appropriate.


    ## Versioning

    Pin your integration to a specific API version via the `NexSpace-Version`
    header

    (date-based, e.g. `2026-05-10`). When absent, the latest version is assumed.

    Deprecated versions include `Sunset` and `Deprecation` headers. Discovery at

    `GET /.well-known/api-versions`.


    ## Idempotency

    Write operations (POST/PUT/PATCH) accept an `Idempotency-Key` header. If

    the same key + body combination is sent again within 24 hours, the original

    response is replayed. Different body with the same key returns 409 Conflict.


    ## MCP (Model Context Protocol)

    AI agents interact via `POST /mcp` using JSON-RPC 2.0. Call `tools/list` to

    discover available verbs, then `tools/call` to invoke them.
  version: 1.0.0
  contact:
    name: NexSpace API Support
    email: support@nexspace365.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.nexspace365.com
    description: Production server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and session management
  - name: Facilities
    description: Facility management
  - name: Staff
    description: Staff member management and profiles
  - name: Credentials
    description: Staff credential tracking — licenses, certifications, and training
  - name: Shifts
    description: Shift scheduling and management
  - name: Dashboard
    description: Dashboard statistics and widgets
  - name: API Keys
    description: API key lifecycle — create, list, revoke, rotate
  - name: MCP
    description: Model Context Protocol endpoint for AI agent tool calling
  - name: OAuth
    description: OAuth 2.1 authorization server — DCR, authorize, token
  - name: Webhooks
    description: Outbound webhook subscription management
  - name: Analytics
    description: API usage analytics and observability
paths:
  /api/staff:
    post:
      tags:
        - Staff
      summary: Create new staff member
      description: >-
        Add a new staff member to the system. **Required API-key scope:**
        `staff:write`
      operationId: createStaff
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateStaffRequest'
      responses:
        '201':
          description: Staff member created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Staff'
        '400':
          description: Invalid staff data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    CreateStaffRequest:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        specialty:
          type: string
        employmentType:
          type: string
          enum:
            - full_time
            - part_time
            - contract
            - per_diem
        hourlyRate:
          type: number
          format: decimal
        yearsExperience:
          type: integer
        certifications:
          type: array
          items:
            type: string
        skills:
          type: array
          items:
            type: string
      required:
        - firstName
        - lastName
        - email
      example:
        firstName: Ada
        lastName: Lovelace
        email: ada.lovelace@acme.example.com
        phone: +1-614-555-0199
        specialty: Forklift Operator
        employmentType: full_time
        hourlyRate: 28.5
        yearsExperience: 6
        certifications:
          - Forklift Class II
          - OSHA 10
        skills:
          - Inventory
          - Pallet Jack
          - RF Scanner
    Staff:
      type: object
      properties:
        id:
          type: integer
          description: Unique staff identifier
        firstName:
          type: string
          description: First name
        lastName:
          type: string
          description: Last name
        email:
          type: string
          format: email
          description: Email address
        phone:
          type: string
          nullable: true
          description: Phone number
        specialty:
          type: string
          nullable: true
          description: Worker specialty or role classification (industry-specific)
        employmentType:
          type: string
          enum:
            - full_time
            - part_time
            - contract
            - per_diem
          nullable: true
          description: Type of employment
        hourlyRate:
          type: number
          format: decimal
          nullable: true
          description: Hourly pay rate
        yearsExperience:
          type: integer
          nullable: true
          description: Years of experience
        certifications:
          type: array
          items:
            type: string
          description: Professional certifications
        skills:
          type: array
          items:
            type: string
          description: Skills and competencies
        isActive:
          type: boolean
          description: Whether the staff member is active
        profilePhoto:
          type: string
          nullable: true
          description: URL to profile photo
        emergencyContact:
          type: object
          nullable: true
          properties:
            name:
              type: string
            phone:
              type: string
            relationship:
              type: string
        workHistory:
          type: array
          items:
            type: object
            properties:
              facility:
                type: string
              position:
                type: string
              startDate:
                type: string
                format: date
              endDate:
                type: string
                format: date
                nullable: true
              description:
                type: string
        education:
          type: array
          items:
            type: object
            properties:
              institution:
                type: string
              degree:
                type: string
              graduationYear:
                type: integer
              gpa:
                type: number
                nullable: true
      example:
        id: 42
        firstName: Ada
        lastName: Lovelace
        email: ada.lovelace@acme.example.com
        phone: +1-614-555-0199
        specialty: Forklift Operator
        employmentType: full_time
        hourlyRate: 28.5
        yearsExperience: 6
        certifications:
          - Forklift Class II
          - OSHA 10
        skills:
          - Inventory
          - Pallet Jack
          - RF Scanner
        isActive: true
        profilePhoto: null
        emergencyContact:
          name: Grace Hopper
          phone: +1-614-555-0177
          relationship: Spouse
        workHistory:
          - facility: Westside Depot
            position: Warehouse Associate
            startDate: '2020-03-01'
            endDate: '2023-11-30'
            description: Fulfillment and receiving
        education:
          - institution: Columbus State
            degree: Associate, Logistics
            graduationYear: 2019
            gpa: 3.6
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message
            code:
              type: string
              description: Machine-readable error code (e.g. VALIDATION_FAILED, NOT_FOUND)
            details:
              type: object
              description: Structured details (e.g. Zod validation issues)
            suggestion:
              type: string
              description: Hint for agents on how to recover
            retryable:
              type: boolean
              description: Whether the same request might succeed on retry
          required:
            - message
        requestId:
          type: string
          description: Correlation ID for logs and Sentry
      required:
        - error
  responses:
    UnauthorizedError:
      description: Missing, invalid, expired, or revoked credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid or revoked API key
              code: UNAUTHENTICATED
              suggestion: >-
                Send a valid `Authorization: Bearer <token>` (nex_live_/nex_pat_
                key, JWT, or OAuth access token).
              retryable: false
    InsufficientScope:
      description: >
        Authenticated, but the API key's granted scopes do not include the scope
        this operation requires (see the operation's "Required API-key scope").
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Insufficient API key scope
              code: INSUFFICIENT_SCOPE
              suggestion: >-
                Mint or rotate a key that includes the required scope, or grant
                a wildcard like `resource:*`.
              retryable: false
    RateLimited:
      description: >
        Per-key rate limit exceeded. Includes `Retry-After` and the full
        `X-RateLimit-*` set so agents can back off precisely (NEX-1659).
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Rate limit exceeded for this API key
              code: API_KEY_RATE_LIMITED
              suggestion: >-
                Wait until X-RateLimit-Reset before retrying, or batch
                operations.
              retryable: true
  headers:
    Retry-After:
      description: Seconds to wait before retrying (present on 429).
      schema:
        type: integer
    X-RateLimit-Limit:
      description: Requests allowed per window for this API key (NEX-1659).
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp (seconds) when the current window resets.
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token authentication
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: NexSpaceApiKey
      description: |
        API key or personal access token (NEX-1042). Send as
        `Authorization: Bearer <token>`. Token format:
          - `nex_live_…`  — live API key (server-to-server)
          - `nex_test_…`  — sandbox API key
          - `nex_pat_…`   — personal access token (acts as the issuing user)

        Authorization is decided by the key's `scopes` array, not the
        owning user's RBAC role. See `POST /api/api-keys` to mint a key.

````