> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.joincandidhealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.joincandidhealth.com/_mcp/server.

# Scan

GET https://api.joincandidhealth.com/api/events/v1/

Scans the last 30 days of events. All results are sorted by created date, descending.

Reference: https://docs.joincandidhealth.com/api-reference/events/v-1/scan

## Authentication

- OAuth2 — send the obtained token as `Authorization: Bearer <token>`

## Servers

- `https://api.joincandidhealth.com` (Production, default)
- `https://api-staging.joincandidhealth.com` (Staging)
- `https://sandbox-api.joincandidhealth.com` (CandidSandbox)
- `https://staging-api.joincandidhealth.com` (CandidStaging)
- `http://localhost:5050` (Local)

## Request

### Query parameters

- `page_token` (string, optional)
- `limit` (integer, optional) — Number of events to return. Minimum value is 1, maximum is 100. Defaults to 10.
- `event_types` (string, optional) — Event types to filter on. Defaults to showing all event types. | Event Type | Description | |------------|-------------| | `CandidApi.Encounter.Created` | When a new claim is created | | `CandidApi.Encounter.StatusUpdated` | When a claim's status has been updated | | `PreEncounter.Patient.Created` | When a new patient has been created | | `PreEncounter.Patient.Updated` | When a patient's information has been updated | | `PreEncounter.Coverage.Created` | When a new coverage has been created for a patient | | `PreEncounter.Coverage.Updated` | When a patient's coverage has been updated | | `PreEncounter.Tag.Created` | When a new tag has been created for a patient | | `PreEncounter.Tag.Updated` | When a patient's tag has been updated | | `CandidApi.OrganizationProvider.Created` | When a new organization provider has been created | | `CandidApi.OrganizationProvider.Updated` | When an organization provider has been updated |
- `created_before` (datetime, optional) — Filters for only events created before this time (inclusive).
- `created_after` (datetime, optional) — Filters for only events created after this time (inclusive).

## Response

### 200

- `items` (list of Event, required)
- `next_page_token` (string, optional)

## Errors

### 400 Bad Request Error

- `errorName` ("BadRequestError", required)
- `content` (BadRequestErrorMessage, required)

### 500 Internal Error

- `errorName` ("InternalError", required)
- `content` (InternalErrorMessage, required)

## Types

### Event

- `id` (UUID, required)
- `created_at` (datetime, required)
- `timestamp` (datetime, required)
- `event_type` (string, required)
- `schema_version` (string, required)
- `payload` (any, required)

### BadRequestErrorMessage

- `message` (string, optional)

### InternalErrorMessage

- `message` (string, optional)

## Examples

**Response**

```json
{
  "items": [
    {
      "id": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
      "created_at": "2024-01-15T09:30:00Z",
      "timestamp": "2024-01-15T09:30:00Z",
      "event_type": "event_type",
      "schema_version": "schema_version",
      "payload": {
        "key": "value"
      }
    },
    {
      "id": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
      "created_at": "2024-01-15T09:30:00Z",
      "timestamp": "2024-01-15T09:30:00Z",
      "event_type": "event_type",
      "schema_version": "schema_version",
      "payload": {
        "key": "value"
      }
    }
  ],
  "next_page_token": "next_page_token"
}
```

**SDK Code**

```python
import requests

url = "https://api.joincandidhealth.com/api/events/v1/"

headers = {"Authorization": "<token>."}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.joincandidhealth.com/api/events/v1/';
const options = {method: 'GET', headers: {Authorization: '<token>.'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.joincandidhealth.com/api/events/v1/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<token>.")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.joincandidhealth.com/api/events/v1/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<token>.'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.joincandidhealth.com/api/events/v1/")
  .header("Authorization", "<token>.")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.joincandidhealth.com/api/events/v1/', [
  'headers' => [
    'Authorization' => '<token>.',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.joincandidhealth.com/api/events/v1/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<token>.");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<token>."]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.joincandidhealth.com/api/events/v1/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```