Skip to main content
Vendor Audit Trail API
curl --request GET \
  --url https://api.pazy.io/v1.0/vendor/:id/audit-trail

Authentication

All requests require an API key in the request headers. Headers:
Authorization: Api-Key YOUR_API_KEY

Request

Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the Vendor to retrieve

Code Examples

curl -X GET https://api.pazy.io/v1.0/vendor/vendor_identifier/audit-trail \
  -H "Authorization: Api-Key YOUR_API_KEY"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the vendor audit trail response data
data.auditTrailarrayList of audit trail entries associated with the vendor
data.auditTrail[].createdOnstringThe date when the audit trail entry was created (ISO 8601 format)
data.auditTrail[].fieldTypestringThe field of the audit where the data experience change. Like: ADDRESS, BANK, PAN, STATE
data.auditTrail[].typestringThe type of the audit trail entry. Like: CREATE, UPDATE, DELETE
data.auditTrail[].actionBystringGive who performed the action: USER, or PLATFORM
data.auditTrail[].userobjectInformation about the user who made the comment
data.auditTrail[].user.idstringUnique identifier for the user
data.auditTrail[].user.namestringName of the user
data.auditTrail[].activityobjectDetails about the audit trail entry
data.auditTrail[].activity.beforeobjectGives the old state
data.auditTrail[].activity.afterobjectGives the new state
data.contextobjectAdditional context for the audit trail
data.context.countnumberThe total number of audit trail

Response Example

{
  "ok": true,
  "data": {
    "auditTrail": [
      {
        "fieldType": "GSTIN",
        "type": "UPDATE",
        "actionBy": "USER",
        "createdOn": "2024-07-14T15:31:58.024Z",
        "user": {
          "id": "u292pekfp7ng",
          "name": "John Doe"
        },
        "activity": {
          "before": {
            "value": "29AAKCD1279Q1ZU"
          },
          "after": {
            "value": "29AAKCD1279Q14U"
          }
        }
      },
      {
        "fieldType": "BANK",
        "type": "DELETE",
        "actionBy": "USER",
        "createdOn": "2024-07-14T19:55:41.879Z",
        "user": {
          "id": "u292pekfp7ng",
          "name": "John Doe"
        },
        "activity": {
          "before": {
            "value": {
              "ifsc": "CONT0012345",
              "accountNumber": "20171562005"
            }
          }
        }
      }
    ],
    "context": {
      "count": 2
    }
  }
}

Error Responses

Missing Vendor ID

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Vendor ID is required"
  }
}

Vendor Not Found

HTTP Status: 404 Not Found
{
  "ok": false,
  "error": {
    "code": "VENDOR_NOT_FOUND",
    "message": "Vendor not found"
  }
}

Access Denied

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: You can only view your own vendors or vendors where you are the vendor owner"
  }
}

Authentication Errors

HTTP Status: 401 Unauthorized
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}

Permission Errors

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}

Best Practices

Access Control

  • Only vendors you created or where you are the vendor owner are accessible (unless you have admin or auditor role)
  • Use the vendor id returned from the vendor creation endpoint to retrieve audit trail