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

# Get key activity

> Read a snapshot of retained Nixflex API request activity for the account. Distinguish request logs from call history and billing usage.

**FIXED · platform** Raw HTTP base URL: `https://api.nixflex.com/v1`. Node and Python SDK base URL: `https://api.nixflex.com`. The SDK adds `/v1`. Keep the credential on your server.

**NOT OFFERED → do this instead · platform** There is one public API: `https://api.nixflex.com/v1`. There is no sandbox. Test with your own number on production. Use local fixtures when you do not need a real call or text.

**YOU CAN CHANGE · account** Rotate the credential and update its callers together.

**SCOPE · account** A platform uses one Nixflex account for all its businesses, with one agent per business or a shared agent. Separate accounts only when businesses sign up themselves. No platform account-creation loop. Sub-accounts are not offered. Authorise each tenant on your server.

In Help choose New request for a capacity review, complaint or problem, abuse report, or other issue. Follow Your open chats. Owners and Admins see organisation tickets. Members see their own while authorised. Close chat removes it from the open list. A staff-closed chat can surface until its final reply is read. `POST /v1/support/tickets/chat-summary` is a read. Use watch\_ticket to check a displayed ticket outside the current page.

Use /v1/support/tickets. A personal session sends X-Nixflex-Expected-Account with the original workspace’s public key\_id for list, detail, chat-summary, writes and receipt lookup. Organisation keys select their own account. On 409 account\_changed, discard the stale draft and refresh Help in the intended workspace.

Create, reply and solve each need an Idempotency-Key. Reply uses X-Expected-Revision. Solve sends version in JSON. Lost response? The original person can `GET /v1/support/tickets/requests/{request_key}` with the original account header. A 200 returns the current ticket and original receipt. 404 means missing or inaccessible. Never resend in a different workspace. Organisation keys can replay only the identical write with its key, body and revision.

