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

# Extend the Spark Ads code of a TikTok post

> Adds days to the validity period of the post's Spark Ads code, or issues a new code if the previous one was deleted. Ad authorization must already be enabled for the post.



## OpenAPI

````yaml https://api.bundle.social/swagger-json post /api/v1/misc/tiktok/ad-authorization/extend
openapi: 3.0.2
info:
  title: bundle.social API
  description: >-
    REST API for social media management. Perfect for AI assistants, GPTs,
    automation tools, and integrations. Post to 14+ platforms including Twitter,
    Instagram, Facebook, LinkedIn, TikTok, Pinterest, Reddit, Discord, Slack,
    YouTube, Mastodon, Bluesky, Threads, and Google Business. Schedule posts,
    manage content, analyze performance, and automate your social media workflow
    across all platforms.
  version: 1.0.0
  contact:
    email: contact@bundle.social
  termsOfService: https://bundle.social/terms
servers:
  - url: https://api.bundle.social
  - url: http://localhost:3001
security:
  - ApiKeyAuth: []
tags:
  - name: app
  - name: organization
  - name: team
  - name: socialAccount
  - name: upload
  - name: post
  - name: postImport
  - name: analytics
  - name: comment
  - name: conversation
    description: >-
      Read and reply to Instagram and Facebook direct message conversations,
      react to messages, and send private replies to comments.
  - name: automation
    description: >-
      Build, publish and monitor automation flows that react to incoming
      messages and comments, plus the per-account provider settings they rely
      on.
  - name: misc
  - name: postCSV
paths:
  /api/v1/misc/tiktok/ad-authorization/extend:
    post:
      tags:
        - misc
      summary: Extend the Spark Ads code of a TikTok post
      description: >-
        Adds days to the validity period of the post's Spark Ads code, or issues
        a new code if the previous one was deleted. Ad authorization must
        already be enabled for the post.
      operationId: misc.tiktok.extendAdAuthorization
      parameters: []
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                teamId:
                  type: string
                postId:
                  type: string
                  description: >-
                    The ID of a post in bundle.social published to TikTok. Pass
                    this or `platformPostId`.
                platformPostId:
                  type: string
                  pattern: ^\d+$
                  description: >-
                    The TikTok post ID (item_id) of a public post on the team's
                    TikTok account, for posts published outside bundle.social.
                    Pass this or `postId`.
                authorizationDays:
                  type: number
                  enum:
                    - 7
                    - 30
                    - 60
                    - 180
                    - 365
                  description: >-
                    Days added to the current validity period (7, 30, 60, 180 or
                    365, default 30). If the code was deleted, the validity
                    period of the new code.
              required:
                - teamId
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  platformPostId:
                    type: string
                    description: The TikTok post ID (item_id).
                  authCode:
                    type: string
                    description: >-
                      Spark Ads authorization code. The advertiser adds it to
                      their TikTok ad account to run this post as a Spark Ad.
                  startsAt:
                    type: string
                    description: When the code becomes valid, ISO 8601 in UTC.
                    nullable: true
                  expiresAt:
                    type: string
                    description: When the code expires, ISO 8601 in UTC.
                    nullable: true
                  authorizationDays:
                    type: number
                    description: Validity period of the code in days.
                    nullable: true
                  status:
                    type: string
                    enum:
                      - NOT_USED
                      - IN_USE
                      - EXPIRED
                    description: >-
                      NOT_USED, IN_USE or EXPIRED. Always set by the status
                      endpoint; usually null on enable and extend.
                    nullable: true
                required:
                  - platformPostId
                  - authCode
                  - startsAt
                  - expiresAt
                  - authorizationDays
                  - status
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - invalid_type
                            - invalid_literal
                            - custom
                            - invalid_union
                            - invalid_union_discriminator
                            - invalid_enum_value
                            - unrecognized_keys
                            - invalid_arguments
                            - invalid_return_type
                            - invalid_date
                            - invalid_string
                            - too_small
                            - too_big
                            - invalid_intersection_types
                            - not_multiple_of
                            - not_finite
                          nullable: true
                        message:
                          type: string
                        path:
                          type: array
                          items:
                            oneOf:
                              - type: string
                              - type: number
                          nullable: true
                      required:
                        - message
                    nullable: true
                required:
                  - message
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
        '429':
          description: '429'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
        '502':
          description: '502'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
        '503':
          description: '503'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
        '504':
          description: '504'
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    nullable: true
                  message:
                    type: string
                required:
                  - message
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.