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

# Register an uploaded site file

> Step 3 of 3 for adding a file to a site: registers a file whose bytes have already been uploaded to the presigned URL from `POST /v1/site/{id}/file/upload-url`. The stored `size` and `contentType` are read back from storage rather than taken from this request. Returns `422` if the upload never completed, so retry the upload before retrying this call. Files registered through the API have no `uploadedBy`, because an API key is not a user. Returns `404` if the site does not exist or is not accessible to the partner. Requires the `siteFile:write` scope.



## OpenAPI

````yaml /openapi.yaml post /v1/site/{id}/file
openapi: 3.1.0
info:
  title: ProVision Public API
  version: 1.0.0
  description: >-
    Use the ProVision Public API to integrate with ProVision conversations,
    clients, users, and addresses. All endpoints accept and return JSON, are
    authenticated with an `x-api-key` header, and are scoped to a single partner
    tenant.
  contact:
    email: support@onevisionresources.com
    name: OneVision Resources Support
  license:
    name: Proprietary
servers:
  - url: https://connect.provisionapp.io
    description: Production
security: []
paths:
  /v1/site/{id}/file:
    post:
      tags:
        - site-file
      summary: Register an uploaded site file
      description: >-
        Step 3 of 3 for adding a file to a site: registers a file whose bytes
        have already been uploaded to the presigned URL from `POST
        /v1/site/{id}/file/upload-url`. The stored `size` and `contentType` are
        read back from storage rather than taken from this request. Returns
        `422` if the upload never completed, so retry the upload before retrying
        this call. Files registered through the API have no `uploadedBy`,
        because an API key is not a user. Returns `404` if the site does not
        exist or is not accessible to the partner. Requires the `siteFile:write`
        scope.
      operationId: createSiteFile
      parameters:
        - schema:
            $ref: '#/components/schemas/SiteId'
          required: true
          description: Site id the files belong to.
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSiteFilePayload'
      responses:
        '201':
          description: Registered site file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiteFile'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OpenApiKeyAuth: []
components:
  schemas:
    SiteId:
      type: string
      minLength: 1
      description: >-
        Site id. Newer ids are `ovaid-<uuid>`; legacy sites may have bare (e.g.
        numeric) ids.
      example: ovaid-2b6d4d8e-9f1a-4b2c-8d4e-5f6011223344
    CreateSiteFilePayload:
      type: object
      properties:
        fileKey:
          type: string
          format: uuid
        fileName:
          type: string
          minLength: 1
          maxLength: 255
        pinned:
          type: boolean
      required:
        - fileKey
        - fileName
      additionalProperties: false
    SiteFile:
      type: object
      properties:
        id:
          type: string
          format: uuid
        fileName:
          type: string
        contentType:
          type: string
        size:
          type: integer
        uploadedBy:
          type:
            - string
            - 'null'
        pinnedAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - fileName
        - contentType
        - size
        - uploadedBy
        - pinnedAt
        - createdAt
        - updatedAt
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    ApiError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: NOT_FOUND
        message:
          type: string
          description: Human-readable error description
      required:
        - code
        - message
  securitySchemes:
    OpenApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Send the API key in the x-api-key header.

````

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