Extraction templates

Create an extraction template

Create a custom (agency-level) extraction template based on a parent global template.

For wide report templates (parent has allow_to_select_dimensions or is_created_from_wide), a connection_id is required and the selected fields are validated against the DSAS API.

Required RBAC permission: EXTRACT.CREATE.

post/api/v3/datasources/{datasource_name}/extract-templates

Request

Path parameters

datasource_namestring required

Datasource name

Request body

parent_idinteger required

ID of the parent (global) extraction template to base this template on

titlestring required

Title for the new template (must be unique within the agency)

descriptionstring required

Description of the template (can be empty)

fieldsstring[] required

List of field names to include in the template

additional_paramsobject required

Additional parameters for the template (e.g. time_granularity)

hashed_fieldsstring[]

List of field names to hash (optional)

historical_data_depth_limitinteger nullable

Limit on historical data depth in days (optional, null for no limit)

connection_idinteger nullable

Connection ID, required for wide report templates (parent has allow_to_select_dimensions or is_created_from_wide)

Example request

{
  "scheduling": [
    {
      "scheduling": {
        "value": {
          "days": 1,
          "hours": 1,
          "minutes": 1,
          "interval": "day",
          "timezone": "UTC",
          "lookback_window": {
            "name": "default"
          }
        }
      }
    }
  ]
}

Response

Template created successfully

idinteger

Extract Template ID

titlestring

Extract Template title

descriptionstring

Extract Template description

data_classstring

Data class

datasource_namestring

Data source name

is_wide_templateboolean

Whether the template is a wide report template

schedules_limitinteger

Schedules limit

Example response

{
  "extract_template": {
    "value": {
      "id": 1,
      "title": "Extract Template 1",
      "description": "Extract Template 1 description",
      "data_class": "table",
      "datasource_name": "google_sheets",
      "is_wide_template": false,
      "schedules_limit": 1,
      "scheduling": [
        {
          "days": 1,
          "hours": 1,
          "minutes": 1,
          "interval": "daily",
          "timezone": "UTC",
          "lookback_window": {
            "name": "1 day"
          }
        }
      ],
      "fields": [
        {
          "title": "Field 1",
          "name": "field_1",
          "user_kind": "dimension",
          "user_type": "string",
          "selected": true,
          "can_edit": true,
          "sql_name": "field_1",
          "format": "string",
          "is_dynamic": false
        }
      ],
      "additional_params": [
        {
          "type": "string",
          "name": "param_1",
          "required": true,
          "title": "Param 1",
          "description": "Param 1 description",
          "params": {},
          "initial_value": "value"
        }
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.