> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List logs

> List the operation logs your Markifact team has produced across workflows, MCP servers, and agents.

Returns one log per operation your team ran, newest first, whatever produced it: a workflow node, an MCP tool call, or an agent step. API keys can only be created by team owners, so a key sees every log the team wrote, including operations run by other members and through private MCP servers.

How far back you can read depends on your plan's history window. Logs outside that window are not returned even though Markifact still stores them.

## Endpoint

```http theme={"dark"}
GET /v1/logs
```

## Query Parameters

| Parameter        | Type    | Required | Description                                                                                   |
| ---------------- | ------- | -------- | --------------------------------------------------------------------------------------------- |
| `source_type`    | string  | No       | Only return logs from one source: `mcp`, `agent`, or `workflow`. Omit for all three.          |
| `status`         | string  | No       | Only return logs with this status: `success`, `error`, `skipped`, `stop`, or `start`.         |
| `operation_id`   | string  | No       | Exact operation ID, such as `gads_get_campaigns`.                                             |
| `source_id`      | string  | No       | Only return logs from one MCP server, agent conversation, or workflow.                        |
| `source_run_id`  | string  | No       | Only return logs from a single workflow run. This is how you fetch every step of one run.     |
| `started_after`  | integer | No       | Only logs started at or after this Unix second. Cannot reach past your plan's history window. |
| `started_before` | integer | No       | Only logs started at or before this Unix second.                                              |
| `limit`          | integer | No       | Logs per page, 1 to 100. Defaults to 25.                                                      |
| `cursor`         | string  | No       | The `next_cursor` from the previous page.                                                     |

## Example Request

```bash theme={"dark"}
curl "https://api.markifact.com/v1/logs?source_type=workflow&status=error&limit=25" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Response

```json theme={"dark"}
{
  "data": [
    {
      "id": "1e38c1c2-1d85-4094-ab55-1f35c78ab436",
      "operation_id": "sheets_read_data",
      "operation_version": 1,
      "status": "success",
      "source": {
        "type": "workflow",
        "id": "bcd0e853-dd0c-4347-bd35-b86148cf2c96",
        "run_id": "411de6e1-9a3d-4838-a1a7-21cbc8dfe15f",
        "name": "Meta Ads Upload"
      },
      "user": {
        "id": "Q8Wvn9gL8GUQ11SsJAnMfiyyGOA2",
        "email": "member@example.com"
      },
      "started_at": 1784874165,
      "completed_at": 1784874172,
      "credits_used": 1,
      "cache_hit": false,
      "input": { "spreadsheet_id": "1AbC...", "range": "Sheet1!A1:F200" },
      "output": { "rows": 199, "file_id": "f_9c21..." },
      "metadata": {
        "node_id": "node_3",
        "node_label": "Read campaign sheet",
        "retry_attempts": 0
      }
    }
  ],
  "has_more": true,
  "next_cursor": "eyJzIjoxNzg0ODc0MTY1LCJpIjoiNjI2OWRhYTUifQ"
}
```

## Pagination

Read `next_cursor` from the response and pass it back as `cursor` to get the next page. When `has_more` is `false`, `next_cursor` is `null` and you have reached the end.

```bash theme={"dark"}
# First page
curl "https://api.markifact.com/v1/logs?limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Next page
curl "https://api.markifact.com/v1/logs?limit=100&cursor=eyJzIjoxNzg0ODc0MTY1LCJpIjoiNjI2OWRhYTUifQ" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Keep every other parameter identical while paging. The cursor marks a position in the ordered result set, not the query that produced it, so changing a filter mid-walk gives you a page that does not line up with the previous one.

Treat the cursor as opaque. Its contents are internal and can change.

## Log Object

| Field               | Type            | Description                                                                                                                |
| ------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `id`                | string          | Log ID.                                                                                                                    |
| `operation_id`      | string          | The Markifact operation that ran.                                                                                          |
| `operation_version` | integer or null | Version of the operation.                                                                                                  |
| `status`            | string          | `success`, `error`, `skipped`, `stop`, or `start`. `start` means the operation was still running when the log was written. |
| `source`            | object          | What ran the operation. See below.                                                                                         |
| `user`              | object          | The team member who ran it, with `id` and `email`.                                                                         |
| `started_at`        | integer         | Start time in Unix seconds.                                                                                                |
| `completed_at`      | integer or null | Completion time in Unix seconds. Null while still running.                                                                 |
| `credits_used`      | integer         | Credits the operation consumed.                                                                                            |
| `cache_hit`         | boolean         | Whether the result came from cache instead of the provider.                                                                |
| `input`             | any             | Input the operation ran with. Shape depends on the operation.                                                              |
| `output`            | any             | What the operation returned, or the error payload when `status` is `error`. Shape depends on the operation.                |
| `metadata`          | object          | Extra context. `node_id`, `node_label`, and `retry_attempts` for workflows, `tool_name` for MCP.                           |

