MENU
    Count records of a Tulip Table
    • 04 Mar 2025
    • 3 Minutes to read
    • Contributors

    Count records of a Tulip Table


    Article summary

    Get
    /tables/{tableId}/count

    Counts the number of records in a Tulip Table, optionally filtered by the query parameters.

    Will return an exact count for Tulip Tables that have had less than 50,000 records created, otherwise returns an approximate count.

    Requires the tables:read API key scope.

    Security
    HTTP
    Type basic

    Access to the Tulip API requires the use of HTTP Basic Authentication using the credentials of an active Tulip API Token. All requests require the Authorization HTTP header with the Basic scheme to provide API credentials unless otherwise noted.

    API tokens can be configured with a set of scopes which determine what parts of the API that specific token has access to. Security best practices dictate that API credentials be given the minimum set of capabilities required to fulfill their intended purpose. For example, an API token created for use in an integration that is only designed to use the Tables API should probably only be given the tables:read and tables:write scopes. In this way you can minimize risk in the event that API credentials are compromised. API endpoints will document what API token scopes are required to access that endpoint in their descriptions. If a request is made to an endpoint with an API token which does not have the required scopes, the response will be an authorization error.

    Path parameters
    tableId
    stringRequired

    The id of a Tulip Table.

    Pattern^[a-zA-Z0-9_]+$
    Exampleg56RCoZCtzv7borvp
    Query parameters
    filters
    Array of object

    An optional array of filter expressions to filter the Table records by. Each filter is an object specifying the field (name of a table column), functionType (comparison function), and arg (the value to compare to).

    The field may be the name of a table column (including id) or one of these special values:

    • _createdAt
    • _updatedAt

    The valid function types are:

    • equal
    • notEqual
    • blank
    • notBlank
    • greaterThanOrEqual
    • lessThanOrEqual
    • greaterThan
    • lessThan
    • contains
    • notContains
    • startsWith
    • notStartsWith
    • endsWith
    • notEndsWith
    • isIn
    • notIsIn

    Note: The isIn and notIsIn functions take in array inputs. To pass an array input into a connector function you must convert the array to a string of this format: ["1", "2", "3"]. Also, the blank and notBlank functions do not take in any arguments at all.

    Example: [{"field": "field1", "functionType": "equal", "arg": "1"},{"field": "field2", "functionType": "notBlank"}, {"field": "field3", "functionType": "isIn", "arg": ["1", "2", "3"]}]

    object
    field
    string Required
    functionType
    string Required
    Valid values[ "equal", "notEqual", "blank", "notBlank", "greaterThanOrEqual", "lessThanOrEqual", "greaterThan", "lessThan", "contains", "notContains", "startsWith", "notStartsWith", "endsWith", "notEndsWith", "isIn", "notIsIn" ]
    arg
    string
    filterAggregator
    string

    How the filters in the filters parameter are combined.

    • all means that every filter must match a record in order for the record to be included.
    • any means at least one filter must match a record in order for the record to be included.
    Valid values[ "all", "any" ]
    Default"all"
    limit
    integer

    A limit for how many records should be returned in the response. If specified, at most the count will be this value. No default cannot be more than 50000. If there are more than 50000 records, an approximate count will be returned.

    Default0
    offset
    integer

    The index of the record to start at. This parameter is usually used for pagination.

    Minimum0
    Default0
    Responses
    200

    The count of Tulip Table records was retrieved successfully.

    integer
    Minimum0
    400

    The request was malformed. This could mean that headers, query parameters, or the request body was unable to be parsed or had unexpected values.

    object
    errorCode
    string
    errorUniqueID
    string
    Pattern^[a-zA-Z0-9+/]+$
    Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
    details
    string
    401

    The request was made unauthorized. HTTP Basic Authorization using a Tulip API Key is required for use of the API.

    object
    errorCode
    string
    errorUniqueID
    string
    Pattern^[a-zA-Z0-9+/]+$
    Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
    details
    string
    403

    The provided authentication info was rejected. The response will provide additional details.

    object
    errorCode
    string
    errorUniqueID
    string
    Pattern^[a-zA-Z0-9+/]+$
    Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
    details
    string
    404

    The requested database entry was not found.

    object
    errorCode
    string
    errorUniqueID
    string
    Pattern^[a-zA-Z0-9+/]+$
    Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
    details
    string
    422

    The request was syntactically sound, but could not be processed due to a logical problem.

    object
    errorCode
    string
    errorUniqueID
    string
    Pattern^[a-zA-Z0-9+/]+$
    Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
    details
    string
    500

    The server encountered an unexpected error.

    object
    errorCode
    string
    errorUniqueID
    string
    Pattern^[a-zA-Z0-9+/]+$
    Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
    details
    string

    Was this article helpful?