# Preparar una publicación en TikTok

> Obtiene la cuenta autorizada y sus opciones vigentes, junto al video propio, para una aprobación humana.



{/* AUTO-GENERATED by @emisso/codegen. DO NOT EDIT. */}

|                     |                                                                    |
| ------------------- | ------------------------------------------------------------------ |
| **Tool ID**         | `tiktok.publicacion.preparar`                                      |
| **Nombre MCP**      | `tiktok__publicacion__preparar`                                    |
| **Conector**        | `tiktok`                                                           |
| **Plano**           | `action`                                                           |
| **Scope (permiso)** | `tiktok:publish`                                                   |
| **Auth**            | `none`                                                             |
| **Versión**         | `1`                                                                |
| **Sensible**        | sí                                                                 |
| **Deprecado**       | no                                                                 |
| **Comportamiento**  | readOnly=false, destructive=false, idempotent=true, openWorld=true |

> **Requiere conexión.** Indica cuál en cada llamada: header `X-Connect-Connection` en REST y campo `connectionId` en el `execute_write` de MCP. No hay resolución implícita, ni siquiera con una sola conexión activa: la conexión es la empresa. El id sale de [`conexiones.estado.consultar`](/docs/referencia/conexiones/estado-consultar).

## Qué hace [#qué-hace]

No publica ni selecciona privacidad por ti.

## Entrada [#entrada]

| Campo     | Tipo   | Requerido | Descripción |
| --------- | ------ | --------- | ----------- |
| `mediaId` | string | sí        |             |

<details>
  <summary>
    JSON Schema de entrada
  </summary>

  ```json
  {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mediaId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 240
      }
    },
    "required": [
      "mediaId"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Ejemplo [#ejemplo]

```bash title="curl"
curl -X POST https://connect.emisso.ai/api/v1/tools/tiktok.publicacion.preparar/execute \
  -H "Authorization: Bearer connect_sk_…" \
  -H "X-Connect-Connection: conn_9tKfR2mQx4Vb" \
  -H "Content-Type: application/json" \
  -d '{"input":{"mediaId":"media_ejemplo"}}'
```

```json title="MCP · meta-tool execute_write"
{
  "tool": "tiktok.publicacion.preparar",
  "params": {
    "mediaId": "media_ejemplo"
  },
  "connectionId": "conn_9tKfR2mQx4Vb"
}
```

**Salida esperada (200):**

```json
{
  "data": {
    "mediaId": "media_ejemplo",
    "mediaSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "durationSeconds": 5,
    "previewUrl": "https://example.com/video.mp4",
    "creatorInfoSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "mode": "sandbox",
    "creatorInfo": {
      "username": "cuenta",
      "nickname": "Cuenta autorizada",
      "avatarUrl": "https://example.com/avatar.jpg",
      "privacyOptions": [
        "SELF_ONLY"
      ],
      "commentDisabled": false,
      "duetDisabled": false,
      "stitchDisabled": false,
      "maxVideoDurationSeconds": 60
    }
  },
  "meta": {
    "request_id": "req_…",
    "tool_id": "tiktok.publicacion.preparar",
    "plane": "action",
    "latency_ms": 24,
    "audit_status": "recorded"
  }
}
```

## Salida [#salida]

| Campo                                 | Tipo                                                                                                  | Requerido | Descripción |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------- | --------- | ----------- |
| `mediaId`                             | string                                                                                                | sí        |             |
| `mediaSha256`                         | string `^[a-f0-9]{64}$`                                                                               | sí        |             |
| `durationSeconds`                     | número                                                                                                | sí        |             |
| `previewUrl`                          | string                                                                                                | sí        |             |
| `creatorInfoSha256`                   | string `^[a-f0-9]{64}$`                                                                               | sí        |             |
| `mode`                                | `"sandbox"` · `"audited"`                                                                             | sí        |             |
| `creatorInfo`                         | objeto                                                                                                | sí        |             |
| `creatorInfo.username`                | string                                                                                                | sí        |             |
| `creatorInfo.nickname`                | string                                                                                                | sí        |             |
| `creatorInfo.avatarUrl`               | string                                                                                                | sí        |             |
| `creatorInfo.privacyOptions`          | lista de `"PUBLIC_TO_EVERYONE"` · `"MUTUAL_FOLLOW_FRIENDS"` · `"FOLLOWER_OF_CREATOR"` · `"SELF_ONLY"` | sí        |             |
| `creatorInfo.commentDisabled`         | booleano                                                                                              | sí        |             |
| `creatorInfo.duetDisabled`            | booleano                                                                                              | sí        |             |
| `creatorInfo.stitchDisabled`          | booleano                                                                                              | sí        |             |
| `creatorInfo.maxVideoDurationSeconds` | número                                                                                                | sí        |             |

<details>
  <summary>
    JSON Schema de salida
  </summary>

  ```json
  {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mediaId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 240
      },
      "mediaSha256": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      },
      "durationSeconds": {
        "type": "number",
        "exclusiveMinimum": 0
      },
      "previewUrl": {
        "type": "string",
        "maxLength": 4096,
        "format": "uri"
      },
      "creatorInfoSha256": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      },
      "mode": {
        "type": "string",
        "enum": [
          "sandbox",
          "audited"
        ]
      },
      "creatorInfo": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "nickname": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "avatarUrl": {
            "type": "string",
            "maxLength": 4096,
            "format": "uri"
          },
          "privacyOptions": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "PUBLIC_TO_EVERYONE",
                "MUTUAL_FOLLOW_FRIENDS",
                "FOLLOWER_OF_CREATOR",
                "SELF_ONLY"
              ]
            }
          },
          "commentDisabled": {
            "type": "boolean"
          },
          "duetDisabled": {
            "type": "boolean"
          },
          "stitchDisabled": {
            "type": "boolean"
          },
          "maxVideoDurationSeconds": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "username",
          "nickname",
          "avatarUrl",
          "privacyOptions",
          "commentDisabled",
          "duetDisabled",
          "stitchDisabled",
          "maxVideoDurationSeconds"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "mediaId",
      "mediaSha256",
      "durationSeconds",
      "previewUrl",
      "creatorInfoSha256",
      "mode",
      "creatorInfo"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Errores de esta tool [#errores-de-esta-tool]

| Código                 | HTTP | Reintentable | Qué hacer                                                                                                           |
| ---------------------- | ---- | ------------ | ------------------------------------------------------------------------------------------------------------------- |
| `connection_disabled`  | 403  | no           | Reactívala en /connections o usa otra conexión del mismo sistema.                                                   |
| `connection_not_found` | 404  | no           | Usa uno de los connectionId que lista el error, o revisa la conexión en /connections. No hace falta reactivar nada. |

Toda llamada puede devolver además los códigos transversales (`validation_error`, `unauthorized`, `scope_not_granted`, `rate_limited`, entre otros): el detalle vive en el [catálogo de errores](/docs/referencia/errores).


---

Esta página es parte de la documentación de Emisso. El índice completo, con cada página y su descripción, está en https://connect.emisso.ai/llms.txt. Esta misma página en HTML: https://connect.emisso.ai/docs/referencia/tiktok/publicacion-preparar.
