Body parameters

templatestringrequired

The template used to display the resolved route.

patternarrayrequired

A list of route patterns. Min: 1 pattern.

pattern.*.typestringrequired

The type of route pattern.

pattern.*.namestringrequired

The name of the route pattern.

pattern.*.valuestring | null

The value of the route pattern if any.

Response

idstring

The unique identifier for this route pattern.

objectstring

This will always contain route_pattern for this endpoint.

patternarray

A list of route patterns.

pattern.*.typestring

The type of route pattern.

pattern.*.valuestring | null

The value of the route pattern if any.

pattern.*.namestring

The name of the route pattern.

templatestring

The template used to display the resolved route.

created_atstring

The date and time when the route pattern was created.

updated_atstring

The date and time when the route pattern was updated.

import Blutui from 'blutui'

const blutui = new Blutui('ey....')

blutui.project('one').admin.routePatterns.create({
  template: 'pages/products/product.canvas',
  pattern: [
    {
      type: 'string',
      value: 'products',
      name: 'products',
    },
    {
      type: 'slug',
      name: 'slug',
    },
  ],
})
Response
{
  "id": "99e280a8-dfc6-4b46-8b6a-3055187fe078",
  "object": "route_pattern",
  "pattern": [
    {
      "type": "string",
      "value": "products",
      "name": "products"
    },
    {
      "type": "slug",
      "name": "slug"
    }
  ],
  "template": "pages/products/product.canvas",
  "created_at": "2023-08-14T16:49:46+12:00",
  "updated_at": "2023-08-14T16:49:46+12:00"
}

Was this helpful?