On this page
Create a legal document
Creates an immutable draft revision.
Creates an immutable draft revision.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/legal_documents - Scope
auth:write - Effect
write— a successful call changes state. - Collection legal_documents
- Query
legal_document_id
Request
| Field | Type | What it is |
|---|---|---|
parent | string | Canonical name of the parent Resource. Required. |
legal_document | LegalDocument | Draft revision to create. Required. |
legal_document_id | string | Optional legal document TypeID; Auth assigns one if omitted. |
LegalDocument
| Field | Type | What it is |
|---|---|---|
name | string | Canonical Resource name. |
meta | ResourceMeta | Resource metadata. |
spec | LegalDocumentSpec | The immutable agreement text and publication policy. Required. |
ResourceMeta
| Field | Type | What it is |
|---|---|---|
labels | map<string, string> | Caller-writable, indexed labels (AIP-122 label rules). |
annotations | map<string, string> | Caller-writable, unindexed annotations. |
display_name | string | Caller-writable human-readable name. |
LegalDocumentSpec
| Field | Type | What it is |
|---|---|---|
doc_slug | string | A stable agreement kind, e.g. terms, privacy, dpa, eula. Required. |
version | string | An opaque immutable version label, not used for ordering. Required. |
canonical_text | string | Exact plain UTF-8 text shown to the user. Auth never normalizes it. Required. |
document_url | string | An external HTTPS reference. Auth's canonical text, not this link, is evidence. Required. |
change_summary | string | User-facing summary of the changes. Required. |
major_reconsent_required | bool | Whether previously accepted versions become insufficient. |
effective_time | timestamp | When a published revision takes effect. Required. |
Response
| Field | Type | What it is |
|---|---|---|
name | string | Canonical Resource name. |
uid | string | Server-assigned immutable ID. Output only. |
meta | ResourceMeta | Resource metadata. |
spec | LegalDocumentSpec | The immutable agreement text and publication policy. Required. |
status | LegalDocumentStatus | Computed hash and publication state. Output only. |
ResourceMeta
| Field | Type | What it is |
|---|---|---|
generation | int64 | Increases by one on every change to spec. Output only. |
etag | string | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only. |
create_time | timestamp | When the Resource was created. Output only. |
update_time | timestamp | When the Resource last changed. Output only. |
delete_time | timestamp | Set while the Resource is being deleted. Output only. |
labels | map<string, string> | Caller-writable, indexed labels (AIP-122 label rules). |
annotations | map<string, string> | Caller-writable, unindexed annotations. |
display_name | string | Caller-writable human-readable name. |
creator | string | The principal that created the Resource. Output only. |
LegalDocumentSpec
| Field | Type | What it is |
|---|---|---|
doc_slug | string | A stable agreement kind, e.g. terms, privacy, dpa, eula. Required. |
version | string | An opaque immutable version label, not used for ordering. Required. |
canonical_text | string | Exact plain UTF-8 text shown to the user. Auth never normalizes it. Required. |
document_url | string | An external HTTPS reference. Auth's canonical text, not this link, is evidence. Required. |
change_summary | string | User-facing summary of the changes. Required. |
major_reconsent_required | bool | Whether previously accepted versions become insufficient. |
effective_time | timestamp | When a published revision takes effect. Required. |
LegalDocumentStatus
| Field | Type | What it is |
|---|---|---|
observed_generation | int64 | The spec generation observed by Auth. Output only. |
conditions | Condition[] | Observed conditions. Output only. |
document_sha256 | string | Lowercase hex SHA-256 of the exact UTF-8 bytes of canonical_text. Output only. |
publish_time | timestamp | Unset for drafts. No field can change after publication. Output only. |
Condition
| Field | Type | What it is |
|---|---|---|
type | string | The condition type, for example Ready. |
status | ConditionStatus | Whether the condition holds. One of true, false, unknown. |
observed_generation | int64 | The generation this observation was made against. |
reason | string | A machine-readable UpperCamelCase reason. |
message | string | A customer-safe human-readable message. |
severity | Severity | How severe a FALSE condition is. One of info, warning, error. |
transition_time | timestamp | When status last changed. |
Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.INVALID_FIELD— A field failed validation.RESOURCE_ALREADY_EXISTS— A Resource with this name exists.IDEMPOTENCY_KEY_REUSED— An Idempotency-Key was reused with another body.IDEMPOTENCY_IN_PROGRESS— The first call with this Idempotency-Key is still running.UNKNOWN_FIELD— The request has a field the schema does not know.
Every error arrives in the body Errors describes.
Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/legal_documents" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"spec":{"canonical_text":"…","change_summary":"…","doc_slug":"…","document_url":"…","effective_time":{},"version":"…"}}'