Agent time
Record, backfill, import and report coding-agent time per project. Not personal working time.
- 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)
Resolve validated local project metadata and tracking policy
GET/projects/{projectId}/project-binding
Scope readPermission projects:read
Path parameters
-
projectIdstringrequired
Response 200
Success. See the agent-time API contract for response fields.
Errors
- 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)
No content
Read tracking policy
GET/projects/{projectId}/agent-time-settings
Scope readPermission projects:read
Path parameters
-
projectIdstringrequired
Response 200
Success. See the agent-time API contract for response fields.
Errors
- 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)
No content
Enable or disable tracking (project owner or workspace administrator)
PATCH/projects/{projectId}/agent-time-settings
Scope projects:writePermission projects:write
Path parameters
-
projectIdstringrequired
Request body application/json
-
enabledbooleanrequired
Response 200
Success. See the agent-time API contract for response fields.
Errors
- 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)
No content
Read own times or project report; elapsed times are not billable time
GET/projects/{projectId}/agent-time
Scope readPermission agent-time:read
Path parameters
-
projectIdstringrequired
Query parameters
-
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).
Response 200
Success. See the agent-time API contract for response fields.
Errors
- 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)
No content
Import immutable, idempotent intervals (maximum 100 per batch; 5000 new intervals per project/UTC day)
POST/projects/{projectId}/agent-time
Scope tasks:writePermission agent-time:write
Path parameters
-
projectIdstringrequired
Headers
-
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 objectrequiredShow 14 attributes
-
entryIdstringrequired -
deviceIdstringrequired -
runIdstringrequired -
sessionIdstringrequired -
agentstringrequiredAllowed values:
codexclaudeother -
startedAtstring (date-time)required -
endedAtstring (date-time)required -
durationMsintegerrequired -
captureMethodstringrequiredAllowed values:
hooksagent -
qualitystringrequiredAllowed values:
elapsedincompleteclock-anomaly -
outcomestringrequiredAllowed values:
completedinterruptedincomplete -
taskIdstring -
descriptionstring -
tokensobjectToken usage of this interval; input excludes cache reads and writes.
Show 5 attributes
-
inputintegerrequired -
outputintegerrequired -
cacheReadintegerrequired -
cacheWriteintegerrequired -
modelstring
-
-
Response 200
Success. See the agent-time API contract for response fields.
Errors
- 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)
No content
Backfill or import historical time entries (maximum 400 rows; all-or-nothing, idempotent per row)
POST/projects/{projectId}/agent-time-import
Scope tasks:writePermission 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.
Path parameters
-
projectIdstringrequired
Request body application/json
-
sourcestringAllowed values:
manualimport -
timeZonestring -
dryRunboolean -
csvstring -
entriesarray of objectShow 8 attributes
-
startedAtstringrequiredISO instant with offset, or local "YYYY-MM-DD HH:MM" / "DD.MM.YYYY HH:MM".
-
endedAtstring -
durationMinutesnumber -
agentstringAllowed values:
codexclaudeother -
taskIdstring -
descriptionstring -
externalIdstring -
tokensobjectToken usage of this interval; input excludes cache reads and writes.
Show 5 attributes
-
inputintegerrequired -
outputintegerrequired -
cacheReadintegerrequired -
cacheWriteintegerrequired -
modelstring
-
-
Response 200
Success. Preview (dryRun) or results with accepted, duplicates and conflicts counts.
Errors
- 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)
No content