---
title: "Apply (create or update) a resource"
method: POST
path: "/api/orgs/{org}/resources"
tags: ["Resources"]
---

# Apply (create or update) a resource

`POST /api/orgs/{org}/resources`

Creates or updates a Kubernetes resource in the organization's namespace.
The org context is automatically injected into metadata and spec.

## Path parameters

- `org` string, required

## Request body

- KradleResource — A Kradle (Kubernetes-style) resource object
  - `apiVersion` string, required
  - `kind` string, required — Resource kind (e.g. Repository, AgentStack)
  - `metadata` object, required
    - `name` string, required
    - `namespace` string
    - `labels` object
    - `annotations` object
    - `creationTimestamp` string, date-time
  - `spec` object — Resource spec (kind-specific fields)
  - `status` object — Resource status (set by controller)

## Response `201`

Resource applied

- ApplyResult
  - `resource` KradleResource — A Kradle (Kubernetes-style) resource object
    - `apiVersion` string, required
    - `kind` string, required — Resource kind (e.g. Repository, AgentStack)
    - `metadata` object, required
      - `name` string, required
      - `namespace` string
      - `labels` object
      - `annotations` object
      - `creationTimestamp` string, date-time
    - `spec` object — Resource spec (kind-specific fields)
    - `status` object — Resource status (set by controller)
  - `created` boolean — True if created, false if updated
  - `name` string — Resource name

## Other responses

- `400` — Bad request — invalid input or malformed JSON
- `500` — Internal server error

---

[API](https://skmtc.dev/a5c-ai/apis/kradle-api.md) · [All operations](https://skmtc.dev/a5c-ai/apis/kradle-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/a5c-ai/kradle-api/revisions/b5eadb2ecd8b/schema)
