> 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 Shifts Report

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

Attendance report 1: catalog of configured shifts (one per row).

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

## 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, optional) — Start of the range, in YYYY-MM-DD format. Inclusive. With no `to_date` the range stays open going forward. Applies to the shift creation date (`created_at`). Unlike the other Attendance reports, there is no dated event to filter on here: what the range narrows down is when the shift was configured.
- `to_date` (string, optional) — End of the range, in YYYY-MM-DD format. Inclusive: the whole day is covered, not just its midnight. For a single day, send the same date in `from_date` and in `to_date`. Applies to the shift creation date (`created_at`). Unlike the other Attendance reports, there is no dated event to filter on here: what the range narrows down is when the shift was configured.
- `is_active` (boolean, required) — Required. Shift status to return: `true` only active shifts, `false` only inactive ones. `total` and pagination count only the shifts in that status.
- `limit` (integer, optional, default: 100) — Rows per page, up to 500. Defaults to 100 when omitted.
- `offset` (integer, optional) — Rows to skip before the page. Use it together with `limit` to walk the report: 0, then `limit`, then twice `limit`, and so on.

## Response

### 200

Successful Response

- `results` (list of AttendanceShiftReport, required)
- `total` (integer, optional)

## Errors

### 400 Bad Request Error

Bad Request

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

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### AttendanceShiftReport

Report 1 — Shift creation. One row per configured shift.

- `shift_name` (string, optional)
- `shift_type` (string, optional)
- `schedule` (string, optional)
- `days` (string, optional)
- `tolerance_before_minutes` (integer, optional)
- `tolerance_after_minutes` (integer, optional)
- `is_active` (boolean, optional)
- `created_by_name` (string, optional)
- `created_at` (date, optional)
- `updated_at` (date, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "results": [
    {
      "shift_name": "string",
      "shift_type": "string",
      "schedule": "string",
      "days": "string",
      "tolerance_before_minutes": 1,
      "tolerance_after_minutes": 1,
      "is_active": true,
      "created_by_name": "string",
      "created_at": "2023-01-15",
      "updated_at": "2023-01-15"
    }
  ],
  "total": 1
}
```

**SDK Code**

```python
import requests

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

querystring = {"is_active":"true"}

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/shifts/?is_active=true';
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/shifts/?is_active=true"

	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/shifts/?is_active=true")

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/shifts/?is_active=true")
  .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/shifts/?is_active=true', [
  '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/shifts/?is_active=true");
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/shifts/?is_active=true")! 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()
```