Use these views to get a log of your Content Delivery and Management API requests, as well as other platform resource usage.
API Requests
platform.api_requests
This view contains a log of all API requests for Management APIs. There is a 30-day lookback period for API requests, rather than the standard one year lookback for fact tables.
| Column | Data Type | Description |
|---|---|---|
subject_business_id | NUMBER | The numeric identifier for the account that is the subject of the API call. |
app_business_id | NUMBER | The numeric identifier for the account that is the owner of the app making the request. |
uuid | VARCHAR | The unique ID associated with the request |
request_timestamp | TIMESTAMP_NTZ | The time the request was made |
app_id | NUMBER | The app associated with the request |
endpoint_id | NUMBER | The ID of the API endpoint being accessed |
version | NUMBER | The API version corresponding to the 'v' parameter specified in the request |
request_url | VARCHAR | The URL of the request |
method | VARCHAR | The HTTP method of the request |
status_code | NUMBER | The status code of the response |
request_headers | OBJECT | The headers of the request |
request_body | VARCHAR | The body of the request |
request_bytes | NUMBER | The size of the request, in bytes |
duration_milliseconds | NUMBER | The duration of time required to process the request |
response_headers | OBJECT | The headers of the response |
response_body | VARCHAR | The body of the response |
response_bytes | NUMBER | The size of the response, in bytes |
is_truncated | BOOLEAN | Whether the log was truncated due to size constraints |
errors | ARRAY | Any errors encountered while processing the request |
Sample Query
Get all Management API requests and associated metadata for the past seven days.
select
uuid,
request_timestamp,
app_id,
endpoint_id,
status_code,
request_url,
request_body,
duration_milliseconds,
response_body,
errors
from platform.api_requests
where date(request_timestamp) > dateadd(day, -8, current_date)Apps
platform.apps
This view contains information about your Yext developer apps. This can be used to decode the app_id column in other platform views.
| Column | Data Type | Description |
|---|---|---|
business_id | NUMBER | The numeric identifier for the account |
app_id | NUMBER | The numeric identifier for the app |
display_name | VARCHAR | The app name |
has_write_access | BOOLEAN | Whether the app has write permissions |
directory_status | VARCHAR | Whether the app is published to the app directory. Can be one of PRIVATE, PUBLISHED, PUBLISHED_WITH_CHANGES, or SUBMITTED |
is_internal | BOOLEAN | Whether the app is internal. Internal apps are not subject to API quota |
receives_subaccount_webhooks | BOOLEAN | Whether the webhooks in a given app are configured to receive webhook events from any sub-accounts |
distribution_intent | VARCHAR | Whether the app distribution intent is private or public on the Yext app directory |
Sample Query
Get all consumer API calls from the last 7 days, using the apps view to decode which apps made the requests.
select
uuid,
request_timestamp,
consumer_api_requests.app_id,
apps.display_name
endpoint_id,
status_code,
request_url,
request_body,
duration_milliseconds,
response_body,
errors
from platform.consumer_api_requests
join platform.apps using (app_id)
where date(request_timestamp) > dateadd(day, -8, current_date)Consumer API Requests
platform.consumer_api_requests
This view contains a log of all API requests for Content Delivery and other consumer-facing APIs. There is a 30-day lookback period for API requests.
| Column | Data Type | Description |
|---|---|---|
subject_business_id | NUMBER | The numeric identifier for the account that is the subject of the API call. |
app_business_id | NUMBER | The numeric identifier for the account that is the owner of the app making the request. |
uuid | VARCHAR | The unique ID associated with the request |
request_timestamp | TIMESTAMP_NTZ | The time the request was made |
app_id | NUMBER | The app associated with the request |
endpoint_id | NUMBER | The ID of the API endpoint being accessed |
version | NUMBER | The API version corresponding to the 'v' parameter specified in the request |
request_url | VARCHAR | The URL of the request |
method | VARCHAR | The HTTP method of the request |
status_code | NUMBER | The status code of the response |
request_headers | OBJECT | The headers of the request |
request_body | VARCHAR | The body of the request |
request_bytes | NUMBER | The size of the request, in bytes |
duration_milliseconds | NUMBER | The duration of time required to process the request |
response_headers | OBJECT | The headers of the response |
response_body | VARCHAR | The body of the response |
response_bytes | NUMBER | The size of the response, in bytes |
is_truncated | BOOLEAN | Whether the log was truncated due to size constraints |
errors | ARRAY | Any errors encountered while processing the request |
Sample Query
Get all Content Delivery API requests that received a 404 status code for the past seven days.
select
uuid,
request_timestamp,
app_id,
endpoint_id,
request_url,
request_body,
duration_milliseconds,
response_body,
errors
from platform.consumer_api_requests
where date(request_timestamp) > dateadd(day, -8, current_date)
and status_code = 404Endpoints
platform.endpoints
This view contains all Yext API endpoint IDs and their names, meant to be used for decoding the endpoint_id column in other platform views.
| Column | Data Type | Description |
|---|---|---|
endpoint_id | NUMBER | The numeric identifier of the API endpoint |
name | VARCHAR | The endpoint name |
Sample Query
Get a count of all Management API calls from the last 7 days by endpoint.
select
api_requests.endpoint_id,
endpoints.name,
count(*)
from platform.api_requests
join platform.endpoints using (endpoint_id)
where date(request_timestamp) > dateadd(day, -8, current_date)
group by 1,2 order by 3 descFunction Invocations
platform.function_invocations
This view contains a log history of function invocations associated with plugins.
| Column | Data Type | Description |
|---|---|---|
business_id | NUMBER | The numeric identifier of the account |
plugin_external_id | VARCHAR | The plugin's string identifier ($id) |
invocation_id | VARCHAR(26) | The alphanumeric identifier of the invocation |
invocation_timestamp | TIMESTAMP_NTZ | The timestamp at which the invocation began |
function_name | VARCHAR | The name of the function invoked |
argument_json | VARIANT | The JSON object passed into the function as an argument |
argument_bytes | NUMBER | The size of the argument JSON object, in bytes |
result_json | VARIANT | The JSON body of the result returned by the function |
result_bytes | NUMBER | The size of the result JSON, in bytes |
load_duration_milliseconds | NUMBER | The time spent loading the plugin, in milliseconds |
invoke_duration_milliseconds | NUMBER | The time it took for the function invocation to execute, in milliseconds |
alloc_memory_mb | NUMBER | The amount of memory allocated to the plugin, in megabytes |
logs | ARRAY | JSON array of log records |
queue_duration_milliseconds | NUMBER | Time elapsed between the time the plugin is ready and executing the function, in milliseconds |
tags | OBJECT | Additional key-values provided by the caller |
disabled_logging | ARRAY | Specific plugin properties that are omitted from logging |
caller_type | VARCHAR | The type of caller invoking the plugin |
is_truncated | BOOLEAN | If true, indicates something was truncated to fit into a Kafka message |
error | OBJECT | Structured value containing any errors while processing the request |
Sample Query
Get a log of all function invocations for a given plugin today.
select
businesses.business_id,
name,
invocation_timestamp,
plugin_external_id,
argument_json,
logs,
case
when error is not null then 'FAILED'
else 'SUCCESS'
end as status,
caller_type,
error
from logs.function_invocations
join public.businesses using (business_id)
where plugin_external_id like '%somePluginName%'
and invocation_timestamp > current_date()
order by 3 desc;