Create scope

posthttps://api.faraday.ai/v1/scopes

Add a new scope

Authentication

Bearer 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_TOKEN

Body

The definition of the new scope

namestringrequired

Human-readable label for this scope. Each scope must have a unique name.

Match pattern: ^(?!\s*$).+
Maximum characters: 64
payloadobjectrequired

(Parameters used to POST a new value of the ScopePayload type.)

The data to include for each person in this scope.

Additional properties: not allowed
Properties of object
attributesarray[string]

Include additional traits.

For traits created through output_to_traits via /datasets, specify the trait name.

For traits from Faraday's Internal Graph (FIG), specify the name prefixed by fig/ ex. fig/age.

cohort_idsarray[string]

Specify a list of cohort membership(s) to include. The list can include any cohort, not just those in population.cohort_ids.

Opt-in to include prediction explainability.

locationobject

Include each person's proximity to the locations of one or more atlases.

Distances are in meters, measured to the nearest edge of a location's geometry.

Additional properties: not allowed
Properties of object

Which atlas locations each person is matched against, and the distance bounds for a match. If absent, each person is matched against every location in the account's atlases at any distance.

Additional properties: not allowed
Properties of object
atlas_idsarray[string]

The atlases whose locations each person is matched against.

If this is empty or absent, every atlas in the account is used.

Match each person only against the locations carrying these reference keys.

A reference key is unique only within one atlas, so these keys are matched in every atlas each person is matched against. S...

A person only matches a location if they are no further than this many meters from it.

Example: 8000
Minimum value: 0

A person only matches a location if they are at least this many meters from it.

Example: 100
Minimum value: 0
property_conditionsarray[object]

Match each person only against the locations whose properties satisfy these conditions.

Items of array[object]
_eqstring

Equal to

_gtnumber

Greater than

_gtenumber

Greater than or equal to

_inarray[string]

Value is one of

_ltnumber

Less than

_ltenumber

Less than or equal to

_matchesstring

