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

# Publish view version

> Publish a View's draft as a new version.

**Operation ID:** `http.views.versions.publish`

```http theme={null}
POST /v1/orgs/{org}/projects/{project}/context/slices/{id}/versions
```


## OpenAPI

````yaml openapi.json POST /v1/orgs/{org}/projects/{project}/context/slices/{id}/versions
openapi: 3.1.0
info:
  title: Penumbra API
  version: v1
  description: >-
    HTTP reference for Files, search, extraction, reviews, Graph, Shapes and
    sharing.
servers:
  - url: https://api.pnbr.io
    description: Penumbra API
security: []
paths:
  /v1/orgs/{org}/projects/{project}/context/slices/{id}/versions:
    post:
      tags:
        - Views
      summary: Publish view version
      description: |-
        Publish a View's draft as a new version.

        Product guidance: [View](/concepts/view), [Context](/concepts/context).
      operationId: http.views.versions.publish
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: project
          in: path
          required: true
          schema:
            type: string
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            1–200 printable ASCII characters, no surrounding spaces; '.' and
            '..' are reserved. Reuse this key with the same request when
            retrying an uncertain outcome.
          schema:
            type: string
            minLength: 1
            maxLength: 200
            pattern: ^(?!\.{1,2}$)[!-~](?:[ -~]*[!-~])?$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/http_views_versions_publish_request'
      responses:
        2XX:
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http_views_versions_publish_response'
      security:
        - bearerAuth: []