[Read the compact AI rules](https://docs.nixflex.com/ai-rules.md#account-access)

Read a single snapshot of retained API request activity for the authenticated account. This is request activity, separate from organisation audit events and call usage.

Method: **GET** · Success: **200** · Scope: **Owning account**

**The important part**

* Read key activity without exposing the credential itself.
* Activity is bounded by its available history and retention.

[Business guide](https://docs.nixflex.com/guides/business/team-ownership.md) · [Developer guide](https://docs.nixflex.com/authentication.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Authentication

Send `Authorization: Bearer KEY_ID:KEY_SECRET` using the owning account’s server-side credential.

## Request fields

| Field | Type | Required | Default | Limits and meaning |
| - | - | - | - | - |
| `period` (query) | string | No | `"today"` | UTC reporting period. Allowed: `"today"`, `"7d"`. |

Do not send a request body.

Counts cover retained request logs. Logging happens after responses and is asynchronous, so the request fetching this page may appear only in a later snapshot. Responses use Cache-Control: no-store.

## Response fields

`200 OK` returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.

| Field | Type | Meaning |
| - | - | - |
| `period` | string | Selected UTC reporting period. Allowed: `"today"`, `"7d"`. |
| `timezone` | string | Reporting time zone. |
| `requests` | integer | Retained requests in the chosen period. Minimum 0. |
| `errors` | integer | Retained error responses in the chosen period. Minimum 0. |
| `requests_today` | integer | Retained requests since the current UTC midnight. Minimum 0. |
| `errors_today` | integer | Retained error responses since the current UTC midnight. Minimum 0. |
| `day_start` | string | Current UTC day start. Format: date-time. |
| `period_start` | string | Beginning of the selected reporting interval. Format: date-time. |
| `as_of` | string | Snapshot time for these counts. Format: date-time. |
| `last_used_at` | string or null | Last retained request time, or null. Format: date-time. |
| `top_endpoints` | array of object | Up to five busiest endpoint/method pairs. Maximum 5 items. |
| `top_endpoints[].method` | string | HTTP method. |
| `top_endpoints[].endpoint` | string | Recorded endpoint label. |
| `top_endpoints[].requests` | integer | Retained request count. Minimum 0. |

## Example request

Raw HTTP base URL: `https://api.nixflex.com/v1`. Node and Python SDK base URL: `https://api.nixflex.com`. The SDK adds `/v1`. Keep `NIXFLEX_API_KEY` in your private process environment. The shell examples use Bash syntax. SDK and CLI examples require Node/CLI 0.11.0 or later and Python 0.4.0 or later.

```bash cURL theme={"dark"}
curl --request GET \
  --url "https://api.nixflex.com/v1/keys/activity?period=7d" \
  --header "Authorization: Bearer $NIXFLEX_API_KEY"
```

```javascript Node theme={"dark"}
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.keys.activity({period:"7d"});
// Handle result privately; do not log secrets or call content.
```

```python Python theme={"dark"}
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
    result = client.keys.activity(period="7d")
# AsyncNixflex supports the same calls with await (and async with).
```

```bash CLI theme={"dark"}
nixflex keys activity --period 7d --base-url https://api.nixflex.com --json
```

## Example response

Illustrative `200` response. Identifiers and values are examples; some optional or compatibility fields are omitted.

```json Response theme={"dark"}
{
  "period": "today",
  "timezone": "UTC",
  "requests": 12,
  "errors": 1,
  "requests_today": 12,
  "errors_today": 1,
  "day_start": "2026-11-01T00:00:00.000Z",
  "period_start": "2026-11-01T00:00:00.000Z",
  "as_of": "2026-11-01T12:00:00.000Z",
  "last_used_at": "2026-11-01T11:59:00.000Z",
  "top_endpoints": [
    {
      "method": "GET",
      "endpoint": "/v1/agents",
      "requests": 12
    }
  ]
}
```

## Errors

Failures return an `error` object with `code`, `message`, `doc_url` and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.

| Status | Code | Meaning | What to do |
| - | - | - | - |
| 400 | [`invalid_period`](https://docs.nixflex.com/api-reference/errors#invalid_period) | The period is not today or 7d. | Use one of the two documented values. |
| 503 | [`key_activity_unavailable`](https://docs.nixflex.com/api-reference/errors#key_activity_unavailable) | A complete activity snapshot could not be confirmed. | Retry a bounded read later; do not substitute zero counts. |
| 401 | [`unauthorized`](https://docs.nixflex.com/api-reference/errors#unauthorized) | The credential is missing or invalid. | Check the full account credential. |
| 429 | [`rate_limit_exceeded`](https://docs.nixflex.com/api-reference/errors#rate_limit_exceeded) | The account request limit was reached. | Wait for Retry-After. Reconcile uncertain writes before resending. |

## Retry and idempotency

This is a read-only request. Retry transient connection or server failures with bounded backoff; respect Retry-After for 429. Do not retry validation or ownership errors unchanged. A later read can return newer state.

## Related endpoints

* [Create an API account](https://docs.nixflex.com/api-reference/account/create-key.md)
* [Rotate the API key](https://docs.nixflex.com/api-reference/account/rotate-key.md)
* [Errors and recovery](https://docs.nixflex.com/api-reference/errors.md#error-envelope)


## OpenAPI

````yaml api-reference/public.openapi.json GET /keys/activity
openapi: 3.1.0
info:
  title: Nixflex public API
  version: 1.0.0
  description: >-
    Nixflex API reference for agents, calls, messaging, knowledge, organisations
    and integrations. Authenticate with the owning account and follow each
    operation’s permissions, response and retry contract.
servers:
  - url: https://api.nixflex.com/v1
security:
  - bearerAuth: []
paths:
  /keys/activity:
    get:
      tags:
        - Account and keys
      summary: Get key activity
      description: >-
        Read a single snapshot of retained API request activity for the
        authenticated account. This is request activity, separate from
        organisation audit events and call usage. Counts cover retained request
        logs. Logging happens after responses and is asynchronous, so the
        request fetching this page may appear only in a later snapshot.
        Responses use Cache-Control: no-store.
      operationId: getKeyActivity
      parameters:
        - name: period
          in: query
          required: false
          schema:
            type: string
            description: UTC reporting period.
            enum:
              - today
              - 7d
            default: today
          description: UTC reporting period.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  period:
                    type: string
                    description: Selected UTC reporting period.
                    enum:
                      - today
                      - 7d
                  timezone:
                    type: string
                    description: Reporting time zone.
                    const: UTC
                  requests:
                    type: integer
                    description: Retained requests in the chosen period.
                    minimum: 0
                  errors:
                    type: integer
                    description: Retained error responses in the chosen period.
                    minimum: 0
                  requests_today:
                    type: integer
                    description: Retained requests since the current UTC midnight.
                    minimum: 0
                  errors_today:
                    type: integer
                    description: Retained error responses since the current UTC midnight.
                    minimum: 0
                  day_start:
                    type: string
                    description: Current UTC day start.
                    format: date-time
                  period_start:
                    type: string
                    description: Beginning of the selected reporting interval.
                    format: date-time
                  as_of:
                    type: string
                    description: Snapshot time for these counts.
                    format: date-time
                  last_used_at:
                    type:
                      - string
                      - 'null'
                    description: Last retained request time, or null.
                    format: date-time
                  top_endpoints:
                    type: array
                    items:
                      type: object
                      properties:
                        method:
                          type: string
                          description: HTTP method.
                        endpoint:
                          type: string
                          description: Recorded endpoint label.
                        requests:
                          type: integer
                          description: Retained request count.
                          minimum: 0
                      required:
                        - method
                        - endpoint
                        - requests
                      description: ''
                      additionalProperties: false
                    description: Up to five busiest endpoint/method pairs.
                    maxItems: 5
                required:
                  - period
                  - timezone
                  - requests
                  - errors
                  - requests_today
                  - errors_today
                  - day_start
                  - period_start
                  - as_of
                  - last_used_at
                  - top_endpoints
                description: ''
                additionalProperties: false
              example:
                period: today
                timezone: UTC
                requests: 12
                errors: 1
                requests_today: 12
                errors_today: 1
                day_start: '2026-11-01T00:00:00.000Z'
                period_start: '2026-11-01T00:00:00.000Z'
                as_of: '2026-11-01T12:00:00.000Z'
                last_used_at: '2026-11-01T11:59:00.000Z'
                top_endpoints:
                  - method: GET
                    endpoint: /v1/agents
                    requests: 12
        '400':
          description: >-
            invalid_period: The period is not today or 7d. Use one of the two
            documented values.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error class.
                      code:
                        type: string
                        description: Stable machine-readable code.
                      message:
                        type: string
                        description: Readable refusal or failure reason.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                        format: uri
                      details:
                        type: object
                        properties: {}
                        description: Additional field, operation or outcome details.
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '401':
          description: >-
            unauthorized: The credential is missing or invalid. Check the full
            account credential.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error class.
                      code:
                        type: string
                        description: Stable machine-readable code.
                      message:
                        type: string
                        description: Readable refusal or failure reason.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                        format: uri
                      details:
                        type: object
                        properties: {}
                        description: Additional field, operation or outcome details.
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '429':
          description: >-
            rate_limit_exceeded: The account request limit was reached. Wait for
            Retry-After. Reconcile uncertain writes before resending.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error class.
                      code:
                        type: string
                        description: Stable machine-readable code.
                      message:
                        type: string
                        description: Readable refusal or failure reason.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                        format: uri
                      details:
                        type: object
                        properties: {}
                        description: Additional field, operation or outcome details.
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
        '503':
          description: >-
            key_activity_unavailable: A complete activity snapshot could not be
            confirmed. Retry a bounded read later; do not substitute zero
            counts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        description: Error class.
                      code:
                        type: string
                        description: Stable machine-readable code.
                      message:
                        type: string
                        description: Readable refusal or failure reason.
                      doc_url:
                        type: string
                        description: Error documentation URL.
                        format: uri
                      details:
                        type: object
                        properties: {}
                        description: Additional field, operation or outcome details.
                        additionalProperties: true
                    required:
                      - type
                      - code
                      - message
                      - doc_url
                    description: ''
                    additionalProperties: false
                required:
                  - error
                description: ''
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A
        verified personal dashboard Bearer session may be used where the
        operation documents role-based access.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.