Skip to content

Retrieve the API Usage Log for a single day, up to 30 days in the past. The log contains information such as user name, user ID, remaining burst limit, and the endpoint called. Users with the Admin: Logs: API Usage Logs permission can access these logs.

Note that the daily logs may have a delay of about 15 minutes. If your log does not include appropriate data, know that your data is not lost; it is just not yet populated.

The logs are designed for troubleshooting burst limits and discovering which of your integrations are causing you to hit the limit. These logs should not be used for auditing, as they are not designed with the appropriate level of restrictions. For example, if an API request fails to enter the usage log, the API call is not prevented from executing, which would be required if this log was designed for auditing. In rare cases an API call may not show up as an entry in the log, but know that all calls are accurately reflected in your burst limit counts.

GET/api/{version}/logs/api_usage?date=YYYY-MM-DD

Note that this Accept header only changes the format of the response in the case of an error. This does not change the file format of the download.

NameDescription
Acceptapplication/json (default) or application/xml

You can modify the request by using one or more of the following parameters:

NameDescription
dateThe day to retrieve the API Usage log. Date is in UTC and follows the format YYYY-MM-DD. Date cannot be more than 30 days in the past.
log_formatOptional: Specify the format to download. Possible values are csv or logfile. If omitted, defaults to csv. Note that this call always downloads a ZIP file. This parameter only changes the format of the file contained within the ZIP.
curl -X GET -H "Authorization: {SESSION_ID}" \ https://myvault.veevavault.com/api/v26.1/logs/api_usage?date=2018-01-31 > file
Content-Type: application/octet-stream;charset=UTF-8 Content-Disposition: attachment;filename="response.zip"

On SUCCESS, Vault retrieves the log from the specified date as a .ZIP file. The HTTP Response Header Content-Type is set to application/octet-stream. The returned CSV or Logfile includes the following data:

NameDescription
timestampThe date and time of this API request, in UTC.
session_idThe Session ID of the user who made the request.
user_idThe ID of the user who made the request.
usernameThe Vault user name (login credentials) of the user who made the request.
http_methodThe HTTP Method of the request, for example, POST.
endpointThe Vault API endpoint used for this request.
http_response_statusThe HTTP response status of the request, for example, 200.
api_versionThe Vault API version used for this request, for example, v18.1. This value is blank for endpoints which do not have an API version.
api_response_statusThe API response status, for example, SUCCESS. This column may be blank for requests where the response contains binary content, such as files.
api_response_error_typeThe API response error type, for example, INSUFFICIENT_ACCESS.
execution_idUnique ID generated by Vault for each API request. Returned in the response header X-VaultAPI-ExecutionId.
client_idThe client ID passed with this request. If the API request did not include a client ID, this value is unknown. If the API received a client_id which was incorrectly formatted, this value is invalid_client_id. Learn more about Client ID in the Vault API Documentation.
client_ipThe IP address of the client, which is where the call originated.
burst_limit_remainingThe number of API calls remaining in your burst limit. Learn more about API Limits.
durationThe time it takes an API request to execute in Vault, measured in milliseconds. Note the duration does not include transport times between Vault and the client.
response_delayThis column is populated whenever API calls are throttled and indicates the length of the delay in milliseconds.
sdk_countThis column is populated if the API request invoked custom Vault Java SDK code, and indicates the total number of SDK entry points executed in this request. Learn more about Vault Java SDK performance metrics.
sdk_cpu_timeThis column is populated if the API request invoked custom Vault Java SDK code, and indicates the total CPU processing time required for this request in nanoseconds. Learn more about Vault Java SDK performance metrics.
sdk_elasped_timeThis column is populated if the API request invoked custom Vault Java SDK code, and indicates the total elapsed time for this request in milliseconds. Learn more about Vault Java SDK performance metrics.
sdk_gross_memory This column is populated if the API request invoked custom Vault Java SDK code, and indicates the total gross memory required for this request in bytes. Learn more about Vault Java SDK performance metrics.
connectionThe api_name__sys of the matching Connection record associated with this request. If this is a trusted Veeva connection, such as Vault Loader, Vault Mobile, or Station Manager, this value is vault__sys. If there is no associated connection, this value is blank.
api_resourceThe API resource for the request. For example, the primary query object for a VQL request.
api_response_warning_typeThe API request warning type. For example, DUPLICATE.
api_response_warning_messageThe API request warning message. For example, "Duplicate query execution detected. Consider caching commonly required data."
api_response_error_messageThe API request error message. For example, "product__b is not a queryable object; please refer to api documentation".
reference_idThe X-VaultAPI-ReferenceIdheader value. If this header was not included in the request, this value is blank.