{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prospectapis/json-schema/prospectapis-queued-write-schema.json",
  "title": "QueuedWrite",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prospectapis-people-writes-api-openapi.yml#/components/schemas/QueuedWrite",
  "type": "object",
  "required": [
    "queued_id",
    "op",
    "route",
    "status",
    "reason",
    "created_at",
    "expires_at",
    "finished_at",
    "outcome"
  ],
  "properties": {
    "queued_id": {
      "type": "string",
      "format": "uuid"
    },
    "op": {
      "type": "string",
      "description": "The write, e.g. message or invite."
    },
    "route": {
      "type": "string",
      "description": "The write route, e.g. POST /v1/people/invite."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "sending",
        "sent",
        "failed",
        "expired",
        "cancelled"
      ]
    },
    "reason": {
      "type": "string",
      "enum": [
        "session_logged_out",
        "account_not_connected",
        "account_reconnect_required"
      ],
      "description": "Why it was held."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "finished_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "outcome": {
      "type": [
        "object",
        "null"
      ],
      "description": "Set once the write is finished. code is sent, expired, or why it was not sent: account_changed (a different account is connected now), account_disconnected (the account was disconnected), key_revoked, key_scope, key_cap_reached, insufficient_credits, duplicate, or a write error code. outcome_unknown means the send may have reached the platform but its answer was lost: it is never sent again, so check the account before sending it yourself.",
      "properties": {
        "code": {
          "type": "string"
        },
        "status": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    }
  }
}