> ## Documentation Index
> Fetch the complete documentation index at: https://cantonfoundation-generated-reference-full-stack-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v0/amulet-rules

> Amulet rules

<div class="x2mdx-ref-page x2mdx-ref-page--operation x2mdx-ref-page--manual-api" />

<div class="x2mdx-ref-hero">
  <p class="x2mdx-ref-summary">Amulet rules</p>

  <div class="x2mdx-ref-badges">
    <span class="x2mdx-ref-badge x2mdx-ref-badge--protocol">OpenAPI</span>

    <a class="x2mdx-ref-badge x2mdx-ref-badge--added" href="#history-added-0-5-10">Present since at least 0.5.10</a>
  </div>
</div>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl --request POST \
    --url 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/amulet-rules' \
    --header 'Content-Type: application/json' \
    --data '{
    "cached_amulet_rules_contract_id": "<string>",
    "cached_amulet_rules_domain_id": "<string>"
  }'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import json
  import requests

  url = "https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/amulet-rules"
  headers = {'Content-Type': 'application/json'}
  payload = json.loads(r'''{
    "cached_amulet_rules_contract_id": "<string>",
    "cached_amulet_rules_domain_id": "<string>"
  }''')
  response = requests.request(
      "POST", url, headers=headers, json=payload
  )

  print(response.text)
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/amulet-rules', {
    method: 'POST',
    headers: {
    "Content-Type": "application/json"
  },
    body: JSON.stringify({
    "cached_amulet_rules_contract_id": "<string>",
    "cached_amulet_rules_domain_id": "<string>"
  }),
  });

  console.log(await response.text());
  ```

  ```php PHP theme={"theme":{"light":"github-light","dark":"github-dark"}}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
      CURLOPT_URL => 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/amulet-rules',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_POSTFIELDS => <<<'JSON'
  {
    "cached_amulet_rules_contract_id": "<string>",
    "cached_amulet_rules_domain_id": "<string>"
  }
  JSON,
      CURLOPT_HTTPHEADER => [
          "Content-Type: application/json"
      ],
  ]);

  $response = curl_exec($curl);
  echo $response;
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"}}
  package main

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

  func main() {
    req, _ := http.NewRequest("POST", "https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/amulet-rules", bytes.NewBufferString(`{
    "cached_amulet_rules_contract_id": "<string>",
    "cached_amulet_rules_domain_id": "<string>"
  }`))
    req.Header.Set("Content-Type", "application/json")
    response, _ := http.DefaultClient.Do(req)
    defer response.Body.Close()
    body, _ := io.ReadAll(response.Body)
    fmt.Println(string(body))
  }
  ```

  ```java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  var request = HttpRequest.newBuilder()
      .uri(URI.create("https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/amulet-rules"))
      .header("Content-Type", "application/json")
      .method("POST", HttpRequest.BodyPublishers.ofString("""
  {
    "cached_amulet_rules_contract_id": "<string>",
    "cached_amulet_rules_domain_id": "<string>"
  }
  """))
      .build();
  var response = HttpClient.newHttpClient().send(
      request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```ruby Ruby theme={"theme":{"light":"github-light","dark":"github-dark"}}
  require 'net/http'
  require 'uri'

  uri = URI('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/amulet-rules')
  request = Net::HTTP::Post.new(uri)
  request['Content-Type'] = 'application/json'
  request.body = <<~JSON
  {
    "cached_amulet_rules_contract_id": "<string>",
    "cached_amulet_rules_domain_id": "<string>"
  }
  JSON
  response = Net::HTTP.start(uri.hostname, uri.port) do |http|
    http.request(request)
  end
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "amulet_rules_update": {
      "contract": {
        "template_id": "<string>",
        "contract_id": "<string>",
        "payload": {},
        "created_event_blob": "<string>",
        "created_at": "<string>"
      },
      "domain_id": "<string>"
    }
  }
  ```
</ResponseExample>

## Body

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ParamField body="cached_amulet_rules_contract_id" type="object">
  OpenAPI type: <code>ContractId</code>.
</ParamField>

<ParamField body="cached_amulet_rules_domain_id" type="string" />

## Responses

### 200

ok

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="amulet_rules_update" type="MaybeCachedContractWithState" required>
  <Expandable title="child attributes">
    <ResponseField name="contract" type="Contract">
      <Expandable title="child attributes">
        <ResponseField name="template_id" type="string" required />

        <ResponseField name="contract_id" type="string" required />

        <ResponseField name="payload" type="object" required />

        <ResponseField name="created_event_blob" type="string" required />

        <ResponseField name="created_at" type="string" required />
      </Expandable>
    </ResponseField>

    <ResponseField name="domain_id" type="string" />
  </Expandable>
</ResponseField>

## History

<div class="x2mdx-ref-history" aria-label="Reference history">
  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--introduced" id="history-added-0-5-10">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Present since at least</span>
      <code class="x2mdx-ref-history-event-version">0.5.10</code>
    </div>
  </div>
</div>
