> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mallary.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Attach a TikTok Post URL

> Save the final TikTok post URL after a manual TikTok upload is complete.

Use this endpoint only when a TikTok publishing job asks the creator to finish the upload in TikTok.

Send the job ID from `POST /api/v1/post` and the final public TikTok video or photo URL. Mallary saves the TikTok post ID and URL, marks the job complete, and queues an analytics refresh.

Accepted URLs include:

* `https://www.tiktok.com/@handle/video/1234567890`
* `https://www.tiktok.com/@handle/photo/1234567890`

The endpoint returns an error if the job is not a TikTok job or does not need a final URL.


## OpenAPI

````yaml POST /api/v1/jobs/{id}/tiktok/post-url
openapi: 3.0.3
info:
  title: Mallary API
  version: 1.4.0
  description: >
    Public API for multi-platform publishing, analytics, media upload, and
    webhooks.


    Authentication:

    - Use header `Authorization: Bearer {api_key}`.

    - API key identity is authoritative. Do not use `user_id` to identify a
    caller.


    Connection profiles:

    - Omit `profile_id` to use the authenticated user's default profile.

    - Send the profile's random public `profile_id` when you want to publish,
    list posts, read post analytics or audience counts, list platforms, update
    settings, or disconnect a platform for a non-default profile.

    - Use `GET /api/v1/profiles` to list profile IDs.

    - Per-platform account caps by plan: Free 1, Starter 4, Pro 10, Business 50.


    Rate limits (per user, per minute) depend on subscription plan:

    - plan_id 1: 75 req/min

    - plan_id 2: 150 req/min

    - plan_id 3: 750 req/min

    - plan_id 4: 1500 req/min
servers:
  - url: https://mallary.ai
    description: Production
security:
  - bearerAuth: []
externalDocs:
  description: Full product docs
  url: https://docs.mallary.ai/
paths:
  /api/v1/jobs/{id}/tiktok/post-url:
    post:
      summary: Attach the final TikTok post URL
      description: >-
        Saves the final TikTok URL after a manual TikTok upload is complete.
        This endpoint only accepts TikTok jobs that are waiting for the final
        URL.
      operationId: attachTikTokPostUrl
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: TikTok job ID returned by `POST /api/v1/post`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - post_url
              properties:
                post_url:
                  type: string
                  format: uri
                  description: Final public TikTok post URL.
      responses:
        '200':
          description: TikTok post URL saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachTikTokPostUrlResponse'
        '400':
          description: Invalid job ID, missing URL, or non-TikTok job
        '401':
          description: Missing or invalid API key
        '404':
          description: Job not found
        '409':
          description: The job is not waiting for a final TikTok post URL
components:
  schemas:
    AttachTikTokPostUrlResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - ok
        data:
          type: object
          properties:
            job_id:
              type: integer
            platform:
              type: string
              enum:
                - tiktok
            platform_post_id:
              type: string
            platform_post_url:
              type: string
              format: uri
            analytics_refresh:
              type: string
              enum:
                - queued
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Use `Authorization: Bearer {api_key}`'

````