Reporting Ninja · Schema

CalculatedMetricsCreateRequest

A new calculated metric. The body is the object /v1/calculated-metrics/get answers -- the kind in type and its own block filled in, the other two null. The keys a read publishes and a write has no column for -- calculated_metric_key, integration, is_system_defined, not_expressible_reason and not_expressible_message -- are declared here as readOnly: they are accepted, ignored and named one by one in a READ_ONLY_FIELD_IGNORED warning, so what a read answered can be sent straight back with nothing taken out of it. A null means "leave it as it is".

Marketing ReportingAI reportingData IntegrationWhite LabelClient PortalCross‑channel reporting

Properties

Name Type Description
name string How the definition is listed in the account. 2 to 50 characters, with no character above the Basic Multilingual Plane.
display_name object What a widget draws as the column header. Left out or null on a creation, it is the name.
internal_notes object A note for the account's own staff, at most 250 characters. An empty string takes it away.
integration_id string The integration the metric belongs to. It cannot be changed once the metric exists.
level object The data view the metric is read in. Required for the integrations capabilities lists under calculated_metrics.level_required_for, written by the platform for the ones under calculated_metrics.level_f
type string Which of the three kinds it is. It cannot be changed once the metric exists: each kind is stored in columns of its own.
expression object The block of the expression kind. Null, or left out, in a metric of another kind -- which is what a read publishes for it.
function object The block of the function kind. Null, or left out, in a metric of another kind.
filtered object The block of the filtered kind. Null, or left out, in a metric of another kind.
connection_key string Only for facebook_ads and ga4, together with account_id: the connection of the account whose own fields the definition uses, the custom conversions of a Meta ad account or the custom metrics of a GA4
account_id string Only for facebook_ads and ga4, together with connection_key: the ad account or the GA4 property whose own fields the definition uses. From /v1/connections.
calculated_metric_key string The key the row already has. Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored an
integration string The name of a data source this API publishes no integration_id for, which a read answers instead of integration_id. Published by /v1/calculated-metrics/get and written by nothing. It is accepted here
is_system_defined boolean Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_O
not_expressible_reason object Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_O
not_expressible_message object Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_O
dry_run boolean Validate everything and write nothing.
idempotency_key string Replays the answer of an identical call for 24 hours.
View JSON Schema on GitHub

JSON Schema

