{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tokencanopy-com/json-schema/tokencanopy-com-share-create-out-schema.json",
  "title": "ShareCreateOut",
  "description": "The create/rotate response — the ONLY response carrying the plaintext\nsecret.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tokencanopy-com-openapi.json#/components/schemas/ShareCreateOut",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^shr_[a-f0-9]{16}$",
      "title": "Id"
    },
    "drive_id": {
      "type": "string",
      "pattern": "^drv_[a-f0-9]{16}$",
      "title": "Drive Id"
    },
    "resource_type": {
      "type": "string",
      "enum": [
        "artifact",
        "artifact_version",
        "folder"
      ],
      "title": "Resource Type"
    },
    "resource_id": {
      "type": "string",
      "title": "Resource Id"
    },
    "created_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created By"
    },
    "revision": {
      "type": "string",
      "pattern": "^rev_[a-f0-9]{16}$",
      "title": "Revision"
    },
    "state": {
      "type": "string",
      "enum": [
        "active",
        "revoked",
        "expired"
      ],
      "title": "State"
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expires At"
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Revoked At"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "rotated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Rotated At"
    },
    "secret": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Secret",
      "description": "Plaintext share secret. Present only on first execution of a create or rotate; null on idempotent replay — rotate to obtain a new secret."
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Url",
      "description": "The redemption URL for this share, on the public share origin. Present exactly when `secret` is — the URL EMBEDS the secret, so it is a credential and is never returned by list or get, and never stored in the idempotency ledger. A caller cannot compose this itself: the origin is deployment configuration, not something a client can know."
    }
  },
  "type": "object",
  "required": [
    "id",
    "drive_id",
    "resource_type",
    "resource_id",
    "created_by",
    "revision",
    "state",
    "expires_at",
    "revoked_at",
    "created_at",
    "rotated_at"
  ]
}