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

# Search posts

> Search AI-generated summaries and scorecards for your team. Filter by date, call type, rep, company, CRM deal, and more. Send an empty body `{}` to return recent posts.

Set `detail: true` to get full post payloads, or leave it `false` (default) for compact summaries with snippets.

**Related:** [Get a post](/api-reference/posts/get-a-post) · [List post filters](/api-reference/posts/list-post-filters)


<Tip>Start with `detail: false` (the default) for faster, smaller responses. Only set `detail: true` when you need the full structured payload for a specific post.</Tip>


## OpenAPI

````yaml /api/openapi.yaml post /api/public/v1/posts/search
openapi: 3.1.0
info:
  title: OnePerfectSlice API
  version: 1.0.0
  description: |
    Programmatic access to OnePerfectSlice. Authenticate with a team-scoped
    API key (Bearer sk_...) obtained from Org Settings → API Keys.
servers:
  - url: https://app.oneperfectslice.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /api/public/v1/posts/search:
    post:
      tags:
        - Posts
      summary: Search posts
      description: >
        Search AI-generated summaries and scorecards for your team. Filter by
        date, call type, rep, company, CRM deal, and more. Send an empty body
        `{}` to return recent posts.


        Set `detail: true` to get full post payloads, or leave it `false`
        (default) for compact summaries with snippets.


        **Related:** [Get a post](/api-reference/posts/get-a-post) · [List post
        filters](/api-reference/posts/list-post-filters)
      operationId: searchPosts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicPostSearchRequest'
            example:
              templateType:
                - summary
              limit: 5
      responses:
        '200':
          description: Paginated post search results
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: object
                    required:
                      - posts
                    properties:
                      posts:
                        type: array
                        items:
                          oneOf:
                            - $ref: '#/components/schemas/PublicPostSummaryResponse'
                            - $ref: '#/components/schemas/PublicPostResponse'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '400':
          description: Invalid request body or filters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalidRequest:
                  value:
                    error:
                      code: INVALID_REQUEST
                      message: Malformed JSON body
                invalidFilters:
                  value:
                    error:
                      code: INVALID_FILTERS
                      message: Limit must be between 1 and 100
                dateRangeTooWide:
                  value:
                    error:
                      code: DATE_RANGE_TOO_WIDE
                      message: Maximum lookback is 90 days from today.
                filterArrayTooLarge:
                  value:
                    error:
                      code: FILTER_ARRAY_TOO_LARGE
                      message: Filter array exceeds maximum size
                      details:
                        field: crmDealStages
                        maxAllowed: 100
                        validValuesEndpoint: /api/public/v1/filters/crm-deal-stages
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          description: Post search request timed out
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: POST_SEARCH_TIMEOUT
                  message: Post search request timed out
      security:
        - bearerAuth: []
