Faraday API Reference

website·Indexed 34 days ago

https://faraday.ai/docs

Technical documentation for the Faraday API (v1), featuring OpenAPI specifications and CURL examples for managing atlases, cohorts, datasets, persona sets, and market opportunity analyses. Includes endpoints for creating and archiving resources such as traits, outcomes, recommenders, and feature stores.

Tokens
302.8K
Snippets
1.4K
Records
2.1K
Agent score
70%

What's inside Faraday

  1. Retrieve account billing information

    Use the GET /v1/accounts/{account_id}/billing endpoint to retrieve a comprehensive overview of an account's financial status, including a list of invoices, payment history, and current feature usage statistics against plan limits.
    curl -X GET 'https://api.faraday.ai/v1/accounts/{account_id}/billing' \
      -H 'Authorization: Bearer $FARADAY_API_KEY' \
      -H 'Content-Type: application/json'
  2. Retrieve details for a specific atlas

    Use the GET /v1/atlases/{atlas_id} endpoint to retrieve detailed information about a specific atlas. The request requires the atlas_id as a path parameter and the Content-Type header set to application/json.
    curl -X GET "https://api.faraday.ai/v1/atlases/{atlas_id}" \
         -H "Content-Type: application/json"
  3. Update dataset traits and column mappings

    When updating a dataset, you can define traits (characteristics about people unrelated to specific events). You can provide either a static value or a column_name for each trait.

    Key configuration options for trait columns include:

    • format: Additional context for the data (e.g., specifying if an 'int64' represents 'dollars' or 'cents').
    • null_values: A list of values that should be treated as null.
    • transformation_table: A mapping of dataset values to how they should be interpreted by models. Use * as a key to capture all values not matched by other conditions.

    Constraint: If you modify trait declarations, the output_all_columns_as_traits parameter must be set to null.

  4. Understand the billing information response schema

    The billing endpoint returns a JSON object containing three primary arrays:

    1. invoices: Details about billed amounts, including amount (number), due_date (date), effective_date (date), and paid (boolean).
    2. payments: A history of payments containing amount (number) and date (date).
    3. usages: Feature-specific usage stats including name (machine-friendly ID), description (human-readable feature), usage (current count), and limit (plan allowance).
  5. Understand the Scope response object

    When retrieving a scope via the API, the response includes details about the population and the resource status. Key fields include:

    • population_count: Total count of the population (individuals in multiple cohorts are counted once).
    • population_residence_count: Total count of residences (residences in multiple cohorts are counted once).
    • preview: A boolean indicating if this is a preview scope. Preview scopes provide limited output records and are not billed.
    • status: The current state of the resource. Possible values are new, starting, running, ready, or error.
    • status_error: Contains the error message if the status is error.
    • updated_at and status_changed_at: Timestamps for the last resource update and status change respectively.
  6. Retrieve a specific migration by ID

    Retrieve detailed information about a specific migration by sending a GET request to the /v1/migrations/{migration_id} endpoint. This endpoint returns the migration's status, configuration, and mapping details between fig_v1 and fig_v2 entities (accounts, datasets, cohorts, outcomes, persona sets, and recommenders).
    curl -X GET 'https://api.faraday.ai/v1/migrations/{migration_id}' \
      -H 'Authorization: Bearer $FARADAY_API_KEY' \
      -H 'Content-Type: application/json'
  7. Retrieve a specific trait by ID

    Use the GET /traits/{trait_id} endpoint to retrieve detailed information about a specific trait using its unique UUID. The response includes metadata such as the trait's name, resource type, status, and specific data configurations like allowed categories for string types or cutoff values for continuous data types.
    curl -X GET "https://api.faraday.ai/v1/traits/{trait_id}"
  8. Create a user-defined Trait

    Create a new user-defined Trait using the POST /traits endpoint. Traits represent facts about a person or geographic entity and can be used in modeling, analysis, and reporting. To connect uploaded data to a newly created trait, send a PATCH request to the relevant dataset with the output_to_traits parameter defined.
    curl -X POST https://{api_domain}/traits \
    -H "Content-Type: application/json" \
    -d '{
      "name": "favorite_color",
      "description": "The user's favorite color",
      "literate": "Favorite Color",
      "statistical_type": "categorical_nominal"
    }'
  9. Retrieve details for a specific scope

    Use the GET /scopes/{scope_id} endpoint to retrieve detailed information about a specific scope. You must provide the UUID of the scope as a path parameter. The response includes metadata such as the scope's name, creation and update timestamps, population details, and column configurations used for target exports.
    curl -X GET "https://{api_domain}/scopes/{scope_id}"
  10. Retrieve a specific persona set by ID

    Use the GET /v1/persona_sets/{persona_set_id} endpoint to retrieve detailed information about a specific persona set, including its configuration, status, and the constituent personas it contains. The response includes clustering dimensions, modeling attributes, and a list of personas with their associated avatars, individual counts, and detailed trait breakdowns (bins and centers).
    curl -X GET 'https://api.faraday.ai/v1/persona_sets/{persona_set_id}' \
      -H 'Authorization: Bearer $FARADAY_API_KEY' \
      -H 'Content-Type: application/json'