> 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.

# Create Attendance Mark

POST https://www.crehana.com/api/v5/rest/org/{organization_slug}/time/attendance/marks/
Content-Type: application/json

Records one attendance mark of a person — entry, break start, break end or exit — with the real time it happened. Built for biometric clocks and access-control systems that send each mark as it occurs, or later in a batch. Step-by-step guide: [Send attendance marks](/documentacion/casos-de-uso/enviar-marcajes).

The mark goes through the same rules as a mark made in Crehana: it is assigned to the person's shift for that day, classified for punctuality and included in the daily attendance.

- `marked_at` is the real time of the mark, **with UTC offset**. Marks sent hours later keep their original time.
- `timezone` is the IANA zone where the person marked. It decides the local day of the mark: 23:30 on the 6th in Mexico City is the 6th, not the 7th in UTC. See the [time zones guide](/documentacion/conceptos/zonas-horarias).
- Sending the same mark again (same person, type and minute) does not duplicate it: the answer is `200` with `already_registered: true`. Retrying after a timeout is safe.
- A different time for a type the shift already has (a second `ENTRY`) is a `409`.
- A mark out of order (an `EXIT` with no open `ENTRY`, a break the shift does not have, two marks in the same minute) is a `400`, with the rule in the message.
- The person must be set up in Attendance in the organization, otherwise `404`.
- Requires credentials of an administrator of the organization.

Reference: https://developer.crehana.com/api-reference/endpoints/attendance/create-attendance-mark

## 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)

### Body (application/json)

This endpoint expects a CreateAttendanceMarkInput.

- `user_id` (integer, required) — Centralized id of the person who marked: `user.id` in `GET /org/{organization_slug}/users/user-organizations/`. Not the learning user id. The person must be set up in Attendance in the organization.
- `mark_type` (enum, required) — `ENTRY` starts the workday, `BREAK_START` / `BREAK_END` wrap a break, `EXIT` ends it. A day goes ENTRY → BREAK_START → BREAK_END → EXIT.
  - Allowed values: `ENTRY`, `BREAK_START`, `BREAK_END`, `EXIT`
- `marked_at` (datetime, required) — Real date and time of the mark in ISO 8601 **with UTC offset** (`2026-10-07T08:58:00-06:00`) or in UTC with `Z` (`2026-10-07T14:58:00Z`). A value without offset is rejected. It cannot be in the future; seconds are ignored.
- `timezone` (string, required) — IANA time zone of the place where the person marked, with its exact upper/lower case (`America/Mexico_City`, `America/Lima`). It decides the local day of the mark and the shift it is compared with. Offsets (`-06:00`) and abbreviations (`CST`) are not time zones.

## Response

### 200

The same mark had already been sent; nothing new

- `success` (boolean, required) — True when the mark is stored.
- `message` (string, required) — Human readable result.
- `code` (string, required) — `attendance-001` when the mark was created, `attendance-002` when it already existed. Not an HTTP status.
- `datetime` (string, required) — Datetime of the API in ISO Format
- `data` (AttendanceMark, required)

### 201

Mark created

- `success` (boolean, required) — True when the mark is stored.
- `message` (string, required) — Human readable result.
- `code` (string, required) — `attendance-001` when the mark was created, `attendance-002` when it already existed. Not an HTTP status.
- `datetime` (string, required) — Datetime of the API in ISO Format
- `data` (AttendanceMark, required)

## Errors

### 400 Bad Request Error

Unknown organization or a mark that breaks the day's rules

- `detail` (AttendanceErrorDetail, required)

### 401 Unauthorized Error

Missing or invalid credentials

- `any`

### 403 Forbidden Error

The credentials do not administer the organization

- `detail` (AttendanceErrorDetail, required)

### 404 Not Found Error

The user is not set up in Attendance in the organization

- `detail` (AttendanceErrorDetail, required)

### 409 Conflict Error

The shift already has a mark of that type at another time, or the same mark arrived twice at the same moment

- `detail` (AttendanceErrorDetail, required)

### 422 Unprocessable Entity Error

The body does not match the schema

- `any`

## Types

### AttendanceMark

- `id` (string, required) — Id of the mark.
- `user_id` (integer, required) — Centralized id of the person.
- `mark_type` (string, required) — `ENTRY`, `BREAK_START`, `BREAK_END` or `EXIT`.
- `mark_date` (date, required) — Local day the mark belongs to, in `timezone`.
- `marked_at` (string, required) — Instant of the mark, in UTC.
- `timezone` (string, required) — IANA time zone sent with the mark.
- `status` (string, required) — Punctuality against the person's shift: `ON_TIME`, `ACCEPTABLE`, `LATE`, `EARLY`, `OUT_OF_SCHEDULE`, `REGISTERED` (no shift to compare with) or `PENDING`.
- `shift_slot` (integer, required) — Which of the day's shifts the mark belongs to (1-based).
- `source` (string, required) — Origin of the mark: `BIOMETRIC`.
- `already_registered` (boolean, required) — True when the same mark (same type, same minute) had already been sent: nothing new was written and this is the stored one.

### AttendanceErrorDetail

