OpenSocialDocumentação

batches_apply

Agendar um destino do lote ou encaminhar ao titular. Repetir preserva a publicação original.

REST · POST /api/v1/operations/batches_apply · MCP · batches_apply

Permissão necessária · publish. Envie Idempotency-Key no REST ou requestKey no MCP. Substitua IDs e datas do exemplo antes de executar.

Exemplo de entrada

{
  "batchId": "99ae140f-7526-4e8a-89c2-c6d0d103010d",
  "itemId": "video-01",
  "accountId": "ACCOUNT_ID"
}

O REST retorna a saída abaixo diretamente. No MCP leia structuredContent.result. Consulte o contrato atual em /api/v1/openapi.json.

Em 401 confira a validade da credencial. Em 403 confira papel, escopos e contas. Em 409 releia o registro antes de tentar novamente.

JSON Schema · Entrada

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "batchId": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "itemId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "accountId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    }
  },
  "required": [
    "batchId",
    "itemId",
    "accountId"
  ],
  "additionalProperties": false
}

JSON Schema · Saída

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "diagnosis": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "firstRequestAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "lastCheckedAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "reviewUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "stage": {
              "type": [
                "string",
                "null"
              ]
            },
            "cause": {
              "type": [
                "string",
                "null"
              ]
            },
            "attemptId": {
              "type": [
                "string",
                "null"
              ]
            },
            "originalDueAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "effectiveDueAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "delaySeconds": {
              "type": [
                "number",
                "null"
              ]
            },
            "nextAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "canRetry": {
              "type": "boolean"
            },
            "canRevise": {
              "type": "boolean"
            },
            "canReconcile": {
              "type": "boolean"
            },
            "canResume": {
              "type": "boolean"
            },
            "needsReview": {
              "type": "boolean"
            },
            "action": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "firstRequestAt",
            "lastCheckedAt",
            "reviewUrl",
            "stage",
            "cause",
            "attemptId",
            "originalDueAt",
            "effectiveDueAt",
            "delaySeconds",
            "nextAt",
            "canRetry",
            "canRevise",
            "canReconcile",
            "canResume",
            "needsReview",
            "action"
          ],
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "itemId": {
      "type": "string"
    },
    "accountId": {
      "type": [
        "string",
        "null"
      ]
    },
    "accountName": {
      "type": [
        "string",
        "null"
      ]
    },
    "platform": {
      "type": [
        "string",
        "null"
      ]
    },
    "handle": {
      "type": [
        "string",
        "null"
      ]
    },
    "mediaId": {
      "type": [
        "string",
        "null"
      ]
    },
    "mediaName": {
      "type": [
        "string",
        "null"
      ]
    },
    "mediaStatus": {
      "type": [
        "string",
        "null"
      ]
    },
    "publicationId": {
      "type": [
        "string",
        "null"
      ]
    },
    "remoteId": {
      "type": [
        "string",
        "null"
      ]
    },
    "remoteUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "at": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "confirmation": {
      "type": [
        "string",
        "null"
      ]
    },
    "problems": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "action",
          "operation"
        ],
        "additionalProperties": {}
      }
    },
    "payload": {
      "type": "object",
      "properties": {
        "caption": {
          "type": "string"
        }
      },
      "required": [
        "caption"
      ],
      "additionalProperties": {}
    },
    "approvalUrl": {
      "type": "string"
    }
  },
  "required": [
    "itemId",
    "accountId",
    "accountName",
    "platform",
    "handle",
    "mediaId",
    "mediaName",
    "mediaStatus",
    "publicationId",
    "remoteId",
    "remoteUrl",
    "at",
    "timezone",
    "state",
    "confirmation",
    "problems",
    "payload"
  ],
  "additionalProperties": {}
}