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

# Add a resource

Adds a git or local resource to the current config.


## OpenAPI

````yaml /api-reference/openapi.local.json POST /config/resources
openapi: 3.1.0
info:
  title: btca Local Server API
  version: 2.0.0
  description: Local HTTP API exposed by btca-server.
servers:
  - url: http://localhost:{port}
    variables:
      port:
        default: '8080'
security: []
paths:
  /config/resources:
    post:
      summary: Add a resource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceCreate'
      responses:
        '200':
          description: Created resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ResourceCreate:
      oneOf:
        - $ref: '#/components/schemas/GitResource'
        - $ref: '#/components/schemas/LocalResource'
        - $ref: '#/components/schemas/NpmResource'
    Resource:
      oneOf:
        - $ref: '#/components/schemas/GitResource'
        - $ref: '#/components/schemas/LocalResource'
        - $ref: '#/components/schemas/NpmResource'
    ErrorResponse:
      type: object
      required:
        - error
        - tag
      properties:
        error:
          type: string
        tag:
          type: string
        hint:
          type: string
    GitResource:
      type: object
      required:
        - type
        - name
        - url
        - branch
      properties:
        type:
          const: git
        name:
          type: string
        url:
          type: string
        branch:
          type: string
        searchPath:
          type:
            - string
            - 'null'
        searchPaths:
          type:
            - array
            - 'null'
          items:
            type: string
        specialNotes:
          type:
            - string
            - 'null'
    LocalResource:
      type: object
      required:
        - type
        - name
        - path
      properties:
        type:
          const: local
        name:
          type: string
        path:
          type: string
        specialNotes:
          type:
            - string
            - 'null'
    NpmResource:
      type: object
      required:
        - type
        - name
        - package
      properties:
        type:
          const: npm
        name:
          type: string
        package:
          type: string
        version:
          type:
            - string
            - 'null'
        specialNotes:
          type:
            - string
            - 'null'

````