reportingninja-com-calculated-metrics-create-request-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reportingninja-com/json-schema/reportingninja-com-calculated-metrics-create-request-schema.json",
  "title": "CalculatedMetricsCreateRequest",
  "description": "A new calculated metric. The body is the object /v1/calculated-metrics/get answers -- the kind in type and its own block filled in, the other two null. The keys a read publishes and a write has no column for -- calculated_metric_key, integration, is_system_defined, not_expressible_reason and not_expressible_message -- are declared here as readOnly: they are accepted, ignored and named one by one in a READ_ONLY_FIELD_IGNORED warning, so what a read answered can be sent straight back with nothing taken out of it. A null means \"leave it as it is\".",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reportingninja-com-openapi.json#/components/schemas/CalculatedMetricsCreateRequest",
  "type": "object",
  "required": [
    "name",
    "integration_id",
    "type"
  ],
  "additionalProperties": false,
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 50,
      "description": "How the definition is listed in the account. 2 to 50 characters, with no character above the Basic Multilingual Plane."
    },
    "display_name": {
      "minLength": 2,
      "maxLength": 50,
      "description": "What a widget draws as the column header. Left out or null on a creation, it is the name.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "internal_notes": {
      "maxLength": 250,
      "description": "A note for the account's own staff, at most 250 characters. An empty string takes it away.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "integration_id": {
      "type": "string",
      "description": "The integration the metric belongs to. It cannot be changed once the metric exists."
    },
    "level": {
      "description": "The data view the metric is read in. Required for the integrations capabilities lists under calculated_metrics.level_required_for, written by the platform for the ones under calculated_metrics.level_fixed_for -- which accept the value a read publishes for them and nothing else -- and refused for the rest. The values it takes are the data views /v1/integrations/detail publishes for the integration. It cannot be changed once the metric exists.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "expression",
        "function",
        "filtered"
      ],
      "description": "Which of the three kinds it is. It cannot be changed once the metric exists: each kind is stored in columns of its own."
    },
    "expression": {
      "anyOf": [
        {
          "type": "object",
          "description": "Kind expression: the formula and how its result is printed.",
          "additionalProperties": false,
          "properties": {
            "format": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "none",
                "time",
                "currency",
                "percentage",
                null
              ],
              "description": "Required on a creation. The two older values a read may publish, time_millis and text, are kept by an update that does not name format and cannot be written."
            },
            "formula": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string"
              },
              "description": "A flat list of infix tokens: metric ids of /v1/fields for this integration, the operators + - * /, '(' and ')', and literal numbers. At least one metric, the parentheses balance, and an id the field catalogue does not publish is refused -- which is stricter than the application, where a token is a metric as soon as it starts with the prefix of an integration."
            },
            "green_when_increases": {
              "type": "boolean",
              "description": "Whether a rise of the metric is drawn as a good thing. True on a creation that does not name it."
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "The block of the expression kind. Null, or left out, in a metric of another kind -- which is what a read publishes for it."
    },
    "function": {
      "anyOf": [
        {
          "type": "object",
          "description": "Kind function: one metric aggregated over a period.",
          "additionalProperties": false,
          "properties": {
            "metric": {
              "description": "A metric id of /v1/fields for this integration.",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "function": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "average",
                "min",
                "max",
                null
              ]
            },
            "time_period": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "day",
                "week",
                "month",
                null
              ]
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "The block of the function kind. Null, or left out, in a metric of another kind."
    },
    "filtered": {
      "anyOf": [
        {
          "type": "object",
          "description": "Kind filtered: one metric read through a saved filter of the same integration.",
          "additionalProperties": false,
          "properties": {
            "metric": {
              "description": "A metric id of /v1/fields for this integration.",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "filter_key": {
              "description": "A saved filter of the account and of this integration. From /v1/filters/list.",
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "The block of the filtered kind. Null, or left out, in a metric of another kind."
    },
    "connection_key": {
      "type": "string",
      "description": "Only for facebook_ads and ga4, together with account_id: the connection of the account whose own fields the definition uses, the custom conversions of a Meta ad account or the custom metrics of a GA4 property, as /v1/fields publishes them with include_custom_fields. A formula may then name the count and the value of each custom conversion (not its cost per conversion) or each custom metric (not the averages). The pair is not stored: the metric is offered for any account or property that has every one of the fields it uses. From /v1/connections."
    },
    "account_id": {
      "type": "string",
      "description": "Only for facebook_ads and ga4, together with connection_key: the ad account or the GA4 property whose own fields the definition uses. From /v1/connections."
    },
    "calculated_metric_key": {
      "type": "string",
      "readOnly": true,
      "description": "The key the row already has. Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_ONLY_FIELD_IGNORED warning naming it."
    },
    "integration": {
      "type": "string",
      "readOnly": true,
      "description": "The name of a data source this API publishes no integration_id for, which a read answers instead of integration_id. Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_ONLY_FIELD_IGNORED warning naming it."
    },
    "is_system_defined": {
      "type": "boolean",
      "readOnly": true,
      "description": "Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_ONLY_FIELD_IGNORED warning naming it."
    },
    "not_expressible_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_ONLY_FIELD_IGNORED warning naming it."
    },
    "not_expressible_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "Published by /v1/calculated-metrics/get and written by nothing. It is accepted here so the object a read answers can be sent straight back as a body; the key is ignored and the answer carries a READ_ONLY_FIELD_IGNORED warning naming it."
    },
    "dry_run": {
      "type": "boolean",
      "description": "Validate everything and write nothing."
    },
    "idempotency_key": {
      "type": "string",
      "description": "Replays the answer of an identical call for 24 hours."
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/reportingninja-com-calculated-metrics-create-request"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.