# batches_approve

Aprovar ou recusar os destinos exibidos ao titular. TikTok exige confirmação separada por vídeo.

REST · `POST /api/v1/operations/batches_approve` · MCP · `batches_approve`

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

## Exemplo de entrada

~~~json
{
  "batchId": "99ae140f-7526-4e8a-89c2-c6d0d103010d",
  "targets": [
    {
      "itemId": "video-01",
      "accountId": "ACCOUNT_ID"
    }
  ],
  "approve": false
}
~~~

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

~~~json
{
  "$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)$"
    },
    "targets": {
      "minItems": 1,
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "itemId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "accountId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "itemId",
          "accountId"
        ],
        "additionalProperties": false
      }
    },
    "approve": {
      "type": "boolean"
    },
    "tiktokConsent": {
      "type": "boolean",
      "const": true
    },
    "tiktok": {
      "type": "object",
      "properties": {
        "privacy": {
          "type": "string",
          "enum": [
            "PUBLIC_TO_EVERYONE",
            "FOLLOWER_OF_CREATOR",
            "MUTUAL_FOLLOW_FRIENDS",
            "SELF_ONLY"
          ]
        },
        "comment": {
          "type": "boolean"
        },
        "duet": {
          "type": "boolean"
        },
        "stitch": {
          "type": "boolean"
        },
        "commercial": {
          "type": "boolean"
        },
        "ownBrand": {
          "type": "boolean"
        },
        "brandedContent": {
          "type": "boolean"
        },
        "aiGenerated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "batchId",
    "targets",
    "approve"
  ],
  "additionalProperties": false
}
~~~

## JSON Schema · Saída

~~~json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "batchId": {
      "type": "string"
    },
    "projectId": {
      "type": "string"
    },
    "existing": {
      "type": "boolean"
    },
    "canApply": {
      "type": "boolean"
    },
    "entries": {
      "type": "array",
      "items": {
        "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": {}
      }
    }
  },
  "required": [
    "batchId",
    "projectId",
    "existing",
    "canApply",
    "entries"
  ],
  "additionalProperties": {}
}
~~~
