Skip to Content
Docs
API referenceManagement API

Authflows document

GET
/authn/authflows/document

The instance's auth flows as one authflows/v1 document (api-route-review D47): its published custom flows, each with its own widgets, and the custom widget definitions they show, so the document is self-contained. Only the published state is exported; drafts stay in the dashboard. Built-in flows and definitions are the same everywhere and never travel, and which app runs a flow is the app's authflow_bindings, not part of the flow. Everything is named by a key, never an id: a view node's widget is a definition's key or flow:, one of the flow's own widgets. authflow_id, repeatable, exports just those flows and the definitions they show (a flow that is not a published custom flow is 404); importing that document touches only them. The output is deterministic: two exports of the same state are byte-identical, and the ETag is the hash of the bytes. Send it as If-None-Match to get 304 when nothing changed. Import the document into another instance with POST /v1/authn/authflows/document/import. Needs sys:flow:read and sys:widget:read.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Query Parameters

authflow_id?array<string>

Export only these flows, by id; repeat it for several

Response Body

An authflows/v1 document

application/json
  1. response

Document is an authflows/v1 document, passed to identity-svc as the bytes it was sent. At most 5 MB.

authflows?array<>
pontive_document?"authflows/v1"

PontiveDocument is the document type. An import reads the current and the previous major version.

Value in"authflows/v1"
pontkit?string

Pontkit is the pontkit release the document was exported against. Informational: an import checks markup against the target's release.

widget_definitions?array<>

WidgetDefinitions are the instance's own definitions the flows show, never a built-in. A published definition never changes, so this copy is the branding document's: a key the target lacks is created and published, identical markup is unchanged, other markup is a conflict.

Example Request
curl -X GET 'https://api.us.pontive.com/v1/authn/authflows/document'
Example Response
{  "authflows": [    {      "description": "string",      "edges": [        {          "from": "string",          "id": "string",          "to": "string",          "trigger": {            "event": "string",            "kind": "user-event",            "outcome": "string"          }        }      ],      "entry_node": "string",      "id": "string",      "intents": [        "signin"      ],      "metadata": {        "viewport": {          "x": 0,          "y": 0,          "zoom": 0        }      },      "name": "string",      "nodes": [        {          "action_type": "string",          "expression": "string",          "flow_id": "string",          "id": "string",          "kind": "start",          "metadata": {            "note": "string",            "position": {              "x": 0,              "y": 0            }          },          "name": "string",          "outcome": "string",          "properties": {            "property1": null,            "property2": null          },          "widget": "string",          "widget_overrides": {            "property1": "string",            "property2": "string"          }        }      ],      "role": "entry",      "widgets": {        "property1": {          "key": "string",          "markup": "string",          "name": "string"        },        "property2": {          "key": "string",          "markup": "string",          "name": "string"        }      }    }  ],  "pontive_document": "authflows/v1",  "pontkit": "string",  "widget_definitions": [    {      "description": "string",      "key": "string",      "markup": "string",      "name": "string"    }  ]}
POST
/authn/authflows/document/import

Plans importing an authflows/v1 document into this instance and, with dry_run false, applies the plan (api-route-review D47). Flows and widget definitions are merged by key: a new key is created, a differing flow replaced whole, and one the document lacks is listed as absent and left alone. Nothing is deleted; delete a flow with DELETE /v1/authn/authflows/{authflow_id}. A definition the instance lacks is created and published; identical markup is unchanged, and different markup is a conflict, since a published definition never changes. A changed flow keeps each of its own widgets whose content matches, and gets a new one where content changed. With publish true (the default) each changed flow is published, its widgets first; with publish false it writes drafts for review in the dashboard. Anything the flow's publish validator refuses, a reference to a key in neither the document nor the instance, and a draft with unpublished changes the import would overwrite (unless discard_unpublished) are conflicts. Re-importing an instance's own export plans every entry unchanged and writes nothing. The dry run's ETag is the revision of the flows it read: send it as If-Match on the apply to be refused 412 precondition_failed if anything changed since. An apply with conflicts is 409 import_conflict, one detail per conflict, field .., and applies nothing. A document the format refuses (not JSON, a member it does not define, a pontive_document it does not read) is 422 field_invalid_format; one over 5 MB is 422 field_too_long. X-Idempotency-Key makes an apply safe to retry; the same key with another request is 422 idempotency_key_reused. Needs sys:flow:manage, sys:widget:read and sys:widget:manage.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Header Parameters

If-Match?string

The dry run's ETag: the apply is refused 412 precondition_failed if the instance's flows changed since

X-Idempotency-Key?string

Idempotency key, read on an apply

Request Body

The document and how to import it

application/json
  1. body

The document and how to import it

discard_unpublished?boolean

DiscardUnpublished lets the import overwrite a draft with unpublished changes, which is otherwise a conflict.

document?

Document is an authflows/v1 document, passed to identity-svc as the bytes it was sent. At most 5 MB.

dry_run?boolean

DryRun returns the plan and writes nothing. True when omitted: send false to apply.

publish?boolean

Publish publishes what the import changes. True when omitted; false writes drafts for review in the dashboard.

secrets?

Secrets are the values of the document's {"$secret": ""} placeholders, by name; never inside the document, and never echoed back. A placeholder with no value here or in the target is a conflict.

Response Body

OK

application/json
  1. response
absent?array<>
changed?array<>
conflicts?array<>
created?array<>
dry_run?boolean

DryRun is true when nothing was written.

object?"authflow_import_plan"
Value in"authflow_import_plan"
publish?boolean

Publish says whether the changed flows are published, or left as drafts. New widget definitions are published either way.

unchanged?array<>
warnings?array<>
Example Request
curl -X POST 'https://api.us.pontive.com/v1/authn/authflows/document/import' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "absent": [    {      "fields": [        "string"      ],      "key": "string",      "kind": "string"    }  ],  "changed": [    {      "fields": [        "string"      ],      "key": "string",      "kind": "string"    }  ],  "conflicts": [    {      "code": "string",      "field": "string",      "key": "string",      "kind": "string",      "message": "string"    }  ],  "created": [    {      "fields": [        "string"      ],      "key": "string",      "kind": "string"    }  ],  "dry_run": true,  "object": "authflow_import_plan",  "publish": true,  "unchanged": [    {      "fields": [        "string"      ],      "key": "string",      "kind": "string"    }  ],  "warnings": [    {      "code": "string",      "field": "string",      "key": "string",      "kind": "string",      "message": "string"    }  ]}