Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Presify public OAuth API
version: 26.11.8
summary: 'Microsoft Teams presence tracker: OAuth 2.0 authorization server, MCP endpoint, discovery documents.'
description: 'Presify is a Microsoft Teams presence tracker: it keeps presence history (who was online, when, and for how long) for owners, managers, and team leads on Microsoft 365.
This document describes the PUBLIC machine surface. Tenant data is read through the Model Context Protocol endpoint (`POST /api/mcp`), which authenticates with OAuth 2.0 (authorization code + PKCE; a client identifies itself through dynamic client registration or an OAuth Client ID Metadata Document) or a personal access token. Every MCP tool is a pure read, scoped to what the connected person may see in Presify. There is no REST resource API for tenant data; the browser app''s session-cookie routes are not a supported integration surface and are not listed here.
Public documents: `/llms.txt` (site index for AI assistants, with when-to-use guidance), `/sitemap.xml`, `/.well-known/security.txt`. Public pages answer `Accept: text/markdown` with a Markdown representation (`Vary: Accept`). Unknown paths return a real 404 (JSON under `/api/`, Markdown for machine clients, HTML for browsers); an unsupported method on a `/api/` route returns a JSON 405 with an `Allow` header.
## Versioning and deprecation
The paths in this document are permanent contracts: `/api/mcp`, the `/api/oauth/*` endpoints and the `/.well-known/*` documents never move or change shape incompatibly. There is no URL version segment. The MCP endpoint is versioned by the `MCP-Protocol-Version` header (the server negotiates down to the newest revision at or below the one requested, and keeps serving older supported revisions). If an operation or protocol revision is ever retired, every affected response carries `Deprecation` (RFC 9745) and `Sunset` (RFC 8594) headers plus a `Link` with rel="deprecation" for at least 90 days before removal, the operation is marked `deprecated: true` here first, and after the sunset date it answers 410 Gone. Those headers are declared on every 2xx response below; none is sent today. New optional fields and new operations are added without notice. Full policy: https://presify.io/docs/api-versioning
## Rate limits
Every `/api/mcp` response, including the unauthenticated handshake (initialize, ping, resources/list, resources/read) and the 401 challenge, carries IETF RateLimit header fields: `RateLimit-Policy` (both windows: 60 requests per minute per grant and 300 per minute per tenant, 2x burst) and `RateLimit` (remaining requests and seconds to full refill for the tighter window), plus the legacy `RateLimit-Limit` / `RateLimit-Remaining` / `RateLimit-Reset` trio. A 429 adds `Retry-After`. Client registration is throttled per IP (429 with `Retry-After`).
The edge also caps each client IP at 2,000 requests per 5 minutes across the whole site; over it, CloudFront answers 429 with a text/html page (not JSON-RPC), `Retry-After: 300` and no RateLimit fields. Edge security rules can also refuse a request with a text/html 403 before it reaches the app, for example a request without a User-Agent header or with a body over 8 KB.
Support: support@presify.io, Monday to Friday, 9am to 5pm US Eastern. Legal: https://presify.io/legal/terms, https://presify.io/legal/privacy.'
termsOfService: https://presify.io/legal/terms
contact:
name: Presify support
url: https://presify.io/contact
email: support@presify.io
servers:
- url: https://app.presify.io
description: 'Canonical API host: OAuth 2.0 issuer and MCP resource.'
- url: https://presify.io
description: Public website. The discovery and document endpoints also answer here.
tags:
- name: OAuth
description: OAuth 2.0 authorization server for the MCP connector.
paths:
/api/oauth/register:
post:
operationId: registerOAuthClient
tags:
- OAuth
summary: Dynamic client registration (RFC 7591)
description: 'Open registration: no initial access token is required. Redirect URIs must be https, or http on localhost for development. Public clients (token_endpoint_auth_method "none") receive no secret; confidential clients receive a client_secret exactly once. Registration is throttled per IP and unused clients are cleaned up nightly.'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ClientRegistrationRequest'
responses:
'201':
description: Client created.
content:
application/json:
schema:
$ref: '#/components/schemas/ClientRegistrationResponse'
headers:
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
'400':
description: Invalid registration request (invalid_client_metadata, invalid_redirect_uri).
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthError'
'429':
description: Registration throttled for this IP.
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthError'
/api/oauth/authorize:
get:
operationId: authorize
tags:
- OAuth
summary: Authorization endpoint (authorization code + PKCE)
description: 'Browser entry point of the authorization-code flow. Validates the request, then sends the person to Microsoft sign-in (if needed) and the Presify consent page; on approval the browser is redirected to redirect_uri with `code` and `state`. PKCE with S256 is required. A client_id that is an https URL names a Client ID Metadata Document: Presify fetches it (https only, public addresses only, no redirects, at most 5 KB, cached per its Cache-Control), and a document it cannot fetch or validate is treated as an unknown client. An unknown client_id, an unregistered redirect_uri, or any error for a redirect_uri Presify has not verified (anything other than a known AI assistant callback or a loopback address) renders a local error page and never redirects (open-redirect guard); for a verified or loopback redirect_uri, errors redirect back to the client with `error` and `error_description`.'
parameters:
- name: response_type
in: query
required: true
description: Must be `code`.
schema:
type: string
enum:
- code
- name: client_id
in: query
required: true
description: 'Client identifier: the UUID from dynamic client registration, or the https URL of the client''s Client ID Metadata Document.'
schema:
oneOf:
- type: string
format: uuid
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
description: Client registered through dynamic client registration (RFC 7591).
- type: string
format: uri
pattern: ^https://
maxLength: 500
description: 'Client ID Metadata Document URL: https, no port, query or fragment, served from a public host.'
- name: redirect_uri
in: query
required: true
description: One of the redirect URIs registered for the client or listed in its Client ID Metadata Document (exact match; for a metadata-document client, a plain-http loopback URI may use any port, RFC 8252 section 7.3).
schema:
type: string
format: uri
maxLength: 500
- name: code_challenge
in: query
required: true
description: PKCE code challenge (base64url, 43 to 128 characters).
schema:
type: string
minLength: 43
maxLength: 128
- name: code_challenge_method
in: query
required: true
description: Must be `S256`.
schema:
type: string
enum:
- S256
- name: state
in: query
required: false
description: Opaque client state, echoed back on the redirect.
schema:
type: string
maxLength: 1024
- name: scope
in: query
required: false
description: Requested scope. Empty or `presify:read`; anything else is rejected.
schema:
type: string
maxLength: 200
- name: resource
in: query
required: false
description: RFC 8707 resource indicator. Must normalize to https://app.presify.io/api/mcp.
schema:
type: string
format: uri
maxLength: 500
responses:
'302':
description: Redirect to sign-in / consent, or back to redirect_uri with `code` + `state`.
'307':
description: Error redirect back to a verified or loopback redirect_uri with `error`, `error_description` and `state`.
'400':
description: 'Unknown client, unregistered redirect_uri, or an error for an unverified redirect_uri: a local HTML error page (no redirect).'
content:
text/html:
schema:
type: string
/api/oauth/token:
post:
operationId: token
tags:
- OAuth
summary: Token endpoint
description: 'Exchanges an authorization code (with PKCE code_verifier) or a refresh token for tokens. Accepts application/x-www-form-urlencoded or application/json. Client authentication: none (public clients), client_secret_basic, or client_secret_post. A Client ID Metadata Document client is public: it sends its document URL as client_id, with no secret. Authorization codes are single-use and live 5 minutes; a code presented twice revokes everything it minted (RFC 9700). Access tokens live 1 hour, refresh tokens rotate and live 30 days. Every OAuth grant ends 90 days after the user approved it, however often its refresh token rotates; refresh then answers invalid_grant and the user approves again. Refresh also answers invalid_grant when the client has been disabled or the user''s Microsoft Entra account is disabled or deleted.'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/TokenRequest'
application/json:
schema:
$ref: '#/components/schemas/TokenRequest'
responses:
'200':
description: Token response (RFC 6749 §5.1).
headers:
Cache-Control:
description: no-store
schema:
type: string
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
content:
application/json:
schema:
$ref: '#/components/schemas/TokenResponse'
'400':
description: invalid_request, invalid_grant, invalid_target or unsupported_grant_type.
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthError'
'401':
description: 'invalid_client: unknown, disabled or mis-authenticated client.'
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthError'
/api/oauth/revoke:
post:
operationId: revokeToken
tags:
- OAuth
summary: Token revocation (RFC 7009)
description: Revokes an access or refresh token and the grant behind it. Returns 200 whether or not the token was live (RFC 7009 §2.2), so a client cannot probe for valid tokens.
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/RevokeRequest'
responses:
'200':
description: Revocation processed.
content:
application/json:
schema:
type: object
additionalProperties: false
headers:
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
'400':
description: Malformed request.
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthError'
components:
schemas:
RevokeRequest:
type: object
required:
- token
properties:
token:
type: string
maxLength: 300
token_type_hint:
type: string
enum:
- access_token
- refresh_token
OAuthError:
type: object
description: RFC 6749 §5.2 error body.
required:
- error
properties:
error:
type: string
description: Error code (invalid_request, invalid_client, invalid_grant, invalid_target, invalid_redirect_uri, invalid_client_metadata, unsupported_grant_type).
error_description:
type: string
TokenResponse:
type: object
required:
- access_token
- token_type
- expires_in
- scope
properties:
access_token:
type: string
token_type:
type: string
enum:
- Bearer
expires_in:
type: integer
description: Seconds (3600).
refresh_token:
type: string
description: Rotating; the previous refresh token is invalidated.
scope:
type: string
TokenRequest:
type: object
description: RFC 6749 token request. grant_type selects the shape.
required:
- grant_type
properties:
grant_type:
type: string
enum:
- authorization_code
- refresh_token
code:
type: string
maxLength: 300
description: authorization_code grant.
redirect_uri:
type: string
format: uri
description: authorization_code grant; must equal the authorize redirect_uri.
code_verifier:
type: string
minLength: 43
maxLength: 128
description: authorization_code grant (PKCE).
refresh_token:
type: string
maxLength: 300
description: refresh_token grant.
client_id:
oneOf:
- type: string
format: uuid
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
description: Client registered through dynamic client registration (RFC 7591).
- type: string
format: uri
pattern: ^https://
maxLength: 500
description: 'Client ID Metadata Document URL: https, no port, query or fragment, served from a public host.'
description: Required unless sent via HTTP Basic. The UUID from dynamic client registration, or the Client ID Metadata Document URL the authorization used.
client_secret:
type: string
description: Confidential clients (client_secret_post).
scope:
type: string
maxLength: 200
resource:
type: string
format: uri
maxLength: 500
ClientRegistrationRequest:
type: object
description: RFC 7591 client metadata. Unknown fields are ignored.
required:
- redirect_uris
properties:
redirect_uris:
type: array
minItems: 1
items:
type: string
format: uri
description: https URIs, or http on localhost/127.0.0.1 for development. Exact-match on authorize.
client_name:
type: string
maxLength: 200
client_uri:
type: string
format: uri
token_endpoint_auth_method:
type: string
enum:
- none
- client_secret_basic
- client_secret_post
default: none
grant_types:
type: array
items:
type: string
enum:
- authorization_code
- refresh_token
response_types:
type: array
items:
type: string
enum:
- code
scope:
type: string
description: Only `presify:read` is issued.
software_id:
type: string
software_version:
type: string
ClientRegistrationResponse:
type: object
required:
- client_id
- client_id_issued_at
- redirect_uris
- grant_types
- response_types
- token_endpoint_auth_method
- scope
properties:
client_id:
type: string
format: uuid
client_id_issued_at:
type: integer
description: Unix seconds.
client_name:
type: string
redirect_uris:
type: array
items:
type: string
format: uri
grant_types:
type: array
items:
type: string
response_types:
type: array
items:
type: string
token_endpoint_auth_method:
type: string
scope:
type: string
client_secret:
type: string
description: Confidential clients only. Shown once; only a hash is stored.
client_secret_expires_at:
type: integer
description: 0 = never expires (rotate by re-registering).
headers:
Sunset:
description: 'RFC 8594. Present only once the operation is scheduled for retirement: the HTTP date after which it stops responding (410 Gone). Accompanied by a Link header with rel="deprecation" pointing at the policy page.'
schema:
type: string
example: Wed, 01 Apr 2027 00:00:00 GMT
Deprecation:
description: 'RFC 9745. Present only once the operation is scheduled for retirement: the moment the deprecation took effect, as an IMF-fixdate or a structured-field date (@ + Unix seconds). Sent at least 90 days before the Sunset date. Not sent today: nothing is deprecated.'
schema:
type: string
example: '@1767225600'
securitySchemes:
oauth2:
type: oauth2
description: OAuth 2.0 authorization code with PKCE (S256 required). Clients register at https://app.presify.io/api/oauth/register (dynamic client registration), or use the https URL of their Client ID Metadata Document as client_id with no registration; metadata at https://app.presify.io/.well-known/oauth-authorization-server. Revocation at https://app.presify.io/api/oauth/revoke.
flows:
authorizationCode:
authorizationUrl: https://app.presify.io/api/oauth/authorize
tokenUrl: https://app.presify.io/api/oauth/token
refreshUrl: https://app.presify.io/api/oauth/token
scopes:
presify:read: Read presence history the connected person may see in Presify. The only scope; every tool is read-only.
personalAccessToken:
type: http
scheme: bearer
description: Personal access token minted by a Presify owner or admin in Settings, then Connections (365-day lifetime, revocable). Same authorization as an OAuth token.
externalDocs:
description: Presify documentation
url: https://presify.io/docs
x-versioning-policy:
scheme: permanent-contract
policyUrl: https://presify.io/docs/api-versioning
urlVersioning: none
mcpProtocolVersionHeader: MCP-Protocol-Version
mcpProtocolVersions:
- '2026-07-28'
- '2025-06-18'
- '2025-03-26'
deprecationHeaders:
- Deprecation
- Sunset
- Link; rel="deprecation"
minimumNoticeDays: 90
afterSunset: 410 Gone with the JSON error shape; retired MCP tools leave tools/list.
currentlyDeprecated: []
deprecationNotice: Deprecation (RFC 9745) and Sunset (RFC 8594) headers at least 90 days before removal, announced in this document first.
x-mcp:
serverCard: https://app.presify.io/.well-known/mcp/server-card.json
endpoint: https://app.presify.io/api/mcp
transport: streamable-http
responseMode: json
protocolVersions:
- '2026-07-28'
- '2025-06-18'
- '2025-03-26'
authorizationServer: https://app.presify.io
protectedResourceMetadata: https://app.presify.io/.well-known/oauth-protected-resource/api/mcp
scope: presify:read
readOnly: true
tools:
- name: get_workspace_info
title: Workspace overview
description: 'Returns the connected Presify workspace at a glance: workspace name, plan tier with seat and retention limits, subscription and trial state, monitored-user counts (active, paused, pending enrollment), presence-collection health, and what the connected person may see. Call this first to orient yourself.'
- name: list_monitored_users
title: Monitored people
description: 'Lists the people monitored in this Presify workspace with their status, department, timezone, business hours, and flags (collection paused; legal hold, shown to owners and admins and null for managers). Filter by monitoring status (active by default; former users appear under removed statuses), department, or a name/email search. Paginated: up to 200 per page with offset. Use this to find a person before calling per-user tools.'
- name: get_user
title: Person overview
description: 'Returns one monitored person: profile (name, email, department, timezone, business hours, monitoring status, flags; the legal hold flag is shown to owners and admins and is null for managers), their latest presence reading (latestReading.at is when it last changed; when latestReading.atIsLowerBound is true it is the start of the workspace retention window, which moves forward each day, so describe the status as unchanged since at least that date), and their last 7 daily presence totals (nightly rollups, so today is never included). Accepts a name, email, or Microsoft user id. For deeper trends use get_user_stats.'
- name: get_user_stats
title: Person deep stats
description: 'Computes rich presence statistics for one person over the last 14 weeks (bounded by plan retention): this week and month with honest same-elapsed-point comparisons to the prior period, a weekly trend, business-hours versus after-hours split, typical day rhythm (median start and end, drift), uninterrupted focus blocks, meeting time, state mix, and longest online stretch. Time when Presify could not read presence counts as No data, never as Offline, and time when collection was off on purpose is not counted as possible time. Accepts a name, email, or Microsoft user id.'
- name: get_user_timeline
title: Person day timeline
description: 'Returns one person''s presence timeline for one local calendar day: ordered segments with local start and end times, duration in seconds, and the presence status held in each ("Available", "Busy", "In a call", "Away", "Offline", and so on). "No data" marks spans where collection was not running, which is different from a confirmed Offline reading. Times are wall-clock in the person''s own timezone; the response names the zone and the business-hours window. Days outside the plan retention window return no segments.'
- name: get_current_presence
title: Who is online now
description: 'Returns the latest Microsoft Teams presence reading for each actively monitored person: availability, activity, presence bucket, when it last changed (lastChangeAt), and whether they count as online right now (fresh reading within the last few minutes). When lastChangeIsLowerBound is true the status has not changed for longer than the workspace retention window: lastChangeAt is the start of that window, which moves forward each day, so describe it as unchanged since at least that date, never as a change at that time. Includes data-freshness info so you can caveat stale results. Optionally filter by department. Up to 500 people per call.'
- name: get_presence_summary
title: Presence summary
description: 'Sums presence time over a date range from nightly per-person daily rollups, grouped by person or by day. Returns seconds in each presence bucket (online, away, offline or no signal, out of office); Busy, Do Not Disturb, in a call and Presenting count as online. Grouped by person, rows are in name order and include everyone with presence data in the range: daysWithData counts the days Presify holds a status for that person for at least part of the day (a status carried from an earlier reading counts, so quiet Offline days and today so far count, but never across an interruption to collection of 15 minutes or more), the Member presence report''s Days with data, in each person''s own time zone; daysTotaled counts the days whose nightly rollups are summed into the seconds, so the two can differ until the latest days are rolled up; sort them by any column when asked. Grouped by day, rows are the dates that have rollups, so today is never listed. Use for questions like "how much was the team online last week" or "show daily totals for June". Range up to 366 days; optionally restrict to specific people (Microsoft user ids) or one department. Days outside the plan retention window have no data.'
- name: compare_users
title: Compare people
description: 'Compares 2 to 10 people side by side over a date range using whole-day presence totals from the nightly rollups: online, away, offline or no signal, and out-of-office seconds (Busy, Do Not Disturb, in a call and Presenting count as online), days with online time, and the average online per day with online time (quiet Offline days do not lower it); daysTotaled is how many days those rollups cover. daysWithData counts the days Presify holds a status for the person for at least part of the day (a status carried from an earlier reading counts, so quiet Offline days and today so far count, but never across an interruption to collection of 15 minutes or more), the Member presence report''s Days with data, in each person''s own time zone, so it can differ from daysTotaled until the latest days are rolled up. People come back in the order you list them. Range up to 92 days. Each entry accepts a name, email, or Microsoft user id. Note: totals are whole-day, not clipped to business hours; the Team presence report on the Presify Reports page counts only inside the hours it is run with (by default each person''s own working hours, in their own time zone), so its numbers differ from these.'
- name: get_coverage
title: Team coverage grid
description: 'Builds a typical-week coverage grid: for each weekday hour, how many of the selected people are typically online (fractional headcount and percent of team), plus best and thinnest hours. Answers "when is the team reachable" and "where are our coverage gaps". Each cell also carries observed and possible minutes and their ratio (confidence): time Presify could not read presence is unobserved, never offline, and time when collection was off on purpose (a person paused or stopped, a paused or read-only workspace, a canceled subscription) is left out of possible, so confidence measures only unplanned loss. Hard caps: at most 31 days of history and 50 people per call; scope the users list or department for bigger teams. Requires a plan with the Coverage feature.'
- name: get_connection_health
title: Microsoft 365 connection health
description: 'Reports the health of this workspace connection to Microsoft 365: whether presence collection is running (active, delayed, paused for reconsent, or suspended), the last successful poll time, how reliably Microsoft Graph has been answering over the chosen window (overall and per day), and the interruptions to collection of 15 minutes or more in the window with their cause (Microsoft 365 access, a delay in Presify collection, or collection off on purpose). Presence figures show the time in those interruptions when Presify could not read presence as No data (a Microsoft 365 access problem while presence was still being read leaves them as they are), and time when collection was off on purpose does not count against coverage. It also reports directory access: which Microsoft directory reads (users, group membership) are failing, since when, and the fix. Use when data looks missing or stale, new people are not showing up, or for an operations checkup. Window up to 90 days. Every credentials field except note is always null: Presify manages the Microsoft app credential, so there is nothing for this workspace to renew.'
- name: list_notifications
title: Workspace notices
description: 'Lists recent in-app workspace notices for admins: billing events, connection health changes, enrollment reminders, digest highlights. Up to 50, newest first; optionally unread only. Useful for "anything needing attention in Presify?".'
- name: list_anomalies
title: Flagged presence patterns
description: 'Lists flagged presence patterns (anomalies) with factual descriptions of what was measured: unbroken Available runs, missing idle time, overnight presence, no activity variation, robotic regularity, weekend uniformity. Filter by person, pattern type, date range, or open/dismissed. Up to 200, newest first. Descriptions state the observed pattern and computation only, never a cause or intent. To inspect a flagged day the way the app does, follow up with get_user_timeline using the entry''s person and date.'
- name: get_anomaly_summary
title: Flagged-pattern summary
description: Counts flagged presence patterns by type over a date range (open and dismissed separately), with the latest detection per type. Use for triage and trend questions like "are overnight flags increasing". Range up to 366 days.
- name: list_reports
title: Generated reports
description: 'Lists recently generated report jobs (Member presence report PDFs and Excel workbooks): type, status, who requested them, when. Up to 50, newest first. Use get_report_download for a finished report file link.'
- name: get_report_download
title: Report download link
description: Returns a fresh download link for a completed report by reportId (from list_reports). Links are valid for 15 minutes and are generated per request; ask again if one expires.
- name: list_scheduled_reports
title: Scheduled reports
description: 'Lists this workspace recurring report schedules: report type, cadence in plain words, window, recipients, status, and the next run time. Answers "when does my next report go out".'
- name: list_audit_events
title: Audit trail
description: 'Lists this workspace audit trail: who did what and when (settings changes, enrollments, report requests, connections). Filter by action prefix or date range. Up to 100, newest first. Owner only, on plans with the audit log feature.'
- name: search
title: Search this workspace
description: Searches this Presify workspace across monitored people (name, email, department), flagged presence patterns, and generated reports. Returns up to 20 results with namespaced ids for fetch. Built for research-style clients; prefer the specific tools when you know what you need.
- name: fetch
title: Fetch a search result
description: 'Fetches the full record behind a search result id (user:, anomaly:, or report: prefixed). Companion to search for research-style clients.'
x-agent-guidance:
llmsTxt: https://presify.io/llms.txt
sitemap: https://presify.io/sitemap.xml
markdownNegotiation: 'Send Accept: text/markdown on any public page URL.'
notFound: 'Unknown paths return HTTP 404: JSON under /api/, Markdown for non-browser clients.'