# Tables API



<Callout>
  *Data Tables* are used in plugins to support calculations. *Constraint Tables* are used to support UI development by filtering options for the user.
</Callout>

<EndpointIndex
  names={[
  	'fetchTableRecord',
  	'fetchLookupTableInZipFormat',
  	'createLookupTable',
  	'replaceLookupTable',
  	'fetchRangeTableRecord',
  	'fetchRangeTableInZipFormat',
  	'createRangeTable',
  	'replaceRangeTable',
  	'evaluateConstraintsForAccount',
  	'fetchDependencyMapForAccount',
  	'fetchDependencyMapForQuote',
  	'evaluateConstraintsForQuote',
  	'evaluateConstraintsForQuickQuote',
  	'fetchDependencyMapForQuickQuote',
  	'fetchDependencyMapForPolicyTransaction',
  	'evaluateConstraintsForPolicyTransaction',
  	'fetchConstraints',
  	'createConstraintTable',
  	'replaceConstraintTable',
  	'zipConstraintTable',
  ]}
  titles={{
  	fetchTableRecord: 'Fetch a Table Record',
  	fetchLookupTableInZipFormat: 'Fetch a Lookup Table in ZIP Format',
  	createLookupTable: 'Create a Lookup Table',
  	replaceLookupTable: 'Replace a Lookup Table',
  	fetchRangeTableRecord: 'Fetch a Range Table Record',
  	fetchRangeTableInZipFormat: 'Fetch a Range Table in ZIP Format',
  	createRangeTable: 'Create a Range Table',
  	replaceRangeTable: 'Replace a Range Table',
  }}
/>

