> ## Documentation Index
> Fetch the complete documentation index at: https://docs.get-rial.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish a template

> Create a template and its permanent link in one call.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/link-templates
openapi: 3.1.0
info:
  title: rial API
  version: 0.1.0
  description: 'Prove a photo is real. Base URL: https://api.rial.io'
  contact:
    name: rial-platform team
    url: https://github.com/Rial-ventures-Inc/rial-platform
  license:
    name: UNLICENSED — proprietary, internal use only
servers:
  - url: https://api.rial.io
    description: Production
security: []
tags:
  - name: Verifications
    description: >-
      Create, fetch, list, and finalize verifications. The core of the API —
      every tenant integration starts here.
  - name: Templates
    description: >-
      Publish, update, revoke and inspect link templates — the reusable capture
      links behind `/l/{token}` (a compact JWT carrying the org and template
      slugs; the legacy `/l/{org}/{slug}` keeps resolving). Callable with a
      secret key; each publish snapshots a versioned capture spec (GET-83).
  - name: Databases
    description: >-
      Create, update, inspect and synchronize tenant-scoped databases used by
      reusable verification templates. Callable with a dashboard session or
      secret API key.
paths:
  /v1/link-templates:
    post:
      tags:
        - Templates
      summary: Publish a template
      description: Create a template and its permanent link in one call.
      requestBody:
        required: true
        description: '`slug`, `name` and `steps` are required. Everything else is optional.'
        content:
          application/json:
            schema:
              type: object
              properties:
                slug:
                  type: string
                  minLength: 2
                  maxLength: 40
                  pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                  description: >-
                    URL-safe id, unique in your account: lowercase letters,
                    digits and single hyphens.
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                  description: Name shown in the dashboard and to the person capturing.
                mode:
                  type: string
                  enum:
                    - capture
                    - audit
                    - hybrid
                  default: capture
                  description: >-
                    `capture` (live photos, default), `audit` (uploaded files)
                    or `hybrid`.
                steps:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: Visible title of the step.
                          screen:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              title:
                                type: string
                                minLength: 1
                                maxLength: 120
                              description:
                                type: string
                                maxLength: 8000
                            required:
                              - key
                              - title
                            additionalProperties: false
                            description: >-
                              Groups consecutive steps on one screen: `key` and
                              `title` shared by the group.
                          when:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              value:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                            required:
                              - key
                              - value
                            additionalProperties: false
                            description: >-
                              Show this step only when the step `key` was
                              answered with `value`.
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z0-9][a-z0-9_-]*$
                            description: >-
                              Stable id of the step. Its answer or photos come
                              back under this key.
                          type:
                            type: string
                            enum:
                              - image
                            default: image
                          description:
                            type: string
                            maxLength: 500
                            default: ''
                            description: Instruction shown to the person.
                          min:
                            type: integer
                            minimum: 0
                            description: Minimum photos. 0 makes the step optional.
                          max:
                            type: integer
                            minimum: 1
                            description: Maximum photos.
                          allow_upload:
                            type: boolean
                            description: >-
                              Also allow picking a file from the gallery instead
                              of the camera.
                          accept:
                            type: array
                            items:
                              type: string
                              enum:
                                - image/jpeg
                                - image/png
                                - image/webp
                                - image/heic
                                - image/heif
                            minItems: 1
                            description: Accepted media types.
                          max_size_bytes:
                            type: integer
                            minimum: 1
                            maximum: 26214400
                            description: Maximum size per photo, in bytes.
                          expected_object:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: >-
                              What must appear in this photo. Overrides the
                              verification-level value.
                          condition_aspects:
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 40
                            minItems: 1
                            maxItems: 6
                            description: >-
                              Aspects to score on this photo. Overrides the
                              verification-level value.
                        required:
                          - key
                          - min
                          - max
                        additionalProperties: false
                      - type: object
                        properties:
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: Visible title of the step.
                          screen:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              title:
                                type: string
                                minLength: 1
                                maxLength: 120
                              description:
                                type: string
                                maxLength: 8000
                            required:
                              - key
                              - title
                            additionalProperties: false
                            description: >-
                              Groups consecutive steps on one screen: `key` and
                              `title` shared by the group.
                          when:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              value:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                            required:
                              - key
                              - value
                            additionalProperties: false
                            description: >-
                              Show this step only when the step `key` was
                              answered with `value`.
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z0-9][a-z0-9_-]*$
                            description: >-
                              Stable id of the step. Its answer or photos come
                              back under this key.
                          type:
                            type: string
                            enum:
                              - text
                          description:
                            type: string
                            maxLength: 500
                            default: ''
                            description: Instruction shown to the person.
                          required:
                            type: boolean
                            default: true
                            description: Default true.
                          validation:
                            type: object
                            properties:
                              min_length:
                                type: integer
                                minimum: 0
                                maximum: 2000
                              max_length:
                                type: integer
                                minimum: 1
                                maximum: 2000
                              format:
                                type: string
                                enum:
                                  - free_text
                                  - numeric_id
                                  - alphanumeric_id
                                  - email
                                default: free_text
                            default:
                              format: free_text
                            additionalProperties: false
                            description: >-
                              Length and format rules: `free_text`,
                              `numeric_id`, `alphanumeric_id` or `email`.
                          variant:
                            type: string
                            enum:
                              - short
                              - long
                            description: '`short` (one line) or `long`.'
                        required:
                          - key
                          - type
                        additionalProperties: false
                      - type: object
                        properties:
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: Visible title of the step.
                          screen:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              title:
                                type: string
                                minLength: 1
                                maxLength: 120
                              description:
                                type: string
                                maxLength: 8000
                            required:
                              - key
                              - title
                            additionalProperties: false
                            description: >-
                              Groups consecutive steps on one screen: `key` and
                              `title` shared by the group.
                          when:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              value:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                            required:
                              - key
                              - value
                            additionalProperties: false
                            description: >-
                              Show this step only when the step `key` was
                              answered with `value`.
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z0-9][a-z0-9_-]*$
                            description: >-
                              Stable id of the step. Its answer or photos come
                              back under this key.
                          type:
                            type: string
                            enum:
                              - upload
                          input:
                            type: string
                            enum:
                              - signature
                            description: >-
                              `signature` shows a signature pad instead of a
                              file picker.
                          description:
                            type: string
                            maxLength: 500
                            default: ''
                            description: Instruction shown to the person.
                          min:
                            type: integer
                            minimum: 0
                            description: Minimum files. 0 makes the step optional.
                          max:
                            type: integer
                            minimum: 1
                            description: Maximum files.
                          accept:
                            type: array
                            items:
                              type: string
                              enum:
                                - image/jpeg
                                - image/png
                                - image/webp
                                - image/heic
                                - image/heif
                            minItems: 1
                            default:
                              - image/jpeg
                              - image/png
                              - image/webp
                              - image/heic
                              - image/heif
                            description: Accepted media types.
                          max_size_bytes:
                            type: integer
                            minimum: 1
                            maximum: 26214400
                            default: 10485760
                            description: Maximum size per file, in bytes.
                        required:
                          - key
                          - type
                          - min
                          - max
                        additionalProperties: false
                      - type: object
                        properties:
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: Visible title of the step.
                          screen:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              title:
                                type: string
                                minLength: 1
                                maxLength: 120
                              description:
                                type: string
                                maxLength: 8000
                            required:
                              - key
                              - title
                            additionalProperties: false
                            description: >-
                              Groups consecutive steps on one screen: `key` and
                              `title` shared by the group.
                          when:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              value:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                            required:
                              - key
                              - value
                            additionalProperties: false
                            description: >-
                              Show this step only when the step `key` was
                              answered with `value`.
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z0-9][a-z0-9_-]*$
                            description: >-
                              Stable id of the step. Its answer or photos come
                              back under this key.
                          type:
                            type: string
                            enum:
                              - video
                          description:
                            type: string
                            maxLength: 500
                            default: ''
                            description: Instruction shown to the person.
                          min:
                            type: integer
                            minimum: 0
                            description: Minimum clips. 0 makes the step optional.
                          max:
                            type: integer
                            minimum: 1
                            description: Maximum clips.
                          max_duration_sec:
                            type: integer
                            minimum: 1
                            maximum: 30
                            default: 30
                            description: Maximum length of each clip, in seconds.
                        required:
                          - key
                          - type
                          - min
                          - max
                        additionalProperties: false
                      - type: object
                        properties:
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: Visible title of the step.
                          screen:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              title:
                                type: string
                                minLength: 1
                                maxLength: 120
                              description:
                                type: string
                                maxLength: 8000
                            required:
                              - key
                              - title
                            additionalProperties: false
                            description: >-
                              Groups consecutive steps on one screen: `key` and
                              `title` shared by the group.
                          when:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              value:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                            required:
                              - key
                              - value
                            additionalProperties: false
                            description: >-
                              Show this step only when the step `key` was
                              answered with `value`.
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z0-9][a-z0-9_-]*$
                            description: >-
                              Stable id of the step. Its answer or photos come
                              back under this key.
                          type:
                            type: string
                            enum:
                              - choice
                          description:
                            type: string
                            maxLength: 500
                            default: ''
                            description: Instruction shown to the person.
                          required:
                            type: boolean
                            default: true
                            description: Default true.
                          multiple:
                            type: boolean
                            default: false
                            description: Allow picking more than one option.
                          options:
                            type: array
                            items:
                              type: object
                              properties:
                                key:
                                  type: string
                                  minLength: 1
                                  maxLength: 64
                                  pattern: ^[a-z0-9][a-z0-9_-]*$
                                label:
                                  type: string
                                  minLength: 1
                                  maxLength: 500
                              required:
                                - key
                                - label
                              additionalProperties: false
                            minItems: 1
                            maxItems: 50
                            description: Options to pick from, each with `key` and `label`.
                        required:
                          - key
                          - type
                          - options
                        additionalProperties: false
                      - type: object
                        properties:
                          label:
                            type: string
                            minLength: 1
                            maxLength: 200
                            description: Visible title of the step.
                          screen:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              title:
                                type: string
                                minLength: 1
                                maxLength: 120
                              description:
                                type: string
                                maxLength: 8000
                            required:
                              - key
                              - title
                            additionalProperties: false
                            description: >-
                              Groups consecutive steps on one screen: `key` and
                              `title` shared by the group.
                          when:
                            type: object
                            properties:
                              key:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                              value:
                                type: string
                                minLength: 1
                                maxLength: 64
                                pattern: ^[a-z0-9][a-z0-9_-]*$
                            required:
                              - key
                              - value
                            additionalProperties: false
                            description: >-
                              Show this step only when the step `key` was
                              answered with `value`.
                          key:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z0-9][a-z0-9_-]*$
                            description: >-
                              Stable id of the step. Its answer or photos come
                              back under this key.
                          type:
                            type: string
                            enum:
                              - address
                          country:
                            type: string
                            enum:
                              - BR
                            description: '`BR` shows Brazilian address fields.'
                          description:
                            type: string
                            maxLength: 500
                            default: ''
                            description: Instruction shown to the person.
                          required:
                            type: boolean
                            default: true
                            description: Default true.
                        required:
                          - key
                          - type
                        additionalProperties: false
                  minItems: 1
                  description: Steps every person goes through, in order.
                expires_in_seconds:
                  type: integer
                  minimum: 60
                  maximum: 86400
                  default: 3600
                  description: >-
                    How long each verification minted from the link stays open,
                    in seconds. Default 3600.
                status:
                  type: string
                  enum:
                    - draft
                    - active
                  default: active
                  description: >-
                    `active` (default) publishes the link. `draft` only allows
                    simulation.
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                    maxLength: 500
                  description: >-
                    Key/value strings stamped on every verification from this
                    template.
                expected_location:
                  type: string
                  minLength: 1
                  maxLength: 300
                  description: >-
                    Street address every photo must be taken at. Turns on
                    `location_match`.
                expected_object:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: >-
                    What must appear in the photos, e.g. `"car"`. Turns on
                    `object_match`.
                condition_aspects:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 40
                  minItems: 1
                  maxItems: 6
                  description: >-
                    One to six aspects to score from 0 to 10. Turns on
                    `condition`.
                expected_info:
                  type: object
                  properties:
                    shared:
                      type: object
                      properties:
                        expected_location:
                          type: string
                          minLength: 1
                          maxLength: 300
                        expected_object:
                          type: string
                          minLength: 1
                          maxLength: 200
                        condition_aspects:
                          type: array
                          items:
                            type: string
                            minLength: 1
                            maxLength: 40
                          minItems: 1
                          maxItems: 6
                        ocr_type:
                          type: string
                          minLength: 1
                          maxLength: 40
                      additionalProperties: false
                  required:
                    - shared
                  additionalProperties: false
                  description: >-
                    Structured alternative to `expected_location`,
                    `expected_object` and `condition_aspects`. Send one form or
                    the other.
                daily_cap:
                  type: integer
                  minimum: 1
                  maximum: 10000
                  description: Maximum verifications per day. Absent = no cap.
                total_cap:
                  type: integer
                  minimum: 1
                  maximum: 1000000
                  description: Maximum verifications in total. Absent = no cap.
                brand_slug:
                  type: string
                  minLength: 2
                  maxLength: 40
                  pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                  description: >-
                    Brand profile shown on the capture page. Absent = your
                    default brand.
                notify_email:
                  type: string
                  maxLength: 254
                  format: email
                  description: >-
                    Email that receives each result. Inherited by every
                    verification from this template.
                notify_subject_template:
                  type: string
                  minLength: 1
                  description: >-
                    Subject of the result email. `{variable}` placeholders
                    allowed.
                notify_body_template:
                  type: string
                  minLength: 1
                  description: Body of the result email. `{variable}` placeholders allowed.
                completion_message:
                  type: string
                  minLength: 1
                  maxLength: 2000
                  description: >-
                    Full plain-text message shown after submitting content.
                    HTML, markdown and variables are not interpreted. Omit on
                    create or send null on PATCH to use the default.
                identification:
                  type: object
                  properties:
                    required:
                      type: boolean
                    label:
                      type: string
                      minLength: 1
                      maxLength: 80
                  required:
                    - required
                  additionalProperties: false
                  description: >-
                    Which step identifies the person, and how to find their row
                    in the connected database.
                database:
                  type: object
                  properties:
                    database_id:
                      type: string
                      pattern: ^[A-Za-z0-9_-]{1,64}$
                    column_for:
                      type: object
                      properties:
                        identifier:
                          type: string
                          minLength: 1
                          maxLength: 80
                        location:
                          type: string
                          minLength: 1
                          maxLength: 80
                        object:
                          type: string
                          minLength: 1
                          maxLength: 80
                      required:
                        - identifier
                      additionalProperties: false
                  required:
                    - database_id
                    - column_for
                  additionalProperties: false
                  description: >-
                    Connected database: the table and which columns feed the
                    checks.
                requires_location:
                  type: boolean
                  description: >-
                    Require a GPS fix on the first photo of every run without
                    comparing it to an address.
              required:
                - slug
                - name
                - steps
              additionalProperties: false
            example:
              slug: warehouse-intake
              name: Warehouse intake
              mode: capture
              steps:
                - key: front
                  type: image
                  description: Front of the pallet
                  min: 1
                  max: 1
              expires_in_seconds: 3600
      responses:
        '201':
          description: Template published. `version` is always `1` on create.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkTemplate'
              example:
                slug: warehouse-intake
                org_slug: acme-logistics
                public_url: >-
                  https://verify.rial.io/l/eyJhbGciOiJIUzI1NiJ9.eyJvIjoiYWNtZS1sb2dpc3RpY3MiLCJ0Ijoid2FyZWhvdXNlLWludGFrZSJ9.3YjQ4G9Wf0mJ8s2K
                name: Warehouse intake
                mode: capture
                steps:
                  - key: front
                    type: image
                    description: Front of the pallet
                    min: 1
                    max: 1
                expires_in_seconds: 3600
                status: active
                started_total: 0
                started_today: 0
                version: 1
                created_at: '2026-07-30T12:00:00.000Z'
                updated_at: '2026-07-30T12:00:00.000Z'
        '400':
          description: >-
            Body failed validation (slug charset, steps not mintable, mode
            incoherent).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Slug already taken by a live template of this tenant.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - slug_taken
                required:
                  - error
              example:
                error: slug_taken
        '422':
          description: >-
            `brand_slug` references a brand profile that does not exist for the
            tenant.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - unknown_brand
                required:
                  - error
              example:
                error: unknown_brand
        '503':
          description: The template store is unreachable — retry with backoff.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  cause:
                    type: string
                required:
                  - error
              example:
                error: storage_unavailable
      security:
        - bearerApiKey: []
