{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-sales-cloud/json-schema/salesforce-sales-cloud-query-result-schema.json",
  "title": "QueryResult",
  "description": "Result from a SOQL query execution",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-sales-cloud-query-api-openapi.yml#/components/schemas/QueryResult",
  "type": "object",
  "properties": {
    "totalSize": {
      "type": "integer",
      "description": "Total number of records matching the query"
    },
    "done": {
      "type": "boolean",
      "description": "Whether all results have been returned"
    },
    "nextRecordsUrl": {
      "type": "string",
      "description": "URL to retrieve the next batch of results (if done is false)"
    },
    "records": {
      "type": "array",
      "description": "Array of matching records",
      "items": {
        "$ref": "#/$defs/SObjectRecord"
      }
    }
  },
  "$defs": {
    "SObjectRecord": {
      "type": "object",
      "description": "An sObject record with attributes and field values",
      "properties": {
        "attributes": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "The sObject type"
            },
            "url": {
              "type": "string",
              "description": "The relative URL for the record"
            }
          }
        },
        "Id": {
          "type": "string",
          "description": "The 18-character Salesforce record ID"
        }
      },
      "additionalProperties": true
    }
  }
}