{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":586,"path":"api-reference/rest-apis/wsd_user-api.md","title":"WSD User API","bundle":null,"doc_type":null,"release":"australia","body":"\n# WSD User API\n\nThe WSD User API is a Scripted REST API which returns the authenticated user's workplace context, including their assigned workspace location, in-office presence schedule, collaborators, and past and future reservations.\n\nThis WSD User is featured with the Workplace Service Delivery \\(WSD\\) Reservation product and provides a single-call entry point for initializing the reservation booking experience with all relevant user data. This API sits within the Workplace Service Delivery Reservation \\(com.sn\\_wsd\\_rsv\\) plugin and serves as the entry point for surfacing a user's complete workplace identity and history.\n\nAn authenticated user is someone who is logged in or whose credentials are included in the API request.\n\nCommon use cases:\n\n-   Reservation portal initialization: Load a user's home location, schedule, and booking history in a single call when opening a workplace app or portal.\n-   Custom mobile or web apps: Fetch all the user context without stitching together multiple table API calls,for example when building front-end reservation experiences.\n-   In-office presence tracking: Identify which employees are scheduled to be in-office on a given day.\n\n## Requirements\n\nThe WSD User API requires:\n\n-   At least one user record must exist with the sn\\_wsd\\_core.workplace\\_user role.\n-   The Workplace Service Delivery Concierge \\(com.sn\\_wsd\\_concierge\\), Workplace Service Delivery Core \\(com.sn\\_wsd\\_core\\), and Workplace Service Delivery Reservation \\(com.sn\\_wsd\\_rsv\\) plugins to be active.\n\n## Related APIs\n\nThe WSD User API belongs to a family of APIs all under the `sn_wsd_rsv` namespace that together support the full reservation lifecycle:\n\n-   WSD Search API: Find available reservable spaces based on location, time, and capacity criteria.\n-   WSD Reservation API: Create reservations and manage check-in/check-out.\n-   WSD Reservable Module API: Retrieve the booking rule configurations that govern what users can reserve and how.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## WSD User - GET /api/sn\\_wsd\\_rsv/v1/user/context\n\nRetrieves the authenticated user's workplace context, including their assigned workplace location, presence schedule, collaborators, and past and future reservations.\n\nUse this endpoint to initialize a reservation experience by loading all relevant user context in a single call. Collaborator data is optionally included when the com.sn\\_wsd\\_concierge plugin is active.\n\n### URL format\n\nVersioned URL: `/api/sn_wsd_rsv/{api_version}/user/context`\n\nDefault URL: `/api/sn_wsd_rsv/user/context`\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr></tbody>\n</table><table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ninclude\n\n</td><td>\n\nValue to include related data in the response. Uses strict equality matching \\(not comma-separated parsing\\).**Note:** **include** is only effective when the Workplace Service Delivery Concierge \\(com.sn\\_wsd\\_concierge\\) plugin is active. If the plugin is inactive, the parameter is ignored and `collaborators` is omitted from the response.\n\nOnly valid value: `collaborators`\n\nData type: String\n\nDefault: Excludes collaborators from the response.\n\n</td></tr><tr><td>\n\npast\\_reservations\\_months\n\n</td><td>\n\nNumber of months of past reservations to return.Data type: Number\n\nMinimum value: `0`- A value of 0 returns an empty array for that direction.\n\nMaximum value: `12`\n\nDefault value: `3`\n\n</td></tr><tr><td>\n\nfuture\\_reservations\\_months\n\n</td><td>\n\nNumber of months of future reservations to return.Data type: Number\n\nMinimum value: `0`\n\nMaximum value: `12`\n\nDefault value: `3`\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Supported types: application/json, application/xml, text/xml.|\n|Authorization|Authentication credentials. Supports Basic authentication or session-based authentication.|\n\n|Header|Description|\n|------|-----------|\n|Content-Type|Data format of the response body: application/json.|\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nObject containing results of the request.Data type: Object\n\n```\n\"result\": {\n  \"collaborators\": [Array],\n  \"reservations\": {Object},\n  \"schedule\": {Object},\n  \"workplace_location\": {Object}\n}\n```\n\n</td></tr><tr><td>\n\ncollaborators\n\n</td><td>\n\nList of the user's collaborators with their presence data.Data type: Array of Objects\n\n```\n\"collaborators\": [\n {\n  \"exceptions\": \"Array\",\n  \"name\": \"String\",\n  \"routine\": \"Object\",\n  \"sys_id\": \"String\", \n }\n]\n```\n\n</td></tr><tr><td>\n\ncollaborators.exceptions\n\n</td><td>\n\nList of dates on which the collaborator's in-office schedule deviates from their routine.Data type: Array of Objects\n\n```\n\"exceptions\": [\n {\n  \"date\": \"String\",\n  \"in_office\": Boolean,\n  \"location\": \"String\",\n  \"origin\": \"String\",\n  \"sys_id\": \"String\"\n }\n]\n```\n\n</td></tr><tr><td>\n\ncollaborators.exceptions.sys\\_id\n\n</td><td>\n\nSys\\_id of the exception record.Table: Employee presence exceptions \\(sn\\_wsd\\_concierge\\_employee\\_presence\\_exception\\)\n\nData type: String\n\n</td></tr><tr><td>\n\ncollaborators.exceptions.date\n\n</td><td>\n\nDate this exception applies to. This is the date the user's routine is being overridden.Format: yyyy-MM-dd\n\nData type: String\n\n</td></tr><tr><td>\n\ncollaborators.exceptions.in\\_office\n\n</td><td>\n\nFlag that indicates whether the user will be in the office on this date. This overrides whatever the weekly routine specifies for that day of the week.Valid values:\n\n-   `true`: User will be in the office.\n-   `false`: User won't be in the office\n\nData type: Boolean\n\n</td></tr><tr><td>\n\ncollaborators.exceptions.origin\n\n</td><td>\n\nSource that created the exception.Valid values:\n\n-   `user`: Created manually by the employee.\n-   `system`: Created automatically by the platform.\n-   `manual`: Created by an admin or on behalf of the user.\n\nData type: String\n\n</td></tr><tr><td>\n\ncollaborators.exceptions.location\n\n</td><td>\n\nName or identifier of the office location the user will be at on this date. Only relevant when `in_office` is `true`. May be an empty string when the user is remote.Data type: String\n\n</td></tr><tr><td>\n\ncollaborators.name\n\n</td><td>\n\nDisplay name of the collaborator. For example, `Jane Smith`.Data type: String\n\n</td></tr><tr><td>\n\ncollaborators.routine\n\n</td><td>\n\nThe collaborator's recurring weekly in-office schedule. Follows the same day-of-week Boolean structure as **schedule.routine**.A value of `true` indicates in-office attendance, and `false` indicates no attendance.\n\nData type: Object\n\n```\n\"routine\": {\n  \"monday\": Boolean,\n  \"tuesday\": Boolean,\n  \"wednesday\": Boolean,\n  \"thursday\": Boolean, \n  \"friday\": Boolean,\n  \"saturday\": Boolean,\n  \"sunday\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\ncollaborators.sys\\_id\n\n</td><td>\n\nSys\\_id of the collaborator's user record. Table: User \\[sys\\_user\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations\n\n</td><td>\n\nObject containing the user's past and future reservations. Private and location-less reservations are excluded. Maximum 100 reservations per direction.\n\nFiltered by states: confirmed, completed.\n\nData type: Object\n\n```\n\"reservations\": {\n  \"past\": [Array],\n  \"future\": [Array]\n}\n```\n\n</td></tr><tr><td>\n\nreservations.future\n\n</td><td>\n\nList of the user's future reservations within the requested month range. Ordered by start datetime, soonest first.Data type: Array of Object\n\n```\n\"future\": [\n {\n  \"sys_id\": \"String\",\n  \"number\": \"String\",\n  \"start\": \"String\",\n  \"end\": \"String\",\n  \"state\": \"String\",\n  \"subject\": \"String,\n  \"location\": {Object},\n  \"building\": {Object}\n }\n]\n```\n\n</td></tr><tr><td>\n\nreservations.future.building\n\n</td><td>\n\nBuilding in which the reserved location resides.Data type: Object\n\n```\n\"building\": {\n \"name\": \"String\",\n \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nreservations.future.building.name\n\n</td><td>\n\nDisplay name of the building. For example, `HQ Building A`.Data type: String\n\n</td></tr><tr><td>\n\nreservations.future.building.sys\\_id\n\n</td><td>\n\nSys\\_id of the building record.Table: Workplace Building \\[sn\\_wsd\\_core\\_building\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.future.end\n\n</td><td>\n\nEnd date time of the reservation in UTC. Format: yyyy-MM-dd HH:mm:ss\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.future.location\n\n</td><td>\n\nThe reserved space.Data type: Object\n\n```\n\"location\": {\n  \"sys_id\": \"String\",\n  \"name\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nreservations.future.location.name\n\n</td><td>\n\nDisplay name of the reserved location. For example, `Desk 42`. Data type: String\n\n</td></tr><tr><td>\n\nreservations.future.location.sys\\_id\n\n</td><td>\n\nSys\\_id of the reserved location.Table: Workplace Location \\[sn\\_wsd\\_core\\_workplace\\_location\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.future.number\n\n</td><td>\n\nHuman-readable reservation number. For example, `RSV0001234`.Data type: String\n\n</td></tr><tr><td>\n\nreservations.future.start\n\n</td><td>\n\nStart date time of the reservation in UTC.Format: yyyy-MM-dd HH:mm:ss\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.future.state\n\n</td><td>\n\nCurrent state of the reservation. Valid values:\n\n-   `confirmed`\n-   `completed`\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.future.subject\n\n</td><td>\n\nSubject or title of the reservation. For example, `Team standup desk`.Data type: String\n\n</td></tr><tr><td>\n\nreservations.future.sys\\_id\n\n</td><td>\n\nSys\\_id of the reservation record. Table: Workplace Reservation \\[sn\\_wsd\\_rsv\\_reservation\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.past\n\n</td><td>\n\nList of the user's past reservations within the requested month range. Ordered by start date/time, most recent first.Data type: Array of Objects\n\n```\n\"past\": [\n {\n  \"sys_id\": \"String\",\n  \"number\": \"String\",\n  \"start\": \"String\",\n  \"end\": \"String\",\n  \"state\": \"String\",\n  \"subject\": \"String,\n  \"location\": {Object},\n  \"building\": {Object}\n }\n]\n```\n\n</td></tr><tr><td>\n\nreservations.past.building.name\n\n</td><td>\n\nDisplay name of the building. For example, `HQ Building A`.Data type: String\n\n</td></tr><tr><td>\n\nreservations.past.building.sys\\_id\n\n</td><td>\n\nSys\\_id of the building record.Table: Workplace Building \\[sn\\_wsd\\_core\\_building\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.past.end\n\n</td><td>\n\nEnd date time of the reservation in UTC. Format: yyyy-MM-dd HH:mm:ss\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.past.location\n\n</td><td>\n\nThe reserved space.Data type: Object\n\n```\n\"location\": {\n  \"sys_id\": \"String\",\n  \"name\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nreservations.past.location.name\n\n</td><td>\n\nDisplay name of the reserved location. For example, `Desk 42`. Data type: String\n\n</td></tr><tr><td>\n\nreservations.past.location.sys\\_id\n\n</td><td>\n\nSys\\_id of the reserved location.Table: Workplace Location \\[sn\\_wsd\\_core\\_workplace\\_location\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.past.number\n\n</td><td>\n\nHuman-readable reservation number. For example, `RSV0001234`.Data type: String\n\n</td></tr><tr><td>\n\nreservations.past.start\n\n</td><td>\n\nStart date time of the reservation in UTC.Format: yyyy-MM-dd HH:mm:ss\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.past.state\n\n</td><td>\n\nCurrent state of the reservation. Valid values:\n\n-   `confirmed`\n-   `completed`\n\nData type: String\n\n</td></tr><tr><td>\n\nreservations.past.subject\n\n</td><td>\n\nSubject or title of the reservation. For example, `Team standup desk`.Data type: String\n\n</td></tr><tr><td>\n\nreservations.past.sys\\_id\n\n</td><td>\n\nSys\\_id of the reservation record. Table: Workplace Reservation \\[sn\\_wsd\\_rsv\\_reservation\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nschedule\n\n</td><td>\n\nUser's in-office presence schedule, including their recurring weekly routine and any exceptions.**Note:** When the com.sn\\_wsd\\_concierge plugin is inactive, routine is null and exceptions is an empty array.\n\nData type: Object\n\n```\n\"schedule\": {\n  \"exceptions\": [Array],\n  \"routine\": {Object}\n}\n```\n\n</td></tr><tr><td>\n\nschedule.exceptions\n\n</td><td>\n\nList of dates on which the user's in-office schedule deviates from their routine.Data type: Array of Objects\n\n```\n\"exceptions\": [\n{\n  \"sys_id\": \"sys_id\", \n  \"date\": \"String\", \n  \"in_office\": Boolean, \n  \"origin\": \"String\", \n  \"location\": \"String\" \n }\n]\n```\n\n</td></tr><tr><td>\n\nschedule.exceptions.date\n\n</td><td>\n\nDate this exception applies to, in yyyy-MM-dd format. This is the date the user's routine is being overridden.Data type: String\n\n</td></tr><tr><td>\n\nschedule.exceptions.in\\_office\n\n</td><td>\n\nFlag that indicates whether the user will be in the office on this date. This overrides whatever the schedule specifies for that day of the week.Valid values:\n\n-   `true`: User will be in the office.\n-   `false`: User won't be in the office\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nschedule.exceptions.location\n\n</td><td>\n\nThe name or identifier of the office location the user will be at on this date. Only relevant when `in_office` is `true`. May be an empty string when the user is remote.Data type: String\n\n</td></tr><tr><td>\n\nschedule.exceptions.origin\n\n</td><td>\n\nSource that created the exception.Valid values:\n\n-   `user`: Created manually by the employee.\n-   `system`: Created automatically by the platform.\n-   `manual`: Created by an admin or on behalf of the user.\n\nData type: String\n\n</td></tr><tr><td>\n\nschedule.exceptions.sys\\_id\n\n</td><td>\n\nSys\\_id of the exception record.Table: Employee presence exceptions \\(sn\\_wsd\\_concierge\\_employee\\_presence\\_exception\\)\n\nData type: String\n\n</td></tr><tr><td>\n\nschedule.routine\n\n</td><td>\n\nUser's recurring weekly in-office schedule. Each field is a Boolean which represents a day of the week and indicates whether the user is scheduled to be in-office on that day.A value of `true` indicates in-office attendance, and `false` indicates no attendance.\n\nData type: Object\n\n```\n\"routine\": {\n  \"monday\": Boolean,\n  \"tuesday\": Boolean,\n  \"wednesday\": Boolean,\n  \"thursday\": Boolean, \n  \"friday\": Boolean,\n  \"saturday\": Boolean,\n  \"sunday\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nworkplace\\_location\n\n</td><td>\n\nThe user's assigned workplace location, including floor, building, and campus details.Data type: Object\n\n```\n\"workplace_location\": {\n  \"building\": {Object},\n  \"campus\": {Object},\n  \"floor\": {Object},\n  \"name\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nworkplace\\_location.building\n\n</td><td>\n\nBuilding in which the workplace location resides. Data type: Object\n\n```\n\"building\": {\n  \"name\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nworkplace\\_location.building.name\n\n</td><td>\n\nDisplay name of the building. For example, `HQ Building A`. Data type: String\n\n</td></tr><tr><td>\n\nworkplace\\_location.building.sys\\_id\n\n</td><td>\n\nSys\\_id of the building record. Table: Workplace Building \\[sn\\_wsd\\_core\\_building\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nworkplace\\_location.campus\n\n</td><td>\n\nCampus on which the building resides. Data type: Object\n\n```\n\"campus\": {\n  \"name\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nworkplace\\_location.campus.name\n\n</td><td>\n\nDisplay name of the campus. For example, `Main Campus`.Data type: String\n\n</td></tr><tr><td>\n\nworkplace\\_location.campus.sys\\_id\n\n</td><td>\n\nSys\\_id of the campus record.Table: Workplace Campus \\[sn\\_wsd\\_core\\_campus\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nworkplace\\_location.floor\n\n</td><td>\n\nFloor on which the workplace location resides. Data type: Object\n\n```\n\"floor\": {\n  \"name\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nworkplace\\_location.floor.name\n\n</td><td>\n\nDisplay name of the floor. For example, `Floor 3`. Data type: String\n\n</td></tr><tr><td>\n\nworkplace\\_location.floor.sys\\_id\n\n</td><td>\n\nSys\\_id of the floor record. Table: Workplace Floor \\[sn\\_wsd\\_core\\_floor\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nworkplace\\_location.name\n\n</td><td>\n\nDisplay name of the user's assigned workplace location. For example, `Desk 42 - Floor 3`. Data type: String\n\n</td></tr><tr><td>\n\nworkplace\\_location.sys\\_id\n\n</td><td>\n\nSys\\_id of the user's assigned workplace location. Table: Workplace Location \\[sn\\_wsd\\_core\\_workplace\\_location\\]\n\nData type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example retrieves the authenticated user's full workplace context, including collaborators, 1 month of past reservations, and 6 months of future reservations.\n\nThis example uses Basic authentication. If your instance uses SSO, use a bearer token or session cookie instead. See the 'Headers' table for details.\n\n```\ncurl \"https://<instance>.service-now.com/api/sn_wsd_rsv/v1/user/context?include=collaborators&past_reservations_months=1&future_reservations_months=6\" \\\n  --request GET \\\n  --header \"Accept: application/json\" \\\n  --user \"username:password\"\n```\n\nResponse body.\n\n```\n{\n  \"result\": {\n    \"workplace_location\": {\n      \"sys_id\": \"a1b2c3d4e5f6g7h8\",\n      \"name\": \"Desk 42 - Floor 3\",\n      \"floor\": { \"sys_id\": \"f1a2b3c4\", \"name\": \"Floor 3\" },\n      \"building\": { \"sys_id\": \"b1c2d3e4\", \"name\": \"HQ Building A\" },\n      \"campus\": { \"sys_id\": \"c1d2e3f4\", \"name\": \"Main Campus\" }\n    },\n    \"schedule\": {\n      \"routine\": {\n        \"monday\": true, \"tuesday\": true, \"wednesday\": false,\n        \"thursday\": true, \"friday\": false, \"saturday\": false, \"sunday\": false\n      },\n      \"exceptions\": []\n    },\n    \"collaborators\": [\n      {\n        \"sys_id\": \"d4e5f6g7\",\n        \"name\": \"Jane Smith\",\n        \"routine\": { \"monday\": true, \"tuesday\": false, \"wednesday\": true,\n                     \"thursday\": true, \"friday\": false, \"saturday\": false, \"sunday\": false },\n        \"exceptions\": []\n      }\n    ],\n    \"reservations\": {\n      \"past\": [\n        {\n          \"sys_id\": \"r1e2s3v4\",\n          \"number\": \"RSV0001234\",\n          \"start\": \"2026-04-01 09:00:00\",\n          \"end\": \"2026-04-01 17:00:00\",\n          \"state\": \"completed\",\n          \"subject\": \"Team standup desk\",\n          \"location\": { \"sys_id\": \"l1o2c3\", \"name\": \"Desk 42\" },\n          \"building\": { \"sys_id\": \"b1c2d3e4\", \"name\": \"HQ Building A\" }\n        }\n      ],\n      \"future\": []\n    }\n  }\n}\n```\n\n"}}