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

> Retrieve the number of items for the authenticated workspace. The provided query parameters allow filtering the returned items.

# Retrieve the number of items



## OpenAPI

````yaml get /items/count
openapi: 3.0.3
info:
  title: Retrac API
  description: >-
    Retrac is an inventory management API for workspaces, items, locations,
    stock balances, transfers, and tags.
  version: 0.0.1
  contact:
    name: Retrac Support
    email: support@retrac.co
    url: https://api.retrac.co
servers:
  - url: https://api.retrac.co
    description: Production API
security: []
paths:
  /items/count:
    get:
      tags:
        - Items
      summary: Retrieve the number of items
      description: >-
        Retrieve the number of items for the authenticated workspace. The
        provided query parameters allow filtering the returned items.
      operationId: getItemsCount
      parameters:
        - in: query
          name: workspaceId
          description: The ID of the workspace.
          schema:
            type: string
            description: The ID of the workspace.
            example: ws_cluuwcv0r...
          required: true
        - in: query
          name: projectSlug
          description: >-
            The slug of the project. This field is deprecated – use
            `workspaceId` instead.
          schema:
            type: string
            description: >-
              The slug of the project. This field is deprecated – use
              `workspaceId` instead.
            deprecated: true
        - in: query
          name: sku
          description: The SKU of the item.
          schema:
            type: string
            description: The SKU of the item.
        - in: query
          name: description
          description: The item description.
          schema:
            type: string
            description: The item description.
        - in: query
          name: cost
          description: The item cost.
          schema:
            type: number
            description: The item cost.
        - in: query
          name: sellPrice
          description: The default sell price of the item.
          schema:
            type: number
            description: The default sell price of the item.
        - in: query
          name: supplierId
          description: The supplier ID for the item.
          schema:
            type: string
            description: The supplier ID for the item.
        - in: query
          name: supplierIds
          description: The supplier IDs to filter the items by.
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: The supplier IDs to filter the items by.
        - in: query
          name: tagId
          description: >-
            [DEPRECATED] (use tagIds instead): The tag ID to filter the items
            by.
          schema:
            type: string
            description: >-
              [DEPRECATED] (use tagIds instead): The tag ID to filter the items
              by.
            deprecated: true
        - in: query
          name: tagIds
          description: The tag IDs to filter the items by.
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: The tag IDs to filter the items by.
        - in: query
          name: tagNames
          description: >-
            The unique name of the tags assigned to the items (case
            insensitive).
          schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              The unique name of the tags assigned to the items (case
              insensitive).
        - in: query
          name: search
          description: >-
            The search term to filter the items by. The search term will be
            matched against the short item slug and the destination url.
          schema:
            type: string
            description: >-
              The search term to filter the items by. The search term will be
              matched against the short item slug and the destination url.
        - in: query
          name: userId
          description: The user ID to filter the items by.
          schema:
            type: string
            description: The user ID to filter the items by.
        - in: query
          name: locationId
          description: >-
            The location ID to filter the items by (only items with a balance
            row at that location will be returned).
          schema:
            type: string
            description: >-
              The location ID to filter the items by (only items with a balance
              row at that location will be returned).
        - in: query
          name: withTags
          description: >-
            Whether to include tags in the response. Defaults to `false` if not
            provided.
          schema:
            type: boolean
            default: 'false'
            description: >-
              Whether to include tags in the response. Defaults to `false` if
              not provided.
        - in: query
          name: groupBy
          description: The field to group the items by.
          schema:
            anyOf:
              - type: string
                enum:
                  - tagId
              - type: string
                enum:
                  - userId
              - type: string
                enum:
                  - locationId
              - type: string
                enum:
                  - supplierId
            description: The field to group the items by.
      responses:
        '200':
          description: A list of items
          content:
            application/json:
              schema:
                type: number
                description: The number of items matching the query.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '410':
          $ref: '#/components/responses/410'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - token: []
components:
  responses:
    '400':
      description: >-
        The server cannot or will not process the request due to something that
        is perceived to be a client error (e.g., malformed request syntax,
        invalid request message framing, or deceptive request routing).
      content:
        application/json:
          schema:
            x-speakeasy-name-override: BadRequest
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - bad_request
                    description: A short code indicating the error code returned.
                    example: bad_request
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#bad-request
                required:
                  - code
                  - message
            required:
              - error
    '401':
      description: >-
        Although the HTTP standard specifies "unauthorized", semantically this
        response means "unauthenticated". That is, the client must authenticate
        itself to get the requested response.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Unauthorized
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                    description: A short code indicating the error code returned.
                    example: unauthorized
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#unauthorized
                required:
                  - code
                  - message
            required:
              - error
    '403':
      description: >-
        The client does not have access rights to the content; that is, it is
        unauthorized, so the server is refusing to give the requested resource.
        Unlike 401 Unauthorized, the client's identity is known to the server.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Forbidden
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - forbidden
                    description: A short code indicating the error code returned.
                    example: forbidden
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#forbidden
                required:
                  - code
                  - message
            required:
              - error
    '404':
      description: The server cannot find the requested resource.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: NotFound
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - not_found
                    description: A short code indicating the error code returned.
                    example: not_found
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#not-found
                required:
                  - code
                  - message
            required:
              - error
    '409':
      description: >-
        This response is sent when a request conflicts with the current state of
        the server.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Conflict
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - conflict
                    description: A short code indicating the error code returned.
                    example: conflict
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#conflict
                required:
                  - code
                  - message
            required:
              - error
    '410':
      description: >-
        This response is sent when the requested content has been permanently
        deleted from server, with no forwarding address.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: InviteExpired
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - invite_expired
                    description: A short code indicating the error code returned.
                    example: invite_expired
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.retrac.co/api-reference/errors#invite-expired
                required:
                  - code
                  - message
            required:
              - error
    '422':
      description: >-
        The request was well-formed but was unable to be followed due to
        semantic errors.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: UnprocessableEntity
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unprocessable_entity
                    description: A short code indicating the error code returned.
                    example: unprocessable_entity
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.retrac.co/api-reference/errors#unprocessable-entity
                required:
                  - code
                  - message
            required:
              - error
    '429':
      description: >-
        The user has sent too many requests in a given amount of time ("rate
        limiting")
      content:
        application/json:
          schema:
            x-speakeasy-name-override: RateLimitExceeded
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - rate_limit_exceeded
                    description: A short code indicating the error code returned.
                    example: rate_limit_exceeded
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.retrac.co/api-reference/errors#rate-limit_exceeded
                required:
                  - code
                  - message
            required:
              - error
    '500':
      description: The server has encountered a situation it does not know how to handle.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: InternalServerError
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - internal_server_error
                    description: A short code indicating the error code returned.
                    example: internal_server_error
                  message:
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.retrac.co/api-reference/errors#internal-server_error
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    token:
      type: http
      description: >-
        Bearer API key from Settings → API Keys. Use restricted keys (prefix
        `retrac_`) with the minimum scopes required.
      scheme: bearer
      bearerFormat: API key

````