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

# Update a post

> This endpoint lets you update a post.

When used by a BM or GM user, this endpoint also serves to validate and publish a draft post.  

The update will not happen in real time and might take a few minutes

⚠️ Due to Instagram API limitations, **this operation has no effect on Instagram posts**.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml put /posts/{post_id}
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /posts/{post_id}:
    put:
      tags:
        - Posts
      summary: Update a post
      description: >
        This endpoint lets you update a post.


        When used by a BM or GM user, this endpoint also serves to validate and
        publish a draft post.  


        The update will not happen in real time and might take a few minutes


        ⚠️ Due to Instagram API limitations, **this operation has no effect on
        Instagram posts**.
      operationId: updatePost
      parameters:
        - $ref: '#/components/parameters/path_post_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostUpdateData'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
components:
  parameters:
    path_post_id:
      in: path
      name: post_id
      required: true
      schema:
        type: number
      description: Post id
  schemas:
    PostUpdateData:
      description: Request body to update a Post
      type: object
      properties:
        title:
          $ref: '#/components/schemas/postTitle'
        summary:
          $ref: '#/components/schemas/postSummary'
        image_url:
          $ref: '#/components/schemas/postImageURL'
        cta_type:
          $ref: '#/components/schemas/postCTAType'
        link:
          $ref: '#/components/schemas/postLink'
        schedule_time:
          $ref: '#/components/schemas/postScheduleTime'
        start_at:
          $ref: '#/components/schemas/postStartAt'
        end_at:
          $ref: '#/components/schemas/postEndAt'
        coupon_code:
          $ref: '#/components/schemas/postCouponCode'
        offer_terms:
          $ref: '#/components/schemas/postOfferTerms'
    Post:
      description: Post
      type: object
      properties:
        id:
          $ref: '#/components/schemas/postId'
        business_id:
          $ref: '#/components/schemas/BusinessId'
        post_type:
          $ref: '#/components/schemas/postType'
        summary:
          $ref: '#/components/schemas/postSummary'
        schedule_time:
          description: >-
            Date when the Post will be published. No scheduled start time means
            that the Post will be published immediately.
          type: string
          example: '2020-01-01T12:00:00+02:00'
          default: null
        expiration_time:
          description: >-
            If this post is a draft, this indicates the date when it will be
            expired (= date after which the BM/GM user will no longer be able to
            validate and publish).
          type: string
          example: '2020-01-01T12:00:00+02:00'
          default: null
        validation_time:
          description: >-
            Date when the Draft post has been validated by the BM or GM user If
            the post doesn't also have a schedule time, this date coincides with
            the publishing date
          type: string
          example: '2020-01-01T12:00:00+02:00'
          default: null
        post_medias:
          $ref: '#/components/schemas/postMedias'
        created_at:
          $ref: '#/components/schemas/CreatedDate'
        updated_at:
          $ref: '#/components/schemas/UpdatedDate'
        created_on_partoo:
          $ref: '#/components/schemas/postCreatedOnPartoo'
        updated_on_partoo:
          $ref: '#/components/schemas/postUpdatedOnPartoo'
        business_info:
          $ref: '#/components/schemas/postBusinessInfo'
        post_insight:
          $ref: '#/components/schemas/postInsight'
        post_status:
          $ref: '#/components/schemas/postStatus'
        offer_terms:
          $ref: '#/components/schemas/postOfferTerms'
        offer_code:
          $ref: '#/components/schemas/postCouponCode'
        cta_link:
          $ref: '#/components/schemas/postCTALink'
        cta_type:
          $ref: '#/components/schemas/postCTAType'
    postTitle:
      type: string
      description: Title of the post.
      example: Great post title !
    postSummary:
      type: string
      description: Main text content of the post.
      example: Wonderful post summary !
    postImageURL:
      description: |
        URLs of the images displayed with the post.

        **Note:**
          - Add up to 10 images for multi-image post on Facebook and IG
          - Multi-image is not supported by Google, only the first image will be displayed
          - Image ratio must be between 4:5 and 16:9 for IG
          - All images must be same ratio for IG or they will be crop at the first image ratio by IG
      anyOf:
        - type: string
        - type: array
          items:
            type: string
      example:
        - https://example.com/1.png
        - https://example.com/2.png
    postCTAType:
      description: The type of the post to be created. Some type mig.
      type: string
      enum:
        - book
        - order
        - shop
        - learn_more
        - sign_up
        - call
        - no_cta
    postLink:
      description: >-
        Link displayed in the post to redirect the client clicking on it. Use
        can only have one of the following parameters ('use_business_url' or
        'custom_url').
      type: object
      properties:
        use_business_url:
          type: boolean
          description: Use the business google url for link on the post.
        custom_url:
          type: string
          description: An URL to redirect client when they click on the button
    postScheduleTime:
      type: string
      description: >-
        Date and time of when the post will be diffused corresponding platforms.
        It needs to be at least 2 hours after the time of the request. The
        timezone used is UTC.
      example: '2050-01-01T09:00:00'
    postStartAt:
      type: string
      description: >-
        For either event or offer post type. Defined when it start. Timezone is
        defined by the business timezone.
      example: '2050-01-01T09:00:00'
    postEndAt:
      type: string
      description: >-
        For either event or offer post type. Defined when it end. Timezone is
        defined by the business timezone.
      example: '2050-01-01T09:00:00'
    postCouponCode:
      type: string
      description: Offer code that is usable in store or online
      example: PROMO25
    postOfferTerms:
      type: string
      description: Terms and conditions of the offer
      example: These are the conditions
    postId:
      description: The Post id
      type: integer
      example: 34
    BusinessId:
      description: Business id
      type: string
      example: 5409c35a97bbc544d8e26737
    postType:
      type: string
      description: >-
        The type of the post to be created. Event and Offer are not yet
        available for Facebook.
      enum:
        - news
        - event
        - offer
        - covid
    postMedias:
      description: The photo that will be on the Post
      type: array
      items:
        type: object
        properties:
          media_url:
            $ref: '#/components/schemas/postImageURL'
    CreatedDate:
      type: string
      description: Creation date on Partoo
      format: datetime
      example: '2019-08-01T19:15:54.256000+02:00'
    UpdatedDate:
      type: string
      description: Last update date (either on Partoo or on Partner platform)
      format: datetime
      example: '2019-09-01T15:12:35.256000+02:00'
    postCreatedOnPartoo:
      description: Indicates whether or not the post was created using Partoo App/API
      type: boolean
      example: false
    postUpdatedOnPartoo:
      description: Indicates whether or not the post was updated using Partoo App/API
      type: boolean
      example: false
    postBusinessInfo:
      description: name and address of the business that the post is related to.
      type: string
      example: Rick - HQ - 157 boulevard Macdonald, Paris
    postInsight:
      description: >-
        Statistics related to the posts on the different platforms.

        ⚠️ Due to a Google deprecation, on 20/02/2023, Google views and counts
        won't be available anymore. Old insights will still be sent. Facebook
        ones will still be available.
      type: array
      items:
        type: object
        properties:
          name:
            $ref: '#/components/schemas/postPublisherPost'
          click_count:
            type: integer
            description: number of times a user has clicked on the post.
            example: 1512
          view_count:
            type: integer
            description: number of times the post has been viewed.
            example: 2012
    postStatus:
      description: Status related to the posts on the different platforms.
      type: array
      items:
        type: object
        properties:
          name:
            $ref: '#/components/schemas/postPublisherPost'
          state:
            $ref: '#/components/schemas/postState'
          link:
            $ref: '#/components/schemas/postCTALink'
    postCTALink:
      description: Link displayed in the post to redirect the client clicking on it.
      type: string
      example: www.partoo.co
    postPublisherPost:
      type: string
      description: Publisher related to the post
      enum:
        - google_my_business__posts
        - facebook__posts
      example: facebook__posts
    postState:
      description: >-
        The state of the post, indicating at which lifecycle stage it is
        currently.
      type: string
      enum:
        - live
        - pending
        - to_configure
        - scheduled
        - error
        - expired
      example: live
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
    '404':
      description: Resource does not exist
      content:
        application/json:
          schema:
            description: >-
              Error that occcurs when you are trying to reach a resource that
              does not exist
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: string
                    default: Resource not found
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````