Create scope
https://api.faraday.ai/v1/scopesAdd a new scope
Authentication
Provide your bearer token in the Authorization header.
Authorization: Bearer YOUR_TOKENBody
The definition of the new scope
Human-readable label for this scope. Each scope must have a unique name.
^(?!\s*$).+(Parameters used to POST a new value of the ScopePayload type.)
The data to include for each person in this scope.
(Parameters used to POST a new value of the ScopePopulation type.)
The people to include in a scope. Leave cohort_ids empty to include the entire US population.
A preview scope provides only a limited number of output records, but
it is not billed.
trueResponses
201The new 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.
When this resource was created.
A unique ID for this resource.
"8e63467d-9478-4fba-b05a-d5e98fd06d12"last_read_input_atstring<date-time>The last time this resource's input was read.
last_updated_config_atstring<date-time>The last time this resource's configuration was updated. If this is more recent than last_updated_output_at, the resource will be rebuilt.
last_updated_output_atstring<date-time>The last time this resource successfully built.
Human-readable label for this scope. Each scope must have a unique name.
^(?!\s*$).+The data to include for each person in this scope.
The people to include in a scope. Leave cohort_ids empty to include the entire US population.
population_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 current state of this resource and any updates.
"pending"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.
When 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 POST 'https://api.faraday.ai/v1/scopes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"name": "string (pattern: ^(?!\\s*$).+)",
"payload": {
"attributes": [
"fig/age"
],
"cohort_ids": [
"5bf9aa70-7bf1-4ef1-a131-8c84441be231"
],
"explainability": true,
"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_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",
"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,
"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_cohort_ids": [
"54270059-c9b5-42c6-a728-36b69a1cf3d8"
]
},
"population_count": 0,
"population_residence_count": 0,
"preview": true,
"resource_type": "scopes",
"status": "pending",
"status_changed_at": "2024-01-01T12:00:00Z",
"status_error": "string",
"updated_at": "2024-01-01T12:00:00Z"
}