Skip to content

Pixels

The pixels() method provides access to the pixels API endpoints.

Get all pixels

This method returns a list of all pixels available to the user.

val pixels = api.pixels().getPixels()

Parameters

  • search (optional): A search string to filter the results.
  • page (optional): The page number to return.
  • pageSize (optional): The number of results to return per page.

Get a pixel by ID

This method returns the details of a specific pixel.

val pixel = api.pixels().getPixel("pixel-id")

Create a pixel

This method creates a new tracking pixel.

val pixel = api.pixels().createPixel(
    name = "New Pixel",
    slug = "new-pixel-slug",
    teamId = "team-id"
)

Parameters

  • name (required): The name for the pixel.
  • slug (required): The slug for the pixel.
  • teamId (optional): The ID of the team to associate the pixel with.

Update a pixel

This method updates the details of a specific pixel.

val pixel = api.pixels().updatePixel(
    pixelId = "pixel-id",
    request = UpdatePixelRequest(
        name = "New Pixel Name",
        slug = "new-pixel-slug"
    )
)

Delete a pixel

This method deletes a specific pixel.

api.pixels().deletePixel("pixel-id")