> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.apologist.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.apologist.ai/_mcp/server.

# List User Flags

GET https://your-agent-domain.com/api/v1/users/flags

Returns a paginated list of user flag definitions for the agent's team (all columns from user_flags), ordered by id ascending.

Reference: https://docs.apologist.ai/agent-api/api-reference/users/list-user-flags

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: agent-api
  version: 1.0.0
paths:
  /users/flags:
    get:
      operationId: listUserFlags
      summary: List User Flags
      description: >-
        Returns a paginated list of user flag definitions for the agent's team
        (all columns from user_flags), ordered by id ascending.
      tags:
        - users
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Results per page (clamped to 100).
          required: false
          schema:
            type: integer
            default: 50
        - name: x-api-key
          in: header
          description: API key for authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Paginated list of user flag definitions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Users_listUserFlags_Response_200'
        '403':
          description: Forbidden - Invalid or missing API key
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                description: Any type
servers:
  - url: https://your-agent-domain.com/api/v1
    description: Production server
components:
  schemas:
    UserFlag:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        user_id:
          type:
            - integer
            - 'null'
          description: Upstream owning user id when present (mirrored from Ignite).
        team_id:
          type:
            - integer
            - 'null'
        synced_at:
          type: string
      description: A team-level user flag definition from the user_flags table.
      title: UserFlag
    Users_listUserFlags_Response_200:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/UserFlag'
        total:
          type: integer
        page:
          type: integer
        per_page:
          type: integer
      title: Users_listUserFlags_Response_200
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

```

## Examples



**Response**

```json
{
  "data": [
    {
      "id": 1,
      "name": "string",
      "user_id": 1,
      "team_id": 1,
      "synced_at": "string"
    }
  ],
  "total": 1,
  "page": 1,
  "per_page": 1
}
```

**SDK Code**

```typescript
import { ApologistAgentClient } from "apologist";

async function main() {
    const client = new ApologistAgentClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.users.listUserFlags({});
}
main();

```

```python
from apologist import ApologistAgent

client = ApologistAgent(
    api_key="YOUR_API_KEY_HERE",
)

client.users.list_user_flags()

```

```java
package com.example.usage;

import ai.apologist.AgentClient;
import ai.apologist.resources.users.requests.ListUserFlagsRequest;

public class Example {
    public static void main(String[] args) {
        AgentClient client = AgentClient
            .builder()
            .apiKey("YOUR_API_KEY_HERE")
            .build();

        client.users().listUserFlags(
            ListUserFlagsRequest
                .builder()
                .build()
        );
    }
}
```

```ruby
require "apologist"

client = Apologist::AgentClient.new(api_key: "YOUR_API_KEY_HERE")

client.users.list_user_flags

```

```csharp
using Apologist;
using System.Threading.Tasks;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new AgentClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.Users.ListUserFlagsAsync(
            new ListUserFlagsRequest()
        );
    }

}

```

```go
package example

import (
    context "context"

    apgsdkgo "github.com/apologist-project/apg-sdk-go"
    client "github.com/apologist-project/apg-sdk-go/client"
    option "github.com/apologist-project/apg-sdk-go/option"
)

func do() {
    client := client.NewApologistAgentClient(
        option.WithAPIKey(
            "YOUR_API_KEY_HERE",
        ),
    )
    request := &apgsdkgo.ListUserFlagsRequest{}
    client.Users.ListUserFlags(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Apologist\AgentClient;
use Apologist\Users\Requests\ListUserFlagsRequest;

$client = new AgentClient(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->users->listUserFlags(
    new ListUserFlagsRequest([]),
);

```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://your-agent-domain.com/api/v1/users/flags")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```