HYBRID-CHAINDEVELOPERS
DOCUMENTATIONv2
POST

Smart-contract lifecycle

Create launch

/api/v2/contracts
AUTHENTICATIONBearer token · contracts:writeAUTHORITATIVE OWNERcontract-authority-serviceCONTRACT AUTHORITYGenerated Rust OpenAPISTATUSSource ready · production listed

PURPOSE + BUSINESS CONTEXT

Create an immutable smart-contract launch intent from source, artifact, constructor, state, and runtime policy digests.

WHEN THIS CALL IS USEFUL

Call this when a contract author, authority reviewer, deployment operator, or contract-lifecycle agent needs to apply the documented launch transition after re-reading the current authoritative state so it can move a contract launch through draft, analysis, governance binding, freeze, evidence, and deployment preparation without collapsing those gates.

OUTCOME · Create or advance

What changes

Creates or advances only the launch resource described by this contract after authorization, validation, policy, and idempotency gates pass.

WHY IT MATTERS

  • Gives people and agents a contract-backed way to advance launch.
  • Creates an auditable path from editable launch intent to immutable, authority-bound deployment inputs.

ISOLATION + AUTHORITY

Launch owner, workspace, source artifact, analysis, declared authority, governance binding, frozen revision, deployment preparation, target network, and runtime deployment remain distinct. Analysis or preparation does not deploy code, freezing does not approve it, and no contract route grants wallet, publisher, matching, trading, or external-domain authority.

BEFORE YOU CALL

  • Authenticate at the documented boundary: bearer+scope.
  • Supply the required request (body) exactly as defined by the live contract.
  • Use one Idempotency-Key only for retries of the same byte-equivalent logical mutation.
  • Resolve the launch owner, current revision, source and configuration commitments, authority analysis, governance binding, and target-network policy.

WHAT TO DO NEXT

  • Re-read launch using the canonical identifier returned by this operation.
  • Reconcile an ambiguous response with the same idempotency key before attempting another mutation.
  • Compare the launch revision, source and configuration commitments, authority analysis, governance binding, and target-network policy before moving to the next contract stage.

AGENT GUIDANCE

  • Use launch only for the purpose and lifecycle stage described by this operation; do not treat it as authority for an adjacent action.
  • Supply the required request (body) exactly as defined by the live contract.
  • Treat draft editing, authority analysis, governance binding, freeze, evidence completion, deployment preparation, deployment, activation, and external effects as separate states.
  • After a timeout or conflict, read authoritative state before deciding whether an equivalent retry is safe.
MACHINE CONTRACT

The exact deployed parameters, schemas, responses, security requirements, and Hybrid-Chain agent metadata are authoritative at this operation's production OpenAPI JSON Pointer. The readable tables below add integration guidance; the deployed OpenAPI controls if guidance and the machine contract ever differ.

Open the authoritative production contract

EXTENDED INTEGRATION GUIDANCE

Readable request and response reference

Examples illustrate integration intent; the referenced OpenAPI operation and component schemas define the executable shape.

PARAMETERS

Headers, path, query, and body

NAMELOCATIONPRESENCETYPE / RULES / PURPOSE
AuthorizationheaderRequired

Bearer tokenCredential containing the contracts:write scope.EXAMPLEBearer hc_live_…

Idempotency-KeyheaderRequired

ASCII string · 1–128Caller-generated key reused for every retry of the same logical mutation.EXAMPLElaunch-treasury-v1-001

slugbodyRequired

string · 1–160Lowercase URL-safe name, unique within the workspace.EXAMPLEtreasury-settlement-v1

namebodyRequired

string · 1–160Human-readable launch name.EXAMPLETreasury Settlement

descriptionbodyOptional

string · 0–1000Purpose and operating boundary.EXAMPLEGoverned settlement contract.

networkIdbodyRequired

identifierTarget Hybrid-Chain network.EXAMPLEhybrid-devnet

chainIdbodyRequired

identifierTarget chain identifier.EXAMPLEhybrid-1

