spartera_api_sdk

SparteraApiSdk - the Ruby gem for the Spartera API Documentation

Auto-generated API documentation for REST services of the Spartera platform

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.25.0
  • Package version: 1.0.78
  • Generator version: 7.21.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build spartera_api_sdk.gemspec

Then either install the gem locally:

gem install ./spartera_api_sdk-1.0.78.gem

(for development, run gem install --dev ./spartera_api_sdk-1.0.78.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'spartera_api_sdk', '~> 1.0.78'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'spartera_api_sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'spartera_api_sdk'

# Setup authorization
SparteraApiSdk.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = SparteraApiSdk::APIKeysApi.new
company_id = 'company_id_example' # String | Unique identifier for the Company
api_keys_input = SparteraApiSdk::ApiKeysInput.new({company_id: 'company_id_abc123', role_id: 1}) # ApiKeysInput | 
opts = {
  page: 56, # Integer | Page number for pagination
  limit: 56, # Integer | Number of items per page
  sort_by: 'sort_by_example', # String | Field to sort by
  sort_order: 'asc', # String | Sort order (ascending or descending)
  search: 'search_example' # String | Search term to filter results
}

begin
  #Create single API key.     Returns the actual sk_ key (only time it's exposed) and api_key_id for future operations.
  result = api_instance.create_api_keys(company_id, api_keys_input, opts)
  p result
rescue SparteraApiSdk::ApiError => e
  puts "Exception when calling APIKeysApi->create_api_keys: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.spartera.com

Class Method HTTP request Description
SparteraApiSdk::APIKeysApi create_api_keys POST /companies/company_id/api-keys Create single API key. Returns the actual sk_ key (only time it's exposed) and api_key_id for future operations.
SparteraApiSdk::APIKeysApi create_api_keys_api_keys_revoke POST /companies/company_id/api-keys/api_key_id/revoke Explicitly revoke an API key with reason tracking. This is different from delete as it includes revocation metadata.
SparteraApiSdk::APIKeysApi delete_api_keys DELETE /companies/company_id/api-keys/api_key_id Delete (deactivate) single API key by api_key_id. Uses the api_key_id returned during creation for clean identification. Fixed to use correct primary key lookup.
SparteraApiSdk::APIKeysApi get_api_keys_by_id GET /companies/company_id/api-keys/api_key_id Get single API key by ID. Returns masked API key for security (sk_****1234).
SparteraApiSdk::APIKeysApi get_api_keys_by_id_api_keys_stats GET /companies/company_id/api-keys/api_key_id/stats Get usage statistics for a specific API key. Returns usage count, last used date, failed attempts, etc.
SparteraApiSdk::APIKeysApi list_api_keys GET /companies/company_id/api-keys Get all API keys for a company. Returns masked API keys for security (sk_****1234).
SparteraApiSdk::APIKeysApi update_api_keys PATCH /companies/company_id/api-keys/api_key_id Update an existing API key by ID. Can update metadata like name, expiration, rate limits, etc. Cannot update the actual key value (for security).
SparteraApiSdk::AlertsApi create_alerts POST /companies/company_id/users/user_id/alerts POST /companies/company_id/users/user_id/alerts
SparteraApiSdk::AlertsApi delete_alerts DELETE /companies/company_id/users/user_id/alerts/alert_id Delete single alert by ID
SparteraApiSdk::AlertsApi get_alerts_by_id GET /companies/company_id/users/user_id/alerts Get a list of all alerts for a specific user
SparteraApiSdk::AlertsApi get_alerts_by_id_asset_all GET /companies/company_id/users/user_id/alerts/asset/asset_id/all Get all alerts for a specific asset
SparteraApiSdk::AlertsApi get_alerts_by_id_users GET /companies/company_id/users/user_id/alerts/alert_id Get single alert by ID
SparteraApiSdk::AlertsApi get_alerts_by_id_users_asset GET /companies/company_id/users/user_id/alerts/asset/asset_id Get all alerts for a specific asset (by user)
SparteraApiSdk::AlertsApi update_alerts PATCH /companies/company_id/users/user_id/alerts/alert_id Update an existing alert by ID
SparteraApiSdk::AssetPriceHistoryApi create_asset_price_history POST /companies/company_id/assets/asset_id/prices Create a new price history record for an asset
SparteraApiSdk::AssetPriceHistoryApi create_asset_price_history_prices_calculate_credits POST /companies/company_id/assets/asset_id/prices/calculate_credits Calculate the credit equivalent for a given USD price without saving
SparteraApiSdk::AssetPriceHistoryApi create_asset_price_history_prices_discount POST /companies/company_id/assets/asset_id/prices/discount POST /companies/company_id/assets/asset_id/prices/discount
SparteraApiSdk::AssetPriceHistoryApi delete_asset_price_history DELETE /companies/company_id/assets/asset_id/prices/aph_id Delete single price history record by ID
SparteraApiSdk::AssetPriceHistoryApi get_asset_price_history_by_id GET /companies/company_id/assets/asset_id/prices Get all price history records for a specific asset
SparteraApiSdk::AssetPriceHistoryApi get_asset_price_history_by_id_assets_prices GET /companies/company_id/assets/asset_id/prices/aph_id Get single price history record by ID
SparteraApiSdk::AssetPriceHistoryApi get_asset_price_history_by_id_prices_active GET /companies/company_id/assets/asset_id/prices/active Get the currently active price for an asset
SparteraApiSdk::AssetPriceHistoryApi update_asset_price_history PATCH /companies/company_id/assets/asset_id/prices/aph_id Update an existing price history record by ID
SparteraApiSdk::AssetUsecasesApi get_asset_usecases_by_id GET /asset_usecases/auc_id Get single asset use case by ID
SparteraApiSdk::AssetUsecasesApi list_asset_usecases GET /asset_usecases Get a list of all asset use cases
SparteraApiSdk::AssetsApi create_assets POST /companies/company_id/assets Create a new asset
SparteraApiSdk::AssetsApi create_assets_analyze POST /analyze/company_handle/assets/asset_slug Process (analyze) an asset with dynamic rate limiting applied via decorator.
SparteraApiSdk::AssetsApi create_assets_scan_column POST /companies/company_id/assets/asset_id/scan_column Scan a column in the asset's table to retrieve distinct values Request Body: column (str): Column name to scan limit (int, optional): Maximum distinct values to return (default 1000, max 5000) Returns: Flask Response with scan results
SparteraApiSdk::AssetsApi create_assets_test POST /companies/company_id/assets/asset_id/test POST /companies/company_id/assets/asset_id/test
SparteraApiSdk::AssetsApi delete_assets DELETE /companies/company_id/assets/asset_id Delete single asset by ID
SparteraApiSdk::AssetsApi get_assets_by_id GET /companies/company_id/assets/asset_id Get single asset by ID
SparteraApiSdk::AssetsApi get_assets_by_id2 GET /companies/company_id/assets/asset_id/statistics Get statistics for a specific asset (public endpoint)
SparteraApiSdk::AssetsApi get_assets_by_id_analyze GET /analyze/company_handle/assets/asset_slug Process (analyze) an asset with dynamic rate limiting applied via decorator.
SparteraApiSdk::AssetsApi get_assets_by_id_infoschema GET /companies/company_id/assets/asset_id/infoschema Get the information schema for a specific asset's table
SparteraApiSdk::AssetsApi get_assets_by_id_infoschema_save GET /companies/company_id/assets/asset_id/infoschema/save Retrieve and save an asset's information schema
SparteraApiSdk::AssetsApi get_assets_by_id_predicted_price GET /companies/company_id/assets/asset_id/predicted_price Get AI-predicted pricing for a specific asset
SparteraApiSdk::AssetsApi get_assets_by_id_statistics GET /companies/company_id/assets/statistics Get statistics for all assets the user has access to
SparteraApiSdk::AssetsApi get_assets_by_id_test GET /companies/company_id/assets/asset_id/test GET /companies/company_id/assets/asset_id/test
SparteraApiSdk::AssetsApi list_assets GET /companies/company_id/assets Get all assets for a specific company
SparteraApiSdk::AssetsApi list_assets_search GET /companies/company_id/assets/search Search and filter assets with advanced options Query Parameters: q: Search query string category: Filter by category sport: Filter by sport tag sort_by: Sort field (name
SparteraApiSdk::AssetsApi update_assets PATCH /companies/company_id/assets/asset_id Update an existing asset by ID
SparteraApiSdk::CloudProvidersApi get_cloud_providers_by_id GET /cloud-providers/provider_id Get single cloud provider by ID
SparteraApiSdk::CloudProvidersApi list_cloud_providers GET /cloud-providers Get a list of all cloud providers
SparteraApiSdk::CompaniesApi get_companies_by_id GET /companies/company_id Get details of the requestor's own company
SparteraApiSdk::CompaniesApi list_companies GET /companies/company_id/requests/plan Get the total number of requests allocated in the company's current subscription plan.
SparteraApiSdk::CompaniesApi list_companies_analytics_assets GET /companies/company_id/analytics/assets Get asset performance analytics. Query params: start_date, end_date, limit, sort_by, include
SparteraApiSdk::CompaniesApi list_companies_analytics_customers GET /companies/company_id/analytics/customers Get customer analytics including growth and segmentation. Query params: start_date, end_date, group_by, segment_by
SparteraApiSdk::CompaniesApi list_companies_analytics_dashboard GET /companies/company_id/analytics/dashboard Get comprehensive dashboard analytics for seller dashboard. Query params: start_date, end_date, period (day/week/month/quarter)
SparteraApiSdk::CompaniesApi list_companies_analytics_metrics GET /companies/company_id/analytics/metrics Get summary metrics (counts only). No date params needed — returns all-time totals. Performance: < 0.1s
SparteraApiSdk::CompaniesApi list_companies_analytics_sales GET /companies/company_id/analytics/sales Get sales over time analytics. Query params: start_date, end_date, group_by (day/week/month/quarter), metrics
SparteraApiSdk::CompaniesApi list_companies_objects GET /companies/company_id/objects Get all objects (connections, assets) of a single company
SparteraApiSdk::CompaniesApi list_companies_requests_usage GET /companies/company_id/requests/usage Get company request usage data for a specific month.
SparteraApiSdk::CompaniesApi update_companies PATCH /companies/company_id Update an existing company by ID
SparteraApiSdk::ConnectionsApi create_connections POST /companies/company_id/connections Create a new connection by ID
SparteraApiSdk::ConnectionsApi delete_connections DELETE /companies/company_id/connections/connection_id Delete single connection by ID
SparteraApiSdk::ConnectionsApi get_connections_by_id GET /companies/company_id/connections/connection_id Get single connection by ID
SparteraApiSdk::ConnectionsApi get_connections_by_id2 GET /companies/company_id/connections/connection_id/test Test the specified connection
SparteraApiSdk::ConnectionsApi get_connections_by_id_infoschema GET /companies/company_id/connections/connection_id/infoschema Retrieve the information schema for the specified connection
SparteraApiSdk::ConnectionsApi list_connections GET /companies/company_id/connections Get all connections for a specific company
SparteraApiSdk::ConnectionsApi update_connections PATCH /companies/company_id/connections/connection_id Update an existing connection by ID
SparteraApiSdk::EndpointsApi create_endpoints POST /companies/company_id/endpoints Create a new endpoint
SparteraApiSdk::EndpointsApi create_endpoints_keys POST /companies/company_id/endpoints/endpoint_id/keys POST /companies/company_id/endpoints/endpoint_id/keys
SparteraApiSdk::EndpointsApi delete_endpoints DELETE /companies/company_id/endpoints/endpoint_id Delete single endpoint by ID
SparteraApiSdk::EndpointsApi delete_endpoints_keys DELETE /companies/company_id/endpoints/endpoint_id/keys/api_key_id DELETE /companies/company_id/endpoints/endpoint_id/keys/api_key_id
SparteraApiSdk::EndpointsApi get_endpoints_by_id GET /companies/company_id/endpoints/endpoint_id Get single endpoint by ID
SparteraApiSdk::EndpointsApi get_endpoints_by_id_available_endpoints GET /companies/company_id/endpoints/endpoint_id/available-endpoints GET /companies/company_id/endpoints/endpoint_id/available-endpoints
SparteraApiSdk::EndpointsApi get_endpoints_by_id_connections_describe GET /companies/company_id/endpoints/../connections/connection_id/describe Get schema information for a connection Query parameters: include_fields: Whether to include field information (default: true) schemas: Optional comma-separated schemas to include tables: Optional comma-separated tables to include
SparteraApiSdk::EndpointsApi get_endpoints_by_id_execute GET /companies/company_id/endpoints/endpoint_id/execute Execute an endpoint with pagination support. Customer-facing route that returns paginated data. Query params: ?start=0&limit=100
SparteraApiSdk::EndpointsApi get_endpoints_by_id_keys GET /companies/company_id/endpoints/endpoint_id/keys GET /companies/company_id/endpoints/endpoint_id/keys
SparteraApiSdk::EndpointsApi get_endpoints_by_id_stats GET /companies/company_id/endpoints/endpoint_id/stats Get usage statistics for an endpoint Query parameters: days: Number of days to analyze (default: 30)
SparteraApiSdk::EndpointsApi get_endpoints_by_id_test GET /companies/company_id/endpoints/endpoint_id/test Test an endpoint with sample data Request body (optional): limit: Number of sample rows to return (default: 10)
SparteraApiSdk::EndpointsApi get_endpoints_by_id_url GET /companies/company_id/endpoints/endpoint_id/url GET /companies/company_id/endpoints/endpoint_id/url
SparteraApiSdk::EndpointsApi list_endpoints GET /companies/company_id/endpoints Get all endpoints for a specific company with pagination, filtering, and sorting
SparteraApiSdk::EndpointsApi update_endpoints PATCH /companies/company_id/endpoints/endpoint_id Update an existing endpoint by ID
SparteraApiSdk::FavoritesApi create_favorites POST /companies/company_id/users/user_id/favorites POST /companies/company_id/users/user_id/favorites
SparteraApiSdk::FavoritesApi delete_favorites DELETE /companies/company_id/users/user_id/favorites/favorite_id Delete single favorite by ID (unfavorite an asset)
SparteraApiSdk::FavoritesApi get_favorites_by_id GET /companies/company_id/users/user_id/favorites Get a list of all favorites for a specific user
SparteraApiSdk::FavoritesApi get_favorites_by_id_users GET /companies/company_id/users/user_id/favorites/favorite_id Get single favorite by ID
SparteraApiSdk::FavoritesApi get_favorites_by_id_users_category GET /companies/company_id/users/user_id/favorites/category/category Get all favorites for the specified user in a specific category
SparteraApiSdk::FavoritesApi get_favorites_by_id_users_check GET /companies/company_id/users/user_id/favorites/check/asset_id Check if the specified user has favorited a specific asset
SparteraApiSdk::FavoritesApi get_favorites_by_id_users_uncategorized GET /companies/company_id/users/user_id/favorites/uncategorized Get all favorites for the specified user that don't have a category
SparteraApiSdk::FavoritesApi update_favorites PATCH /companies/company_id/users/user_id/favorites/favorite_id Update an existing favorite by ID
SparteraApiSdk::IndustriesApi get_industries_by_id GET /industries/industry_id Get single industry by ID
SparteraApiSdk::IndustriesApi list_industries GET /industries Get a list of all industries
SparteraApiSdk::IndustriesApi list_industries_active GET /industries/active Get a list of industries that have active marketplace products
SparteraApiSdk::JobFunctionsApi get_job_functions_by_id GET /job-functions/function_id Get single job function by ID
SparteraApiSdk::JobFunctionsApi list_job_functions GET /job-functions Get a list of all job functions
SparteraApiSdk::PostgenIntegrationsApi create_postgen_integrations POST /companies/company_id/postgen_integrations POST /companies/company_id/postgen_integrations
SparteraApiSdk::PostgenIntegrationsApi create_postgen_integrations_test POST /companies/company_id/postgen_integrations/test POST /companies/company_id/postgen_integrations/test
SparteraApiSdk::PostgenIntegrationsApi delete_postgen_integrations DELETE /companies/company_id/postgen_integrations/integration_id Delete single integration by ID. Also deletes credentials from GCP Secret Manager.
SparteraApiSdk::PostgenIntegrationsApi get_postgen_integrations_by_id GET /companies/company_id/postgen_integrations/integration_id Get single integration by ID.
SparteraApiSdk::PostgenIntegrationsApi list_postgen_integrations GET /companies/company_id/postgen_integrations Get a list of all postgen integrations for the company. All company users can view integrations.
SparteraApiSdk::PostgenIntegrationsApi update_postgen_integrations PATCH /companies/company_id/postgen_integrations/integration_id Update an existing integration by ID. Can update credentials, is_active status, etc.
SparteraApiSdk::PostsApi create_posts POST /companies/company_id/posts POST /companies/company_id/posts
SparteraApiSdk::PostsApi create_posts2 POST /companies/company_id/posts/post_id/publish/integration_id Publish a post to an external platform via an integration. Args: post_id: ID of the post to publish integration_id: ID of the integration to use (from postgen_integrations) Returns: Publication record with external_url and external_post_id
SparteraApiSdk::PostsApi create_posts_publish POST /companies/company_id/posts/post_id/publish Publish a post (make it publicly visible).
SparteraApiSdk::PostsApi create_posts_unpublish POST /companies/company_id/posts/post_id/unpublish Unpublish a post (make it private/draft again).
SparteraApiSdk::PostsApi create_posts_view POST /companies/company_id/posts/post_id/view Increment view count for a post. Public endpoint (no authentication required).
SparteraApiSdk::PostsApi delete_posts DELETE /companies/company_id/posts/post_id Delete single post by ID.
SparteraApiSdk::PostsApi get_posts_by_id GET /companies/company_id/posts/post_id Get single post by ID.
SparteraApiSdk::PostsApi get_posts_by_id_publications GET /companies/company_id/posts/post_id/publications Get all publications for a post. Shows where this post has been published to external platforms. Returns: Array of publication records with platform, URL, status
SparteraApiSdk::PostsApi list_posts GET /companies/company_id/posts Get a list of all posts for the user's company. Supports filtering, sorting, pagination.
SparteraApiSdk::PostsApi list_posts_summary GET /companies/company_id/posts/summary GET /companies/company_id/posts/summary
SparteraApiSdk::PostsApi update_posts PATCH /companies/company_id/posts/post_id Update an existing post by ID. Note: last_edited_at is automatically updated.
SparteraApiSdk::StorageEnginesApi get_storage_engines_by_id GET /cloud-providers/provider_id/storage-engines/engine_id Get single storage engine by ID
SparteraApiSdk::StorageEnginesApi list_storage_engines GET /cloud-providers/provider_id/storage-engines Get a list of all storage engines
SparteraApiSdk::UsersApi create_users POST /companies/company_id/users Create a new user
SparteraApiSdk::UsersApi create_users_google_oauth POST /companies/company_id/users/google-oauth POST /companies/company_id/users/google-oauth
SparteraApiSdk::UsersApi create_users_logout POST /companies/company_id/users/logout Logout current user by revoking their sessions
SparteraApiSdk::UsersApi delete_users DELETE /companies/company_id/users/user_id Delete single user by ID
SparteraApiSdk::UsersApi get_users_by_id GET /companies/company_id/users/user_id Get single user by ID
SparteraApiSdk::UsersApi list_users GET /companies/company_id/users Get a list of all users in a company
SparteraApiSdk::UsersApi list_users_me GET /me Get current authenticated user's profile.
SparteraApiSdk::UsersApi update_users PATCH /companies/company_id/users/user_id Update an existing user by ID

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header