- `errors` (list of string, required) — Why the request was rejected, for a log or a person.
- `code` (string, optional) — Stable reason to program against, when there is one.
- `user_ids` (list of integer, optional) — Only with `USER_NOT_FOUND` on shift assignments: the ids that do not belong to the organization.
- `shift_id` (string, optional) — Only with `SHIFT_NAME_ALREADY_EXISTS` on shift creation: the id of the active shift that already has that name.

## Examples

### Example 1

**Request**

```json
{
  "user_id": 97099,
  "mark_type": "ENTRY",
  "marked_at": "2026-10-07T08:58:00-06:00",
  "timezone": "America/Mexico_City"
}
```

**Response**

```json
{
  "success": true,
  "message": "Mark created.",
  "code": "attendance-001",
  "datetime": "2026-10-07T09:00:03.120394",
  "data": {
    "id": "4b2b7d0e-6a3a-4f0e-9a8e-2f6c1d9b7c11",
    "user_id": 97097,
    "mark_type": "ENTRY",
    "mark_date": "2026-10-07",
    "marked_at": "2026-10-07T15:00:00+00:00",
    "timezone": "America/Mexico_City",
    "status": "ON_TIME",
    "shift_slot": 1,
    "source": "BIOMETRIC",
    "already_registered": false
  }
}
```

**SDK Code**

```python
import requests

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

payload = {
    "user_id": 97099,
    "mark_type": "ENTRY",
    "marked_at": "2026-10-07T08:58:00-06:00",
    "timezone": "America/Mexico_City"
}
headers = {
    "Secret-Access": "Secret-Access",
    "Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/';
const options = {
  method: 'POST',
  headers: {
    'Secret-Access': 'Secret-Access',
    'Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"user_id":97099,"mark_type":"ENTRY","marked_at":"2026-10-07T08:58:00-06:00","timezone":"America/Mexico_City"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Secret-Access", "Secret-Access")
	req.Header.Add("Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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/time/attendance/marks/")

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

request = Net::HTTP::Post.new(url)
request["Secret-Access"] = 'Secret-Access'
request["Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}"

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.post("https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/")
  .header("Secret-Access", "Secret-Access")
  .header("Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/', [
  'body' => '{
  "user_id": 97099,
  "mark_type": "ENTRY",
  "marked_at": "2026-10-07T08:58:00-06:00",
  "timezone": "America/Mexico_City"
}',
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Content-Type' => 'application/json',
    'Secret-Access' => 'Secret-Access',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/");
var request = new RestRequest(Method.POST);
request.AddHeader("Secret-Access", "Secret-Access");
request.AddHeader("Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Secret-Access": "Secret-Access",
  "Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "user_id": 97099,
  "mark_type": "ENTRY",
  "marked_at": "2026-10-07T08:58:00-06:00",
  "timezone": "America/Mexico_City"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Example 2

**Request**

```json
{
  "user_id": 97099,
  "mark_type": "ENTRY",
  "marked_at": "2026-10-07T08:58:00-06:00",
  "timezone": "America/Mexico_City"
}
```

**Response**

```json
{
  "success": true,
  "message": "Mark created.",
  "code": "attendance-001",
  "datetime": "2026-10-07T09:00:03.120394",
  "data": {
    "id": "4b2b7d0e-6a3a-4f0e-9a8e-2f6c1d9b7c11",
    "user_id": 97097,
    "mark_type": "ENTRY",
    "mark_date": "2026-10-07",
    "marked_at": "2026-10-07T15:00:00+00:00",
    "timezone": "America/Mexico_City",
    "status": "ON_TIME",
    "shift_slot": 1,
    "source": "BIOMETRIC",
    "already_registered": false
  }
}
```

**SDK Code**

```python
import requests

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

payload = {
    "user_id": 97099,
    "mark_type": "ENTRY",
    "marked_at": "2026-10-07T08:58:00-06:00",
    "timezone": "America/Mexico_City"
}
headers = {
    "Secret-Access": "Secret-Access",
    "Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/';
const options = {
  method: 'POST',
  headers: {
    'Secret-Access': 'Secret-Access',
    'Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"user_id":97099,"mark_type":"ENTRY","marked_at":"2026-10-07T08:58:00-06:00","timezone":"America/Mexico_City"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Secret-Access", "Secret-Access")
	req.Header.Add("Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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/time/attendance/marks/")

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

request = Net::HTTP::Post.new(url)
request["Secret-Access"] = 'Secret-Access'
request["Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}"

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.post("https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/")
  .header("Secret-Access", "Secret-Access")
  .header("Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/', [
  'body' => '{
  "user_id": 97099,
  "mark_type": "ENTRY",
  "marked_at": "2026-10-07T08:58:00-06:00",
  "timezone": "America/Mexico_City"
}',
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Content-Type' => 'application/json',
    'Secret-Access' => 'Secret-Access',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/");
var request = new RestRequest(Method.POST);
request.AddHeader("Secret-Access", "Secret-Access");
request.AddHeader("Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"user_id\": 97099,\n  \"mark_type\": \"ENTRY\",\n  \"marked_at\": \"2026-10-07T08:58:00-06:00\",\n  \"timezone\": \"America/Mexico_City\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Secret-Access": "Secret-Access",
  "Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "user_id": 97099,
  "mark_type": "ENTRY",
  "marked_at": "2026-10-07T08:58:00-06:00",
  "timezone": "America/Mexico_City"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/marks/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```