MARS documentation
API reference

Create entry

Contract and client context

Operation: create_entry · HTTP: POST /v1/entries

Use an operator-supplied registry base URL. Request execution is disabled in this documentation explorer. Generated request snippets are templates, not signed or authorized submissions.

Exact operation definition
{
  "operationId": "create_entry",
  "parameters": [
    {
      "description": "Required route-scoped idempotency key",
      "in": "header",
      "name": "Idempotency-Key",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MarsEntry"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MarsEntry"
          }
        }
      },
      "description": "Entry created"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Entry validation failed"
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "SIWS session missing or invalid"
    },
    "403": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Session publisher mismatch"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Entry already exists"
    },
    "429": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Write rate limit exceeded"
    }
  },
  "security": [
    {
      "siwsSession": []
    },
    {
      "siwsCookie": []
    }
  ],
  "tags": [
    "entries"
  ]
}

Resolve schema references against the complete OpenAPI document. Standalone schemas and hashes are generated from the same checked-in source.

POST/v1/entries

Authorization

AuthorizationBearer <token>

Opaque capability-bearing MARS session issued by an enabled authentication profile.

In: header

Header Parameters

Idempotency-Key*string

Required route-scoped idempotency key

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A complete MARS registry entry (MARS Specification Section 5).

This is the canonical on-wire and at-rest representation of every artifact registered in the MARS ecosystem. Required fields are always present; optional fields are omitted from JSON when None or empty.

Validation

Call validate to check structural invariants before signing or persisting.

Examples

use mars_protocol::entry::{MarsEntry, EntryType};let entry: MarsEntry = serde_json::from_str(r#"{ ... }"#)?;entry.validate()?;# Ok::<(), Box<dyn std::error::Error>>(())

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/entries" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "entryDid": "string",    "entryType": "AgentDefinition",    "itemData": null,    "itemDataHash": "string",    "itemSchemaUri": "string",    "marsVersion": "string",    "name": "string",    "publishedAt": "2019-08-24T14:15:22Z",    "publisherDid": "string",    "signature": {      "algorithm": "string",      "keyId": "string",      "value": "string"    },    "version": "string"  }'
{  "accessPolicy": null,  "anchorState": "unanchored",  "bondReference": null,  "customMetadata": {    "property1": null,    "property2": null  },  "description": "string",  "entryDid": "string",  "entryType": "AgentDefinition",  "itemData": null,  "itemDataHash": "string",  "itemSchemaUri": "string",  "lifecycleStatus": "draft",  "lineageReference": null,  "marsVersion": "string",  "name": "string",  "publishedAt": "2019-08-24T14:15:22Z",  "publisherDid": "string",  "relationships": [    {      "label": "string",      "relationshipType": "dependsOn",      "targetDid": "string"    }  ],  "semanticAnnotations": [    {      "objectLiteral": "string",      "objectUri": "string",      "predicateUri": "string"    }  ],  "sequence": 0,  "serviceEndpoints": [    {      "id": "string",      "priority": 0,      "properties": {        "property1": null,        "property2": null      },      "type": "string",      "url": "string"    }  ],  "shardAssignment": "string",  "signature": {    "algorithm": "string",    "created": "string",    "keyId": "string",    "value": "string"  },  "tags": [    "string"  ],  "updatedAt": "2019-08-24T14:15:22Z",  "verifiableAttestations": [    null  ],  "version": "string"}