{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clarifymedical/json-schema/clarifymedical-list-of-api-keys-response-dto-schema.json",
  "title": "ListOfApiKeysResponseDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clarifymedical-api-keys-api-openapi.yml#/components/schemas/ListOfApiKeysResponseDto",
  "type": "object",
  "properties": {
    "links": {
      "type": "object",
      "properties": {
        "next": {
          "type": [
            "string",
            "null"
          ],
          "description": "URL of the next page, or `null` on the last page."
        },
        "prev": {
          "type": [
            "string",
            "null"
          ],
          "description": "URL of the previous page, or `null` on the first page."
        }
      },
      "required": [
        "next",
        "prev"
      ],
      "description": "Pagination links."
    },
    "meta": {
      "type": "object",
      "properties": {
        "total_records": {
          "type": "number",
          "description": "Total number of records across all pages."
        },
        "total_pages": {
          "type": "number",
          "description": "Total number of pages at the current page size."
        }
      },
      "required": [
        "total_records",
        "total_pages"
      ],
      "description": "Pagination metadata."
    },
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "api-key"
            ],
            "description": "The resource type; matches the `object` path parameter."
          },
          "id": {
            "type": "string",
            "description": "The unique ID of the resource."
          },
          "attributes": {
            "type": "object",
            "properties": {
              "_id": {
                "type": "string",
                "description": "The unique ID of the API key."
              },
              "name": {
                "type": "string",
                "description": "The display name of the API key."
              },
              "key_prefix": {
                "type": "string",
                "description": "The first characters of the key, shown to identify it."
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The access scopes recorded on the key, such as `manage:entities`."
              },
              "actor": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "workspace",
                      "user",
                      "rep",
                      "agent",
                      "workflow"
                    ],
                    "description": "The kind of identity: `user`, `workspace`, `rep`, `agent`, or `workflow`."
                  },
                  "id": {
                    "type": "string",
                    "description": "The unique ID of the identity."
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "description": "The identity the API key authenticates as."
              },
              "on_behalf_of": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "user"
                    ],
                    "description": "Always `user`."
                  },
                  "id": {
                    "type": "string",
                    "description": "The unique ID of the user."
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "description": "The user an agent or workflow key acts for, or `null` for keys that act as themselves."
              },
              "hidden": {
                "type": "boolean",
                "description": "True for server-managed keys that listings omit."
              },
              "_created_by": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The ID of the user who created the key, or `null` for server-created keys."
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "The time the key stops working, or `null` when it never expires."
              },
              "_created_at": {
                "type": "string",
                "format": "date-time",
                "description": "The time the key was created."
              },
              "_updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "The time the key was last updated."
              },
              "last_used_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "The time the key last authenticated a request, or `null` if never."
              }
            },
            "required": [
              "_id",
              "name",
              "key_prefix",
              "scopes",
              "actor",
              "on_behalf_of",
              "hidden",
              "_created_by",
              "expires_at",
              "_created_at",
              "_updated_at",
              "last_used_at"
            ],
            "description": "Field values keyed by field name; available fields depend on the object’s schema."
          },
          "relationships": {
            "type": "object",
            "properties": {},
            "description": "Related resources keyed by relationship name, present when requested via `include`."
          }
        },
        "required": [
          "type",
          "id",
          "attributes"
        ]
      },
      "description": "The page of resources."
    }
  },
  "required": [
    "links",
    "meta",
    "data"
  ]
}