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

# Create Company Punch Detail Operation

POST https://api.paylocity.com/apiHub/time/v2/companies/{companyId}/punchDetails
Content-Type: application/json

**Summary Description**

The Company Punch Detail API offers access to comprehensive punch data at the company level. This API will include all punch data for all employees within a timeframe. It serves as a tool for accessing, analyzing, managing time-related records, and providing intricate details related to employee punches. Calls to this endpoint can be filtered by date range.

**Key Features**
- Company-Level Data: Retrieve punch details for all employees in a company.
- Employee-Level Insights: Filter and access individual employee punch records.
- Custom Timeframes: Specify start and end dates to narrow down the data range.
- Detailed Records: Access intricate details such as punch times, locations, and punch types (e.g., clock-in, clock-out).

```
Filtering by Date Range
The Punch Detail API can be filtered by the relative date and time based on your time zone. For example:
Start of the day: At 00:00:00 (midnight), marking the beginning of the day.
Midday: At 12:00:00 (noon), halfway through the day.
End of the day: At 23:59:00, just a second before the next day begins.
```

**Use Cases:**
- Time Tracking and Payroll Integration: Integrate punch details into payroll systems to ensure accurate and efficient calculation of employee hours worked.
- Attendance and Compliance Monitoring: Generate attendance reports and monitor compliance with labor laws and company policies.
- Performance Analysis: Analyze punch patterns to identify trends, such as overtime or under-utilized employee hours.
- Real-Time Insights for Managers: Provide managers with up-to-date punch data for better workforce management and scheduling.
- HR and Administrative Audits: Simplify audits by offering detailed, exportable punch records to meet internal and external reporting requirements.

This API is an essential tool for companies looking to streamline workforce management and improve operational efficiency. With its detailed punch data, it supports a wide range of business functions, from compliance to analytics.

For more information on implementing this API, see our [Punch Details Overview](https://developer.paylocity.com/integrations/reference/punch-detail-overview)

Reference: https://paylocity.ferndocs.com/time-labor/api-reference/paylocity-ap-is/punch-detail-company-punch-details/create-company-punch-detail-operation

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `companyId` (string, required)

### Headers

- `Accept` (string, optional)

## Response

### 200

Successful response

## Examples

**Request**

```json
{
  "relativeStart": "2020-10-09T12:33:56.047Z",
  "relativeEnd": "1992-03-09T22:49:54.659Z"
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails"

payload = {
    "relativeStart": "2020-10-09T12:33:56.047Z",
    "relativeEnd": "1992-03-09T22:49:54.659Z"
}
headers = {
    "Accept": "application/json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"relativeStart":"2020-10-09T12:33:56.047Z","relativeEnd":"1992-03-09T22:49:54.659Z"}'
};

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://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails"

	payload := strings.NewReader("{\n  \"relativeStart\": \"2020-10-09T12:33:56.047Z\",\n  \"relativeEnd\": \"1992-03-09T22:49:54.659Z\"\n}")

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

	req.Header.Add("Accept", "application/json")
	req.Header.Add("Authorization", "Bearer <token>")
	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://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails")

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

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"relativeStart\": \"2020-10-09T12:33:56.047Z\",\n  \"relativeEnd\": \"1992-03-09T22:49:54.659Z\"\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://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"relativeStart\": \"2020-10-09T12:33:56.047Z\",\n  \"relativeEnd\": \"1992-03-09T22:49:54.659Z\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails', [
  'body' => '{
  "relativeStart": "2020-10-09T12:33:56.047Z",
  "relativeEnd": "1992-03-09T22:49:54.659Z"
}',
  'headers' => [
    'Accept' => 'application/json',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"relativeStart\": \"2020-10-09T12:33:56.047Z\",\n  \"relativeEnd\": \"1992-03-09T22:49:54.659Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Accept": "application/json",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "relativeStart": "2020-10-09T12:33:56.047Z",
  "relativeEnd": "1992-03-09T22:49:54.659Z"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.paylocity.com/apiHub/time/v2/companies/companyId/punchDetails")! 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()
```