{"openapi":"3.0.0","info":{"title":"Purple Suite WorkIQ API","description":"Conversational workplace-assistant API. Resembles Microsoft 365 Copilot / WorkIQ-style chat: start a session, then submit natural-language queries and receive synthesized answers with citations over the tenant's mail, calendar and collaboration data. This demo instance answers from a fixed set of canned responses rather than reasoning over live data.\n\n---\n\n**Acting as a user (`X-PS-Impersonate-User`).** Every endpoint accepts an optional `X-PS-Impersonate-User` request header whose value is the email of the instance user to act as. The effective user resolves in this order: the header if present, else the instance's configured default MCP user, else none. User-scoped paths additionally accept the literal `me` in place of an email, and Graph-style apps also serve `/me/…` twins of their `/users/{email}/…` paths that resolve the same way. This header is honored by all operations but is intentionally omitted from each operation's parameter list so it is not surfaced as a per-tool argument by MCP clients; see the `ImpersonateUser` entry under `components.parameters`.","version":"1.0.0"},"servers":[{"url":"https://marketplace.moveworks.com/api/purple-suite/workiq"}],"security":[{"patAuth":[]}],"components":{"securitySchemes":{"patAuth":{"type":"http","scheme":"bearer"}},"parameters":{"InstanceId":{"in":"header","name":"X-Instance-ID","required":true,"schema":{"type":"string"}},"ImpersonateUser":{"in":"header","name":"X-PS-Impersonate-User","required":false,"schema":{"type":"string","format":"email"},"description":"Optional. Act as a specific user in the target instance — the value is that user's email (must exist in the instance). Resolution order for the effective user: (1) this header, if set; (2) the instance's configured default MCP user; (3) otherwise no user is bound. User-scoped paths (e.g. /users/{email}/…) also accept the literal \"me\", and Graph-style apps serve /me/… twins of those paths (Graph: /me ≡ /users/{signed-in-user}) — both resolve to whatever this header (or the default MCP user) points at. An explicit path email always wins over the header. The unified MCP server does not send this header — it relies on the per-instance default — so it is primarily for direct REST/HTTP callers."}},"schemas":{"ResponseMessage":{"type":"object","properties":{"@odata.type":{"type":"string","example":"#microsoft.graph.copilotConversationResponseMessage"},"id":{"type":"string"},"text":{"type":"string"},"createdDateTime":{"type":"string","format":"date-time"},"adaptiveCards":{"type":"array","items":{}},"attributions":{"type":"array","items":{}},"references":{"type":"object"},"sensitivityLabel":{"type":"object","properties":{"sensitivityLabelId":{"type":["string","null"]},"displayName":{"type":["string","null"]},"tooltip":{"type":["string","null"]},"priority":{"type":["integer","null"]},"color":{"type":"null"}}}}},"Conversation":{"type":"object","properties":{"id":{"type":"string","example":"d72c1425-7004-48b6-b1b8-6a0e33f764a6"},"createdDateTime":{"type":"string","format":"date-time"},"displayName":{"type":"string"},"agentId":{"type":"null"},"state":{"type":"string","example":"active"},"turnCount":{"type":"integer","example":1},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ResponseMessage"}}}},"ChatRequest":{"type":"object","required":["message"],"properties":{"message":{"type":"object","required":["text"],"properties":{"text":{"type":"string","example":"Get details about the latest emails between Alice and Bob."}}},"locationHint":{"type":"object","properties":{"timeZone":{"type":"string","example":"UTC"}}}}}}},"paths":{"/conversations":{"get":{"summary":"List WorkIQ conversations","description":"Lists conversational sessions started in this instance. OData-enabled ($filter/$select/$orderby/$search/$top/$skip/$count) for the Live Data browser and MCP discovery; there is no underlying queryable workplace dataset behind the answers themselves.","parameters":[{"$ref":"#/components/parameters/InstanceId"},{"in":"query","name":"$filter","schema":{"type":"string"},"description":"OData filter expression. Comparison operators: eq, ne, gt, ge, lt, le. Logical: and, or, not, with parentheses for grouping. String functions: contains(field,'x'), startswith(field,'x'), endswith(field,'x'). Membership: field in ('a','b'). Case-insensitive matching via tolower(field) / toupper(field). Nested fields use a slash, e.g. pto_balance/vacation_days. String literals use single quotes; dates are ISO-8601. Examples: \"status eq 'active'\"; \"salary gt 50000 and department eq 'Engineering'\"; \"contains(tolower(name),'acme')\"; \"closeDate gt 2026-01-01\"."},{"in":"query","name":"$select","schema":{"type":"string"},"description":"Comma-separated list of fields to return, e.g. \"id,firstName,email\". Nested fields via slash (\"pto_balance/vacation_days\"). The id field is always included."},{"in":"query","name":"$orderby","schema":{"type":"string"},"description":"Sort clause(s), comma-separated, each \"field [asc|desc]\" (asc is the default). Example: \"createdAt desc, lastName asc\". Null values sort last."},{"in":"query","name":"$search","schema":{"type":"string"},"description":"Free-text, case-insensitive substring match across the resource's searchable fields."},{"in":"query","name":"$top","schema":{"type":"integer"},"description":"Maximum number of items to return (page size)."},{"in":"query","name":"$skip","schema":{"type":"integer"},"description":"Number of matching items to skip before returning results (offset paging). Combine with $top."},{"in":"query","name":"$count","schema":{"type":"boolean"},"description":"When true, include @odata.count (total matches after $filter/$search, before paging) in the response."}],"responses":{"200":{"description":"Paginated list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}},"nextCursor":{"type":"string","nullable":true,"description":"Cursor for the next page, or null on the last page. With $top/$skip this is the next $skip value; otherwise a keyset cursor."},"total":{"type":"integer","description":"Total documents in the collection."},"@odata.count":{"type":"integer","description":"Present only when $count=true: total matches after $filter/$search."},"@odata.truncated":{"type":"boolean","description":"Present and true only when the collection exceeded the in-memory query cap and results may be incomplete."}}}}}}}},"post":{"summary":"Create a WorkIQ conversation","description":"Starts a new conversational session. Call once per conversation, before the first /chat turn.","parameters":[{"$ref":"#/components/parameters/InstanceId"}],"responses":{"201":{"description":"Conversation created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}}}}},"/conversations/{id}":{"get":{"summary":"Get a WorkIQ conversation","description":"Fetches a conversation and its message history so far.","parameters":[{"$ref":"#/components/parameters/InstanceId"},{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Conversation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}},"404":{"description":"Conversation not found"}}}},"/conversations/{id}/chat":{"post":{"summary":"Submit a query to a WorkIQ conversation","description":"Submits a natural-language query to an existing conversation and returns a synthesized answer with citations, appended to the conversation's message history. This demo instance matches queries against a fixed set of canned answers rather than reasoning over data.","parameters":[{"$ref":"#/components/parameters/InstanceId"},{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Updated conversation, including the new turn's messages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}}},"400":{"description":"message.text is required"},"404":{"description":"Conversation not found"}}}}}}