contractKindbodyRequired

GENERAL | TOKEN | HYBRIDSCRIPTContract runtime kind.EXAMPLEHYBRIDSCRIPT

packageHashbodyRequired

sha256 digestImmutable package commitment.EXAMPLEsha256:1111111111111111111111111111111111111111111111111111111111111111

sourceHashbodyRequired

sha256 digestReadable source commitment.EXAMPLEsha256:2222222222222222222222222222222222222222222222222222222222222222

artifactHashbodyRequired

sha256 digestCompiled artifact commitment.EXAMPLEsha256:3333333333333333333333333333333333333333333333333333333333333333

manifestHashbodyRequired

sha256 digestBuild manifest commitment.EXAMPLEsha256:4444444444444444444444444444444444444444444444444444444444444444

compilerProfilebodyRequired

identifierPinned deterministic compiler profile.EXAMPLEhybridscript-0.1

factoryAddressbodyOptional

string | nullOptional governed deployment factory.

constructorArgsHashbodyRequired

sha256 digestConstructor argument commitment.

initialStateHashbodyRequired

sha256 digestInitial-state commitment.

runtimePolicyHashbodyRequired

sha256 digestSigned runtime-policy commitment.

deploymentSaltbodyRequired

identifierDeterministic address salt.EXAMPLEtreasury-settlement-001

xuLimitbodyRequired

integer · 1–10¹⁵Execution Unit ceiling; never gas.EXAMPLE100000

capabilitiesbodyRequired

enum[]Declared UPGRADEABLE, MINTABLE, BURNABLE, PAUSABLE, TREASURY, AUTOMATION, or ORACLE capabilities.

safeguardsbodyRequired

objectTimelocks, caps, emergency pause, recovery delay, source verification, and deterministic-build controls.

authoritiesbodyRequired

role → wallet mapExact activated MPC wallet assignment for every required authority role.

expectedContractAddressbodyOptional

string | nullOptional independently calculated deterministic address.

REQUEST

JSON body example

{
  "slug": "treasury-settlement-v1",
  "name": "Treasury Settlement",
  "description": "Governed HybridScript settlement contract.",
  "networkId": "hybrid-devnet",
  "chainId": "hybrid-1",
  "contractKind": "HYBRIDSCRIPT",
  "packageHash": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
  "sourceHash": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
  "artifactHash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
  "manifestHash": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
  "compilerProfile": "hybridscript-0.1",
  "factoryAddress": null,
  "constructorArgsHash": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
  "initialStateHash": "sha256:6666666666666666666666666666666666666666666666666666666666666666",
  "runtimePolicyHash": "sha256:7777777777777777777777777777777777777777777777777777777777777777",
  "deploymentSalt": "treasury-settlement-001",
  "xuLimit": 100000,
  "capabilities": [
    "PAUSABLE",
    "TREASURY"
  ],
  "safeguards": {
    "upgradeTimelockSeconds": 86400,
    "mintCap": null,
    "emergencyPause": true,
    "recoveryDelaySeconds": 172800,
    "sourceVerified": true,
    "deterministicBuild": true
  },
  "authorities": {
    "DEPLOYMENT": "wallet-deploy",
    "POLICY": "wallet-policy",
    "RECOVERY": "wallet-recovery",
    "PAUSE": "wallet-pause",
    "UNPAUSE": "wallet-pause",
    "TREASURY": "wallet-treasury"
  },
  "expectedContractAddress": null
}

RESPONSES

Status and payload examples

