Update a trait
https://api.faraday.ai/v1/traits/{trait_id}Update the configuration of a trait
Authentication
Provide your API key in the Authorization header. You can find your API key in the Settings page of the dashboard.
Authorization: Bearer YOUR_TOKENpath parameters
Responses
200Information about the Trait
archived_atstring<date-time>(For user traits only) If not null, this resource will no longer receive updates, but will still be visable.
breaksarray[number]For continuous data types, list of reasonable cutoff values.
[1,2,3,4,5,6,7,8,9,10,15,20,25,30,35,40,45,50]categoriesarray[string]For STRING type, list of allowed values.
[
"Large families",
"Single suburbanites",
"Single urbanites",
"Small families",
"Upper middle class small families"
]categorystringA broad category describing the flavor of this Trait.
fig/demography, fig/environment, fig/geography, fig/identity, fig/lifestyle, fig/life_event, fig/property, fig/reachability, fig/society, fig/financial, user_definedcoveragenumberThe percentage (0.1 meaning 10%) of the population for which we know the trait value.
0.5When this resource was created.
deprecatedboolean(For Faraday traits only) This trait will no longer receive updated data. Please use the updated version of the trait instead, if available.
emitted_by_datasetsarray[object]A unique ID for this resource.
lookup_tableobjectA mapping of the input values used in modeling, to how they should be displayed in reports.
How to refer to this Trait in other API calls to Faraday.
"favorite_color"^[_a-z][_a-z0-9]*$permissionsarray[string]What the account is able to use this trait for. Contact support to change access.
precisionstringPrecision refers to the specificity used to assign a trait. For example, 'person' precision indicates a trait specific to an individual, such as a preference for baseball, while 'address' precision pe...
"person"person, address, postcode, geomThe type of a resource which is available via the REST SDK.
"scopes"accounts, cohorts, connections, datasets, market_opportunity_analyses, outcomes, persona_sets, places, recommenders, scopes, streams, targets, traitsstatistical_typestringA string describing the nature of data represented by the trait.
categorical: the field contains one value of a bounded set. Example "favorite_color": one of "red", "blue", or "yellow".
multicategori...
categorical, multicategorical, ordinal, nominalThe current state of this resource and any updates.
"pending"new, starting, running, ready, errortypestringWhat type of data this field contains.
"string"boolean, long, double, string, dateWhen this resource was last updated.
400The request was invalid.
A Faraday error code.
Some possible values include:
Generic HTTP Errors
- BAD_REQUEST: The request could not be validated.
- FORBIDDEN: You do not have permission to access the specified resour...
"ERROR_TYPE"BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICTA unique ID for this error. Please include this in bug reports.
"082f9513-901c-4308-8081-902a8fe22d7e"validationErrorsarray[object]JSON Schema validation errors, if any.
401No API key was supplied.
A Faraday error code.
Some possible values include:
Generic HTTP Errors
- BAD_REQUEST: The request could not be validated.
- FORBIDDEN: You do not have permission to access the specified resour...
"ERROR_TYPE"BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICTA unique ID for this error. Please include this in bug reports.
"082f9513-901c-4308-8081-902a8fe22d7e"validationErrorsarray[object]JSON Schema validation errors, if any.
403Access to this resource was forbidden.
A Faraday error code.
Some possible values include:
Generic HTTP Errors
- BAD_REQUEST: The request could not be validated.
- FORBIDDEN: You do not have permission to access the specified resour...
"ERROR_TYPE"BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICTA unique ID for this error. Please include this in bug reports.
"082f9513-901c-4308-8081-902a8fe22d7e"validationErrorsarray[object]JSON Schema validation errors, if any.
404The requested resource ID was not found.
A Faraday error code.
Some possible values include:
Generic HTTP Errors
- BAD_REQUEST: The request could not be validated.
- FORBIDDEN: You do not have permission to access the specified resour...
"ERROR_TYPE"BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICTA unique ID for this error. Please include this in bug reports.
"082f9513-901c-4308-8081-902a8fe22d7e"validationErrorsarray[object]JSON Schema validation errors, if any.
500An internal server error occurred.
A Faraday error code.
Some possible values include:
Generic HTTP Errors
- BAD_REQUEST: The request could not be validated.
- FORBIDDEN: You do not have permission to access the specified resour...
"ERROR_TYPE"BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICTA unique ID for this error. Please include this in bug reports.
"082f9513-901c-4308-8081-902a8fe22d7e"validationErrorsarray[object]JSON Schema validation errors, if any.
Tags
Test request
Request snippet
curl -X PATCH 'https://api.faraday.ai/v1/traits/{trait_id}' \
-H 'Content-Type: application/json+merge-patch' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"description": "The number of baths in the house.",
"literate": "Number of baths",
"lookup_table": {},
"statistical_type": "categorical",
"unit": "dollars"
}'Example response
{
"archived_at": "2024-01-01T12:00:00Z",
"breaks": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
15,
20,
25,
30,
35,
40,
45,
50
],
"categories": [
"Large families",
"Single suburbanites",
"Single urbanites",
"Small families",
"Upper middle class small families"
],
"category": "fig/demography",
"coverage": 0.5,
"created_at": "2024-01-01T12:00:00Z",
"deprecated": true,
"description": "The number of baths in the house.",
"emitted_by_datasets": [
{
"column_name": "skus",
"dataset_id": "123e4567-e89b-12d3-a456-426614174000",
"format": "currency_cents",
"null_values": [
"string"
],
"transformation_table": {
"key": "string"
},
"value": true
}
],
"id": "123e4567-e89b-12d3-a456-426614174000",
"literate": "Number of baths",
"lookup_table": {},
"name": "favorite_color",
"permissions": [
"add_to_scope_payload"
],
"precision": "person",
"resource_type": "scopes",
"statistical_type": "categorical",
"status": "pending",
"tier": "standard",
"type": "string",
"unit": "dollars",
"updated_at": "2024-01-01T12:00:00Z"
}