Skip to main content
POST
/
projects
/
{project_id}
/
resources
/
apply
Apply Resource
curl --request POST \
  --url https://api.example.com/projects/{project_id}/resources/apply \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "<string>",
  "resource": "<string>",
  "name": "<string>",
  "project_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "config": {},
  "resolved_config": {},
  "dependencies": [],
  "owner_references": [],
  "outputs": {},
  "error": "<string>",
  "lifecycle_state": "draft",
  "health": "healthy",
  "health_message": "<string>",
  "pending_event_id": "<string>",
  "pending_event_type": "<string>",
  "provisioned": false,
  "reconcile_count": 0,
  "version": 0,
  "tags": [
    "<string>"
  ],
  "provider_version": "<string>"
}
'
import requests

url = "https://api.example.com/projects/{project_id}/resources/apply"

payload = {
    "provider": "<string>",
    "resource": "<string>",
    "name": "<string>",
    "project_id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "config": {},
    "resolved_config": {},
    "dependencies": [],
    "owner_references": [],
    "outputs": {},
    "error": "<string>",
    "lifecycle_state": "draft",
    "health": "healthy",
    "health_message": "<string>",
    "pending_event_id": "<string>",
    "pending_event_type": "<string>",
    "provisioned": False,
    "reconcile_count": 0,
    "version": 0,
    "tags": ["<string>"],
    "provider_version": "<string>"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    provider: '<string>',
    resource: '<string>',
    name: '<string>',
    project_id: '<string>',
    created_at: '2023-11-07T05:31:56Z',
    updated_at: '2023-11-07T05:31:56Z',
    config: {},
    resolved_config: {},
    dependencies: [],
    owner_references: [],
    outputs: {},
    error: '<string>',
    lifecycle_state: 'draft',
    health: 'healthy',
    health_message: '<string>',
    pending_event_id: '<string>',
    pending_event_type: '<string>',
    provisioned: false,
    reconcile_count: 0,
    version: 0,
    tags: ['<string>'],
    provider_version: '<string>'
  })
};