components:
  schemas:
    LinkTemplate:
      type: object
      properties:
        slug:
          type: string
        org_slug:
          type: string
        public_url:
          type: string
          format: uri
        name:
          type: string
        mode:
          type: string
          enum:
            - capture
            - audit
            - hybrid
        steps:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              type:
                type: string
                enum:
                  - image
                  - upload
                  - text
                  - video
                  - choice
                  - address
            required:
              - key
              - type
            description: One normalized capture-spec step (see `stepsInputSchema`).
        expires_in_seconds:
          type: integer
        metadata:
          type: object
          additionalProperties:
            type: string
        expected_info:
          type: object
          properties: {}
        expected_location:
          type: object
          properties: {}
        expected_object:
          type: object
          properties: {}
        condition_aspects:
          type: array
          items: {}
        brand_slug:
          type: string
        notify_email:
          type: string
          format: email
        notify_subject_template:
          type: string
        notify_body_template:
          type: string
        completion_message:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            Full plain-text message shown after submitting content. HTML,
            markdown and variables are not interpreted. Omit on create or send
            null on PATCH to use the default.
        identification:
          type: object
          properties:
            required:
              type: boolean
            label:
              type: string
          required:
            - required
        requires_location:
          type: boolean
        database:
          type: object
          properties:
            database_id:
              type: string
            column_for:
              type: object
              properties:
                identifier:
                  type: string
                location:
                  type: string
                object:
                  type: string
              required:
                - identifier
          required:
            - database_id
            - column_for
        status:
          type: string
          enum:
            - active
            - paused
        daily_cap:
          type: integer
        total_cap:
          type: integer
        started_total:
          type: integer
        started_today:
          type: integer
        version:
          type: integer
          minimum: 1
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - slug
        - name
        - mode
        - steps
        - expires_in_seconds
        - status
        - started_total
        - started_today
        - version
        - created_at
        - updated_at
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            fields:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                  message:
                    type: string
                required:
                  - path
                  - message
          required:
            - code
            - message
      required:
        - error
      description: >-
        Uniform error envelope. `code` is the stable string SDKs branch on
        (`invalid_request`, `unauthorized`, `not_found`, `expired`, `step_full`,
        `unknown_step`, `steps_incomplete`, `already_finalized`,
        `too_many_requests`, `storage_unavailable`, `internal_error`). `fields`
        is only present on `invalid_request` validation failures.
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: rk_secret_<key>
      description: >-
        Secret API key, created in the dashboard under Settings → API. Send it
        as `Authorization: Bearer rk_secret_…` from your server only.
        Publishable keys (`pk_live_…`) are for the native SDKs and reach the
        capture endpoints alone. An unknown key returns 401.

````