components:
  schemas:
    http_views_versions_publish_request:
      type: object
      properties:
        expected_revision:
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        expected_compile_fingerprint:
          type: string
          pattern: ^sha256:[0-9a-f]{64}$
      required:
        - expected_revision
        - expected_compile_fingerprint
      additionalProperties: false
    http_views_versions_publish_response:
      anyOf:
        - type: object
          properties:
            data:
              type: object
              properties:
                schema:
                  type: string
                  const: penumbra.context-slice-version
                version:
                  type: number
                  const: 1
                id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                project_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                slice_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                version_number:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                source_draft_revision:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                definition:
                  type: object
                  properties:
                    purpose:
                      type: string
                      minLength: 1
                      maxLength: 1024
                    scope:
                      default:
                        files:
                          file_ids: []
                          collection_ids: []
                        graph:
                          node_ids: []
                          entity_type_ids: []
                          relationship_type_ids: []
                        shape_ids: []
                      type: object
                      properties:
                        files:
                          default:
                            file_ids: []
                            collection_ids: []
                          type: object
                          properties:
                            file_ids:
                              default: []
                              maxItems: 100
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            collection_ids:
                              default: []
                              maxItems: 100
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          required:
                            - file_ids
                            - collection_ids
                          additionalProperties: false
                        graph:
                          default:
                            node_ids: []
                            entity_type_ids: []
                            relationship_type_ids: []
                          type: object
                          properties:
                            node_ids:
                              default: []
                              maxItems: 100
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            entity_type_ids:
                              default: []
                              maxItems: 100
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            relationship_type_ids:
                              default: []
                              maxItems: 100
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          required:
                            - node_ids
                            - entity_type_ids
                            - relationship_type_ids
                          additionalProperties: false
                        shape_ids:
                          default: []
                          maxItems: 32
                          type: array
                          items:
                            type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      required:
                        - files
                        - graph
                        - shape_ids
                      additionalProperties: false
                  required:
                    - purpose
                    - scope
                  additionalProperties: false
                compiled:
                  type: object
                  properties:
                    schema:
                      type: string
                      const: penumbra.project-context-compiled
                    version:
                      type: number
                      const: 1
                    compiler_version:
                      type: string
                      const: mesh-context-compiler/1
                    fingerprint:
                      type: string
                      pattern: ^sha256:[0-9a-f]{64}$
                    project_id:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    purpose:
                      type: string
                    definition:
                      type: object
                      properties:
                        scope:
                          default:
                            files:
                              file_ids: []
                              collection_ids: []
                            graph:
                              node_ids: []
                              entity_type_ids: []
                              relationship_type_ids: []
                            shape_ids: []
                          type: object
                          properties:
                            files:
                              default:
                                file_ids: []
                                collection_ids: []
                              type: object
                              properties:
                                file_ids:
                                  default: []
                                  maxItems: 100
                                  type: array
                                  items:
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                collection_ids:
                                  default: []
                                  maxItems: 100
                                  type: array
                                  items:
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                              required:
                                - file_ids
                                - collection_ids
                              additionalProperties: false
                            graph:
                              default:
                                node_ids: []
                                entity_type_ids: []
                                relationship_type_ids: []
                              type: object
                              properties:
                                node_ids:
                                  default: []
                                  maxItems: 100
                                  type: array
                                  items:
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                entity_type_ids:
                                  default: []
                                  maxItems: 100
                                  type: array
                                  items:
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                                relationship_type_ids:
                                  default: []
                                  maxItems: 100
                                  type: array
                                  items:
                                    type: string
                                    format: uuid
                                    pattern: >-
                                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                              required:
                                - node_ids
                                - entity_type_ids
                                - relationship_type_ids
                              additionalProperties: false
                            shape_ids:
                              default: []
                              maxItems: 32
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          required:
                            - files
                            - graph
                            - shape_ids
                          additionalProperties: false
                      required:
                        - scope
                      additionalProperties: false
                    dependencies:
                      type: object
                      properties:
                        ontology_revision:
                          type: string
                          pattern: ^sha256:[0-9a-f]{64}$
                        shape_artifacts:
                          type: array
                          items:
                            type: object
                            properties:
                              shape_id:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                              artifact_digest:
                                type: string
                                pattern: ^sha256:[0-9a-f]{64}$
                            required:
                              - shape_id
                              - artifact_digest
                            additionalProperties: false
                        bridge_set_digest:
                          type: string
                          pattern: ^sha256:[0-9a-f]{64}$
                      required:
                        - ontology_revision
                        - shape_artifacts
                        - bridge_set_digest
                      additionalProperties: false
                    resolved_scope:
                      type: object
                      properties:
                        files:
                          type: object
                          properties:
                            file_ids:
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            collection_ids:
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          required:
                            - file_ids
                            - collection_ids
                          additionalProperties: false
                        graph:
                          type: object
                          properties:
                            node_ids:
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            shape_ids:
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            entity_type_ids:
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            entity_type_names:
                              type: array
                              items:
                                type: string
                            relationship_type_ids:
                              type: array
                              items:
                                type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            relationship_type_names:
                              type: array
                              items:
                                type: string
                            search_relationships:
                              type: boolean
                          required:
                            - node_ids
                            - shape_ids
                            - entity_type_ids
                            - entity_type_names
                            - relationship_type_ids
                            - relationship_type_names
                            - search_relationships
                          additionalProperties: false
                      required:
                        - files
                        - graph
                      additionalProperties: false
                    warnings:
                      type: array
                      items:
                        type: object
                        properties:
                          code:
                            type: string
                          catalog:
                            type: string
                            enum:
                              - files
                              - graph
                              - context
                          detail:
                            type: string
                        required:
                          - code
                          - catalog
                          - detail
                        additionalProperties: false
                  required:
                    - schema
                    - version
                    - compiler_version
                    - fingerprint
                    - project_id
                    - purpose
                    - definition
                    - dependencies
                    - resolved_scope
                    - warnings
                  additionalProperties: false
                definition_hash:
                  type: string
                  pattern: ^sha256:[0-9a-f]{64}$
                resolved_hash:
                  type: string
                  pattern: ^sha256:[0-9a-f]{64}$
                compiler_version:
                  type: string
                  minLength: 1
                  maxLength: 128
                previous_version_id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                published_by_subject_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                published_by_credential_id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                published_at:
                  type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                replayed:
                  type: boolean
              required:
                - schema
                - version
                - id
                - project_id
                - slice_id
                - version_number
                - source_draft_revision
                - definition
                - compiled
                - definition_hash
                - resolved_hash
                - compiler_version
                - previous_version_id
                - published_by_subject_id
                - published_by_credential_id
                - published_at
              additionalProperties: false
          required:
            - data
          additionalProperties: false
        - type: object
          properties:
            request_id:
              type: string
            outcome:
              type: string
              const: pending
            reason:
              type: string
            operation:
              type: object
              properties:
                id:
                  type: string
                request_id:
                  type: string
                status_url:
                  type: string
              required:
                - id
                - request_id
                - status_url
              additionalProperties: false
            approval:
              type: object
              properties:
                url:
                  type: string
                status:
                  type: string
                expires_at:
                  type: string
                effects:
                  type: array
                  items:
                    type: string
                next:
                  type: string
              required:
                - url
                - status
                - expires_at
                - effects
                - next
              additionalProperties: false
          required:
            - request_id
            - outcome
            - reason
            - operation
            - approval
          additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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