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

# Get Attendance Novelties

GET https://www.crehana.com/api/v5/rest/org/{organization_slug}/reports/attendance/novelties/

Attendance novelties of a period, ready to load into payroll: the same rows and the same 13 columns as the Excel report downloaded from Attendance cards («Descargar reporte»), with the same period and concepts.

- One row per novelty: overtime, tardiness, absences, early departures, work on rest days, holidays and Sundays, time off with and without pay, sick leave and compensated time. Overtime comes as one row per pay factor.
- `from_date` and `to_date` are required, inclusive, and at most 31 days apart.
- `concepts` narrows the rows to some concepts (comma separated). Without it, every concept is returned.
- A cell the Excel report shows as a dash comes as `null`, never as empty text.
- Rows follow the order of the Excel report: by person, then by date. Walk them with `cursor` / `next_cursor`.
- Requires credentials of an administrator of the organization.

Reference: https://developer.crehana.com/api-reference/endpoints/reports/get-attendance-novelties

## Authentication

- `Api-Key` header (required) — API key of the organization. Always sent together with the `Secret-Access` header.

## Servers

- `https://www.crehana.com` (Production, default)
- `https://qa.creha.co` (QA)

## Request

### Path parameters

- `organization_slug` (string, required)

### Query parameters

- `from_date` (string, required) — Required, in YYYY-MM-DD format. Inclusive. The window between `from_date` and `to_date` cannot exceed 31 days. Applies to the day of the novelty (`start_date`), the same period the Attendance cards Excel report asks for.
- `to_date` (string, required) — Required, in YYYY-MM-DD format. Inclusive. The window between `from_date` and `to_date` cannot exceed 31 days. Applies to the day of the novelty (`start_date`), the same period the Attendance cards Excel report asks for.
- `concepts` (string, optional) — Concepts to include, comma separated, for example `EXTRA_HOURS,SICK_LEAVE`. Omit it to get every concept. Valid values: EXTRA_HOURS, TARDINESS, UNJUSTIFIED_ABSENCE, EARLY_DEPARTURE, WORKED_REST_DAY, WORKED_HOLIDAY, SUNDAY_WORKDAY, PAID_TIME_OFF, UNPAID_TIME_OFF, SICK_LEAVE, COMPENSATED_TIME.
- `limit` (integer, optional, default: 100) — Rows per page, up to 500. Defaults to 100 when omitted.
- `cursor` (string, optional) — Cursor for the next page. Take it from `next_cursor` in the previous response and send it back unchanged; it is opaque. Omit it for the first page. It points to a row position: if the attendance of the period is recalculated between two pages, the walk can repeat or skip a row, so prefer periods already closed.

## Response

### 200

Successful Response

- `total` (integer, required) — Rows in the whole period.
- `from_date` (date, required)
- `to_date` (date, required)
- `results` (list of AttendanceNovelty, required)
- `has_next_page` (boolean, required)
- `next_cursor` (string, optional) — Send it as `cursor` to get the next page.

## Errors

### 400 Bad Request Error

Invalid or missing dates, a window over 31 days, an unknown concept or an invalid cursor

- `message` (string, required)
- `errors` (list of string, required)
- `datetime` (string, optional)

### 401 Unauthorized Error

Missing or invalid credentials

- `any`

### 403 Forbidden Error

The credentials do not administer the organization

- `any`

### 422 Unprocessable Entity Error

A query parameter has the wrong type

- `any`

### 503 Service Unavailable Error

Attendance did not answer

- `any`

## Types

### AttendanceNovelty

One attendance novelty: one row of the Attendance cards Excel report.

- `start_date` (date, required) — Start date of the novelty.
- `email` (string, required) — Email of the person.
- `concept` (string, required) — Novelty concept, as a code: `EXTRA_HOURS`, `TARDINESS`, `UNJUSTIFIED_ABSENCE`, `EARLY_DEPARTURE`, `WORKED_REST_DAY`, `WORKED_HOLIDAY`, `SUNDAY_WORKDAY`, `PAID_TIME_OFF`, `UNPAID_TIME_OFF`, `SICK_LEAVE`, `COMPENSATED_TIME`. New codes may be added; ignore or log the ones you do not know.
- `end_date` (date, optional) — End date. Only on time-off rows, one row per day; null on the rest.
- `first_name` (string, optional) — First name.
- `last_name` (string, optional) — Last names.
- `username` (string, optional) — Username in Crehana.
- `document_number` (string, optional) — Identity document number.
- `legal_entity` (string, optional) — Legal entity of the person's current contract.
- `shift` (string, optional) — Shift assigned that day, with the name it had then.
- `value` (string, optional) — Value exactly as the Excel report shows it: `h:mm` for a duration (`2:30`), `h:mm (xN)` when a pay factor applies (`2:00 (x2)`), or days for a time off (`1 día`, `0.5 días`). Null when the size of a time off is unknown.
- `reason` (string, optional) — Reason written by the administrator. Only on `EXTRA_HOURS` and `COMPENSATED_TIME` rows that have one.
- `imss_folio` (string, optional) — IMSS folio (Mexico). Only on `SICK_LEAVE` rows that have one.

## Examples

**Response**

```json
{
  "total": 1,
  "from_date": "2023-01-15",
  "to_date": "2023-01-15",
  "results": [
    {
      "start_date": "2023-01-15",
      "email": "string",
      "concept": "string",
      "end_date": "2023-01-15",
      "first_name": "string",
      "last_name": "string",
      "username": "string",
      "document_number": "string",
      "legal_entity": "string",
      "shift": "string",
      "value": "string",
      "reason": "string",
      "imss_folio": "string"
    }
  ],
  "has_next_page": true,
  "next_cursor": "string"
}
```

**SDK Code**

```python
import requests

url = "https://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/"

querystring = {"from_date":"from_date","to_date":"to_date"}

headers = {
    "Secret-Access": "Secret-Access",
    "Api-Key": "<apiKey>"
}

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

print(response.json())
```

```javascript
const url = 'https://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/?from_date=from_date&to_date=to_date';
const options = {
  method: 'GET',
  headers: {'Secret-Access': 'Secret-Access', 'Api-Key': '<apiKey>'}
};

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://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/?from_date=from_date&to_date=to_date"

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

	req.Header.Add("Secret-Access", "Secret-Access")
	req.Header.Add("Api-Key", "<apiKey>")

	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://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/?from_date=from_date&to_date=to_date")

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

request = Net::HTTP::Get.new(url)
request["Secret-Access"] = 'Secret-Access'
request["Api-Key"] = '<apiKey>'

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://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/?from_date=from_date&to_date=to_date")
  .header("Secret-Access", "Secret-Access")
  .header("Api-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/?from_date=from_date&to_date=to_date', [
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Secret-Access' => 'Secret-Access',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/?from_date=from_date&to_date=to_date");
var request = new RestRequest(Method.GET);
request.AddHeader("Secret-Access", "Secret-Access");
request.AddHeader("Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Secret-Access": "Secret-Access",
  "Api-Key": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.crehana.com/api/v5/rest/org/organization_slug/reports/attendance/novelties/?from_date=from_date&to_date=to_date")! 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()
```