### Source Object

| Field    | Type           | Description                                                                                        |
| -------- | -------------- | -------------------------------------------------------------------------------------------------- |
| `type`   | string         | `mcp`, `agent`, or `workflow`.                                                                     |
| `id`     | string or null | The MCP server, agent conversation, or workflow the operation belongs to.                          |
| `run_id` | string or null | A single execution. Set on workflow logs, null otherwise.                                          |
| `name`   | string or null | Current name of the parent. Falls back to the name recorded at log time if the parent was deleted. |

<Note>
  Timestamps in this resource are Unix **seconds**. Connection timestamps are in milliseconds.
</Note>

## Reconstructing a Workflow Run

A workflow writes one log per node, all sharing a `source_run_id`. To pull a whole run in order, filter by it:

```bash theme={"dark"}
curl "https://api.markifact.com/v1/logs?source_run_id=411de6e1-9a3d-4838-a1a7-21cbc8dfe15f" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Logs come back newest first, so reverse them to read the run in execution order. A run that failed before any node executed, for example when the team ran out of credits, produces no logs at all.


## OpenAPI

````yaml GET /v1/logs
openapi: 3.1.0
info:
  title: Markifact API
  version: 1.0.0
  description: API for managing Markifact workspace connections.
servers:
  - url: https://api.markifact.com
security:
  - bearerAuth: []
paths:
  /v1/logs:
    get:
      tags:
        - Logs
      summary: List logs
      description: List your team's operation logs, newest first.
      operationId: listLogs
      parameters:
        - name: source_type
          in: query
          required: false
          schema:
            type: string
            enum:
              - mcp
              - agent
              - workflow
          description: Only return logs from this source. Omit for all sources.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - success
              - error
              - skipped
              - stop
              - start
          description: Only return logs with this status.
        - name: operation_id
          in: query
          required: false
          schema:
            type: string
            example: gads_get_campaigns
          description: Exact operation ID to filter by.
        - name: source_id
          in: query
          required: false
          schema:
            type: string
          description: >-
            Only return logs from one MCP server, agent conversation, or
            workflow.
        - name: source_run_id
          in: query
          required: false
          schema:
            type: string
          description: Only return logs from a single workflow run.
        - name: started_after
          in: query
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
          description: >-
            Only return logs started at or after this Unix second. Cannot reach
            past your plan's history window.
        - name: started_before
          in: query
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
          description: Only return logs started at or before this Unix second.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: Logs per page.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: >-
            The next_cursor from the previous page. Keep every other filter
            unchanged while paging.
      responses:
        '200':
          description: Logs returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogPage'
        '400':
          description: Invalid cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    LogPage:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Log'
        has_more:
          type: boolean
          description: Whether more logs match beyond this page.
        next_cursor:
          type:
            - string
            - 'null'
          description: Pass back as `cursor` to fetch the next page. Null on the last page.
      required:
        - data
        - has_more
    Error:
      type: object
      properties:
        detail: {}
    Log:
      type: object
      properties:
        id:
          type: string
          description: Log ID.
        operation_id:
          type: string
          example: gads_get_campaigns
          description: Markifact operation that ran.
        operation_version:
          type:
            - integer
            - 'null'
        status:
          type: string
          enum:
            - success
            - error
            - skipped
            - stop
            - start
        source:
          $ref: '#/components/schemas/LogSource'
        user:
          $ref: '#/components/schemas/LogUser'
        started_at:
          type: integer
          format: int64
          example: 1784874174
          description: Start time in Unix seconds.
        completed_at:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Completion time in Unix seconds. Null while the operation is still
            running.
        credits_used:
          type: integer
        cache_hit:
          type: boolean
          description: Whether the result came from cache instead of the provider.
        input:
          description: Input the operation ran with. Shape depends on the operation.
        output:
          description: >-
            Result the operation returned, or the error payload when status is
            error. Shape depends on the operation.
        metadata:
          type: object
          additionalProperties: true
          description: >-
            Extra context. Keys depend on the source: node_id, node_label, and
            retry_attempts for workflows, tool_name for MCP.
      required:
        - id
        - operation_id
        - status
        - source
        - user
        - started_at
        - credits_used
        - cache_hit
        - metadata
    LogSource:
      type: object
      properties:
        type:
          type: string
          enum:
            - mcp
            - agent
            - workflow
          description: What ran the operation.
        id:
          type:
            - string
            - 'null'
          description: 'Parent object ID: the MCP server, agent conversation, or workflow.'
        run_id:
          type:
            - string
            - 'null'
          description: Single execution ID. Set on workflow logs, null otherwise.
        name:
          type:
            - string
            - 'null'
          description: >-
            Current parent name, falling back to the name captured at log time
            if the parent was deleted.
      required:
        - type
    LogUser:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Markifact user ID.
        email:
          type:
            - string
            - 'null'
          description: Email of the team member who ran the operation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````