# aiFlags

query · in the family [Billing and the wallet](/reference/billing-and-the-wallet/)

## What it does

Your group’s AI usage flags by day — who tripped which unusual-pressing pattern, so a person can take a look.

YOUR group's fired AI-watch flags by UTC day. Actor captions resolve at read (a user actor names itself; a session actor answers 'other'). SELF-group BY CONSTRUCTION (no target arg exists — the aiUsage stance). Requires authentication.

## What happens

A read over the flags the AI watch records when someone presses AI features unusually hard (the thresholds are deliberately generous). Nothing is ever blocked — a flag just asks a human to review; the same fire also drops a task in the owners’ inbox.

## Who may call it

Capability area: **Billing and the wallet** — Your platform bill, token purchases and the usage and cost reads.

- Owner
- Manager
- Associate Manager
- An API key whose scope allows `api:aiFlags`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `days` | [Int](/types/#scalars) | no | No further notes. |

## Returns

[AiFlagWindow](/types/AiFlagWindow/) `AiFlagWindow!` — YOUR group's fired AI-watch flags: newest day first.

## Example request

```graphql
query ExampleAiFlags($days: Int) {
  aiFlags(days: $days) {
    flags {
      day
      pattern
      actorKind
      actorId
      actorCaption
      count
    }
  }
}
```

Variables:

```json
{
  "days": 1
}
```

## Example response

```json
{
  "data": {
    "aiFlags": {
      "flags": [
        {
          "day": "<day>",
          "pattern": "<pattern>",
          "actorKind": "<actor kind>",
          "actorId": "01900000-0000-7000-8000-3c94fe170000",
          "actorCaption": "Blue jeans",
          "count": 1
        }
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