Data Tables [#data-tables]

Usage [#usage]

Fetch a Table Record [#fetch-a-table-record]

<ApiEndpoint name="fetchTableRecord" title="Fetch a Table Record" />

<ApiSchema name="TableLookupResponse" />

Configuration [#configuration]

Fetch a Lookup Table in ZIP Format [#fetch-a-lookup-table-in-zip-format]

<ApiEndpoint name="fetchLookupTableInZipFormat" title="Fetch a Lookup Table in ZIP Format" />

Create a Lookup Table [#create-a-lookup-table]

<ApiEndpoint name="createLookupTable" title="Create a Lookup Table" />

<Callout type="warn">
  Files must be converted to ZIP files before uploading.
</Callout>

Replace a Lookup Table [#replace-a-lookup-table]

<ApiEndpoint name="replaceLookupTable" title="Replace a Lookup Table" />

<Callout type="warn">
  Files must be converted to ZIP files before uploading.
</Callout>

Range Tables [#range-tables]

Usage [#usage-1]

Fetch a Range Table Record [#fetch-a-range-table-record]

<ApiEndpoint name="fetchRangeTableRecord" title="Fetch a Range Table Record" />

Configuration [#configuration-1]

Fetch a Range Table in ZIP Format [#fetch-a-range-table-in-zip-format]

<ApiEndpoint name="fetchRangeTableInZipFormat" title="Fetch a Range Table in ZIP Format" />

Create a Range Table [#create-a-range-table]

<ApiEndpoint name="createRangeTable" title="Create a Range Table" />

<Callout type="warn">
  Files must be converted to ZIP files before uploading.
</Callout>

Replace a Range Table [#replace-a-range-table]

<ApiEndpoint name="replaceRangeTable" title="Replace a Range Table" />

<Callout type="warn">
  Files must be converted to ZIP files before uploading.
</Callout>

<span id="constraint_tables_api" />

Constraint Tables [#constraint-tables]

Accounts [#accounts]

Evaluate Constraints For Account [#evaluate-constraints-for-account]

<ApiEndpoint name="evaluateConstraintsForAccount" />

Fetch Dependency Map For Account [#fetch-dependency-map-for-account]

<ApiEndpoint name="fetchDependencyMapForAccount" />

Quotes [#quotes]

Fetch Dependency Map For Quote [#fetch-dependency-map-for-quote]

<ApiEndpoint name="fetchDependencyMapForQuote" />

<ApiSchema name="ConstraintDependency" />

<ApiSchema name="ConditionValue" />

Evaluate Constraints For Quote [#evaluate-constraints-for-quote]

<ApiEndpoint name="evaluateConstraintsForQuote" />

Quick Quotes [#quick-quotes]

Evaluate Constraints For Quick Quote [#evaluate-constraints-for-quick-quote]

<ApiEndpoint name="evaluateConstraintsForQuickQuote" />

Fetch Dependency Map For Quick Quote [#fetch-dependency-map-for-quick-quote]

<ApiEndpoint name="fetchDependencyMapForQuickQuote" />

Policy Transactions [#policy-transactions]

Fetch Dependency Map For Policy Transaction [#fetch-dependency-map-for-policy-transaction]

<ApiEndpoint name="fetchDependencyMapForPolicyTransaction" />

Evaluate Constraints For Policy Transaction [#evaluate-constraints-for-policy-transaction]

<ApiEndpoint name="evaluateConstraintsForPolicyTransaction" />

Configuration [#configuration-2]

Fetch Constraints [#fetch-constraints]

<ApiEndpoint name="fetchConstraints" />

Create Constraint Table [#create-constraint-table]

<ApiEndpoint name="createConstraintTable" />

<Callout type="warn">
  Files must be converted to ZIP files before uploading.
</Callout>

Replace Constraint Table [#replace-constraint-table]

<ApiEndpoint name="replaceConstraintTable" />

<Callout type="warn">
  Files must be converted to ZIP files before uploading.
</Callout>

Zip Constraint Table [#zip-constraint-table]

<ApiEndpoint name="zipConstraintTable" />


## API Reference

GET /resource/{tenantLocator}/tables/{name}/record — fetchTableRecord
Tags: lookup-tables-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
  date (datetime, query)
  jurisdiction (string, query)
  byStaticName (boolean, query)
  key (string[], query, required)
Responses:
  200 TableLookupResponse — OK

GET /resource/{tenantLocator}/tables/{name} — fetchLookupTableInZipFormat
Tags: lookup-tables-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
Responses:
  200 — OK

POST /resource/{tenantLocator}/tables — createLookupTable
Tags: lookup-tables-controller
Permissions: upload
Parameters:
  tenantLocator (uuid, path, required)
  name (string, query, required)
  staticName (string, query, required)
  jurisdiction (string[], query)
Responses:
  200 BasicResourceResponse — OK

PATCH /resource/{tenantLocator}/tables/{name} — replaceLookupTable
Tags: lookup-tables-controller
Permissions: upload
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
Responses:
  200 BasicResourceResponse — OK

GET /resource/{tenantLocator}/rangeTables/{name}/record — fetchRangeTableRecord
Tags: range-tables-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
  date (datetime, query)
  jurisdiction (string, query)
  byStaticName (boolean, query)
  key (string[], query, required)
  boundValue (number, query, required)
Responses:
  200 TableLookupResponse — OK

GET /resource/{tenantLocator}/rangeTables/{name} — fetchRangeTableInZipFormat
Tags: range-tables-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
Responses:
  200 — OK

POST /resource/{tenantLocator}/rangeTables — createRangeTable
Tags: range-tables-controller
Permissions: upload
Parameters:
  tenantLocator (uuid, path, required)
  name (string, query, required)
  staticName (string, query, required)
  jurisdiction (string[], query)
Responses:
  200 BasicResourceResponse — OK

PATCH /resource/{tenantLocator}/rangeTables/{name} — replaceRangeTable
Tags: range-tables-controller
Permissions: upload
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
Responses:
  200 BasicResourceResponse — OK

POST /policy/{tenantLocator}/accounts/{locator}/constraints/evaluate — evaluateConstraintsForAccount
Tags: accounts-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Request body (map<string, map<string, string>>):
Responses:
  200 map<string, map<string, string[]>> — OK

GET /policy/{tenantLocator}/accounts/{locator}/constraints/dependency — fetchDependencyMapForAccount
Tags: accounts-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Responses:
  200 map<string, map<string, ConstraintDependency>> — OK

GET /policy/{tenantLocator}/quotes/{locator}/constraints/dependency — fetchDependencyMapForQuote
Tags: quotes-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Responses:
  200 map<string, map<string, ConstraintDependency>> — OK

POST /policy/{tenantLocator}/quotes/{locator}/constraints/evaluate — evaluateConstraintsForQuote
Tags: quotes-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Request body (map<string, map<string, map<string, string>>>):
Responses:
  200 map<string, map<string, string[]>> — OK

POST /policy/{tenantLocator}/quickquotes/{locator}/constraints/evaluate — evaluateConstraintsForQuickQuote
Tags: quick-quotes-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Request body (map<string, map<string, map<string, string>>>):
Responses:
  200 map<string, map<string, string[]>> — OK

GET /policy/{tenantLocator}/quickquotes/{locator}/constraints/dependency — fetchDependencyMapForQuickQuote
Tags: quick-quotes-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Responses:
  200 map<string, map<string, ConstraintDependency>> — OK

GET /policy/{tenantLocator}/transactions/{locator}/elements/constraints/dependency — fetchDependencyMapForPolicyTransaction
Tags: transactions-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Responses:
  200 map<string, map<string, ConstraintDependency>> — OK

POST /policy/{tenantLocator}/transactions/{locator}/elements/constraints/evaluate — evaluateConstraintsForPolicyTransaction
Tags: transactions-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  locator (ulid, path, required)
Request body (map<string, map<string, map<string, string>>>):
Responses:
  200 map<string, map<string, string[]>> — OK

GET /resource/{tenantLocator}/constraints/{name}/record — fetchConstraints
Tags: constraint-tables-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
  date (datetime, query)
  jurisdiction (string, query)
  byStaticName (boolean, query)
  key (string[], query)
Responses:
  200 map<string, object[]> — OK

POST /resource/{tenantLocator}/constraints — createConstraintTable
Tags: constraint-tables-controller
Permissions: upload
Parameters:
  tenantLocator (uuid, path, required)
  name (string, query, required)
  staticName (string, query, required)
  jurisdiction (string[], query)
Responses:
  200 BasicResourceResponse — OK

PATCH /resource/{tenantLocator}/constraints/{name} — replaceConstraintTable
Tags: constraint-tables-controller
Permissions: upload
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
Responses:
  200 BasicResourceResponse — OK

GET /resource/{tenantLocator}/constraints/{name} — zipConstraintTable
Tags: constraint-tables-controller
Permissions: read
Parameters:
  tenantLocator (uuid, path, required)
  name (string, path, required)
Responses:
  200 — OK

TableLookupResponse
Properties:
  value (object, required)

ConstraintDependency
Properties:
  table (string, required)
  column (string, required)
  where (map<string, ConditionValue>, required)

ConditionValue
Properties:
  staticLocator (ulid, required)
  fieldName (string, required)
  values (string[], required)