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

# Create resource



## OpenAPI

````yaml /openapi/forge-api.yaml post /api/headless/v1/organizations/{organizationId}/resources
openapi: 3.0.3
info:
  title: Forge API
  version: 0.1.0
  description: >-
    Automate Forge inventory, investigations, findings, governance, fleet,
    policy, configuration, compliance, MCP, service-account, and audit
    workflows.
servers:
  - url: https://api.forge.ai
    description: Forge production API
security:
  - serviceAccountBearer: []
tags:
  - name: approvals
    description: MCP approvals
  - name: audit
    description: Audit
  - name: capabilities
    description: Capabilities
  - name: compliance
    description: Compliance
  - name: findings
    description: Findings
  - name: fleet
    description: Fleet
  - name: governance
    description: Governance
  - name: inventory
    description: Inventory
  - name: investigation
    description: Investigations
  - name: managed-config
    description: Managed configuration
  - name: mcp
    description: MCP sessions
  - name: mcp-registry
    description: MCP and skill registry
  - name: operations
    description: operations
  - name: policies
    description: Policies and violations
  - name: resources
    description: Resources
  - name: service-accounts
    description: Service accounts
  - name: settings
    description: Automation settings
paths:
  /api/headless/v1/organizations/{organizationId}/resources:
    post:
      tags:
        - resources
      summary: Create resource
      operationId: createHeadlessResource
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - $ref: '#/components/parameters/ForgeReason'
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/ForgeConfirm'
        - $ref: '#/components/parameters/ForgeTerraformManager'
        - $ref: '#/components/parameters/ForgeTerraformInstance'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourcePutRequest'
      responses:
        '201':
          description: Resource created under the requesting automation manager.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
components:
  parameters:
    OrganizationId:
      name: organizationId
      in: path
      required: true
      schema:
        type: string
    ForgeReason:
      name: X-Forge-Reason
      in: header
      required: true
      schema:
        type: string
        minLength: 1
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 1
    ForgeConfirm:
      name: X-Forge-Confirm
      in: header
      required: true
      schema:
        type: boolean
        enum:
          - true
    ForgeTerraformManager:
      name: X-Forge-Terraform-Manager
      in: header
      required: true
      schema:
        type: string
        minLength: 1
    ForgeTerraformInstance:
      name: X-Forge-Terraform-Instance
      in: header
      required: true
      schema:
        type: string
        minLength: 1
  schemas:
    ResourcePutRequest:
      type: object
      additionalProperties: false
      required:
        - name
        - protocol
        - upstreamHost
        - upstreamPort
        - transparentRouting
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
        protocol:
          $ref: '#/components/schemas/ResourceProtocol'
        upstreamHost:
          type: string
          minLength: 3
          maxLength: 253
        upstreamPort:
          type: integer
          minimum: 1
          maximum: 65535
        upstreamTls:
          type: boolean
          default: true
        upstreamCaPem:
          type: string
          maxLength: 65536
          description: >-
            Optional public CA certificate PEM used to verify this Resource
            instead of system trust roots.
        enabled:
          type: boolean
          default: true
        transparentRouting:
          type: boolean
        gatewayId:
          type: string
    Resource:
      type: object
      required:
        - id
        - organizationId
        - name
        - protocol
        - upstreamHost
        - upstreamPort
        - upstreamTls
        - enabled
        - transparentRouting
        - managementMode
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        organizationId:
          type: string
        name:
          type: string
        protocol:
          $ref: '#/components/schemas/ResourceProtocol'
        upstreamHost:
          type: string
        upstreamPort:
          type: integer
          minimum: 1
          maximum: 65535
        upstreamTls:
          type: boolean
        upstreamCaPem:
          type: string
          maxLength: 65536
        enabled:
          type: boolean
        transparentRouting:
          type: boolean
        gatewayId:
          type: string
        accessName:
          type: string
          readOnly: true
          minLength: 1
          maxLength: 63
        managementMode:
          type: string
          enum:
            - forge
            - terraform
        managerId:
          type: string
        managerInstance:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ResourceProtocol:
      type: string
      enum:
        - postgres
        - mysql
        - redis
        - http
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  responses:
    Error:
      description: Stable Forge error envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
  securitySchemes:
    serviceAccountBearer:
      type: http
      scheme: bearer
      bearerFormat: Forge service-account or delegated OAuth access token
      description: >-
        Enter a Forge service-account token or delegated OAuth access token.
        Mintlify adds the Bearer prefix.

````

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