Create a JsonFabrica sequence
jsonfabrica_create_sequenceCreates a durable named sequence for generating numbers, strings, or UUIDs in templates. Fails if a sequence with the same name already exists.
Instructions
Calls POST /v1/sequences. Creates a durable named sequence (number/string/uuid), referenced from template bodies via createSeq()/getSeq()-style functions. Fails with a 409-style conflict error if a sequence with this name already exists for the tenant — use jsonfabrica_update_sequence to change an existing one's currentValue/step instead of retrying create with the same name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Unique identifier for the sequence within the tenant, referenced from template bodies via createSeq("name")/getSeq("name") placeholders. Required; creation fails if a sequence with this name already exists. | |
| step | No | Amount `currentValue` is incremented by on each bump, for "number"/"string" sequences (ignored for "uuid"). Optional; defaults to 1 when omitted. May be negative to count down. | |
| type | Yes | Value kind the sequence produces on each bump: "number" increments `currentValue` by `step` and returns a numeric value; "string" behaves like "number" but the returned value is stringified; "uuid" does not use `start`/`step` to derive values (but `start` must still be provided — see its description); each bump returns a fresh UUID. Required. | |
| start | No | Initial value of `currentValue` for "number"/"string" sequences. Marked optional in this schema, but the gateway validates it as a required finite number for every sequence type — omitting it always causes a 400 validation error, even for type "uuid". For "uuid" sequences the value is stored but not used to derive the generated UUIDs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Sequence name. | |
| step | No | Increment applied per bump (ignored for "uuid"). | |
| type | Yes | Value kind produced on each bump. | |
| start | No | Initial value the sequence was created with. | |
| tenantId | Yes | Owning tenant id. | |
| createdAt | Yes | ISO-8601 creation timestamp. | |
| updatedAt | Yes | ISO-8601 last-update timestamp. | |
| currentValue | Yes | Current stored counter value (unused by "uuid" sequences). |