Posit Instrumentation API
The Instrumentation API from Posit — 3 operation(s) for instrumentation.
The Instrumentation API from Posit — 3 operation(s) for instrumentation.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/posit-instrumentation-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
contact:
email: support@posit.co
name: Posit Connect Support
url: https://support.posit.co/hc/en-us
description: '## Overview
The Posit Connect Server API can be used to perform certain
user actions remotely.'
license:
name: Commercial. Copyright 2015-2026 Posit Software, PBC. All Rights Reserved.
url: https://posit.co/about/eula/
termsOfService: https://posit.co/about/eula/
title: Posit Connect API Reference Instrumentation API
version: 1.0.1
servers:
- url: /__api__
security:
- apiKey: []
tags:
- name: Instrumentation
paths:
/v1/instrumentation/content/hits:
get:
description: 'This endpoint returns content usage information for all content types, also known as hits, where hits
are individual activity events such as content visits or requests to APIs hosted on Posit Connect.
This endpoint requires administrator or publisher access. Publishers can
query visits data for content they own or are a collaborator on.
#### Filtering of results:
There are several ways the result set can be filtered by the server before
being sent back within the API response. If multiple filters are in effect,
they will be logically ANDed together.
##### Implicit filtering
If the user calling the endpoint is a publisher, the data returned will be
limited to the content owned by the user.
##### Time windows
This API accepts optional `from` and `to` timestamps to define a window of
interest. If `from` is not specified, it is assumed to be before the earliest
recorded information. If `to` is not specified, it is assumed to be "now".
Any content hit activity that falls inclusively within the time window will be
part of the result set.
#### Responses
The response of a call will contain zero or more data records representing a hit
by a user to a piece of content. As opposed to other instrumentation API endpoints,
this API is better suited to consume large amounts of unfiltered content activity records,
to later be analysed and processed by the consumer.'
operationId: getContentHits
parameters:
- in: query
name: content_guid
schema:
type: string
- in: query
name: from
schema:
format: date-time
type: string
- in: query
name: to
schema:
format: date-time
type: string
responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/ContentHitEntry'
type: array
description: Successful response.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: The requested operation is invalid.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: The requested operation requires authentication.
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: You do not have permission to perform this operation.
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: A server error occurred.
summary: Get all content hits
tags:
- Instrumentation
/v1/instrumentation/content/visits:
get:
description: 'This endpoint returns a portion of the visit (or "hits") information for all
content types _other than Shiny applications_. The results returned include
paging details that can be used to navigate the information this endpoint
returns.
The information returned is based on data collected by Posit Connect as
users visit content in the dashboard or make requests to applications or APIs
hosted on Connect.
#### Important notes
In the past there were issues with how visits were recorded that caused extra
entries to be stored under certain circumstances. These will affect analyses
that interpret visit counts. Entries that were recorded before issues were
addressed are not returned by default. If you desire these records, specify
the `min_data_version` filter with a value of `0` (the default value is `3`).
This endpoint requires administrator or publisher access. Publishers can
query visits data for content they own or are a collaborator on.
#### Service tokens
This endpoint can be accessed using a service token with the
`instrumentation:read` scope. When accessed with a service token,
visits for all content items are returned regardless of ownership.
#### Filtering of results:
There are several ways the result set can be filtered by the server before
being sent back within the API response. If multiple filters are in effect,
they will be logically ANDed together.
##### Implicit filtering
If the user calling the endpoint is a publisher, the data returned will be
limited to the content owned by the user.
##### Time windows
This API accepts optional `from` and `to` timestamps to define a window of
interest. If `from` is not specified, it is assumed to be before the earliest
recorded information. If `to` is not specified, it is assumed to be "now".
Any visit to content that falls inclusively within the time window will be
part of the result set.
#### Responses
The response of a call will contain zero or more data records representing a visit
by a user to a piece of content. No more than `limit` records will be returned.
Multiple requests of this endpoint are typically required to retrieve the complete
result set from the server. To facilitate this, each response includes a paging
object containing full URL links which can be requested to iteratively move forward
or backward through multiple response pages.'
operationId: getContentVisits
parameters:
- in: query
name: content_guid
schema:
type: string
- in: query
name: min_data_version
schema:
default: 3
format: int32
type: integer
- in: query
name: user_agent
schema:
type: string
- in: query
name: from
schema:
format: date-time
type: string
- in: query
name: to
schema:
format: date-time
type: string
- in: query
name: limit
schema:
default: 20
format: int32
type: integer
- in: query
name: previous
schema:
type: string
- in: query
name: next
schema:
type: string
- in: query
name: asc_order
schema:
default: true
type: boolean
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ContentVisitLogs'
description: Successful response.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: The requested operation is invalid.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: The requested operation requires authentication.
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: You do not have permission to perform this operation.
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: A server error occurred.
summary: Get content visits
tags:
- Instrumentation
/v1/instrumentation/shiny/usage:
get:
description: 'This endpoint returns a portion of the Shiny application usage information,
as well as paging details that can be used to navigate that information.
The information returned is based on data collected by Posit Connect as
users visit Shiny applications. Because of how visits are detected, end
times will be slightly inflated by a reconnect timeout, generally around
15 seconds.
#### Important notes
Prior to the release of this API, there was an issue with how visits were
recorded that caused extra entries to be stored. These will affect analyses
that interpret visit counts or durations. Entries that were recorded before
the issue was addressed are not returned by default. If you desire these
records, specify the `min_data_version` filter with a value of 0.
- Because of how visits are detected, end times will be slightly inflated by the
currently configured client reconnect timeout, which defaults to 15 seconds.
The ending time may also be affected by connect and read timeout
settings.
The Shiny Application
Events
section of the Posit Connect Admin Guide has more details about
how these events are collected.
- This endpoint requires administrator or publisher access. Publishers can
query Shiny usage data for content they own or are a collaborator on.
#### Service tokens
This endpoint can be accessed using a service token with the
`instrumentation:read` scope. When accessed with a service token,
usage data for all Shiny applications is returned regardless of
ownership.
#### Filtering of results:
There are several ways the result set can be filtered by the server before
being sent back within the API response. If multiple filters are in effect,
they will be logically ANDed together.
##### Implicit filtering
If the user calling the endpoint is a publisher, the data returned will be
limited to those applications owned by the user.
##### Time windows
This API accepts optional `from` and `to` timestamps to define a window of
interest. If `from` is not specified, it is assumed to be before the earliest
recorded information. If `to` is not specified, it is assumed to be "now".
Any visit to content that falls inclusively within the time window will be
part of the result set.
#### Responses
The response of a call will contain zero or more data records representing a session
by a user of a Shiny application. No more than `limit` records will be returned.
Multiple requests of this endpoint are typically required to retrieve the complete
result set from the server. To facilitate this, each response includes a paging
object containing full URL links which can be requested to iteratively move forward
or backward through multiple response pages.'
operationId: getShinyAppUsage
parameters:
- in: query
name: content_guid
schema:
type: string
- in: query
name: min_data_version
schema:
default: 1
format: int32
type: integer
- in: query
name: from
schema:
format: date-time
type: string
- in: query
name: to
schema:
format: date-time
type: string
- in: query
name: limit
schema:
default: 20
format: int32
type: integer
- in: query
name: previous
schema:
type: string
- in: query
name: next
schema:
type: string
- in: query
name: asc_order
schema:
default: true
type: boolean
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ShinyAppUsageLogs'
description: Successful response.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: The requested operation is invalid.
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: The requested operation requires authentication.
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: You do not have permission to perform this operation.
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/APIError'
description: A server error occurred.
summary: Get Shiny app usage
tags:
- Instrumentation
components:
schemas:
PagingLinks:
description: Navigation links for keyset pagination.
properties:
first:
description: A full URL of the first page of results. Null if the current response is the first page.
type:
- string
- 'null'
previous:
description: A full URL of the previous page of results. Null if the current response is the first page.
type:
- string
- 'null'
next:
description: A full URL of the next page of results. Null if the current response is the last page.
type:
- string
- 'null'
last:
description: A full URL of the last page of results. Null if the current response is the last page.
type:
- string
- 'null'
type: object
ContentVisitEntry:
additionalProperties: false
description: A content visit record.
properties:
content_guid:
description: The GUID of the content this visit pertains to.
example: bd1d2285-6c80-49af-8a83-a200effe3cb3
format: uuid
type: string
user_guid:
description: The GUID of the user that visited the content. May be null when the content does not require a user session.
example: 08e3a41d-1f8e-47f2-8855-f05ea3b0d4b2
format: uuid
type:
- string
- 'null'
variant_key:
description: The key of the variant the user visited. Null for static content.
example: HidI2Kwq
type:
- string
- 'null'
time:
description: The timestamp (RFC3339) when the user visited the content.
example: '2018-09-15T18:00:00-05:00'
format: date-time
type: string
rendering_id:
description: The ID of the rendering the user visited. Null for static content.
example: '7'
type:
- string
- 'null'
bundle_id:
description: The ID of the particular bundle used.
example: '33'
type:
- string
- 'null'
path:
description: The path requested by the user.
example: /logs
type:
- string
- 'null'
data_version:
description: The data version the record was recorded with.
example: 1
format: int32
type: integer
user_agent:
description: The user agent that made the request.
example: Mozilla/5.0
type:
- string
- 'null'
type: object
ContentHitEntry:
additionalProperties: false
description: A content hit activity record.
properties:
id:
description: The ID of the activity record.
example: '33'
type: string
user_guid:
description: The GUID of the user that visited the content. May be null when the content does not require a user session.
example: 08e3a41d-1f8e-47f2-8855-f05ea3b0d4b2
format: uuid
type:
- string
- 'null'
content_guid:
description: The GUID of the content this activity pertains to.
example: bd1d2285-6c80-49af-8a83-a200effe3cb3
format: uuid
type: string
timestamp:
description: The timestamp (RFC3339) when the user visited the content.
example: '2018-09-15T18:00:00-05:00'
format: date-time
type: string
data:
allOf:
- $ref: '#/components/schemas/ContentHitData'
description: Additional data about the content hit.
type: object
APIError:
additionalProperties: false
description: The error object returned by the API on failure.
properties:
code:
description: The specific code for the type of error returned. See the [API error codes reference](#api-error-codes) for the full set of values.
type: integer
error:
description: A description of the problem that was encountered.
type: string
payload:
description: Additional error details, if any. The structure varies by error type.
type:
- object
- 'null'
required:
- code
- error
type: object
PagingCursors:
additionalProperties: false
description: Cursor values for keyset pagination.
properties:
previous:
description: A cursor ID that can be used with the previous query parameter to get the previous page of results.
example: '23948901087'
type:
- string
- 'null'
next:
description: A cursor ID that can be used with the next query parameter to get the next page of results.
example: '23948901087'
type:
- string
- 'null'
type: object
ShinyAppUsageEntry:
additionalProperties: false
description: A Shiny application usage record.
properties:
content_guid:
description: The GUID of the Shiny application this usage record pertains to.
example: bd1d2285-6c80-49af-8a83-a200effe3cb3
format: uuid
type: string
user_guid:
description: The GUID of the user that visited the application. May be null if the user cannot be determined.
example: 08e3a41d-1f8e-47f2-8855-f05ea3b0d4b2
format: uuid
type:
- string
- 'null'
started:
description: The timestamp (RFC3339) when the user opened the application.
example: '2018-09-15T18:00:00-05:00'
format: date-time
type: string
ended:
description: The timestamp (RFC3339) when the user left the application.
example: '2018-09-15T18:01:00-05:00'
format: date-time
type:
- string
- 'null'
data_version:
description: The data version the record was recorded with.
example: 1
format: int32
type: integer
type: object
KeysetPaging:
allOf:
- $ref: '#/components/schemas/PagingLinks'
- properties:
cursors:
allOf:
- $ref: '#/components/schemas/PagingCursors'
description: Cursor values for navigating between pages.
type: object
description: Keyset-based pagination metadata with cursors and navigation links.
ContentVisitLogs:
additionalProperties: false
description: Content visit results with keyset pagination.
properties:
results:
description: The content visit logs.
items:
$ref: '#/components/schemas/ContentVisitEntry'
type: array
paging:
allOf:
- $ref: '#/components/schemas/KeysetPaging'
description: Paging information for navigating result sets.
type: object
ShinyAppUsageLogs:
additionalProperties: false
description: Shiny application usage results with keyset pagination.
properties:
results:
description: The Shiny application usage logs.
items:
$ref: '#/components/schemas/ShinyAppUsageEntry'
type: array
paging:
allOf:
- $ref: '#/components/schemas/KeysetPaging'
description: Paging information for navigating result sets.
type: object
ContentHitData:
additionalProperties: false
description: Additional data about a content hit.
properties:
path:
description: The path consumed for this hit event.
example: /summary
type:
- string
- 'null'
query:
description: The query string for this hit event.
example: view_hit_source=email
type:
- string
- 'null'
user_agent:
description: The user agent registered for this hit event.
example: Mozilla/5.0
type:
- string
- 'null'
sec_fetch_dest:
description: 'The value of the Sec-Fetch-Dest HTTP header. Common values: document, iframe, empty.'
type:
- string
- 'null'
sec_fetch_site:
description: 'The value of the Sec-Fetch-Site HTTP header. Common values: same-origin, same-site, cross-site, none.'
type:
- string
- 'null'
type: object
securitySchemes:
apiKey:
description: 'Prefix your API key with `Key `, e.g. `Key ABC123`.
'
in: header
name: Authorization
type: apiKey