---
updatedAt: 2026-04-21T04:23:54.000Z
agentTools:
  projectIndex: https://developer.blueshift.com/llms.txt
---

# Most recent event

Use this endpoint to fetch the most recent event. It returns the latest events our server has received for each event type.

## API at a glance

**Description:** This API fetches the most recent event received by the Blueshift server. It returns the latest event data for each event type, useful for debugging and testing event integrations.

## Authentication & testing

<details>
  <summary><strong>Testing the API on this page</strong></summary>

  <h3>How to try it here</h3>

  <ul>
    <li>Use your <strong>User API Key</strong> as the <strong>Username</strong> (leave <strong>Password</strong> blank).</li>

<Image align="center" border={true} width="100% " src="https://files.readme.io/c11a123983769d19ed808108a287068e6ddab2f279c4771a8f34c47fb8c6a40d-Account-Settings-User-API.png" className="border" />

<li>Select the appropriate API endpoint based on your Blueshift region.</li>

    <img src="https://files.readme.io/a567ea5d40fd528b7651d01be5932921690ecbe9786b366284cb2bd48f05ff7d-API_-_Select_Region_-_With_Highlights.png" alt="API - Select Region" width="75%" />

    <li>Enter the necessary parameters and click <strong>Try It</strong> to run the request.</li>
  </ul>
</details>

<details>
  <summary><strong>Authentication using Base64 encoding</strong></summary>

  <h3>Note for developers</h3>

  <p>
    API requests require authentication using HTTP Basic Authentication with an API key.
    The API key serves as the username, while the password field should be left empty.
    The format to encode is: <code>your\_api\_key:</code> (note the trailing colon).
  </p>

  <p>
    This string must be Base64-encoded and included in the request's Authorization header
    as follows:
  </p>

  <pre><code>Authorization: Basic encoded\_value</code></pre>

  <p>
    You can generate the encoded value using a trusted
    <a href="https://gchq.github.io/CyberChef/#recipe=To_Base64('A-Za-z0-9%2B/%3D')" target="_blank">Base64 encoder</a>.
  </p>
</details>

***

<h4>Postman collection</h4>

<p>
  <strong>Try it with Postman:</strong>
  Explore the API using <a href="https://developer.blueshift.com/reference/test-apis#postman-collection" target="_blank">Blueshift's Postman collection.</a>
</p>

***

## Things to know before you start

* **Debug endpoint:** This endpoint is primarily used for debugging and testing event tracking implementations.
* **No parameters required:** This is a simple GET request with no query or body parameters.
* **Latest event only:** Returns only the most recent event received by the server for each event type.
* **Use case:** Best for verifying that events are being received correctly, testing event payloads, and debugging event tracking issues.

## Request parameters

This endpoint does not require any parameters.

## Example requests & responses

<details>
  <summary><strong>Get most recent event</strong></summary>

**Request**

```bash
curl --request GET \
     --url https://api.getblueshift.com/api/v1/event/debug \
     --header 'accept: application/json' \
     --header 'authorization: Basic <YOUR_EVENT_API_KEY>'
```

**Response**

```json
{
  "customer_id": "812123",
  "event": "identify",
  "device_type": "ios",
  "device_tokens": "49244924492449244924492449244924492449244924",
  "device_id": "8abe3faa-d48d-4e4a-00ca-beae01f1c987",
  "device_idfa": "4d031ed8-c40e-57d4-9c99-a3e308d8cd78",
  "device_idfv": "6d031ec8-e40c-47d4-9c99-b3e308d8ed78",
  "device_manufacturer": "apple",
  "os_name": "ios",
  "network_carrier": "verizon",
  "ip": "123.123.123.123",
  "email": "janedoe@acme.com",
  "latitude": "212.99333",
  "longitude": "-12.39334"
}
```

</details>

<details>
<summary><strong>API error responses</strong></summary>

<Callout icon="📘" theme="info">
  ### Note

  The following error codes are commonly returned by Blueshift APIs. Depending on the specific endpoint, not all may apply.
</Callout>

