  /api/v1/projects:
    get:
      tags:
        - projects
      summary: "List projects"
      description: "Lists projects"
      operationId: getProjects
      x-codeSamples:
      - lang: php
        label: php
        source: |
          $ninja = new InvoiceNinja("YOUR-TOKEN");
          $projects = $ninja->projects->all([
              'per_page' => 10,
              'page' => 1
          ]);
      - lang: curl
        label: curl
        source: |
          curl -X GET https://demo.invoiceninja.com/api/v1/projects \
            -H "X-API-TOKEN: YOUR-TOKEN" \
            -H "X-Requested-With: XMLHttpRequest"
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
        - $ref: "#/components/parameters/index"
        - $ref: "#/components/parameters/per_page_meta"
        - $ref: "#/components/parameters/page_meta"
      responses:
        200:
          description: "A list of projects"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:  
                type: object
                properties:
                  data: 
                    type: array
                    items:
                      $ref: '#/components/schemas/Project'
                  meta:
                    type: object
                    $ref: '#/components/schemas/Meta'
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
    post:
      tags:
        - projects
      summary: "Create project"
      description: "Adds an project to a company"
      operationId: storeProject
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
      requestBody:
        description: Project object that needs to be added to the company
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectRequest'
      x-codeSamples:
      - lang: php
        label: php
        source: |
          $ninja = new InvoiceNinja("YOUR-TOKEN");
          
          $project = $ninja->projects->create([
              'name' => 'Website Redesign Project',
              'client_id' => 'D2J234DFA',
              'description' => 'Complete redesign of company website',
              'budgeted_hours' => 120.5,
              'task_rate' => 75.00,
              'due_date' => '2024-03-31',
              'color' => '#FF5733'
          ]);
      - lang: curl
        label: curl
        source: |
          curl -X POST https://demo.invoiceninja.com/api/v1/projects \
            -H "X-API-TOKEN: YOUR-TOKEN" \
            -H "Content-Type: application/json" \
            -H "X-Requested-With: XMLHttpRequest" \
            -d '{
              "name": "Website Redesign Project",
              "client_id": "D2J234DFA",
              "description": "Complete redesign of company website",
              "budgeted_hours": 120.5,
              "task_rate": 75.00,
              "due_date": "2024-03-31",
              "color": "#FF5733"
            }'
      responses:
        200:
          description: "Returns the saved project object"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
  "/api/v1/projects/{id}":
    get:
      tags:
        - projects
      summary: "Show project"
      description: "Displays a project by id"
      operationId: showProject
      x-codeSamples:
      - lang: php
        label: php
        source: |
          $ninja = new InvoiceNinja("YOUR-TOKEN");
          $project = $ninja->projects->show("D2J234DFA");
      - lang: curl
        label: curl
        source: |
          curl -X GET https://demo.invoiceninja.com/api/v1/projects/D2J234DFA \
            -H "X-API-TOKEN: YOUR-TOKEN" \
            -H "X-Requested-With: XMLHttpRequest"
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
        - name: id
          in: path
          description: "The Project Hashed ID"
          required: true
          schema:
            type: string
            format: string
          example: D2J234DFA
      responses:
        200:
          description: "Returns the expense object"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
    put:
      tags:
        - projects
      summary: "Update project"
      description: "Handles the updating of a project by id"
      operationId: updateProject
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
        - name: id
          in: path
          description: "The Project Hashed ID"
          required: true
          schema:
            type: string
            format: string
          example: D2J234DFA
      requestBody:
        description: Project object that needs to be updated
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectRequest'
      x-codeSamples:
      - lang: php
        label: php
        source: |
          $ninja = new InvoiceNinja("YOUR-TOKEN");
          $project = $ninja->projects->update("D2J234DFA", [
              'name' => 'Updated Project Name',
              'description' => 'Updated project description',
              'budgeted_hours' => 150.0,
              'due_date' => '2024-04-30'
          ]);
      - lang: curl
        label: curl
        source: |
          curl -X PUT https://demo.invoiceninja.com/api/v1/projects/D2J234DFA \
            -H "X-API-TOKEN: YOUR-TOKEN" \
            -H "Content-Type: application/json" \
            -H "X-Requested-With: XMLHttpRequest" \
            -d '{
              "name": "Updated Project Name",
              "description": "Updated project description",
              "budgeted_hours": 150.0,
              "due_date": "2024-04-30"
            }'
      responses:
        200:
          description: "Returns the project object"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
    delete:
      tags:
        - projects
      summary: "Delete project"
      description: "Handles the deletion of a project by id"
      operationId: deleteProject
      x-codeSamples:
      - lang: php
        label: php
        source: |
          $ninja = new InvoiceNinja("YOUR-TOKEN");
          $ninja->projects->delete("D2J234DFA");
      - lang: curl
        label: curl
        source: |
          curl -X DELETE https://demo.invoiceninja.com/api/v1/projects/D2J234DFA \
            -H "X-API-TOKEN: YOUR-TOKEN" \
            -H "X-Requested-With: XMLHttpRequest"
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
        - name: id
          in: path
          description: "The Project Hashed ID"
          required: true
          schema:
            type: string
            format: string
          example: D2J234DFA
      responses:
        200:
          description: "Returns a HTTP status"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
  "/api/v1/projects/{id}/edit":
    get:
      tags:
        - projects
      summary: "Edit project"
      description: "Displays a project by id"
      operationId: editProject
      x-codeSamples:
      - lang: php
        label: php
        source: |
          $ninja = new InvoiceNinja("YOUR-TOKEN");
          $project = $ninja->projects->show("D2J234DFA");
      - lang: curl
        label: curl
        source: |
          curl -X GET https://demo.invoiceninja.com/api/v1/projects/D2J234DFA/edit \
            -H "X-API-TOKEN: YOUR-TOKEN" \
            -H "X-Requested-With: XMLHttpRequest"
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
        - name: id
          in: path
          description: "The Project Hashed ID"
          required: true
          schema:
            type: string
            format: string
          example: D2J234DFA
      responses:
        200:
          description: "Returns the project object"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
  /api/v1/projects/create:
    get:
      tags:
        - projects
      summary: "Blank project"
      description: "Returns a blank object with default values"
      operationId: getProjectsCreate
      x-codeSamples:
      - lang: php
        label: php
        source: |
          $ninja = new InvoiceNinja("YOUR-TOKEN");
          $project = $ninja->projects->model();
      - lang: curl
        label: curl
        source: |
          curl -X GET https://demo.invoiceninja.com/api/v1/projects/create \
            -H "X-API-TOKEN: YOUR-TOKEN" \
            -H "X-Requested-With: XMLHttpRequest"
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
      responses:
        200:
          description: "A blank project object"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
  /api/v1/projects/bulk:
    post:
      tags:
        - projects
      summary: "Bulk project actions"
      description: ""
      operationId: bulkProjects
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/index"
      requestBody:
        description: "User credentials"
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                description: "Array of hashed IDs to be bulk 'actioned"
                type: integer
                example: 0
      responses:
        200:
          description: "The Project User response"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"
  "/api/v1/projects/{id}/upload":
    post:
      tags:
        - projects
      summary: "Uploads a project document"
      description: "Handles the uploading of a document to a project"
      operationId: uploadProject
      parameters:
        - $ref: "#/components/parameters/X-API-TOKEN"
        - $ref: "#/components/parameters/X-Requested-With"
        - $ref: "#/components/parameters/include"
        - name: id
          in: path
          description: "The Project Hashed ID"
          required: true
          schema:
            type: string
            format: string
          example: D2J234DFA
      requestBody:
        description: "File Upload Body"
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                _method:
                  type: string
                  example: PUT
                documents:
                  type: array
                  items:
                    description: "Array of binary documents for upload"
                    type: string
                    format: binary
      responses:
        200:
          description: "Returns the Project object"
          headers:
            X-MINIMUM-CLIENT-VERSION:
              $ref: "#/components/headers/X-MINIMUM-CLIENT-VERSION"
            X-RateLimit-Remaining:
              $ref: "#/components/headers/X-RateLimit-Remaining"
            X-RateLimit-Limit:
              $ref: "#/components/headers/X-RateLimit-Limit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        401:
          $ref: "#/components/responses/401"
        403:
          $ref: "#/components/responses/403"
        422:
          $ref: '#/components/responses/422'
        429:
          $ref: '#/components/responses/429'
        5XX:
          description: 'Server error'
        default:
          $ref: "#/components/responses/default"