Skip to main content
API Reference
Cards
Events

Events are records of things that happened to objects at Increase. Events are accessible via the List Events endpoint and can be delivered to your application via webhooks. For more information, see our webhooks guide.

The Event object
{
  "associated_object_id": "account_in71c4amph0vgo2qllky",
  "associated_object_type": "account",
  "category": "account.created",
  "created_at": "2020-01-31T23:59:59Z",
  "id": "event_001dzz0r20rzr4zrhrr1364hy80",
  "type": "event"
}
Attributes
associated_object_id
string

The identifier of the object that generated this Event.

associated_object_type
string

The type of the object that generated this Event.

category
enum

The category of the Event. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.

created_at
string

The time the Event was created.

id
string

The Event identifier.

type
string

A constant representing the object’s type. For this resource it will always be event.

List Events
curl \
  --url "${INCREASE_URL}/events" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
import Increase from 'increase';

const client = new Increase({
  apiKey: process.env['INCREASE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const event of client.events.list()) {
  console.log(event.id);
}
import os
from increase import Increase

client = Increase(
    api_key=os.environ.get("INCREASE_API_KEY"),  # This is the default and can be omitted
)
page = client.events.list()
page = page.data[0]
print(page.id)
require "increase"

increase = Increase::Client.new(
  api_key: ENV["INCREASE_API_KEY"] # This is the default and can be omitted
)

page = increase.events.list

puts(page)
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/Increase/increase-go"
	"github.com/Increase/increase-go/option"
)

func main() {
	client := increase.NewClient(
		option.WithAPIKey(os.Getenv("INCREASE_API_KEY")), // This is the default and can be omitted
	)
	page, err := client.Events.List(context.TODO(), increase.EventListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
package com.increase.api.example;

import com.increase.api.client.IncreaseClient;
import com.increase.api.client.okhttp.IncreaseOkHttpClient;
import com.increase.api.models.events.EventListPage;
import com.increase.api.models.events.EventListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        IncreaseClient client = IncreaseOkHttpClient.fromEnv();

        EventListPage page = client.events().list();
    }
}
package com.increase.api.example

import com.increase.api.client.IncreaseClient
import com.increase.api.client.okhttp.IncreaseOkHttpClient
import com.increase.api.models.events.EventListPage
import com.increase.api.models.events.EventListParams

fun main() {
    val client: IncreaseClient = IncreaseOkHttpClient.fromEnv()

    val page: EventListPage = client.events().list()
}
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Increase\Client;
use Increase\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('INCREASE_API_KEY'));

try {
  $page = $client->events->list(
    associatedObjectID: 'associated_object_id',
    category: ['in' => ['account.created']],
    createdAt: [
      'after' => new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
      'before' => new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
      'onOrAfter' => new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
      'onOrBefore' => new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
    ],
    cursor: 'cursor',
    limit: 1,
    orderBy: ['direction' => 'ascending', 'field' => 'created_at'],
  );

  var_dump($page);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using Increase.Api;
using Increase.Api.Models.Events;

IncreaseClient client = new();

EventListParams parameters = new();

var page = await client.Events.List(parameters);
await foreach (var item in page.Paginate())
{
    Console.WriteLine(item);
}
Returns a list response :
{
  "data": [
    { /* Event object */ },
    { /* Event object */ }
    /* ... */
  ],
  "next_cursor": "v57w5d",
}
Parameters
category.in
array of strings

Filter Events for those with the specified category or categories. For GET requests, this should be encoded as a comma-delimited string, such as ?in=one,two,three.

associated_object_id
string

Filter Events to those belonging to the object with the provided identifier.

order_by.direction
enum

The direction to order in.

order_by.field
enum

The field to order by.

More
cursor
string
limit
integer
created_at.after
string
created_at.before
string
created_at.on_or_after
string
created_at.on_or_before
string
Retrieve an Event
curl \
  --url "${INCREASE_URL}/events/event_001dzz0r20rzr4zrhrr1364hy80" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
import Increase from 'increase';

const client = new Increase({
  apiKey: process.env['INCREASE_API_KEY'], // This is the default and can be omitted
});

const event = await client.events.retrieve('event_001dzz0r20rzr4zrhrr1364hy80');

console.log(event.id);
import os
from increase import Increase

client = Increase(
    api_key=os.environ.get("INCREASE_API_KEY"),  # This is the default and can be omitted
)
event = client.events.retrieve(
    "event_001dzz0r20rzr4zrhrr1364hy80",
)
print(event.id)
require "increase"

increase = Increase::Client.new(
  api_key: ENV["INCREASE_API_KEY"] # This is the default and can be omitted
)

event = increase.events.retrieve("event_001dzz0r20rzr4zrhrr1364hy80")

puts(event)
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/Increase/increase-go"
	"github.com/Increase/increase-go/option"
)

func main() {
	client := increase.NewClient(
		option.WithAPIKey(os.Getenv("INCREASE_API_KEY")), // This is the default and can be omitted
	)
	event, err := client.Events.Get(context.TODO(), "event_001dzz0r20rzr4zrhrr1364hy80")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", event.ID)
}
package com.increase.api.example;

import com.increase.api.client.IncreaseClient;
import com.increase.api.client.okhttp.IncreaseOkHttpClient;
import com.increase.api.models.events.Event;
import com.increase.api.models.events.EventRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        IncreaseClient client = IncreaseOkHttpClient.fromEnv();

        Event event = client.events().retrieve("event_001dzz0r20rzr4zrhrr1364hy80");
    }
}
package com.increase.api.example

import com.increase.api.client.IncreaseClient
import com.increase.api.client.okhttp.IncreaseOkHttpClient
import com.increase.api.models.events.Event
import com.increase.api.models.events.EventRetrieveParams

fun main() {
    val client: IncreaseClient = IncreaseOkHttpClient.fromEnv()

    val event: Event = client.events().retrieve("event_001dzz0r20rzr4zrhrr1364hy80")
}
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Increase\Client;
use Increase\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('INCREASE_API_KEY'));

try {
  $event = $client->events->retrieve('event_001dzz0r20rzr4zrhrr1364hy80');

  var_dump($event);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using Increase.Api;
using Increase.Api.Models.Events;

IncreaseClient client = new();

EventRetrieveParams parameters = new()
{
    EventID = "event_001dzz0r20rzr4zrhrr1364hy80"
};

var event_ = await client.Events.Retrieve(parameters);

Console.WriteLine(event_);
Parameters
event_id
string
Required

The identifier of the Event.

More about Events.