{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elocuenti-com/json-schema/elocuenti-com-me-response-schema.json",
  "title": "MeResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elocuenti-com-account-api-openapi.yml#/components/schemas/MeResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/Me"
    },
    "request_id": {
      "type": "string",
      "description": "The identifier of this request. Give it to support if you need help.",
      "title": "Request Id"
    }
  },
  "required": [
    "data",
    "request_id"
  ],
  "$defs": {
    "Me": {
      "type": "object",
      "properties": {
        "business": {
          "$ref": "#/$defs/MeBusiness"
        },
        "key": {
          "$ref": "#/$defs/MeKey"
        },
        "limits": {
          "$ref": "#/$defs/MeLimits"
        }
      },
      "required": [
        "business",
        "key",
        "limits"
      ],
      "description": "The business, the key and its limits.",
      "title": "Me"
    },
    "MeBusiness": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of your business.",
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The name of your business, as shown in the dashboard.",
          "title": "Name"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "description": "The business the API key belongs to.",
      "title": "MeBusiness"
    },
    "MeCreator": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the person.",
          "title": "Id"
        }
      },
      "required": [
        "id"
      ],
      "description": "The person who created the key. The key acts on their behalf: it can only do what they are allowed to do in the business. Only their identifier is shown, never their name: whoever holds the key may not be them, and their name is in the dashboard.",
      "title": "MeCreator"
    },
    "MeKey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the key (not the secret).",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "description": "The name you gave the key when you created it.",
          "title": "Name"
        },
        "environment": {
          "type": "string",
          "enum": [
            "production",
            "sandbox"
          ],
          "description": "`production` acts on your real business. `sandbox` is for testing: it never sends a message to your customers, never calls them and never moves real money, and reads show the real data of your business; what each write does with it is in its access line.",
          "title": "Environment"
        },
        "permissions": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "What the key may do: for each resource, the actions allowed (`read`, `write`, `delete`). An operation needs the permission its access line names (`x-access.permission`).",
          "title": "Permissions"
        },
        "created_at": {
          "type": "string",
          "description": "When the key was created (UTC, ISO 8601).",
          "title": "Created At"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "When the key stops working (UTC, ISO 8601), or `null` if it does not expire.",
          "title": "Expires At"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The last time the key was used (UTC, ISO 8601), or `null` if it never was. It is approximate.",
          "title": "Last Used At"
        },
        "created_by": {
          "$ref": "#/$defs/MeCreator"
        }
      },
      "required": [
        "id",
        "name",
        "environment",
        "permissions",
        "created_at",
        "expires_at",
        "last_used_at",
        "created_by"
      ],
      "description": "The API key making the request.",
      "title": "MeKey"
    },
    "MeLimits": {
      "type": "object",
      "properties": {
        "requests_per_minute": {
          "type": "integer",
          "description": "How many requests the key may make per minute.",
          "title": "Requests Per Minute"
        },
        "requests_per_hour": {
          "type": "integer",
          "description": "How many requests the key may make per hour.",
          "title": "Requests Per Hour"
        }
      },
      "required": [
        "requests_per_minute",
        "requests_per_hour"
      ],
      "description": "The limits of the key. Past them the API answers `429` with `Retry-After`; each answer also carries `X-RateLimit-*` headers.",
      "title": "MeLimits"
    }
  }
}