ProjectFlow Pre-Launch

Agent-Zeit

Zeiten von Coding-Agents pro Projekt erfassen, nachtragen, importieren und auswerten. Keine persönliche Arbeitszeit.

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

  • 400invalid_request: malformed body, missing field, invalid cursor.
  • 401unauthorized: missing, invalid or revoked token.
  • 403forbidden or a plan code (plan-api-read-only, plan-api-disabled, plan-webhooks): missing scope or permission, or the plan does not allow it.
  • 404not_found.
  • 409Tracking disabled; retain local entries for explicit review.
  • 429rate_limited or daily_write_limit.

Alle Fehlercodes

Anfrage
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)
Antwort · 200JSON
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

  • 400invalid_request: malformed body, missing field, invalid cursor.
  • 401unauthorized: missing, invalid or revoked token.
  • 403forbidden or a plan code (plan-api-read-only, plan-api-disabled, plan-webhooks): missing scope or permission, or the plan does not allow it.
  • 404not_found.
  • 409Tracking disabled; retain local entries for explicit review.
  • 429rate_limited or daily_write_limit.

Alle Fehlercodes

Anfrage
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)
Antwort · 200JSON
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

  • 400invalid_request: malformed body, missing field, invalid cursor.
  • 401unauthorized: missing, invalid or revoked token.
  • 403forbidden or a plan code (plan-api-read-only, plan-api-disabled, plan-webhooks): missing scope or permission, or the plan does not allow it.
  • 404not_found.
  • 409Tracking disabled; retain local entries for explicit review.
  • 429rate_limited or daily_write_limit.

Alle Fehlercodes

Anfrage
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)
Antwort · 200JSON
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

  • 400invalid_request: malformed body, missing field, invalid cursor.
  • 401unauthorized: missing, invalid or revoked token.
  • 403forbidden or a plan code (plan-api-read-only, plan-api-disabled, plan-webhooks): missing scope or permission, or the plan does not allow it.
  • 404not_found.
  • 409Tracking disabled; retain local entries for explicit review.
  • 429rate_limited or daily_write_limit.

Alle Fehlercodes

Anfrage
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)
Antwort · 200JSON
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-Personastringmax 80 characters

    Agent 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 gets 400 persona-requires-user-token. Errors persona-invalid-name 400, persona-not-found 404, persona-archived 409, persona-limit 429. When the workspace policy personas is off or the persona is blocked, the write succeeds without persona and the response carries X-ProjectFlow-Persona-Ignored: policy|blocked.

Request-Body application/json

  • entriesarray of objectPflichtmax 100 items
    14 Attribute anzeigen
    • entryIdstringPflicht1 to 160 characters · pattern ^[a-zA-Z0-9_.:-]+$
    • deviceIdstringPflicht1 to 160 characters · pattern ^[a-zA-Z0-9_.:-]+$
    • runIdstringPflicht1 to 160 characters · pattern ^[a-zA-Z0-9_.:-]+$
    • sessionIdstringPflicht1 to 160 characters · pattern ^[a-zA-Z0-9_.:-]+$
    • agentstringPflicht

      Erlaubte Werte: codex claude other

    • startedAtstring (date-time)Pflichtpattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • endedAtstring (date-time)Pflichtpattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • durationMsintegerPflicht0 to 86400000
    • captureMethodstringPflicht

      Erlaubte Werte: hooks agent

    • qualitystringPflicht

      Erlaubte Werte: elapsed incomplete clock-anomaly

    • outcomestringPflicht

      Erlaubte Werte: completed interrupted incomplete

    • taskIdstring1 to 160 characters · pattern ^[a-zA-Z0-9_.:-]+$
    • descriptionstringmax 240 characters
    • tokensobject

      Token usage of this interval; input excludes cache reads and writes.

      5 Attribute anzeigen
      • inputintegerPflicht0 to 1000000000
      • outputintegerPflicht0 to 1000000000
      • cacheReadintegerPflicht0 to 1000000000
      • cacheWriteintegerPflicht0 to 1000000000
      • modelstringmax 80 characters

Antwort 200

Success. See the agent-time API contract for response fields.

Fehler

  • 400invalid_request: malformed body, missing field, invalid cursor.
  • 401unauthorized: missing, invalid or revoked token.
  • 403forbidden or a plan code (plan-api-read-only, plan-api-disabled, plan-webhooks): missing scope or permission, or the plan does not allow it.
  • 404not_found.
  • 409Tracking disabled; retain local entries for explicit review.
  • 429rate_limited or daily_write_limit.

Alle Fehlercodes

Anfrage
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)
Antwort · 200JSON
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

  • sourcestringStandard: "import"

    Erlaubte Werte: manual import

  • timeZonestring
  • dryRunboolean
  • csvstringmax 500000 characters
  • entriesarray of objectmax 400 items
    8 Attribute anzeigen
    • startedAtstringPflicht

      ISO instant with offset, or local "YYYY-MM-DD HH:MM" / "DD.MM.YYYY HH:MM".

    • endedAtstring
    • durationMinutesnumbermax 1440
    • agentstring

      Erlaubte Werte: codex claude other

    • taskIdstring
    • descriptionstringmax 240 characters
    • externalIdstring
    • tokensobject

      Token usage of this interval; input excludes cache reads and writes.

      5 Attribute anzeigen
      • inputintegerPflicht0 to 1000000000
      • outputintegerPflicht0 to 1000000000
      • cacheReadintegerPflicht0 to 1000000000
      • cacheWriteintegerPflicht0 to 1000000000
      • modelstringmax 80 characters

Antwort 200

Success. Preview (dryRun) or results with accepted, duplicates and conflicts counts.

Fehler

  • 400invalid_request: malformed body, missing field, invalid cursor.
  • 401unauthorized: missing, invalid or revoked token.
  • 403forbidden or a plan code (plan-api-read-only, plan-api-disabled, plan-webhooks): missing scope or permission, or the plan does not allow it.
  • 404not_found.
  • 409Tracking disabled for this project.
  • 429rate_limited or daily_write_limit.

Alle Fehlercodes

Anfrage
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)
Antwort · 200JSON
Kein Inhalt

↑↓ wählen, Enter öffnen, Esc schließen