Agent-Zeit
Zeiten von Coding-Agents pro Projekt erfassen, nachtragen, importieren und auswerten. Keine persönliche Arbeitszeit.
- GET
/projects/{projectId}/project-bindingResolve validated local project metadata and tracking policy - GET
/projects/{projectId}/agent-time-settingsRead tracking policy - PATCH
/projects/{projectId}/agent-time-settingsEnable or disable tracking (project owner or workspace administrator) - GET
/projects/{projectId}/agent-timeRead own times or project report; elapsed times are not billable time - POST
/projects/{projectId}/agent-timeImport immutable, idempotent intervals (maximum 100 per batch; 5000 new intervals per project/UTC day) - POST
/projects/{projectId}/agent-time-importBackfill or import historical time entries (maximum 400 rows; all-or-nothing, idempotent per row)
Die Referenz wird aus der englischen OpenAPI-Spezifikation erzeugt und ist deshalb auf Englisch.
Resolve validated local project metadata and tracking policy
GET/projects/{projectId}/project-binding
Scope readBerechtigung projects:read
Pfadparameter
-
projectIdstringPflicht
Antwort 200
Success. See the agent-time API contract for response fields.
Fehler
- 400
invalid_request: malformed body, missing field, invalid cursor. - 401
unauthorized: missing, invalid or revoked token. - 403
forbiddenor a plan code (plan-api-read-only,plan-api-disabled,plan-webhooks): missing scope or permission, or the plan does not allow it. - 404
not_found. - 409Tracking disabled; retain local entries for explicit review.
- 429
rate_limitedordaily_write_limit.
curl "https://api.getprojectflow.com/v1/projects/PROJECT_ID/project-binding" \
-H "Authorization: Bearer pfat_YOUR_TOKEN"const res = await fetch('https://api.getprojectflow.com/v1/projects/PROJECT_ID/project-binding', {
headers: {
Authorization: `Bearer ${process.env.PROJECTFLOW_TOKEN}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://api.getprojectflow.com/v1/projects/PROJECT_ID/project-binding",
headers={
"Authorization": f"Bearer {os.environ['PROJECTFLOW_TOKEN']}",
},
)
data = res.json()var request = URLRequest(url: URL(string: "https://api.getprojectflow.com/v1/projects/PROJECT_ID/project-binding")!)
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
let (data, response) = try await URLSession.shared.data(for: request)
Kein Inhalt
Read tracking policy
GET/projects/{projectId}/agent-time-settings
Scope readBerechtigung projects:read
Pfadparameter
-
projectIdstringPflicht
Antwort 200
Success. See the agent-time API contract for response fields.
Fehler
- 400
invalid_request: malformed body, missing field, invalid cursor. - 401
unauthorized: missing, invalid or revoked token. - 403
forbiddenor a plan code (plan-api-read-only,plan-api-disabled,plan-webhooks): missing scope or permission, or the plan does not allow it. - 404
not_found. - 409Tracking disabled; retain local entries for explicit review.
- 429
rate_limitedordaily_write_limit.
curl "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings" \
-H "Authorization: Bearer pfat_YOUR_TOKEN"const res = await fetch('https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings', {
headers: {
Authorization: `Bearer ${process.env.PROJECTFLOW_TOKEN}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings",
headers={
"Authorization": f"Bearer {os.environ['PROJECTFLOW_TOKEN']}",
},
)
data = res.json()var request = URLRequest(url: URL(string: "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings")!)
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
let (data, response) = try await URLSession.shared.data(for: request)
Kein Inhalt
Enable or disable tracking (project owner or workspace administrator)
PATCH/projects/{projectId}/agent-time-settings
Scope projects:writeBerechtigung projects:write
Pfadparameter
-
projectIdstringPflicht
Request-Body application/json
-
enabledbooleanPflicht
Antwort 200
Success. See the agent-time API contract for response fields.
Fehler
- 400
invalid_request: malformed body, missing field, invalid cursor. - 401
unauthorized: missing, invalid or revoked token. - 403
forbiddenor a plan code (plan-api-read-only,plan-api-disabled,plan-webhooks): missing scope or permission, or the plan does not allow it. - 404
not_found. - 409Tracking disabled; retain local entries for explicit review.
- 429
rate_limitedordaily_write_limit.
curl -X PATCH "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings" \
-H "Authorization: Bearer pfat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'const res = await fetch('https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.PROJECTFLOW_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
enabled: false
}),
});
const data = await res.json();import os
import requests
res = requests.patch(
"https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings",
headers={
"Authorization": f"Bearer {os.environ['PROJECTFLOW_TOKEN']}",
},
json={
"enabled": False
},
)
data = res.json()var request = URLRequest(url: URL(string: "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-settings")!)
request.httpMethod = "PATCH"
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body: [String: Any] = [
"enabled": false,
]
request.httpBody = try JSONSerialization.data(withJSONObject: body)
let (data, response) = try await URLSession.shared.data(for: request)
Kein Inhalt
Read own times or project report; elapsed times are not billable time
GET/projects/{projectId}/agent-time
Scope readBerechtigung agent-time:read
Pfadparameter
-
projectIdstringPflicht
Query-Parameter
-
fromstring (date-time)UTC instant. Default: last 30 days; any period, at most 1,000 entries per response (otherwise truncated).
-
tostring (date-time)UTC instant. Default: last 30 days; any period, at most 1,000 entries per response (otherwise truncated).
Antwort 200
Success. See the agent-time API contract for response fields.
Fehler
- 400
invalid_request: malformed body, missing field, invalid cursor. - 401
unauthorized: missing, invalid or revoked token. - 403
forbiddenor a plan code (plan-api-read-only,plan-api-disabled,plan-webhooks): missing scope or permission, or the plan does not allow it. - 404
not_found. - 409Tracking disabled; retain local entries for explicit review.
- 429
rate_limitedordaily_write_limit.
curl "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time" \
-H "Authorization: Bearer pfat_YOUR_TOKEN"const res = await fetch('https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time', {
headers: {
Authorization: `Bearer ${process.env.PROJECTFLOW_TOKEN}`,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time",
headers={
"Authorization": f"Bearer {os.environ['PROJECTFLOW_TOKEN']}",
},
)
data = res.json()var request = URLRequest(url: URL(string: "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time")!)
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
let (data, response) = try await URLSession.shared.data(for: request)
Kein Inhalt
Import immutable, idempotent intervals (maximum 100 per batch; 5000 new intervals per project/UTC day)
POST/projects/{projectId}/agent-time
Scope tasks:writeBerechtigung agent-time:write
Pfadparameter
-
projectIdstringPflicht
Header
-
X-ProjectFlow-PersonastringAgent persona the write is attributed to ("Mira · agent of <you>"): a persona name or
id:<personaId>of the token owner (auto-created when unknown unless switched off in "My team"). Only user-bound credentials (OAuth, personal token) and only on writes; a workspace API token gets400 persona-requires-user-token. Errorspersona-invalid-name400,persona-not-found404,persona-archived409,persona-limit429. When the workspace policypersonasis off or the persona is blocked, the write succeeds without persona and the response carriesX-ProjectFlow-Persona-Ignored: policy|blocked.
Request-Body application/json
-
entriesarray of objectPflicht14 Attribute anzeigen
-
entryIdstringPflicht -
deviceIdstringPflicht -
runIdstringPflicht -
sessionIdstringPflicht -
agentstringPflichtErlaubte Werte:
codexclaudeother -
startedAtstring (date-time)Pflicht -
endedAtstring (date-time)Pflicht -
durationMsintegerPflicht -
captureMethodstringPflichtErlaubte Werte:
hooksagent -
qualitystringPflichtErlaubte Werte:
elapsedincompleteclock-anomaly -
outcomestringPflichtErlaubte Werte:
completedinterruptedincomplete -
taskIdstring -
descriptionstring -
tokensobjectToken usage of this interval; input excludes cache reads and writes.
5 Attribute anzeigen
-
inputintegerPflicht -
outputintegerPflicht -
cacheReadintegerPflicht -
cacheWriteintegerPflicht -
modelstring
-
-
Antwort 200
Success. See the agent-time API contract for response fields.
Fehler
- 400
invalid_request: malformed body, missing field, invalid cursor. - 401
unauthorized: missing, invalid or revoked token. - 403
forbiddenor a plan code (plan-api-read-only,plan-api-disabled,plan-webhooks): missing scope or permission, or the plan does not allow it. - 404
not_found. - 409Tracking disabled; retain local entries for explicit review.
- 429
rate_limitedordaily_write_limit.
curl -X POST "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time" \
-H "Authorization: Bearer pfat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"entries": [
{
"entryId": "entry_1",
"deviceId": "device_1",
"runId": "run_1",
"sessionId": "session_1",
"agent": "codex",
"startedAt": "2026-11-02T09:00:00.000Z",
"endedAt": "2026-11-02T09:00:00.000Z",
"durationMs": 0,
"captureMethod": "hooks",
"quality": "elapsed",
"outcome": "completed",
"taskId": "task_1",
"description": "Short description",
"tokens": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0,
"model": "model"
}
}
]
}'const res = await fetch('https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PROJECTFLOW_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
entries: [
{
entryId: 'entry_1',
deviceId: 'device_1',
runId: 'run_1',
sessionId: 'session_1',
agent: 'codex',
startedAt: '2026-11-02T09:00:00.000Z',
endedAt: '2026-11-02T09:00:00.000Z',
durationMs: 0,
captureMethod: 'hooks',
quality: 'elapsed',
outcome: 'completed',
taskId: 'task_1',
description: 'Short description',
tokens: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
model: 'model'
}
}
]
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time",
headers={
"Authorization": f"Bearer {os.environ['PROJECTFLOW_TOKEN']}",
},
json={
"entries": [
{
"entryId": "entry_1",
"deviceId": "device_1",
"runId": "run_1",
"sessionId": "session_1",
"agent": "codex",
"startedAt": "2026-11-02T09:00:00.000Z",
"endedAt": "2026-11-02T09:00:00.000Z",
"durationMs": 0,
"captureMethod": "hooks",
"quality": "elapsed",
"outcome": "completed",
"taskId": "task_1",
"description": "Short description",
"tokens": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0,
"model": "model"
}
}
]
},
)
data = res.json()var request = URLRequest(url: URL(string: "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time")!)
request.httpMethod = "POST"
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body: [String: Any] = [
"entries": [
[
"entryId": "entry_1",
"deviceId": "device_1",
"runId": "run_1",
"sessionId": "session_1",
"agent": "codex",
"startedAt": "2026-11-02T09:00:00.000Z",
"endedAt": "2026-11-02T09:00:00.000Z",
"durationMs": 0,
"captureMethod": "hooks",
"quality": "elapsed",
"outcome": "completed",
"taskId": "task_1",
"description": "Short description",
"tokens": [
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0,
"model": "model",
],
],
],
]
request.httpBody = try JSONSerialization.data(withJSONObject: body)
let (data, response) = try await URLSession.shared.data(for: request)
Kein Inhalt
Backfill or import historical time entries (maximum 400 rows; all-or-nothing, idempotent per row)
POST/projects/{projectId}/agent-time-import
Scope tasks:writeBerechtigung agent-time:write
Send either entries or csv (header row; columns start/end, date + start/end times, or start + minutes/hours/duration, plus optional agent, description, task, id). Local times without offset use timeZone (IANA, default UTC). dryRun: true validates and returns row errors without saving. Rejected imports return 400 with errors: [{row, message}]. Stored entries carry captureMethod: manual (source manual) or import.
Pfadparameter
-
projectIdstringPflicht
Request-Body application/json
-
sourcestringErlaubte Werte:
manualimport -
timeZonestring -
dryRunboolean -
csvstring -
entriesarray of object8 Attribute anzeigen
-
startedAtstringPflichtISO instant with offset, or local "YYYY-MM-DD HH:MM" / "DD.MM.YYYY HH:MM".
-
endedAtstring -
durationMinutesnumber -
agentstringErlaubte Werte:
codexclaudeother -
taskIdstring -
descriptionstring -
externalIdstring -
tokensobjectToken usage of this interval; input excludes cache reads and writes.
5 Attribute anzeigen
-
inputintegerPflicht -
outputintegerPflicht -
cacheReadintegerPflicht -
cacheWriteintegerPflicht -
modelstring
-
-
Antwort 200
Success. Preview (dryRun) or results with accepted, duplicates and conflicts counts.
Fehler
- 400
invalid_request: malformed body, missing field, invalid cursor. - 401
unauthorized: missing, invalid or revoked token. - 403
forbiddenor a plan code (plan-api-read-only,plan-api-disabled,plan-webhooks): missing scope or permission, or the plan does not allow it. - 404
not_found. - 409Tracking disabled for this project.
- 429
rate_limitedordaily_write_limit.
curl -X POST "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-import" \
-H "Authorization: Bearer pfat_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source": "import",
"timeZone": "timeZone",
"dryRun": false,
"csv": "csv"
}'const res = await fetch('https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-import', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PROJECTFLOW_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
source: 'import',
timeZone: 'timeZone',
dryRun: false,
csv: 'csv'
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-import",
headers={
"Authorization": f"Bearer {os.environ['PROJECTFLOW_TOKEN']}",
},
json={
"source": "import",
"timeZone": "timeZone",
"dryRun": False,
"csv": "csv"
},
)
data = res.json()var request = URLRequest(url: URL(string: "https://api.getprojectflow.com/v1/projects/PROJECT_ID/agent-time-import")!)
request.httpMethod = "POST"
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body: [String: Any] = [
"source": "import",
"timeZone": "timeZone",
"dryRun": false,
"csv": "csv",
]
request.httpBody = try JSONSerialization.data(withJSONObject: body)
let (data, response) = try await URLSession.shared.data(for: request)
Kein Inhalt