fetch('https://api.example.com/projects/{project_id}/resources/apply', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.example.com/projects/{project_id}/resources/apply",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'provider' => '<string>',
    'resource' => '<string>',
    'name' => '<string>',
    'project_id' => '<string>',
    'created_at' => '2023-11-07T05:31:56Z',
    'updated_at' => '2023-11-07T05:31:56Z',
    'config' => [
        
    ],
    'resolved_config' => [
        
    ],
    'dependencies' => [
        
    ],
    'owner_references' => [
        
    ],
    'outputs' => [
        
    ],
    'error' => '<string>',
    'lifecycle_state' => 'draft',
    'health' => 'healthy',
    'health_message' => '<string>',
    'pending_event_id' => '<string>',
    'pending_event_type' => '<string>',
    'provisioned' => false,
    'reconcile_count' => 0,
    'version' => 0,
    'tags' => [
        '<string>'
    ],
    'provider_version' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/projects/{project_id}/resources/apply"

	payload := strings.NewReader("{\n  \"provider\": \"<string>\",\n  \"resource\": \"<string>\",\n  \"name\": \"<string>\",\n  \"project_id\": \"<string>\",\n  \"created_at\": \"2023-11-07T05:31:56Z\",\n  \"updated_at\": \"2023-11-07T05:31:56Z\",\n  \"config\": {},\n  \"resolved_config\": {},\n  \"dependencies\": [],\n  \"owner_references\": [],\n  \"outputs\": {},\n  \"error\": \"<string>\",\n  \"lifecycle_state\": \"draft\",\n  \"health\": \"healthy\",\n  \"health_message\": \"<string>\",\n  \"pending_event_id\": \"<string>\",\n  \"pending_event_type\": \"<string>\",\n  \"provisioned\": false,\n  \"reconcile_count\": 0,\n  \"version\": 0,\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"provider_version\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/projects/{project_id}/resources/apply")
  .header("Content-Type", "application/json")
  .body("{\n  \"provider\": \"<string>\",\n  \"resource\": \"<string>\",\n  \"name\": \"<string>\",\n  \"project_id\": \"<string>\",\n  \"created_at\": \"2023-11-07T05:31:56Z\",\n  \"updated_at\": \"2023-11-07T05:31:56Z\",\n  \"config\": {},\n  \"resolved_config\": {},\n  \"dependencies\": [],\n  \"owner_references\": [],\n  \"outputs\": {},\n  \"error\": \"<string>\",\n  \"lifecycle_state\": \"draft\",\n  \"health\": \"healthy\",\n  \"health_message\": \"<string>\",\n  \"pending_event_id\": \"<string>\",\n  \"pending_event_type\": \"<string>\",\n  \"provisioned\": false,\n  \"reconcile_count\": 0,\n  \"version\": 0,\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"provider_version\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/projects/{project_id}/resources/apply")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"provider\": \"<string>\",\n  \"resource\": \"<string>\",\n  \"name\": \"<string>\",\n  \"project_id\": \"<string>\",\n  \"created_at\": \"2023-11-07T05:31:56Z\",\n  \"updated_at\": \"2023-11-07T05:31:56Z\",\n  \"config\": {},\n  \"resolved_config\": {},\n  \"dependencies\": [],\n  \"owner_references\": [],\n  \"outputs\": {},\n  \"error\": \"<string>\",\n  \"lifecycle_state\": \"draft\",\n  \"health\": \"healthy\",\n  \"health_message\": \"<string>\",\n  \"pending_event_id\": \"<string>\",\n  \"pending_event_type\": \"<string>\",\n  \"provisioned\": false,\n  \"reconcile_count\": 0,\n  \"version\": 0,\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"provider_version\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "provider": "<string>",
  "resource": "<string>",
  "name": "<string>",
  "project_id": "<string>",
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "config": {},
  "resolved_config": {},
  "dependencies": [],
  "owner_references": [],
  "outputs": {},
  "error": "<string>",
  "lifecycle_state": "draft",
  "health": "healthy",
  "health_message": "<string>",
  "pending_event_id": "<string>",
  "pending_event_type": "<string>",
  "provisioned": false,
  "reconcile_count": 0,
  "version": 0,
  "tags": [
    "<string>"
  ],
  "provider_version": "<string>"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Path Parameters

project_id
string
required

Query Parameters

reveal
boolean
default:false

Reveal sensitive field values

Body

application/json

Domain model for resources with provider/resource identity and 5-state lifecycle.

Identity fields (frozen - immutable after creation): provider: Provider that manages this resource type. resource: Resource type name. name: Unique resource instance name.

Configuration fields (mutable): config: Original user-submitted resource configuration. Contains raw field references and dependency markers as submitted by the user. resolved_config: Resolved configuration with field references and dependency markers expanded. Contains field_ref markers with resolved_value and dependency markers with ref data. Set when transitioning to PENDING state. None when resource is in DRAFT state or not yet resolved. dependencies: References to resources this resource depends on. owner_references: References to resources that own this resource for lifecycle coordination and cascading deletes.

Output fields (provider-managed): outputs: Resource outputs from provider processing. error: Error message when resource is in FAILED state.

Lifecycle fields (system-managed): lifecycle_state: Current state (DRAFT/PENDING/PROCESSING/READY/FAILED). pending_event_id: Event ID currently being processed (set on PROCESSING, cleared on READY/FAILED). Used for response idempotency validation. provisioned: Whether the resource was successfully created at least once. Used to distinguish failed creates (retry CREATE) from failed updates (retry UPDATE).

Versioning fields (system-managed): provider_version: Semver of the provider version that last processed this resource. Set automatically when the resource transitions to PENDING. None for platform resources or pre-versioning backfill.

Ownership fields (system-managed): managed_by: Ownership discriminator. user for resources the caller owns and controls, platform for platform-managed resources (platform agents, tier resources, platform-default LLM provider) that reject user writes. None is the legacy unmanaged default for backfilled records.

Categorization fields (mutable): tags: Optional list of tags for categorization and filtering.

Inherited from PragmaModel: created_at: Creation timestamp (frozen). updated_at: Last update timestamp (mutable).

provider
string
required
resource
string
required
name
string
required
project_id
string
required
created_at
string<date-time>
updated_at
string<date-time>
config
Config · object
resolved_config
Resolved Config · object | null
dependencies
ResourceReference · object[]
owner_references
OwnerReference · object[]
outputs
Outputs · object
error
string | null
lifecycle_state
enum<string>
default:draft

Lifecycle states for resources.

Available options:
draft,
waiting,
pending,
processing,
ready,
failed,
deleting
health
enum<string>
default:healthy
Available options:
healthy,
degraded
health_message
string | null
pending_event_id
string | null
pending_event_type
string | null
provisioned
boolean
default:false
reconcile_count
integer
default:0
version
integer
default:0
tags
string[] | null
provider_version
string | null
managed_by
enum<string> | null
Available options:
user,
platform

Response

Successful Response

Domain model for resources with provider/resource identity and 5-state lifecycle.

Identity fields (frozen - immutable after creation): provider: Provider that manages this resource type. resource: Resource type name. name: Unique resource instance name.

Configuration fields (mutable): config: Original user-submitted resource configuration. Contains raw field references and dependency markers as submitted by the user. resolved_config: Resolved configuration with field references and dependency markers expanded. Contains field_ref markers with resolved_value and dependency markers with ref data. Set when transitioning to PENDING state. None when resource is in DRAFT state or not yet resolved. dependencies: References to resources this resource depends on. owner_references: References to resources that own this resource for lifecycle coordination and cascading deletes.

Output fields (provider-managed): outputs: Resource outputs from provider processing. error: Error message when resource is in FAILED state.

Lifecycle fields (system-managed): lifecycle_state: Current state (DRAFT/PENDING/PROCESSING/READY/FAILED). pending_event_id: Event ID currently being processed (set on PROCESSING, cleared on READY/FAILED). Used for response idempotency validation. provisioned: Whether the resource was successfully created at least once. Used to distinguish failed creates (retry CREATE) from failed updates (retry UPDATE).

Versioning fields (system-managed): provider_version: Semver of the provider version that last processed this resource. Set automatically when the resource transitions to PENDING. None for platform resources or pre-versioning backfill.

Ownership fields (system-managed): managed_by: Ownership discriminator. user for resources the caller owns and controls, platform for platform-managed resources (platform agents, tier resources, platform-default LLM provider) that reject user writes. None is the legacy unmanaged default for backfilled records.

Categorization fields (mutable): tags: Optional list of tags for categorization and filtering.

Inherited from PragmaModel: created_at: Creation timestamp (frozen). updated_at: Last update timestamp (mutable).

provider
string
required
resource
string
required
name
string
required
project_id
string
required
id
string
required
read-only

External resource ID for API responses: provider/resource/name.

created_at
string<date-time>
updated_at
string<date-time>
config
Config · object
resolved_config
Resolved Config · object | null
dependencies
ResourceReference · object[]
owner_references
OwnerReference · object[]
outputs
Outputs · object
error
string | null
lifecycle_state
enum<string>
default:draft

Lifecycle states for resources.

Available options:
draft,
waiting,
pending,
processing,
ready,
failed,
deleting
health
enum<string>
default:healthy
Available options:
healthy,
degraded
health_message
string | null
pending_event_id
string | null
pending_event_type
string | null
provisioned
boolean
default:false
reconcile_count
integer
default:0
version
integer
default:0
tags
string[] | null
provider_version
string | null
managed_by
enum<string> | null
Available options:
user,
platform