openapi: 3.0.3
info:
  title: Everflow Network API - Employees
  description: >
    Endpoints for managing network employee accounts.
    For management details, see the [Employee Accounts guide](https://helpdesk.everflow.io/customer/how-to-manage-employee-accounts).
  version: 1.0.0
servers:
  - url: https://api.eflow.team/v1
tags:
  - name: Employees
paths:
  /networks/employees:
    get:
      summary: List Employees
      tags:
        - Employees
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Employee"
      security:
        - API Key: []
    post:
      summary: Create Employee
      tags:
        - Employees
      parameters:
        - in: query
          name: notification
          schema:
            type: boolean
            default: true
          description: Whether to send a welcome notification email to the employee. Defaults to `true` when omitted.
      requestBody:
        required: true
        content:
          application/json:
            example:
              account_status: "active"
              first_name: "Jane"
              last_name: "Smith"
              full_name: "Jane Smith"
              email: "new.employee.docs@example.com"
              is_admin: false
              is_affiliate_manager: true
              is_limited_affiliate_scope: false
              is_advertiser_manager: false
              work_phone: "555-0100"
              cell_phone: "555-0101"
              title: "Account Manager"
              network_role_id: 1
              instant_messaging_id: 0
              instant_messaging_identifier: ""
              language_id: 1
              timezone_id: 90
              currency_id: "USD"
              picture_url: ""
              is_using_email_notification: true
              is_receiving_newsletter: false
              internal_notes: ""
              network_business_unit_id: 1
              city: ""
              country_id: 0
              country_code: ""
              region_code: ""
            schema:
              type: object
              required:
                - account_status
                - first_name
                - last_name
                - email
                - language_id
                - currency_id
                - timezone_id
                - network_role_id
              properties:
                network_business_unit_id:
                  type: integer
                  description: Business unit ID for this employee.
                first_name:
                  type: string
                  description: Employee's first name.
                last_name:
                  type: string
                  description: Employee's last name.
                full_name:
                  type: string
                  description: Employee's full name.
                email:
                  type: string
                  description: Employee's email address. Must be unique across the platform.
                is_admin:
                  type: boolean
                  description: Whether the employee has administrator privileges.
                is_affiliate_manager:
                  type: boolean
                  description: Whether the employee is an affiliate manager.
                is_limited_affiliate_scope:
                  type: boolean
                  description: Whether the employee has limited affiliate scope.
                is_advertiser_manager:
                  type: boolean
                  description: Whether the employee is an advertiser manager.
                work_phone:
                  type: string
                  description: Employee's work phone number.
                cell_phone:
                  type: string
                  description: Employee's cell phone number.
                title:
                  type: string
                  description: Employee's job title.
                network_role_id:
                  type: integer
                  description: Network role ID assigned to this employee.
                instant_messaging_id:
                  type: integer
                  description: Instant messaging platform ID.
                instant_messaging_identifier:
                  type: string
                  description: Instant messaging username or identifier.
                language_id:
                  type: integer
                  description: Language ID for the employee.
                timezone_id:
                  type: integer
                  description: Timezone ID for the employee.
                currency_id:
                  type: string
                  description: ISO currency code (e.g. "USD").
                account_status:
                  type: string
                  enum:
                    - active
                    - inactive
                    - suspended
                    - pending
                  description: Employee account status.
                picture_url:
                  type: string
                  description: URL of the employee's profile picture.
                is_using_email_notification:
                  type: boolean
                  description: Whether the employee receives email notifications.
                is_receiving_newsletter:
                  type: boolean
                  description: Whether the employee receives newsletters.
                internal_notes:
                  type: string
                  description: Internal notes about the employee.
                city:
                  type: string
                  description: Employee's city.
                country_id:
                  type: integer
                  description: Country ID for the employee.
                country_code:
                  type: string
                  description: Country code for the employee.
                region_code:
                  type: string
                  description: Region code for the employee.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Employee"
      security:
        - API Key: []
  /networks/employees/{employeeId}:
    put:
      summary: Update Employee
      tags:
        - Employees
      parameters:
        - in: path
          name: employeeId
          required: true
          schema:
            type: integer
          description: The unique employee ID to update.
      requestBody:
        required: true
        content:
          application/json:
            example:
              account_status: "active"
              first_name: "Sarah"
              last_name: "Johnson"
              full_name: "Sarah Johnson"
              is_admin: false
              is_affiliate_manager: true
              is_limited_affiliate_scope: false
              is_advertiser_manager: false
              work_phone: "555-0200"
              cell_phone: "555-0201"
              title: "Senior Account Manager"
              network_role_id: 1
              instant_messaging_id: 0
              instant_messaging_identifier: ""
              language_id: 1
              timezone_id: 90
              currency_id: "USD"
              picture_url: ""
              is_using_email_notification: true
              is_receiving_newsletter: false
              internal_notes: ""
              network_business_unit_id: 1
              city: ""
              country_id: 0
              country_code: ""
              region_code: ""
            schema:
              type: object
              required:
                - account_status
                - first_name
                - last_name
                - language_id
                - currency_id
                - timezone_id
                - network_role_id
              properties:
                network_business_unit_id:
                  type: integer
                  description: Business unit ID for this employee.
                first_name:
                  type: string
                  description: Employee's first name.
                last_name:
                  type: string
                  description: Employee's last name.
                full_name:
                  type: string
                  description: Employee's full name.
                is_admin:
                  type: boolean
                  description: Whether the employee has administrator privileges.
                is_affiliate_manager:
                  type: boolean
                  description: Whether the employee is an affiliate manager.
                is_limited_affiliate_scope:
                  type: boolean
                  description: Whether the employee has limited affiliate scope.
                is_advertiser_manager:
                  type: boolean
                  description: Whether the employee is an advertiser manager.
                work_phone:
                  type: string
                  description: Employee's work phone number.
                cell_phone:
                  type: string
                  description: Employee's cell phone number.
                title:
                  type: string
                  description: Employee's job title.
                network_role_id:
                  type: integer
                  description: Network role ID assigned to this employee.
                instant_messaging_id:
                  type: integer
                  description: Instant messaging platform ID.
                instant_messaging_identifier:
                  type: string
                  description: Instant messaging username or identifier.
                language_id:
                  type: integer
                  description: Language ID for the employee.
                timezone_id:
                  type: integer
                  description: Timezone ID for the employee.
                currency_id:
                  type: string
                  description: ISO currency code (e.g. "USD").
                account_status:
                  type: string
                  enum:
                    - active
                    - inactive
                    - suspended
                    - pending
                  description: Employee account status.
                picture_url:
                  type: string
                  description: URL of the employee's profile picture.
                is_using_email_notification:
                  type: boolean
                  description: Whether the employee receives email notifications.
                is_receiving_newsletter:
                  type: boolean
                  description: Whether the employee receives newsletters.
                internal_notes:
                  type: string
                  description: Internal notes about the employee.
                city:
                  type: string
                  description: Employee's city.
                country_id:
                  type: integer
                  description: Country ID for the employee.
                country_code:
                  type: string
                  description: Country code for the employee.
                region_code:
                  type: string
                  description: Region code for the employee.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Employee"
        "404":
          description: Employee not found.
      security:
        - API Key: []
components:
  schemas:
    Employee:
      type: object
      properties:
        network_employee_id:
          type: integer
          description: Unique employee ID.
          readOnly: true
        network_id:
          type: integer
          description: Network ID this employee belongs to.
          readOnly: true
        network_business_unit_id:
          type: integer
          description: Business unit ID for this employee.
        first_name:
          type: string
          description: Employee's first name.
        last_name:
          type: string
          description: Employee's last name.
        full_name:
          type: string
          description: Employee's full name.
        email:
          type: string
          description: Employee's email address.
        is_admin:
          type: boolean
          description: Whether the employee has administrator privileges.
        is_affiliate_manager:
          type: boolean
          description: Whether the employee is an affiliate manager.
        is_limited_affiliate_scope:
          type: boolean
          description: Whether the employee has limited affiliate scope.
        is_advertiser_manager:
          type: boolean
          description: Whether the employee is an advertiser manager.
        work_phone:
          type: string
          description: Employee's work phone number.
        cell_phone:
          type: string
          description: Employee's cell phone number.
        title:
          type: string
          description: Employee's job title.
        network_role_id:
          type: integer
          description: Network role ID assigned to this employee.
        instant_messaging_id:
          type: integer
          description: Instant messaging platform ID.
        instant_messaging_identifier:
          type: string
          description: Instant messaging username or identifier.
        language_id:
          type: integer
          description: Language ID for the employee.
        timezone_id:
          type: integer
          description: Timezone ID for the employee.
        currency_id:
          type: string
          description: ISO currency code (e.g. "USD").
        account_status:
          type: string
          enum:
            - active
            - inactive
            - suspended
            - pending
          description: Employee account status.
        picture_url:
          type: string
          description: URL of the employee's profile picture.
        is_using_email_notification:
          type: boolean
          description: Whether the employee receives email notifications.
        is_receiving_newsletter:
          type: boolean
          description: Whether the employee receives newsletters.
        internal_notes:
          type: string
          description: Internal notes about the employee.
        city:
          type: string
          description: Employee's city.
        country_id:
          type: integer
          description: Country ID for the employee.
        country_code:
          type: string
          description: Country code for the employee.
        region_code:
          type: string
          description: Region code for the employee.
        time_created:
          type: integer
          example: 1734455015
          description: Unix timestamp of creation.
          readOnly: true
        time_saved:
          type: integer
          example: 1734455015
          description: Unix timestamp of last update.
          readOnly: true
        relationship:
          type: object
          description: Related data objects.
          readOnly: true
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
