Update a scope
https://api.faraday.ai/v1/scopes/{scope_id}Update the configuration of a scope.
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
The UUID of a scope
Body
Fields to update on the scope (all optional)
insightsone of 2 typesInclude this scope's predictions in the account's Insights, as a table of their own that GET /insights lists. Turning it on requires the plan feature insights.scopes_enabled. A preview scope can b...
namestringHuman-readable label for this scope. Each scope must have a unique name.
^(?!\s*$).+64payloadobject(Parameters used to PATCH the ScopePayload type.)
The data to include for each person in this scope.
not allowedpopulationobject(Parameters used to PATCH the ScopePopulation type.)
The people to include in a scope. Leave cohort_ids empty to include the entire US population.
not allowedpreviewbooleanA preview scope provides only a limited number of output records, but
it is not billed.
trueResponses
200Information about the scope
archived_atstring<date-time>If not null, this resource will no longer receive updates, but will still be visable.
columnsobjectMetadata about the columns in this scope. Useful for advanced target configuration.
not allowedWhen this resource was created. It says nothing about builds; to check status, see Status and timestamps.
A unique ID for this resource.
"8e63467d-9478-4fba-b05a-d5e98fd06d12"insightsbooleanInclude this scope's predictions in the account's Insights, as a table of their own that GET /insights lists. Turning it on requires the plan feature insights.scopes_enabled. A preview scope can b...
falselast_read_input_atstring<date-time>When the latest finished build started reading this resource's configuration and inputs; omitted until the first build finishes. Once this is at or after last_updated_config_at, a build with the cur...
last_updated_config_atstring<date-time>When Faraday registered the latest change to this resource's configuration, or the latest force_update. A create, update or force_update response carries the value then on record (an update that c...
last_updated_output_atstring<date-time>When a build last changed this resource's output. A build that finishes with nothing new to write does not move it.
Human-readable label for this scope. Each scope must have a unique name.
^(?!\s*$).+64The data to include for each person in this scope.
not allowedThe people to include in a scope. Leave cohort_ids empty to include the entire US population.
not allowedpopulation_countintegerCount of the population. If a person appears in multiple cohorts, they are only counted once.
population_residence_countintegerResidence count of the population. If a residence appears in multiple cohorts, it is only counted once.
A preview scope provides only a limited number of output records, but
it is not billed.
trueThe state of this resource's latest build. Until last_read_input_at is at or after last_updated_config_at, no build with the current configuration has finished (starting or running means one i...
"ready"new, starting, running, ready, errorstatus_changed_atstring<date-time>When the status of this resource was last updated.
status_errorstringIf this resource has status == "error", this will contain an error message.
status_needs_fix_fromstringWhat Faraday is waiting for before it builds a resource with status == "error" again. user: a configuration change to this resource or a force_update. support: Faraday support, and `force_upda...
user, supportWhen this resource was last changed, by an edit or by Faraday while building it. Don't use it to check status; use last_updated_config_at and last_read_input_at as Status and timestamps explains.
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, INVALID_API_KEY, ACCOUNT_SUSPENDED, ACCOUNT_DELETED, VALIDATION_FAILED, CONFLICT, QUOTA_EXCEEDEDA 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, INVALID_API_KEY, ACCOUNT_SUSPENDED, ACCOUNT_DELETED, VALIDATION_FAILED, CONFLICT, QUOTA_EXCEEDEDA 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, INVALID_API_KEY, ACCOUNT_SUSPENDED, ACCOUNT_DELETED, VALIDATION_FAILED, CONFLICT, QUOTA_EXCEEDEDA 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, INVALID_API_KEY, ACCOUNT_SUSPENDED, ACCOUNT_DELETED, VALIDATION_FAILED, CONFLICT, QUOTA_EXCEEDEDA 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, INVALID_API_KEY, ACCOUNT_SUSPENDED, ACCOUNT_DELETED, VALIDATION_FAILED, CONFLICT, QUOTA_EXCEEDEDA 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/scopes/{scope_id}' \
-H 'Content-Type: application/merge-patch+json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"insights": false,
"name": "string (pattern: ^(?!\\s*$).+)",
"payload": {
"attributes": [
"fig/age"
],
"cohort_ids": [
"5bf9aa70-7bf1-4ef1-a131-8c84441be231"
],
"explainability": true,
"forecast_ids": [
"08b0cedd-a181-4a77-8b93-4267e0f8301a"
],
"location": {
"conditions": {
"atlas_ids": [
"4c6c0f1e-0a58-4f1a-9c8a-52a1a1a3f5b7"
],
"location_reference_keys": [
"store-042"
],
"max_distance": 8000,
"min_distance": 100,
"property_conditions": [
{
"_eq": "string",
"_gt": 0,
"_gte": 0,
"_in": [
"string"
],
"_lt": 0,
"_lte": 0,
"_matches": "string",
"_neq": "string",
"_nin": [
"string"
],
"_nnull": true,
"_null": true,
"optional": true,
"property": "string"
}
]
},
"distance_output_units": "miles",
"select": "nearest"
},
"max_attribute_observation_date": "2024-01-01",
"outcome_ids": [
"b80217ae-7628-4c66-8a19-5bf452495c39"
],
"persona_set_ids": [
"4b3f42dd-b6c3-4f0f-ac18-9e6e47321f83"
],
"recommender_ids": [
"b4f9c92c-b0e5-4626-9674-e8f88e5adb62"
]
},
"population": {
"cohort_ids": [
"5bf9aa70-7bf1-4ef1-a131-8c84441be231"
],
"exclusion_address_level_cohort_ids": [
"54270059-c9b5-42c6-a728-36b69a1cf3d8"
],
"exclusion_cohort_ids": [
"54270059-c9b5-42c6-a728-36b69a1cf3d8"
]
},
"preview": true
}'Example response
{
"archived_at": "2024-01-01T12:00:00Z",
"columns": {
"columns_for_mode": {
"aggregated": [
{
"aggregation": "avg",
"aggregation_criteria": "string",
"is_identity_col": true,
"output_col": "string (pattern: ^[_a-z][_a-z0-9]*$)",
"scope_col": "string (pattern: ^[_a-z][_a-z0-9]*$)"
}
],
"hashed": [
{
"aggregation": "avg",
"aggregation_criteria": "string",
"is_identity_col": true,
"output_col": "string (pattern: ^[_a-z][_a-z0-9]*$)",
"scope_col": "string (pattern: ^[_a-z][_a-z0-9]*$)"
}
],
"identified": [
{
"aggregation": "avg",
"aggregation_criteria": "string",
"is_identity_col": true,
"output_col": "string (pattern: ^[_a-z][_a-z0-9]*$)",
"scope_col": "string (pattern: ^[_a-z][_a-z0-9]*$)"
}
],
"referenced": [
{
"aggregation": "avg",
"aggregation_criteria": "string",
"is_identity_col": true,
"output_col": "string (pattern: ^[_a-z][_a-z0-9]*$)",
"scope_col": "string (pattern: ^[_a-z][_a-z0-9]*$)"
}
]
},
"identity_columns": [
"string"
],
"payload_columns": [
{
"human_name": "string",
"name": "string"
}
]
},
"created_at": "2024-01-01T12:00:00Z",
"id": "8e63467d-9478-4fba-b05a-d5e98fd06d12",
"insights": false,
"last_read_input_at": "2024-01-01T12:00:00Z",
"last_updated_config_at": "2024-01-01T12:00:00Z",
"last_updated_output_at": "2024-01-01T12:00:00Z",
"name": "string (pattern: ^(?!\\s*$).+)",
"payload": {
"attributes": [
"fig/age"
],
"cohort_ids": [
"5bf9aa70-7bf1-4ef1-a131-8c84441be231"
],
"explainability": true,
"forecast_ids": [
"08b0cedd-a181-4a77-8b93-4267e0f8301a"
],
"location": {
"conditions": {
"atlas_ids": [
"4c6c0f1e-0a58-4f1a-9c8a-52a1a1a3f5b7"
],
"location_reference_keys": [
"store-042"
],
"max_distance": 8000,
"min_distance": 100,
"property_conditions": [
{
"_eq": "string",
"_gt": 0,
"_gte": 0,
"_in": [
"string"
],
"_lt": 0,
"_lte": 0,
"_matches": "string",
"_neq": "string",
"_nin": [
"string"
],
"_nnull": true,
"_null": true,
"optional": true,
"property": "string"
}
]
},
"distance_output_units": "miles",
"select": "nearest"
},
"max_attribute_observation_date": "2024-01-01",
"outcome_ids": [
"b80217ae-7628-4c66-8a19-5bf452495c39"
],
"persona_set_ids": [
"4b3f42dd-b6c3-4f0f-ac18-9e6e47321f83"
],
"recommender_ids": [
"b4f9c92c-b0e5-4626-9674-e8f88e5adb62"
]
},
"population": {
"cohort_ids": [
"5bf9aa70-7bf1-4ef1-a131-8c84441be231"
],
"exclusion_address_level_cohort_ids": [
"54270059-c9b5-42c6-a728-36b69a1cf3d8"
],
"exclusion_cohort_ids": [
"54270059-c9b5-42c6-a728-36b69a1cf3d8"
]
},
"population_count": 0,
"population_residence_count": 0,
"preview": true,
"resource_type": "scopes",
"status": "ready",
"status_changed_at": "2024-01-01T12:00:00Z",
"status_error": "string",
"status_needs_fix_from": "user",
"updated_at": "2024-01-01T12:00:00Z"
}