Value contains a match to the regex (re2) expression provided. For an exact regex match, use the ^ and $ characters as specified by the (re2 documentation)[https://github.com/google/re2/wiki/Syntax].

_neqstring

Not equal to

_ninarray[string]

Value is not one of

_nnullboolean

Value is not null

_nullboolean

Value is null (nulls are otherwise excluded)

optionalboolean

Optional property conditions are unioned together, when combined they select locations that meet either property condition. At least one optional condition must be satisfied.

propertystringrequired

The name of the location property, as defined by its atlas' output_to_locations.

Maximum characters: 256
selectstring

Whether to include only the nearest matching location for each person, or every matching location. all requires max_distance.

The choice sets the shape of the three location columns in the scope ...

Example: "nearest"
Allowed values: nearest, all

The maximum date for FIG attribute observations used in the scope payload. When set, only attribute data observed on or before this date will be included. If not set, the freshest available data is used.

outcome_idsarray[string]

Include the propensity score(s) from the specified outcome(s).

persona_set_idsarray[string]

Include the persona assignment(s) from the specified persona set(s).

recommender_idsarray[string]

Include the recommendation(s) from the specified recommender(s).

This feature is experimental and subject to change. To enable this feature, contact your account manager.

populationobjectrequired

(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.

Additional properties: not allowed
Properties of object
cohort_idsarray[string]required

Include people from the specified cohorts in this scope.

Exclude every individual who shares an address with any individual in the specified cohorts.

Exclude people from the specified cohorts in this scope.

previewbooleanrequired

A preview scope provides only a limited number of output records, but
it is not billed.

Example: true

Responses

201The new scope
archived_atstring<date-time>

If not null, this resource will no longer receive updates, but will still be visable.

columnsobject

Metadata about the columns in this scope. Useful for advanced target configuration.

Additional properties: not allowed
Properties of object
columns_for_modeobjectrequired

Available columns for different modes of target export.

Additional properties: not allowed
Properties of object
aggregatedarray[object]

Available columns for a given mode of target export.

Items of array[object]

The method of aggregation. Applies to aggregation targets only.

Allowed values: avg, count, countif, mode, ignore

For scope columns that can be aggregated with countif (currently just persona sets), this is the value being counted (i.e. the persona ID). Applies to aggregation targets only.

Maximum characters: 64

Set this to true when exporting first party identifiers (given by identity_sets).

If true, scope_col represents the dataset field name being selected (ex: "client_email").

output_colstringrequired

The name of this column in the target export. Can be the same as scope_col.

Match pattern: ^[_a-z][_a-z0-9]*$
scope_colstringrequired

The name of the scope column to export.

Users can supply either the machine-readable name (with underscored uuid) or the human-readable name (with literates).

Match pattern: ^[_a-z][_a-z0-9]*$
hashedarray[object]

Available columns for a given mode of target export.

Items of array[object]

The method of aggregation. Applies to aggregation targets only.

Allowed values: avg, count, countif, mode, ignore

For scope columns that can be aggregated with countif (currently just persona sets), this is the value being counted (i.e. the persona ID). Applies to aggregation targets only.

Maximum characters: 64

Set this to true when exporting first party identifiers (given by identity_sets).

If true, scope_col represents the dataset field name being selected (ex: "client_email").

output_colstringrequired

The name of this column in the target export. Can be the same as scope_col.

Match pattern: ^[_a-z][_a-z0-9]*$
scope_colstringrequired

The name of the scope column to export.

Users can supply either the machine-readable name (with underscored uuid) or the human-readable name (with literates).

Match pattern: ^[_a-z][_a-z0-9]*$
identifiedarray[object]

Available columns for a given mode of target export.

Items of array[object]

The method of aggregation. Applies to aggregation targets only.

Allowed values: avg, count, countif, mode, ignore

For scope columns that can be aggregated with countif (currently just persona sets), this is the value being counted (i.e. the persona ID). Applies to aggregation targets only.

Maximum characters: 64

Set this to true when exporting first party identifiers (given by identity_sets).

If true, scope_col represents the dataset field name being selected (ex: "client_email").

output_colstringrequired

The name of this column in the target export. Can be the same as scope_col.

Match pattern: ^[_a-z][_a-z0-9]*$
scope_colstringrequired

The name of the scope column to export.

Users can supply either the machine-readable name (with underscored uuid) or the human-readable name (with literates).

Match pattern: ^[_a-z][_a-z0-9]*$
referencedarray[object]

Available columns for a given mode of target export.

Items of array[object]

The method of aggregation. Applies to aggregation targets only.

Allowed values: avg, count, countif, mode, ignore

For scope columns that can be aggregated with countif (currently just persona sets), this is the value being counted (i.e. the persona ID). Applies to aggregation targets only.

Maximum characters: 64

Set this to true when exporting first party identifiers (given by identity_sets).

If true, scope_col represents the dataset field name being selected (ex: "client_email").

output_colstringrequired

The name of this column in the target export. Can be the same as scope_col.

Match pattern: ^[_a-z][_a-z0-9]*$
scope_colstringrequired

The name of the scope column to export.

Users can supply either the machine-readable name (with underscored uuid) or the human-readable name (with literates).

Match pattern: ^[_a-z][_a-z0-9]*$
identity_columnsarray[string]required

First party identifiers from all dataset identity_sets populating this scope.

payload_columnsarray[object]required

Payload columns. The shape is a 1:1 mapping of machine-readable payload column names to human-readable column names.

Items of array[object]
human_namestringrequired

Human-readable column name

namestringrequired

Machine-readable column name

created_atstring<date-time>required

When this resource was created.

idstring<uuid>required

A unique ID for this resource.

Example: "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.

namestringrequired

Human-readable label for this scope. Each scope must have a unique name.

Match pattern: ^(?!\s*$).+
Maximum characters: 64
payloadobjectrequired

The data to include for each person in this scope.

Additional properties: not allowed
Properties of object
attributesarray[string]

Include additional traits.

For traits created through output_to_traits via /datasets, specify the trait name.

For traits from Faraday's Internal Graph (FIG), specify the name prefixed by fig/ ex. fig/age.

cohort_idsarray[string]

Specify a list of cohort membership(s) to include. The list can include any cohort, not just those in population.cohort_ids.

Opt-in to include prediction explainability.

locationobject

Include each person's proximity to the locations of one or more atlases.

Distances are in meters, measured to the nearest edge of a location's geometry.

Additional properties: not allowed
Properties of object

Which atlas locations each person is matched against, and the distance bounds for a match. If absent, each person is matched against every location in the account's atlases at any distance.

Additional properties: not allowed
Properties of object
atlas_idsarray[string]

The atlases whose locations each person is matched against.

If this is empty or absent, every atlas in the account is used.

Match each person only against the locations carrying these reference keys.

A reference key is unique only within one atlas, so these keys are matched in every atlas each person is matched against. S...

A person only matches a location if they are no further than this many meters from it.

Example: 8000
Minimum value: 0

A person only matches a location if they are at least this many meters from it.

Example: 100
Minimum value: 0
property_conditionsarray[object]

Match each person only against the locations whose properties satisfy these conditions.

Items of array[object]
_eqstring

Equal to

_gtnumber

Greater than

_gtenumber

Greater than or equal to

_inarray[string]

Value is one of

_ltnumber

Less than

_ltenumber

Less than or equal to

_matchesstring

Value contains a match to the regex (re2) expression provided. For an exact regex match, use the ^ and $ characters as specified by the (re2 documentation)[https://github.com/google/re2/wiki/Syntax].

_neqstring

Not equal to

_ninarray[string]

Value is not one of

_nnullboolean

Value is not null

_nullboolean

Value is null (nulls are otherwise excluded)

optionalboolean

Optional property conditions are unioned together, when combined they select locations that meet either property condition. At least one optional condition must be satisfied.

propertystringrequired

The name of the location property, as defined by its atlas' output_to_locations.

Maximum characters: 256
selectstring

Whether to include only the nearest matching location for each person, or every matching location. all requires max_distance.

The choice sets the shape of the three location columns in the scope ...

Example: "nearest"
Allowed values: nearest, all

The maximum date for FIG attribute observations used in the scope payload. When set, only attribute data observed on or before this date will be included. If not set, the freshest available data is used.

outcome_idsarray[string]

Include the propensity score(s) from the specified outcome(s).

persona_set_idsarray[string]

Include the persona assignment(s) from the specified persona set(s).

recommender_idsarray[string]

Include the recommendation(s) from the specified recommender(s).

This feature is experimental and subject to change. To enable this feature, contact your account manager.

populationobjectrequired

The people to include in a scope. Leave cohort_ids empty to include the entire US population.

Additional properties: not allowed
Properties of object
cohort_idsarray[string]required

Include people from the specified cohorts in this scope.

Exclude every individual who shares an address with any individual in the specified cohorts.

Exclude people from the specified cohorts in this scope.

Count of the population. If a person appears in multiple cohorts, they are only counted once.

Residence count of the population. If a residence appears in multiple cohorts, it is only counted once.

previewbooleanrequired

A preview scope provides only a limited number of output records, but
it is not billed.

Example: true
resource_typestringrequired

The type of this resource.

Example: "scopes"
statusstringrequired

The current state of this resource and any updates.

Example: "pending"
Allowed values: new, starting, running, ready, error
status_changed_atstring<date-time>

When the status of this resource was last updated.

If this resource has status == "error", this will contain an error message.

updated_atstring<date-time>required

When this resource was last updated.

400The request was invalid.
errorstringrequired

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...
Example: "ERROR_TYPE"
Allowed values: BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICT
idstring<uuid>required

A unique ID for this error. Please include this in bug reports.

Example: "082f9513-901c-4308-8081-902a8fe22d7e"
notestringrequired

A human-readable description of the error.

Example: "An error occurred"
validationErrorsarray[object]

JSON Schema validation errors, if any.

Items of array[object]
contextobjectrequired

More information about the error.

Properties of object
errorTypestringrequired

The type of validation error which occurred.

messagestringrequired

A human-readable error message.

pathstringrequired

The location in the document that failed validation.

A suggestion for fixing this error.

401No API key was supplied.
errorstringrequired

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...
Example: "ERROR_TYPE"
Allowed values: BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICT
idstring<uuid>required

A unique ID for this error. Please include this in bug reports.

Example: "082f9513-901c-4308-8081-902a8fe22d7e"
notestringrequired

A human-readable description of the error.

Example: "An error occurred"
validationErrorsarray[object]

JSON Schema validation errors, if any.

Items of array[object]
contextobjectrequired

More information about the error.

Properties of object
errorTypestringrequired

The type of validation error which occurred.

messagestringrequired

A human-readable error message.

pathstringrequired

The location in the document that failed validation.

A suggestion for fixing this error.

403Access to this resource was forbidden.
errorstringrequired

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...
Example: "ERROR_TYPE"
Allowed values: BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICT
idstring<uuid>required

A unique ID for this error. Please include this in bug reports.

Example: "082f9513-901c-4308-8081-902a8fe22d7e"
notestringrequired

A human-readable description of the error.

Example: "An error occurred"
validationErrorsarray[object]

JSON Schema validation errors, if any.

Items of array[object]
contextobjectrequired

More information about the error.

Properties of object
errorTypestringrequired

The type of validation error which occurred.

messagestringrequired

A human-readable error message.

pathstringrequired

The location in the document that failed validation.

A suggestion for fixing this error.

404The requested resource ID was not found.
errorstringrequired

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...
Example: "ERROR_TYPE"
Allowed values: BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICT
idstring<uuid>required

A unique ID for this error. Please include this in bug reports.

Example: "082f9513-901c-4308-8081-902a8fe22d7e"
notestringrequired

A human-readable description of the error.

Example: "An error occurred"
validationErrorsarray[object]

JSON Schema validation errors, if any.

Items of array[object]
contextobjectrequired

More information about the error.

Properties of object
errorTypestringrequired

The type of validation error which occurred.

messagestringrequired

A human-readable error message.

pathstringrequired

The location in the document that failed validation.

A suggestion for fixing this error.

500An internal server error occurred.
errorstringrequired

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...
Example: "ERROR_TYPE"
Allowed values: BAD_REQUEST, FORBIDDEN, MAX_RESOURCES_REACHED, INTERNAL_SERVER_ERROR, INVALID_AUTHORIZATION, NOT_FOUND, MALFORMED_API_KEY, MISSING_API_KEY, EXPIRED_API_KEY, VALIDATION_FAILED, CONFLICT
idstring<uuid>required

A unique ID for this error. Please include this in bug reports.

Example: "082f9513-901c-4308-8081-902a8fe22d7e"
notestringrequired

A human-readable description of the error.

Example: "An error occurred"
validationErrorsarray[object]

JSON Schema validation errors, if any.

Items of array[object]
contextobjectrequired

More information about the error.

Properties of object
errorTypestringrequired

The type of validation error which occurred.

messagestringrequired

A human-readable error message.

pathstringrequired

The location in the document that failed validation.

A suggestion for fixing this error.

Tags

scopes