> For the complete documentation index, see [llms.txt](https://docs.welkinhealth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.welkinhealth.com/api-reference/audit.md).

# Audit

## Data Audit Find All

> \*NOTE: Available only if Admin Access ->\* Data Audit  \
> \*is set.\*\
> \
> \## Find data audit event\
> \
> It is a typical API to work with data audit\
> \
> \`URL Structure: {{url}} / {{tenantName}} / admin /audit-data\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/admin/audit-data\\`>

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Audit","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}}},"schemas":{"AuditRecordPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditRecord"}},"metaInfo":{"$ref":"#/components/schemas/PageMetaInfo"}}},"AuditRecord":{"type":"object","properties":{"eventId":{"type":"string","description":"Numeric ID serialized as a string."},"eventEntity":{"$ref":"#/components/schemas/EventEntity"},"url":{"type":"string","nullable":true},"subjectUsername":{"type":"string","nullable":true},"subjectUserId":{"type":"string","format":"uuid","nullable":true},"subjectActor":{"$ref":"#/components/schemas/ActorType"},"subjectFullName":{"type":"string","nullable":true},"patientFullName":{"type":"string","nullable":true},"patientId":{"type":"string","format":"uuid","nullable":true},"instance":{"type":"string","nullable":true},"cdtName":{"type":"string","nullable":true},"cdtRelation":{"$ref":"#/components/schemas/CdtRelation"},"cdt":{"$ref":"#/components/schemas/Cdt"},"eventSubtype":{"type":"string","description":"One of ~200 event subtype values, each associated with a parent eventEntity. Not modeled as a closed enum here."},"sentAt":{"type":"string","format":"date-time"},"record":{"type":"object","additionalProperties":true,"description":"The audited payload — shape depends on eventEntity."}}},"EventEntity":{"type":"string","enum":["PATIENT","CDT","PDT","USER","ASSESSMENT","ASSESSMENT_MIGRATION","USER_APP_ACCESS","USER_PERMISSION","USER_TERRITORY","API_CLIENT","API_CLIENT_APP_ACCESS","API_CLIENT_PERMISSION","API_CLIENT_TERRITORY","CHAT","EMAIL","SMS","WHATSAPP","VOICE_CALL","PHONE_TREE","TASK","GOAL","NOTIFICATION","WEBHOOK","PATIENT_PROGRAM","CALENDAR","CALENDAR_WORK_HOURS","ENCOUNTER","ENCOUNTER_DISPOSITION","SECURITY_CONFIG","INSTANCE","COMMUNICATION","UNRECOGNIZED_COMMUNICATION","COMMUNICATION_DATA_AUDIT","AUTOMATION","SESSION_CONFIG","LICENSE","TENANT_LICENSE","DOCUMENT","ACUITY_SERVICE","CALENDAR_SERVICE","INVOICE_REQUEST","FAX","PAYMENT_REQUEST","SUBSCRIPTION","INVOICE_AUTOMATION_RESULT","INVOICE","PAYMENT","PAYMENT_AUDIT","CANDID_REQUEST","CANDID_RESPONSE","ENCOUNTER_PAYMENT_INFO","AVAILABILITY","INBOX_MESSAGE","INBOX_USER_CONFIG","INBOX_MENTION","AUTOMATION_ACTION_GROUP","AUTOMATION_ACTION","LOG_LEVEL","CONCURRENCY_SETTINGS","TENANT"]},"ActorType":{"type":"string","enum":["CS_TOOL_CLIENT","USER","API_CLIENT","PATIENT","CONTACT","SYSTEM","WEBHOOK","INTERNAL_SERVICE","ANONYMOUS","UNRECOGNISED"]},"CdtRelation":{"type":"string","enum":["COMMON","PATIENT_INFO","PATIENT","PATIENT_GOAL","ENCOUNTER","ENCOUNTER_DISPOSITION","ENCOUNTER_ASSESSMENT","ASSESSMENT","ASSESSMENT_SCORING","ASSESSMENT_CONSENT","ASSESSMENT_RESULTS_FILE","ASSESSMENT_GROUP","DOCUMENT_SUMMARY","DOCUMENT_TYPE","BILLING_CLAIMS_STATUS","INVOICE","SUPERBILL"]},"Cdt":{"type":"object","required":["name","fields"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","pattern":"^[a-z0-9\\-_]+$"},"title":{"type":"string"},"label":{"type":"string"},"version":{"type":"integer"},"internal":{"type":"boolean"},"readable":{"type":"boolean","default":true},"updatable":{"type":"boolean","default":true},"type":{"$ref":"#/components/schemas/DtType"},"relation":{"$ref":"#/components/schemas/CdtRelation"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/DtField"}}}},"DtType":{"type":"string","enum":["SINGLE_RECORD","MULTI_RECORD"]},"DtField":{"type":"object","required":["name","type","meta"],"properties":{"name":{"type":"string","pattern":"^[a-z0-9\\-_]+$"},"type":{"$ref":"#/components/schemas/FieldTypeEnum"},"formula":{"type":"string","nullable":true},"dictionary":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"field":{"type":"string"}}},"profileDataType":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}}}},"customDataType":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}}}},"customFieldType":{"type":"string","nullable":true},"editable":{"type":"boolean","default":true},"searchable":{"type":"boolean"},"bulkEdit":{"type":"boolean"},"phi":{"type":"boolean"},"disable":{"type":"boolean","description":"JSON key for the \"disabled\" field."},"injectedSource":{"type":"boolean"},"displayType":{"$ref":"#/components/schemas/DtFieldDisplayType"},"valueType":{"$ref":"#/components/schemas/DtFieldValueType"},"meta":{"$ref":"#/components/schemas/DtFieldMeta"},"mask":{"$ref":"#/components/schemas/FieldMask"},"richTextEnabled":{"type":"boolean"}}},"FieldTypeEnum":{"type":"string","enum":["TEXT","TEXTAREA","PASSWORD","EMAIL","INTEGER","FLOAT","PERCENT","RADIO","CHECKBOX","SELECT","CHOICE","DATE","TIME","DATETIME","FILE","IMAGE","URL","PHONE","UUID","SSN","ADDRESS","LOCATION","FORMULA","OBJECT","SIGNATURE"]},"DtFieldDisplayType":{"type":"string","enum":["CHECKBOX","RADIO","SELECT"]},"DtFieldValueType":{"type":"string","enum":["STRING","INTEGER","FLOAT","OBJECT"]},"DtFieldMeta":{"type":"object","properties":{"label":{"type":"string"},"minLength":{"type":"integer","nullable":true},"maxLength":{"type":"integer","nullable":true},"minValue":{"type":"string","nullable":true},"maxValue":{"type":"string","nullable":true},"fileTypes":{"type":"array","items":{"type":"string"}},"maxFiles":{"type":"integer","nullable":true},"maxTotalFileSize":{"type":"integer","nullable":true,"description":"Bytes"},"required":{"type":"boolean","nullable":true},"options":{"type":"array","items":{"$ref":"#/components/schemas/OptionItem"}},"multiple":{"type":"boolean","nullable":true},"patterns":{"type":"array","items":{"type":"string","enum":["NUMBERS_ONLY","LETTERS_ONLY"]}}}},"OptionItem":{"type":"object","properties":{"label":{"type":"string"},"value":{},"refCdtName":{"type":"string","nullable":true}}},"FieldMask":{"type":"object","properties":{"symbol":{"type":"string","minLength":1,"maxLength":1,"default":"*"},"startPosition":{"type":"integer","minimum":1},"endPosition":{"type":"integer","nullable":true}}},"PageMetaInfo":{"type":"object","properties":{"page":{"type":"integer"},"pageSize":{"type":"integer"},"totalElements":{"type":"integer"},"numberOfElements":{"type":"integer"}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/admin/audit-data":{"get":{"summary":"Data Audit Find All","tags":["Audit"],"operationId":"Data_Audit_Find_All","parameters":[{"$ref":"#/components/parameters/TenantName"},{"name":"cdtName","in":"query","required":false,"schema":{"type":"string"},"description":"Cdt name"},{"name":"subjectUsername","in":"query","required":false,"schema":{"type":"string"},"description":"Username of a person performing the action"},{"name":"instance","in":"query","required":false,"schema":{"type":"string"},"description":"Instance name"},{"name":"patientFullName","in":"query","required":false,"schema":{"type":"string"},"description":"Full name of the patient who the action was taken on"},{"name":"dateStart","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Date_time in ISO-8601 format\tFilter by sentAt."},{"name":"dateEnd","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Date_time in ISO-8601 format\tFilter by sentAt."},{"name":"entity","in":"query","required":false,"schema":{"type":"string"},"description":"Type of the entity: CDT, PATIENT"},{"name":"subjectFullName","in":"query","required":false,"schema":{"type":"string"},"description":"Full name of the person performing the action"},{"name":"includeFormation","in":"query","required":false,"schema":{"type":"boolean"},"description":"Include cdt formation"},{"name":"subjectUserId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Id of a person performing the action"},{"name":"subjectActor","in":"query","required":false,"schema":{"type":"string"},"description":"Client type of the person performing the action: API_CLIENT, PATIENT, CS_TOOL_CLIENT, USER"},{"name":"patientId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Id of the patient who the action was taken on"},{"name":"sentAt","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Date_time in ISO-8601 format.\tWhen action happens"},{"name":"cdt","in":"query","required":false,"schema":{"type":"string"},"description":"Object describe all fields with types"},{"name":"operation","in":"query","required":false,"schema":{"type":"string"},"description":"Type of action operation: CREATE, UPDATE, DELETE"},{"name":"record","in":"query","required":false,"schema":{"type":"string"},"description":"Object after performing the action on it"}],"responses":{"200":{"description":"Paginated audit trail records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRecordPage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"*NOTE: Available only if Admin Access ->* Data Audit  \n*is set.*\n\n## Find data audit event\n\nIt is a typical API to work with data audit\n\n`URL Structure: {{url}} / {{tenantName}} / admin /audit-data`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/admin/audit-data`"}}}}
```

## Find Webhook Audit Event

> \_NOTE: Available only if Admin Access ->\_ Data Audit  \
> \_is set.\_\
> \
> It is a typical API to work with webhook audit\
> \
> \`URL Structure: {{url}} / {{tenantName}} / admin /audit-webhook\`\
> \
> in our example it would be: \`<https://api.live.welkincloud.io/gh/admin/audit-webhook\\`>

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Audit","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}}},"schemas":{"AuditWebhookPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditWebhookRecord"}},"metaInfo":{"$ref":"#/components/schemas/PageMetaInfo"}}},"AuditWebhookRecord":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sentAt":{"type":"string","format":"date-time"},"eventEntity":{"$ref":"#/components/schemas/EventEntity"},"patientId":{"type":"string","format":"uuid","nullable":true},"instance":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/WebhookStatus"},"statusCode":{"type":"integer","nullable":true,"description":"HTTP status code of the webhook delivery attempt."},"response":{"type":"string","nullable":true},"eventSubtype":{"type":"string"},"record":{"type":"object","additionalProperties":true,"description":"The webhook configuration that was triggered."}}},"EventEntity":{"type":"string","enum":["PATIENT","CDT","PDT","USER","ASSESSMENT","ASSESSMENT_MIGRATION","USER_APP_ACCESS","USER_PERMISSION","USER_TERRITORY","API_CLIENT","API_CLIENT_APP_ACCESS","API_CLIENT_PERMISSION","API_CLIENT_TERRITORY","CHAT","EMAIL","SMS","WHATSAPP","VOICE_CALL","PHONE_TREE","TASK","GOAL","NOTIFICATION","WEBHOOK","PATIENT_PROGRAM","CALENDAR","CALENDAR_WORK_HOURS","ENCOUNTER","ENCOUNTER_DISPOSITION","SECURITY_CONFIG","INSTANCE","COMMUNICATION","UNRECOGNIZED_COMMUNICATION","COMMUNICATION_DATA_AUDIT","AUTOMATION","SESSION_CONFIG","LICENSE","TENANT_LICENSE","DOCUMENT","ACUITY_SERVICE","CALENDAR_SERVICE","INVOICE_REQUEST","FAX","PAYMENT_REQUEST","SUBSCRIPTION","INVOICE_AUTOMATION_RESULT","INVOICE","PAYMENT","PAYMENT_AUDIT","CANDID_REQUEST","CANDID_RESPONSE","ENCOUNTER_PAYMENT_INFO","AVAILABILITY","INBOX_MESSAGE","INBOX_USER_CONFIG","INBOX_MENTION","AUTOMATION_ACTION_GROUP","AUTOMATION_ACTION","LOG_LEVEL","CONCURRENCY_SETTINGS","TENANT"]},"WebhookStatus":{"type":"string","enum":["SENT","DELIVERED","FAILED"]},"PageMetaInfo":{"type":"object","properties":{"page":{"type":"integer"},"pageSize":{"type":"integer"},"totalElements":{"type":"integer"},"numberOfElements":{"type":"integer"}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/admin/audit-webhook":{"get":{"summary":"Find Webhook Audit Event","tags":["Audit"],"operationId":"Find_Webhook_Audit_Event","parameters":[{"$ref":"#/components/parameters/TenantName"},{"name":"eventEntity","in":"query","required":false,"schema":{"type":"string"},"description":"Entity with which the webhook was called: CDT, ASSESSMENT"},{"name":"eventSubtype","in":"query","required":false,"schema":{"type":"string"},"description":"Type of performing action"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Webhook call status: SENT, DELIVERED, FAILED,"},{"name":"patientId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Id of the patient who the action was taken on"},{"name":"record","in":"query","required":false,"schema":{"type":"string"},"description":"Object after performing the action on it"},{"name":"headers","in":"query","required":false,"schema":{"type":"string"},"description":"List of headers with which the webhook is configured and was called"},{"name":"queryParameters","in":"query","required":false,"schema":{"type":"string"},"description":"List of parameters with which the webhook is configured and was called"},{"name":"dateEnd","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Date_time in ISO-8601 format. Filter by sentAt"},{"name":"dateStart","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Date_time in ISO-8601 format. Filter by sentAt"},{"name":"instance","in":"query","required":false,"schema":{"type":"string"},"description":"The environment for which you want to execute the request"}],"responses":{"200":{"description":"Paginated webhook delivery audit records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditWebhookPage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"_NOTE: Available only if Admin Access ->_ Data Audit  \n_is set._\n\nIt is a typical API to work with webhook audit\n\n`URL Structure: {{url}} / {{tenantName}} / admin /audit-webhook`\n\nin our example it would be: `https://api.live.welkincloud.io/gh/admin/audit-webhook`"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.welkinhealth.com/api-reference/audit.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
