{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fareeqy-com/json-schema/fareeqy-com-account-envelope-schema.json",
  "title": "AccountEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fareeqy-com-account-api-openapi.yml#/components/schemas/AccountEnvelope",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/Account"
    }
  },
  "$defs": {
    "Account": {
      "type": "object",
      "description": "The calling ApiKey and the company it acts for (GET /me).",
      "properties": {
        "key": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The label the key was given in the app."
            },
            "access": {
              "type": "string",
              "enum": [
                "read",
                "write"
              ],
              "description": "The scope ceiling. A `write` key also carries `read`."
            },
            "operations": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Exactly the operations this key may call. Anything else is a 403."
            }
          }
        },
        "company": {
          "type": "object",
          "properties": {
            "name": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "created_by": {
          "type": "object",
          "description": "Who created the key. A signature, not the permissions the call runs with.",
          "properties": {
            "name": {
              "type": [
                "string",
                "null"
              ]
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "format": "email"
            }
          }
        }
      }
    }
  }
}