Files
plumbing/docs/list-all-staff-members.md
T

18 KiB
Executable File

List all Staff Members

Filtering

This endpoint supports result filtering. For more information on how to filter this request, go here.

OAuth Scope

This endpoint requires the following OAuth scope read_staff.

OpenAPI definition

{
  "openapi": "3.1.0",
  "info": {
    "title": "ServiceM8 API",
    "description": "Move your app forward with the ServiceM8 API\n\n\n\n## Limits and Throttling\nTo ensure continuous quality of service, API usage can be subject to throttling. The throttle will be applied once an API consumer reaches a certain \nthreshold in terms of a maximum number of requests per minute. Most clients will never hit this threshold, but those that do, will get met by a \nHTTP 429 Too Many Requests response code. \n \nThere is a limit of 180 requests per minute, if you reach this you will receive a HTTP 429 with a text body of \"Number of allowed API requests per minute exceeded\".\nThere is a limit of 20000 requests per day, if you reach this you will receive a HTTP 429 with a text body of \"Number of allowed API requests per day exceeded\".\n\nWe encourage all API developers to anticipate this error, and take appropriate measures like e.g. using a cached value from a previous call, or passing on a message to the end user that gets subjected to this behaviour (if any).\n\nLimits are per Addon per account.\n",
    "termsOfService": "https://www.servicem8.com/terms-of-service",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.servicem8.com/api_1.0"
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "oauth2": []
    }
  ],
  "paths": {
    "/staff.json": {
      "get": {
        "tags": [
          "Staff Members"
        ],
        "operationId": "listStaffMembers",
        "summary": "List all Staff Members",
        "description": "\n\t\t\t\n#### Filtering\nThis endpoint supports result filtering. For more information on how to filter this request, [go here](/docs/filtering).\n\t\t\t\n\t\t\t\n#### OAuth Scope\nThis endpoint requires the following OAuth scope **read_staff**.\n\n\t\t\t",
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "read_staff"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "An array of Staff Members",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Staff"
                  }
                },
                "examples": {
                  "success": {
                    "value": [
                      {
                        "first": "string",
                        "last": "string",
                        "email": "string",
                        "mobile": "string",
                        "lng": "number",
                        "lat": "number",
                        "geo_timestamp": "2026-03-01 12:00:00",
                        "job_title": "string",
                        "navigating_to_job_uuid": "123e4567-ed86-4242-b22f-23f949021d4b",
                        "navigating_timestamp": "2026-03-01 12:00:00",
                        "navigating_expiry_timestamp": "2026-03-01 12:00:00",
                        "color": "string",
                        "custom_icon_url": "string",
                        "status_message": "string",
                        "status_message_timestamp": "2026-03-01 12:00:00",
                        "hide_from_schedule": "string",
                        "uuid": "123e4567-ce52-4b1f-8564-23f94e82d3cb",
                        "active": 1,
                        "edit_date": "2026-03-01 12:00:00",
                        "can_receive_push_notification": "string",
                        "security_role_uuid": "123e4567-873a-46dc-b21b-23f9497ac49b",
                        "labour_material_uuid": "123e4567-bd3b-4d18-af43-23f941752a7b"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request is malformed or contains invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "badRequest": {
                    "value": {
                      "errorCode": "1000",
                      "message": "An error occurred completing your request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Authentication credentials are missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationError"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "errorCode": "401",
                      "message": "Authentication failed. Please check your API key or OAuth token."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - You don't have permission to access this resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenError"
                },
                "examples": {
                  "forbidden": {
                    "value": {
                      "errorCode": "403",
                      "message": "Access forbidden. You don't have permission to access this resource."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - You have exceeded the rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                },
                "examples": {
                  "rateLimitMinute": {
                    "value": {
                      "errorCode": 429,
                      "message": "Number of allowed API requests per minute exceeded"
                    }
                  },
                  "rateLimitDay": {
                    "value": {
                      "errorCode": 429,
                      "message": "Number of allowed API requests per day exceeded"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - An unexpected error occurred on the server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "serverError": {
                    "value": {
                      "errorCode": 500,
                      "message": "An unexpected error occurred. Please try again later."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "name": "X-Api-Key",
        "in": "header"
      },
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.servicem8.com/oauth/authorize",
            "tokenUrl": "https://api.servicem8.com/oauth/access_token",
            "scopes": {
              "staff_locations": "Access to real-time GPS information about staff",
              "staff_activity": "Access to clock on, lunch break and clock off information about staff",
              "publish_sms": "Access to send SMS messages to customers and/or staff on your behalf. Note sending SMS messages will incur account charges.",
              "publish_email": "Access to send Email messages to customers and/or staff on your behalf",
              "vendor": "Access to basic account information",
              "vendor_logo": "Access to account logo",
              "vendor_email": "Access to account holder email address",
              "read_locations": "Read-only access to Location Endpoint",
              "manage_locations": "Full access to Location Endpoint",
              "read_staff": "Read-only access to Staff Endpoint",
              "manage_staff": "Full access to Staff Endpoint",
              "read_customers": "Read-only access to Company Endpoint",
              "manage_customers": "Full access to Company Endpoint",
              "read_customer_contacts": "Read-only access to CompanyContact Endpoint",
              "manage_customer_contacts": "Full access to CompanyContact Endpoint",
              "read_jobs": "Read-only access to Job Endpoint",
              "manage_jobs": "Full access to Job Endpoint",
              "create_jobs": "Ability to create jobs on behalf of account. Note creating jobs may incur account charges.",
              "read_job_contacts": "Read-only access to JobContact Endpoint",
              "manage_job_contacts": "Full access to JobContact Endpoint",
              "read_job_materials": "Read-only access to JobMaterials Endpoint",
              "manage_job_materials": "Full access to JobMaterials Endpoint",
              "read_job_categories": "Read-only access to Categories Endpoint",
              "manage_job_categories": "Full access to Categories Endpoint",
              "read_job_queues": "Read-only access to Job Queues Endpoint",
              "manage_job_queues": "Full access to Job Queues Endpoint",
              "read_tasks": "Read-only access to Tasks Endpoint",
              "manage_tasks": "Full access to Tasks Endpoint",
              "read_schedule": "Read-only access to JobActivity Endpoint",
              "manage_schedule": "Full access to JobActivity Endpoint",
              "read_inventory": "Read-only access to Materials Endpoint",
              "manage_inventory": "Full access to Materials Endpoint",
              "read_job_notes": "Read-only access to job notes",
              "publish_job_notes": "Ability to add new job notes",
              "read_job_photos": "Read-only access to job photos",
              "publish_job_photos": "Ability to add new job photos",
              "read_attachments": "Read-only access to Attachments Endpoint",
              "manage_attachments": "Full access to Attachments Endpoint",
              "read_inbox": "Read-only access to inbox messages",
              "read_messages": "Read-only access to staff messages",
              "manage_notifications": "Ability to read notifications and mark as read",
              "manage_templates": "Full-access to email, sms and document templates",
              "manage_badges": "Full-access to create/modify job badges",
              "read_assets": "Read-only access to Assets Endpoint",
              "manage_assets": "Full access to Assets Endpoint",
              "read_knowledge_base": "Read-only access to Knowledge Base Endpoint",
              "manage_knowledge_base": "Full access to Knowledge Base Endpoint"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "number",
            "format": "int32",
            "example": "1000"
          },
          "message": {
            "type": "string",
            "example": "An error occurred completing your request"
          }
        }
      },
      "RateLimitError": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "number",
            "format": "int32",
            "example": "429"
          },
          "message": {
            "type": "string",
            "example": "Number of allowed API requests per minute exceeded"
          }
        }
      },
      "AuthenticationError": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "number",
            "format": "int32",
            "example": "401"
          },
          "message": {
            "type": "string",
            "example": "Authentication failed. Please check your API key or OAuth token."
          }
        }
      },
      "ForbiddenError": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "number",
            "format": "int32",
            "example": "403"
          },
          "message": {
            "type": "string",
            "example": "Access forbidden. You don't have permission to access this resource."
          }
        }
      },
      "Staff": {
        "type": "object",
        "properties": {
          "first": {
            "description": "Staff First Name",
            "type": "string",
            "maxLength": 30
          },
          "last": {
            "description": "Staff Last Name",
            "type": "string",
            "maxLength": 30
          },
          "email": {
            "description": "Staff Email Address. This is also your login name.",
            "format": "email",
            "type": "string"
          },
          "mobile": {
            "description": "Mobile phone number of the staff member. Used for SMS communications and identification when calling.",
            "type": "string"
          },
          "lng": {
            "description": "Longitude coordinate of the staff member's current or last known location. Used for tracking staff locations and calculating routes and travel distances.",
            "type": "number",
            "format": "float"
          },
          "lat": {
            "description": "Latitude coordinate of the staff member's current or last known location. Used for tracking staff locations and calculating routes and travel distances.",
            "type": "number",
            "format": "float"
          },
          "geo_timestamp": {
            "description": "The date and time when the staff member's geographic location (lat/lng) was last updated. Format is YYYY-MM-DD HH:MM:SS. Used to determine how recent the location data is.",
            "example": "2026-03-01 12:00:00",
            "type": "string"
          },
          "job_title": {
            "description": "The staff member's job title or role within the organization. Used for organizational purposes and displayed in various places throughout the system.",
            "type": "string"
          },
          "navigating_to_job_uuid": {
            "description": "UUID of the job the staff member is currently navigating to. Used to track which job a staff member is traveling toward.",
            "format": "uuid",
            "example": "123e4567-11b0-4089-8ab2-23f9484d54ab",
            "type": "string"
          },
          "navigating_timestamp": {
            "description": "The date and time when the staff member started navigating to a job. Format is YYYY-MM-DD HH:MM:SS. Used to track when navigation began.",
            "example": "2026-03-01 12:00:00",
            "type": "string"
          },
          "navigating_expiry_timestamp": {
            "description": "The date and time when navigation to a job is expected to complete or expire. Format is YYYY-MM-DD HH:MM:SS. Used to determine if navigation is still active.",
            "example": "2026-03-01 12:00:00",
            "type": "string"
          },
          "color": {
            "description": "The color assigned to this staff member, represented as a hex color code. Used for visual identification in the schedule, dispatch board, and other interfaces.",
            "type": "string"
          },
          "custom_icon_url": {
            "description": "DEPRECATED"
          },
          "status_message": {
            "description": "Short message summarising the staff's current status.",
            "type": "string"
          },
          "status_message_timestamp": {
            "description": "The date and time when the staff member's status message was last updated. Format is YYYY-MM-DD HH:MM:SS. Used to determine how recent the status message is.",
            "example": "2026-03-01 12:00:00",
            "type": "string"
          },
          "hide_from_schedule": {
            "description": "Boolean flag controlling whether this staff member appears in the schedule view. When true (1), the staff member is hidden from the schedule. When false (0), they appear normally in scheduling interfaces..  Valid values are [0,1]",
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "uuid": {
            "format": "uuid",
            "description": "Unique identifier for this record",
            "example": "123e4567-9fa9-46c2-9e1d-23f94b3418fb",
            "type": "string"
          },
          "active": {
            "enum": [
              0,
              1
            ],
            "type": "integer",
            "default": 1,
            "description": "Record active/deleted flag.  Valid values are [0,1]"
          },
          "edit_date": {
            "example": "2026-03-01 12:00:00",
            "readOnly": true,
            "description": "Timestamp at which record was last modified"
          },
          "can_receive_push_notification": {
            "type": "string"
          },
          "security_role_uuid": {
            "format": "uuid",
            "example": "123e4567-4ff4-4f95-8521-23f9452e9a2b",
            "type": "string"
          },
          "labour_material_uuid": {
            "format": "uuid",
            "example": "123e4567-5c47-4d54-b8e7-23f94882c18b",
            "type": "string"
          }
        },
        "required": [
          "first",
          "last",
          "email"
        ]
      }
    }
  },
  "x-speakeasy-retries": {
    "strategy": "backoff",
    "backoff": {
      "initialInterval": 500,
      "maxInterval": 60000,
      "maxElapsedTime": 3600000,
      "exponent": 1.5
    },
    "statusCodes": [
      "5XX",
      "429"
    ],
    "retryConnectionErrors": true
  },
  "tags": [
    {
      "name": "Staff Members",
      "description": "Operations related to Staff Members"
    }
  ]
}