<Table>
  <thead>
    <tr>
      <th>
        Status code
      </th>

      <th>
        Description
      </th>

      <th>
        Example responses
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **400 Bad Request**
      </td>

      <td>
        The request is invalid due to missing or incorrect parameters. This includes missing fields, invalid values, formatting issues, or conflicts such as duplicate data.
      </td>

      <td>
        `{ "errors": { "name": ["can't be blank"] } }`

        `{ "errors": { "startdate": ["can't be blank"] } }`
      </td>
    </tr>

    <tr>
      <td>
        **401 Unauthorized**
      </td>

      <td>
        API authentication failed due to an invalid or missing API key.
      </td>

      <td>
        `{ "message": "Not authorized" }`
      </td>
    </tr>

    <tr>
      <td>
        **403 Forbidden**
      </td>

      <td>
        The API key does not have sufficient permissions to perform this action.
      </td>

      <td>
        `{ "message": "Permission denied" }`
      </td>
    </tr>

    <tr>
      <td>
        **404 Not Found**
      </td>

      <td>
        The specified campaign was not found. Verify the campaign UUID.
      </td>

      <td>
        `{ "message": "Campaign not found" }`
      </td>
    </tr>

    <tr>
      <td>
        **422 Unprocessable Entity**
      </td>

      <td>
        * The campaign cannot be paused due to its current status (e.g., already completed or archived).
        * One or more scheduling parameters may be invalid (if applicable).
      </td>

      <td>
        `{ "message": "Campaign cannot be paused in its current status." }`

        `{ "message": "Invalid schedule values" }`
      </td>
    </tr>

    <tr>
      <td>
        **429 Too Many Requests**
      </td>

      <td>
        The request limit has been exceeded. Reduce request frequency.
      </td>

      <td>
        `{ "message": "Rate limit exceeded" }`
      </td>
    </tr>

    <tr>
      <td>
        **500 Internal Server Error**
      </td>

      <td>
        An unexpected server error occurred. Contact support if the issue persists.
      </td>

      <td>
        `{ "message": "Internal Server Error - Please contact support for more information." }`
      </td>
    </tr>

    <tr>
      <td>
        **502 Bad Gateway**
      </td>

      <td>
        The server received an invalid response. Retry the request.
      </td>

      <td>
        `{ "message": "Bad Gateway - Please retry the request." }`
      </td>
    </tr>

    <tr>
      <td>
        **503 Service Unavailable**
      </td>

      <td>
        The service is temporarily unavailable. Try again later.
      </td>

      <td>
        `{ "message": "Service Unavailable - The service is temporarily unavailable. Try again later." }`
      </td>
    </tr>

    <tr>
      <td>
        **504 Gateway Timeout**
      </td>

      <td>
        The server took too long to respond. Retry the request with exponential backoff.
      </td>

      <td>
        `{ "message": "Gateway Timeout - The server took too long to respond. Retry with exponential backoff." }`
      </td>
    </tr>
  </tbody>
</Table>

</details>

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "These APIs will help you manage different workflows in Blueshift. Our powerful REST APIs provide an easy way to integrate your data and third party applications with Blueshift.",
    "version": "1.0.0",
    "title": "Blueshift APIs",
    "contact": {
      "email": "support@getblueshift.com"
    }
  },
  "tags": [
    {
      "name": "Event",
      "description": "Use the event APIs to send events from your servers."
    }
  ],
  "paths": {
    "/api/v1/event/debug": {
      "get": {
        "summary": "Most recent event",
        "description": "Use this endpoint to fetch the most recent event. It returns the latest events our server has received for each event type.",
        "tags": [
          "Event"
        ],
        "security": [
          {
            "event_api_auth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customer_id": {
                      "type": "string",
                      "example": "812123",
                      "description": "The customer ID."
                    },
                    "event": {
                      "type": "string",
                      "description": "The name of the event. For example, identify, view (product view), add_to_cart, remove_from_cart, checkout, purchase, search, your_custom_event_name (custom event) etc.",
                      "example": "identify"
                    },
                    "device_type": {
                      "type": "string",
                      "description": "The type of the device. For example, ios or android.",
                      "example": "ios"
                    },
                    "device_tokens": {
                      "type": "string",
                      "description": "The token of the device.",
                      "example": "49244924492449244924492449244924492449244924"
                    },
                    "device_id": {
                      "type": "string",
                      "description": "The UUID of the device.",
                      "example": "8abe3faa-d48d-4e4a-00ca-beae01f1c987"
                    },
                    "device_idfa": {
                      "type": "string",
                      "description": "The advertising identifier (idfa) on the device.",
                      "example": "4d031ed8-c40e-57d4-9c99-a3e308d8cd78"
                    },
                    "device_idfv": {
                      "type": "string",
                      "description": "The identfier for vendor (idfv) on the device.",
                      "example": "6d031ec8-e40c-47d4-9c99-b3e308d8ed78"
                    },
                    "device_manufacturer": {
                      "type": "string",
                      "description": "The manufacturer of the device.",
                      "example": "apple"
                    },
                    "os_name": {
                      "type": "string",
                      "description": "The OS name.",
                      "example": "ios"
                    },
                    "network_carrier": {
                      "type": "string",
                      "description": "The carrier on the mobile device.",
                      "example": "verizon"
                    },
                    "ip": {
                      "type": "string",
                      "description": "The IP address of the device.",
                      "example": "123.123.123.123"
                    },
                    "email": {
                      "type": "string",
                      "description": "The user's email address.",
                      "example": "janedoe@acme.com"
                    },
                    "latitude": {
                      "type": "string",
                      "description": "The latitude of the user's location.",
                      "example": "212.99333"
                    },
                    "longitude": {
                      "type": "string",
                      "description": "The longitude of the user's location.",
                      "example": "-12.39334"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request is invalid due to missing or incorrect parameters. This includes missing fields, invalid values, formatting issues, or conflicts such as duplicate data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - API authentication failed due to an invalid or missing API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Not authorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - The API key does not have sufficient permissions to perform this action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The requested resource was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity - The request was well-formed but contains semantic errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "Validation failed"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - The request limit has been exceeded. Reduce request frequency.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - An unexpected server error occurred. Contact support if the issue persists.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Internal Server Error"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway - The server received an invalid response. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Bad Gateway"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable - The service is temporarily unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Service Unavailable"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout - The server took too long to respond. Retry the request with exponential backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Gateway Timeout"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.getblueshift.com"
    },
    {
      "url": "https://api.eu.getblueshift.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "event_api_auth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```