public

Create an attribute template

Requires write. Without this, PUT .../attributes rejects every key as unknown, so a public-key integration could never use typed, filterable or sortable attributes and was forced to put everything in free-form canonicalFields — where recipes cannot scope on it.

Uniqueness is per (directory, listingType, key). A null listingType means "applies to every type" and can coexist with a same-key type-scoped template, matching how attribute resolution works on write.

post/public/v1/directories/{directory}/attribute-templates

Request

  • Base URL: https://api.epicdirectories.com
  • URL: https://api.epicdirectories.com/public/v1/directories/{directory}/attribute-templates
  • Auth: API key in header x-api-key

Path parameters

directorystring required

Headers

Idempotency-Keystring

Optional. Send a unique key per logical operation to make retries safe. 1-256 characters, and only letters, digits, - and _ — colons and other separators are rejected with 400. A retry with the same key replays the original response (status + body) instead of re-executing. Cached for 24h. Reusing a key with a different request body returns 409 — note that a timestamp in the body (e.g. fetchedAt) turns an otherwise-stable key into a permanent 409, so either omit it (snapshots default it server-side) or fold a payload digest into the key. Skipped on 5xx responses (transient errors should be retried fresh).

x-api-keystring required

API Key for authentication

Request body

listingTypestring

Listing type this template applies to (null = all types)

keystring required

Unique key for the attribute

labelstring required

Human-readable label

type'string' | 'text' | 'number' | 'boolean' | 'enum' | 'multi' | 'multi_enum' | 'date' | 'datetime' | 'range' | 'url' | 'email' | 'phone' | 'richtext' | 'json' required

Attribute data type

isFilterableboolean

Whether this attribute can be used in filters

isSortableboolean

Whether this attribute can be used for sorting

isSeoRelevantboolean

Whether this attribute is relevant for SEO

enumValuesstring[]

Allowed values for enum/multi_enum types

settingsobject

Additional settings (validation rules, display hints, etc.)

Example request

{
  "enumValues": [
    "option1",
    "option2"
  ],
  "settings": {
    "min": 0,
    "max": 100,
    "unit": "USD"
  }
}

Response

Attribute template created

Changes

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