components:
  schemas:
    PublicPostSearchRequest:
      type: object
      description: >-
        Post search filters. Send an empty body `{}` to return recent posts. All
        filters are optional.
      properties:
        callTypeId:
          type: array
          items:
            type: integer
            format: int64
          maxItems: 100
          description: Filter by call type IDs
        templateType:
          type: array
          items:
            type: string
            enum:
              - summary
              - scorecard
          maxItems: 100
          description: Filter by template type
        startDate:
          type: string
          format: date-time
          description: Start datetime (inclusive)
        endDate:
          type: string
          format: date-time
          description: End datetime (inclusive)
        callOwnerEmails:
          type: array
          items:
            type: string
          maxItems: 100
          description: Filter by call owner email
        companyDomains:
          type: array
          items:
            type: string
          maxItems: 100
          description: Filter by company domain
        crmDealIds:
          type: array
          items:
            type: integer
            format: int64
          maxItems: 100
          description: Filter by CRM deal IDs
        crmCompanyIds:
          type: array
          items:
            type: integer
            format: int64
          maxItems: 100
          description: Filter by CRM company IDs
        crmDealStages:
          type: array
          items:
            type: string
          maxItems: 100
          description: Filter by CRM deal stages
        crmAmountMin:
          type: number
          description: Minimum CRM deal amount
        crmAmountMax:
          type: number
          description: Maximum CRM deal amount
        crmCustomFieldFilters:
          type: array
          items:
            $ref: '#/components/schemas/CrmFieldFilterValue'
          maxItems: 100
          description: Custom CRM field filters
        detail:
          type: boolean
          default: false
          description: Return full post payloads when true; compact summaries when false
        fields:
          type: array
          items:
            type: string
          description: Optional response field selection hint
        limit:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
        offset:
          type: integer
          minimum: 0
          default: 0
    PublicPostSummaryResponse:
      type: object
      required:
        - fileId
        - title
        - date
        - templateType
        - snippet
      properties:
        postId:
          type: integer
          format: int64
          nullable: true
        fileId:
          type: integer
          format: int64
          description: >-
            Underlying call/file identifier. Use this to deduplicate summary and
            scorecard rows for the same call.
        title:
          type: string
        date:
          type: string
          format: date-time
        callOwnerEmail:
          type: string
          nullable: true
        companyDomain:
          type: string
          nullable: true
        templateType:
          type: string
          enum:
            - summary
            - scorecard
        snippet:
          type: string
    PublicPostResponse:
      type: object
      required:
        - fileId
        - callTypeId
        - callTypeName
        - templateType
        - title
        - published
        - result
        - postCreatedAt
        - fileCreatedAt
        - user
        - team
      properties:
        postId:
          type: integer
          format: int64
          nullable: true
        fileId:
          type: integer
          format: int64
        callTypeId:
          type: integer
          format: int64
        callTypeName:
          type: string
        templateType:
          type: string
          enum:
            - summary
            - scorecard
        title:
          type: string
        published:
          type: boolean
        result:
          type: object
          description: Structured post payload
          additionalProperties: true
        postCreatedAt:
          type: string
          format: date-time
        fileCreatedAt:
          type: string
          format: date-time
        user:
          $ref: '#/components/schemas/PublicPostUserInfo'
        team:
          $ref: '#/components/schemas/PublicPostTeamInfo'
        callOwnerName:
          type: string
          nullable: true
        callOwnerEmail:
          type: string
          nullable: true
        companyDomain:
          type: string
          nullable: true
        externalUrl:
          type: string
          nullable: true
        aiGeneratedTitle:
          type: string
          nullable: true
    PaginationMeta:
      type: object
      required:
        - pagination
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
    ApiError:
      type: object
      description: Standard error envelope for all public API error responses
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable UPPER_SNAKE_CASE error code
              example: INVALID_TOKEN
            message:
              type: string
              description: Human-readable error description
              example: Token is invalid
            details:
              type: object
              description: Optional additional error context
              additionalProperties: true
    CrmFieldFilterValue:
      type: object
      description: Custom CRM field filter
      required:
        - entityType
        - fieldName
        - fieldType
      properties:
        entityType:
          type: string
          enum:
            - deal
            - company
            - contact
          description: CRM entity type
        fieldName:
          type: string
          description: Field name in the CRM
        fieldType:
          type: string
          enum:
            - string
            - number
            - date
            - datetime
            - boolean
            - enumeration
          description: Data type of the field
        stringValue:
          type: string
          description: Filter value for string fields
        numberMin:
          type: number
          description: Range start for number fields
        numberMax:
          type: number
          description: Range end for number fields
        dateStart:
          type: string
          description: Range start for date/datetime fields (ISO-8601)
        dateEnd:
          type: string
          description: Range end for date/datetime fields (ISO-8601)
        booleanValue:
          type: boolean
          description: Filter value for boolean fields
        enumValues:
          type: array
          items:
            type: string
          description: Selected values for enumeration fields (multi-select)
    PublicPostUserInfo:
      type: object
      required:
        - id
        - email
      properties:
        id:
          type: integer
          format: int64
        email:
          type: string
        fullName:
          type: string
          nullable: true
    PublicPostTeamInfo:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
    Pagination:
      type: object
      required:
        - totalCount
        - hasMore
        - limit
        - offset
      properties:
        totalCount:
          type: integer
          description: Total number of results across all pages
          example: 142
        hasMore:
          type: boolean
          description: Whether more results exist beyond the current page
          example: true
        limit:
          type: integer
          description: Number of results per page
          example: 20
        offset:
          type: integer
          description: Current offset into the result set
          example: 0
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            missingToken:
              value:
                error:
                  code: MISSING_TOKEN
                  message: Authorization header with Bearer token is required
            invalidToken:
              value:
                error:
                  code: INVALID_TOKEN
                  message: Token is invalid
            tokenRevoked:
              value:
                error:
                  code: TOKEN_REVOKED
                  message: Token has been revoked
            tokenExpired:
              value:
                error:
                  code: TOKEN_EXPIRED
                  message: Token has expired
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key with sk_ prefix. Create one in Org Settings → API Keys.
      x-default: sk_your_api_key

````