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

# Create a view

> Creates a view for a slot, with no versions. Any member may; only Effective staff may create a `trusted` one, which runs in the page instead of the sandbox. Upload source with createViewVersion. Honors `Idempotency-Key`.



## OpenAPI

````yaml /openapi.json post /customization/views
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.canary.effectiveai.app/api/v2
    description: Canary
security:
  - bearerAuth: []
paths:
  /customization/views:
    post:
      tags:
        - Views
      summary: Create a view
      description: >-
        Creates a view for a slot, with no versions. Any member may; only
        Effective staff may create a `trusted` one, which runs in the page
        instead of the sandbox. Upload source with createViewVersion. Honors
        `Idempotency-Key`.
      operationId: createView
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
          required: false
          name: idempotency-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                slot:
                  type: string
                  maxLength: 160
                  pattern: ^[a-z][a-z0-9-]*(\.[a-z0-9]+([.-][a-z0-9]+)*)+$
                title:
                  type: string
                  minLength: 1
                  maxLength: 120
                trusted:
                  type: boolean
              required:
                - slot
                - title
              additionalProperties: false
      responses:
        '201':
          description: The view.
          content:
            application/json:
              schema:
                type: object
                properties:
                  warnings:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - slot_version_deprecated
                        message:
                          type: string
                        sunsetAt:
                          type: string
                          nullable: true
                        replacedBy:
                          type: number
                          nullable: true
                      required:
                        - code
                        - message
                        - sunsetAt
                        - replacedBy
                  id:
                    type: string
                    format: uuid
                  slot:
                    type: string
                  title:
                    type: string
                  authorUserId:
                    type: string
                  trusted:
                    type: boolean
                  createdAt:
                    type: string
                  liveVersion:
                    type: number
                    nullable: true
                  liveMeta:
                    nullable: true
                  publishedAt:
                    type: string
                    nullable: true
                  versions:
                    type: number
                required:
                  - id
                  - slot
                  - title
                  - authorUserId
                  - trusted
                  - createdAt
                  - liveVersion
                  - publishedAt
                  - versions
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        location:
                          type: string
                          enum:
                            - body
                        path:
                          type: array
                          items:
                            type: string
                        code:
                          type: string
                          enum:
                            - invalid_value
                        message:
                          type: string
                      required:
                        - location
                        - path
                        - code
                        - message
                required:
                  - error
                  - code
        '403':
          description: >-
            The caller may not do this, or UI Modules are off for the
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        location:
                          type: string
                          enum:
                            - body
                        path:
                          type: array
                          items:
                            type: string
                        code:
                          type: string
                          enum:
                            - invalid_value
                        message:
                          type: string
                      required:
                        - location
                        - path
                        - code
                        - message
                required:
                  - error
                  - code
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        location:
                          type: string
                          enum:
                            - body
                        path:
                          type: array
                          items:
                            type: string
                        code:
                          type: string
                          enum:
                            - invalid_value
                        message:
                          type: string
                      required:
                        - location
                        - path
                        - code
                        - message
                required:
                  - error
                  - code
        '409':
          description: The key was used for another request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        location:
                          type: string
                          enum:
                            - body
                        path:
                          type: array
                          items:
                            type: string
                        code:
                          type: string
                          enum:
                            - invalid_value
                        message:
                          type: string
                      required:
                        - location
                        - path
                        - code
                        - message
                required:
                  - error
                  - code
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.