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

# Create Company Document

> This endpoint serves the purpose of creating a company document.

<Info>
  The request body should be sent as `application/json` with the file content as a binary string. All four fields (`name`, `file`, `type`, `file_name`) are required.
</Info>


## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json POST /company/documents
openapi: 3.0.0
info:
  title: Roosted
  version: 0.1.12
  contact:
    name: Support
    url: https://support.roostedhr.com/support/home
    email: support@roostedhr.com
  description: |-
    Enterprise API

    Sandbox keys and Production keys are requested from support
servers:
  - url: https://api.roostedhr.com/api/1_12
  - url: https://sandbox.roostedhr.com/api/1_12
security:
  - X-API-KEY: []
tags:
  - name: Announcements
  - name: Areas
  - name: Clients
  - name: Company
  - name: Configuration
  - name: Events
  - name: Locations
  - name: Payroll Groups
  - name: Rate Cards
  - name: Shifts
  - name: Skillsets
  - name: Time Tracking
  - name: Wage Rules
  - name: Workers
paths:
  /company/documents:
    post:
      tags:
        - Company
      summary: Create Company Document
      description: This endpoint serves the purpose of creating a company document.
      operationId: post-company-document
      requestBody:
        description: Company Document Body
        content:
          application/json:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: byte
                  description: Base64-encoded file content
                name:
                  type: string
                  description: Document name (optional, defaults to 'document.{extension}')
              required:
                - file
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyDocument'
              examples:
                Created Document:
                  value:
                    id: 123
                    name: Weekly Payroll
                    file_name: Weekly_Payroll_2023
                    location: >-
                      https://schedulehead-files.nyc3.digitaloceanspaces.com/Weekly_Payroll_2023.pdf
                    date_added: Dec 12th
                    type: application/pdf
                    deleted: 0
                    date_deleted: null
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                File is required:
                  value:
                    code: CMP-400
                    error: File is required
                Invalid base64 encoding:
                  value:
                    code: CMP-500
                    error: Invalid base64 encoding
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid API key:
                  value:
                    code: ATH-100
                    error: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Insufficient permissions:
                  value:
                    code: CMP-1000
                    error: Insufficient permissions to manage company settings
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Not found:
                  value:
                    code: CMP-800
                    error: Integration not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Unexpected error:
                  value:
                    code: CMP-1100
                    error: An unexpected error occurred
components:
  schemas:
    CompanyDocument:
      title: CompanyDocument
      type: object
      properties:
        id:
          type: integer
          description: Unique document identifier
        name:
          type: string
          description: Display name of the document
        file_name:
          type: string
          description: Original file name
        location:
          type: string
          description: URL to the stored document file
        date_added:
          type: string
          description: Date the document was uploaded
        type:
          type: string
          description: MIME type of the document (e.g. application/pdf, image/png)
        deleted:
          type: integer
          description: Soft-delete flag (0 = active, 1 = deleted)
        date_deleted:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the document was soft-deleted, or null if active
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: header

````