{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/roark/json-schema/roark-update-call-properties-response-schema.json",
  "title": "UpdateCallPropertiesResponse",
  "description": "Result of updating the properties of a call.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/roark-call-api-openapi.yml#/components/schemas/UpdateCallPropertiesResponse",
  "type": "object",
  "properties": {
    "callId": {
      "type": "string",
      "format": "uuid",
      "description": "The call whose properties were updated"
    },
    "updated": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Stored (snake_case) names of the properties written by this request, including ones sent with the value they already had"
    },
    "removed": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Stored names of the properties removed by this request. A property sent as null that was not on the call is not listed."
    },
    "properties": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "All of the call's properties after the update, including the ones Roark sets, when the key also has the 'call:read' permission. A key without it gets back only the properties this request wrote. Values are returned as strings, as on GET /v1/call/:callId."
    },
    "metricCollectionJob": {
      "oneOf": [
        {
          "$ref": "#/$defs/MetricCollectionJobResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "The metric collection job triggered to (re)score the requested metrics, or null when no metrics were requested (or when scoring failed, see metricCollectionError). Track its id to fetch results from GET /v1/metric/collection-jobs/:jobId."
    },
    "metricCollectionError": {
      "type": [
        "string",
        "null"
      ],
      "description": "Present (non-null) only when `metrics` were requested but the collection job could not be started (e.g. insufficient credits, or an unknown metric id). The properties were still written. Retry scoring via POST /v1/metric/collection-jobs, or re-send this request (writing the same values again is harmless). Null on success or when no metrics were requested."
    }
  },
  "required": [
    "callId",
    "updated",
    "removed",
    "properties",
    "metricCollectionJob",
    "metricCollectionError"
  ],
  "$defs": {
    "MetricCollectionJobResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier of the metric collection job"
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "PROCESSING",
            "COMPLETED",
            "FAILED",
            "CANCELED"
          ],
          "description": "Current status of the job"
        },
        "triggeredBy": {
          "type": "string",
          "enum": [
            "USER_MANUAL",
            "USER_API",
            "METRIC_POLICY",
            "SIMULATION"
          ],
          "description": "What triggered this job"
        },
        "totalItems": {
          "type": "integer",
          "description": "Total number of call-metric pairs to process"
        },
        "completedItems": {
          "type": "integer",
          "description": "Number of items that finished without failing: a value was written, or the metric did not apply to the conversation"
        },
        "failedItems": {
          "type": "integer",
          "description": "Number of items that could not be computed, for example because an artifact the metric reads (such as diarization) failed to generate"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "When the job started processing"
        },
        "completedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "When the job completed"
        },
        "errorMessage": {
          "type": [
            "string",
            "null"
          ],
          "description": "Why the job failed or, on a COMPLETED job with failedItems above 0, why those items failed"
        },
        "policyIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "description": "IDs of the metric policies that triggered this job"
        },
        "createdAt": {
          "type": "string",
          "description": "When the job was created"
        },
        "updatedAt": {
          "type": "string",
          "description": "When the job was last updated"
        }
      },
      "required": [
        "id",
        "status",
        "triggeredBy",
        "totalItems",
        "completedItems",
        "failedItems",
        "startedAt",
        "completedAt",
        "errorMessage",
        "policyIds",
        "createdAt",
        "updatedAt"
      ],
      "description": "A metric collection job that processes metrics for calls or chats"
    }
  }
}