201Draft launch created.Mutation completed · JSON RESPONSE+
{
  "launch": {
    "launchId": "9b51ed4c9c8f4aec85d1bd5520e40557",
    "slug": "treasury-settlement-v1",
    "name": "Treasury Settlement",
    "description": "Governed HybridScript settlement contract.",
    "networkId": "hybrid-devnet",
    "chainId": "hybrid-1",
    "contractKind": "HYBRIDSCRIPT",
    "packageHash": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
    "sourceHash": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
    "artifactHash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
    "manifestHash": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
    "compilerProfile": "hybridscript-0.1",
    "factoryAddress": null,
    "constructorArgsHash": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
    "initialStateHash": "sha256:6666666666666666666666666666666666666666666666666666666666666666",
    "runtimePolicyHash": "sha256:7777777777777777777777777777777777777777777777777777777777777777",
    "deploymentSalt": "treasury-settlement-001",
    "xuLimit": 100000,
    "capabilities": [
      "PAUSABLE",
      "TREASURY"
    ],
    "safeguards": {
      "upgradeTimelockSeconds": 86400,
      "mintCap": null,
      "emergencyPause": true,
      "recoveryDelaySeconds": 172800,
      "sourceVerified": true,
      "deterministicBuild": true
    },
    "authorities": {
      "DEPLOYMENT": "wallet-deploy",
      "POLICY": "wallet-policy",
      "RECOVERY": "wallet-recovery",
      "PAUSE": "wallet-pause",
      "UNPAUSE": "wallet-pause",
      "TREASURY": "wallet-treasury"
    },
    "acceptedRiskCodes": [],
    "launchIntentHash": null,
    "trustScore": null,
    "trustGrade": null,
    "state": "DRAFT",
    "expectedContractAddress": null,
    "contractAddress": null,
    "bindings": [],
    "events": [],
    "chainEvidence": [],
    "created": "2026-08-10T21:00:00Z",
    "updated": "2026-08-10T21:00:00Z"
  }
}
INTEGRATION DECISION
CALLER ACTION
Accept the returned representation or receipt, then re-read launch using the canonical identifier returned by this operation.
RETRY SAFETY
Do not repeat a successful mutation merely to confirm it. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Persist returned identifiers, versions, commitments, and receipts. Refresh the draft or launch revision, approval state, artifact commitments, authority assignments, and deployment or rejection receipt before another mutation.
400The request or required headers are malformed.Request must change · JSON RESPONSE+
{
  "code": "invalid_json",
  "message": "The request or required headers are malformed."
}
INTEGRATION DECISIONinvalid_json
CALLER ACTION
Rebuild the request from the live OpenAPI operation and correct the rejected method, media type, header, parameter, or body field.
RETRY SAFETY
Do not retry the same invalid request. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Compare the submitted values with the documented constraints before another call. Refresh the draft or launch revision, approval state, artifact commitments, authority assignments, and deployment or rejection receipt before another mutation.
ESCALATE WHEN
Escalate when revision lineage, approvals, artifact hashes, deployment authority, or finality evidence cannot be proven consistently.
401The bearer credential is missing or invalid.Authentication required · JSON RESPONSE+
{
  "code": "invalid_credentials",
  "message": "The bearer credential is missing or invalid."
}
INTEGRATION DECISIONinvalid_credentials
CALLER ACTION
Discard the rejected credential, complete the documented authentication or reassertion flow, and rebuild any request signature with fresh timestamps and nonces.
RETRY SAFETY
Retry only with a newly valid credential and fresh replay-protection values. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Assume the outcome is unknown only when the connection failed after transmission; otherwise authentication failed before domain work. Refresh the draft or launch revision, approval state, artifact commitments, authority assignments, and deployment or rejection receipt before another mutation.
ESCALATE WHEN
Escalate when revision lineage, approvals, artifact hashes, deployment authority, or finality evidence cannot be proven consistently.
403The credential lacks the required contract scope.Authority or policy denied · JSON RESPONSE+
{
  "code": "insufficient_scope",
  "message": "The credential lacks the required contract scope."
}
INTEGRATION DECISIONinsufficient_scope
CALLER ACTION
Verify the exact scope, tenant or workspace membership, owner boundary, step-up purpose, feature policy, and resource eligibility. Never broaden authority automatically.
RETRY SAFETY
Do not retry until the missing authority or policy condition has been deliberately resolved with least privilege.
STATE RECONCILIATION
Confirm the caller and resource resolve to the same authority boundary for contract drafts, immutable revisions, reviews, approvals, launch inputs, and deployment evidence.
ESCALATE WHEN
Escalate when revision lineage, approvals, artifact hashes, deployment authority, or finality evidence cannot be proven consistently.
404The requested launch does not exist in the caller's workspace.Resource not visible · JSON RESPONSE+
{
  "code": "contract_not_found",
  "message": "The requested launch does not exist in the caller's workspace."
}
INTEGRATION DECISIONcontract_not_found
CALLER ACTION
Verify the canonical identifier and authenticated owner boundary. A 404 may intentionally conceal a resource outside the caller's authority.
RETRY SAFETY
Do not retry the unchanged identifier repeatedly. Refresh the relevant collection or lookup before choosing another identifier.
STATE RECONCILIATION
Refresh the draft or launch revision, approval state, artifact commitments, authority assignments, and deployment or rejection receipt before another mutation.
ESCALATE WHEN
Escalate when revision lineage, approvals, artifact hashes, deployment authority, or finality evidence cannot be proven consistently.
409The request conflicts with immutable launch state or existing governance evidence.State reconciliation required · JSON RESPONSE+
{
  "code": "contract_conflict",
  "message": "The request conflicts with immutable launch state or existing governance evidence."
}
INTEGRATION DECISIONcontract_conflict
CALLER ACTION
Stop the mutation sequence and fetch the latest authoritative resource, lifecycle state, version, ETag, reservation, or existing idempotency result.
RETRY SAFETY
Retry only after reconciling the conflict. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Refresh the draft or launch revision, approval state, artifact commitments, authority assignments, and deployment or rejection receipt before another mutation.
ESCALATE WHEN
Escalate when revision lineage, approvals, artifact hashes, deployment authority, or finality evidence cannot be proven consistently.
422The canonical contract request failed validation.Request must change · JSON RESPONSE+
{
  "code": "invalid_request",
  "message": "The canonical contract request failed validation."
}
INTEGRATION DECISIONinvalid_request
CALLER ACTION
Rebuild the request from the live OpenAPI operation and correct the rejected method, media type, header, parameter, or body field.
RETRY SAFETY
Do not retry the same invalid request. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions.
STATE RECONCILIATION
Compare the submitted values with the documented constraints before another call. Refresh the draft or launch revision, approval state, artifact commitments, authority assignments, and deployment or rejection receipt before another mutation.
ESCALATE WHEN
Escalate when revision lineage, approvals, artifact hashes, deployment authority, or finality evidence cannot be proven consistently.
503The authoritative contract registry is unavailable.Dependency unavailable or outcome uncertain · JSON RESPONSE+
{
  "code": "contract_registry_unavailable",
  "message": "The authoritative contract registry is unavailable."
}
INTEGRATION DECISIONcontract_registry_unavailable
CALLER ACTION
Preserve the exact request and treat the outcome as uncertain until authoritative state proves whether it committed.
RETRY SAFETY
Reconcile before retrying. For one logical mutation, retain the same Idempotency-Key and byte-equivalent request. Never reuse that key for changed instructions. Use bounded backoff with jitter.
STATE RECONCILIATION
Refresh the draft or launch revision, approval state, artifact commitments, authority assignments, and deployment or rejection receipt before another mutation.
ESCALATE WHEN
Escalate when revision lineage, approvals, artifact hashes, deployment authority, or finality evidence cannot be proven consistently.

OPERATIONAL NOTES

Security and lifecycle guarantees

  • The request is rejected if it contains unknown fields or secret-bearing material.
  • Creation stores an intent draft; it does not freeze, sign, deploy, or broadcast anything.
DOCUMENTATION STATUS

This route is implemented in canonical gateway source and appears in the production OpenAPI snapshot observed 2026-09-11T06:35:11.572Z. Authentication, tenant, feature, venue, and market policy still apply.

Verify the exact production OpenAPI operation Return to the V2 directory