> ## 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.

# Search for post

> This endpoint lets you browse through all your posts.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml get /posts
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:
    get:
      tags:
        - Posts
      summary: Search for post
      description: |
        This endpoint lets you browse through all your posts.
      operationId: searchPost
      parameters:
        - $ref: '#/components/parameters/query_business__in'
        - $ref: '#/components/parameters/query_post_start_datetime'
        - $ref: '#/components/parameters/query_post_end_datetime'
        - $ref: '#/components/parameters/query_post_summary'
        - $ref: '#/components/parameters/query_post_state_in'
        - $ref: '#/components/parameters/query_post_topic_type'
        - $ref: '#/components/parameters/query_post_topic_type_in'
        - $ref: '#/components/parameters/query_page'
        - $ref: '#/components/parameters/query_per_page_1_100'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ListResult'
                  - type: object
                    properties:
                      posts:
                        type: array
                        description: List of Post
                        items:
                          $ref: '#/components/schemas/Post'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
components:
  parameters:
    query_business__in:
      in: query
      name: business__in
      description: >-
        Filter by business ids. Use a comma-separated list to provide multiple
        ids.
      schema:
        type: array
        example: >-
          a1c9f37b4deca92f83b61d02,9f4e2a8c0d73b154e621bc97,c73b15e9fa42d60b3a8c21ef
        items:
          $ref: '#/components/schemas/BusinessId'
          description: ''
    query_post_start_datetime:
      in: query
      name: start_datetime
      schema:
        type: string
        example: '2020-11-06T23:59:59'
      required: false
      description: >
        Filters Posts based on their start datetime.


        The start datetime represents the moment on which a Post of type
        **event/offer** will become available. In case of Posts of type
        **news**, the `start_datetime` it will be compare to the creation date
        of the Post, as the field is not present in this context.
    query_post_end_datetime:
      in: query
      name: end_datetime
      schema:
        type: string
        example: '2020-11-06T23:59:59'
      required: false
      description: >
        Filter Posts based on their end datetime.


        The end datetime represents the date on which the Post of type
        **event/offer** will expire. In case of Posts of type **news**, the
        `end_datetime` it will be compare to exactly one week after the creation
        date of the Post, as the field is not present in this context.
    query_post_summary:
      in: query
      name: summary
      schema:
        type: string
      required: false
      description: |
        Filter Posts based on their description.

        It returns Posts that contain in their description the given string.
        The text does not have to match perfectly.
    query_post_state_in:
      in: query
      name: state__in
      schema:
        type: string
        enum:
          - live
          - to_configure
          - pending
          - scheduled
          - error
          - expired
          - to_validate
      required: false
      description: Filter Posts based on its state.
    query_post_topic_type:
      in: query
      name: topic_type
      schema:
        type: string
        enum:
          - standard
          - event
          - offer
          - alert
      required: false
      description: Filter Posts based on its type.
    query_post_topic_type_in:
      in: query
      name: topic_type__in
      schema:
        type: string
        enum:
          - standard
          - event
          - offer
          - alert
      required: false
      description: Filter Posts based on a list of different types.
    query_page:
      in: query
      name: page
      schema:
        type: integer
        default: 1
      description: |
        Page number.
        Starts at 1. Any value lower than 1 will be considered as 1.
        For the number of items per page, see the `per_page` query parameter.
    query_per_page_1_100:
      in: query
      name: per_page
      schema:
        type: integer
        default: 30
        minimum: 1
        maximum: 100
      description: Number of items to return per page. Currently limited to 100.
  schemas:
    ListResult:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/current_page'
        max_page:
          $ref: '#/components/schemas/max_page'
        count:
          $ref: '#/components/schemas/count'
    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'
    BusinessId:
      description: Business id
      type: string
      example: 5409c35a97bbc544d8e26737
    current_page:
      type: integer
      description: Current page number
      example: 1
    max_page:
      type: integer
      description: Last page number
      example: 10
    count:
      type: integer
      description: Number of resources complying with filters
      example: 287
    postId:
      description: The Post id
      type: integer
      example: 34
    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
    postSummary:
      type: string
      description: Main text content of the post.
      example: Wonderful post summary !
    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'
    postOfferTerms:
      type: string
      description: Terms and conditions of the offer
      example: These are the conditions
    postCouponCode:
      type: string
      description: Offer code that is usable in store or online
      example: PROMO25
    postCTALink:
      description: Link displayed in the post to redirect the client clicking on it.
      type: string
      example: www.partoo.co
    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
    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
    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

````