User activity logs

Handling user information

Getting started with Accounts

Accounts at Brevo are used to hold the accounts information along with the payment plans and credit details of the clients. There are some pre-requisites to using the Accounts endpoints which include:

  1. Having a valid Brevo account.
  2. Having a valid and correct API key.
  3. In some cases, only Enterprise clients can use the endpoints.

1. Get user activity logs

You can use the endpoint https://api.brevo.com/v3/organization/activities with the GET method. Through this endpoint, you can get the following information:

  • Information about user login.
  • When a user is invited to access the account, it provides the details regarding it.
  • When you profile is edited, it notifies you about that.
  • When the invited user accesses the account, it notifies you about that.
  • If the user changes email, this endpoint will inform you about the information about email change.

The cURL request for getaccountactivity is mentioned below:

curl --request GET \
     --url 'https://api.brevo.com/v3/organization/activities?startDate=2023-01-01&endDate=2023-02-01&limit=10&offset=0' \
     --header 'accept: application/json' \
     --header 'api-key: '

This endpoint can be used by the Enterprise clients. The attributes for this endpoint are mentioned below in the table:

AttributeDatatypeDescriptionValue
startDateStringMandatory if endDate is used. Enter start date in the (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.2023-01-01
endDateStringMandatory if startDate is used. Enter end date in(YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.2023-02-01
limitInt64Number of documents per page10
offsetInt64Index of the first document in the page.0

Response

A sample JSON response which shows the status of login and profile update would look something like this:

{
  “logs”: [
    {
      “action”: “login-success”,
      “date”: “2023-03-16T16:49:23+05:30”,
      “user_email”: “[email protected]”,
      “user_ip”: “192.158.1.34”,
      “user_agent”: “Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)”
    },
    {
      “action”: “update-profile”,
      “date”: “2023-03-15T16:49:23+05:30”,
      “user_email”: “[email protected]”,
      “user_ip”: “192.158.1.38”,
      “user_agent”: “Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)“,
      “count”: 2
    }
  ]
}

The response codes for the endpoints are mentioned below:

Response codeMessageDescription
200List of user activity logsShows the user activity logs
400Bad requestBad request occurs due to problems like invalid_parameter or reseller_permission_denied or not_enough_credits. It also arises if you are not using the Enterprise plan.