{"info":{"_postman_id":"1b365ad5-63d9-4211-80a3-19d6de979df2","name":"Flowg8 API v1","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json","description":"Import this collection and a Flowg8 Live or Sandbox environment. Set email and password locally, send Get an access token, then Your organization. In Sandbox also send Sandbox environments. Send individual requests for your use case; this reference collection is not an ordered full-collection test run. Invitations, key changes, publications and decisions have real effects. Tokens are captured only after sign-in; downloads contain no credentials. Keep sensitive values local and do not share filled environments."},"item":[{"name":"Organization","item":[{"name":"Integrations","request":{"method":"GET","url":"{{baseUrl}}/v1/integrations","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Reusable outbound connections and designer-managed email trigger addresses.\n\nSecurity policy: only assigned authenticated approvers/reviewers may access private process content. Guest approvals, external document references and outbound sharedFields are disabled. Use private uploads and static outbound notifications. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox remains at 30 days from creation.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"integrations\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create integration","request":{"method":"POST","url":"{{baseUrl}}/v1/integrations","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Create a named outbound connection. Email triggers are managed through flow drafts.\n\nkind=email requires config.recipientDomains. teams requires a Microsoft Teams Workflows HTTPS URL; http accepts HTTPS and optional authorization. Creating email_inbound separately returns EMAIL_TRIGGER_DESIGNER_REQUIRED. Create or save a flow draft with start.trigger={kind:email,integrationId:null}; an address is allocated atomically, after verifying an organization sender domain with TXT. No customer gateway secret is needed.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Purchasing HTTP\",\n  \"kind\": \"http\",\n  \"active\": true,\n  \"config\": {\n    \"url\": \"https://example.com/flow-events\"\n  }\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-integration\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","save('integrationId',data.integration&&data.integration.id);save('integrationRevision',data.integration&&data.integration.revision);","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Update integration","request":{"method":"PUT","url":"{{baseUrl}}/v1/integrations/{{integrationId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Update a connection using its current revision; kind is immutable.\n\nOmitted URL/authorization retain stored values; authorization:\"\" clears the header. Changing settings increments revision. Already queued actions stop with INTEGRATION_CHANGED until an authorized explicit retry accepts the new revision. Disabling stops future delivery attempts. The updating administrator becomes the responsible owner for inbound processing.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Purchasing HTTP\",\n  \"kind\": \"http\",\n  \"active\": false,\n  \"revision\": \"{{integrationRevision}}\",\n  \"config\": {}\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"update-integration\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","save('integrationId',data.id);save('integrationRevision',data.revision);","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Company domains","request":{"method":"GET","url":"{{baseUrl}}/v1/organization/domains","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List TXT ownership challenges. Sandbox inherits Live domain ownership.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"domains\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Add company domain","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/domains","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Generate a TXT challenge without changing the customer DNS.\n\nAdministrator user token required. Add the returned txtName/txtValue at the domain DNS provider. Ownership does not configure email delivery, DKIM or MX and does not verify webhook targets owned by third-party SaaS providers.\n\nRequired user permissions: Administrator role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"domain\": \"example.com\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"add-domain\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","save('domainId',data.id);","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Verify domain TXT","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/domains/{{domainId}}/verify","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Resolve the challenge and reserve the verified domain for the organization.\n\n409 DOMAIN_NOT_VERIFIED means the expected TXT is not visible yet. 409 DOMAIN_IN_USE means another organization already owns the verified domain. Retrying after DNS propagation needs a new Idempotency-Key.\n\nRequired user permissions: Administrator role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"verify-domain\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","save('domainId',data.id);","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Business profile","request":{"method":"GET","url":"{{baseUrl}}/v1/organization/business-profile","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read the saved business details and Live activation status.\n\nAdministrator user tokens only. Manage the parent Live organization under Organization → Business details. Integration keys and Sandbox developer grants cannot read or change business details.\n\nPublishing Live flows and starting Live runs require a complete business profile and explicit Live activation. Draft publication, definition-version publication and process starts return 409 ORGANIZATION_NOT_LIVE until then. Draft editing and Sandbox publication/starts remain available. Existing runs can still be read and decided.\n\nRequired user permissions: Administrator role required · Live only. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"business-profile\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","save('businessRevision',data.revision);","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Save business details","request":{"method":"PUT","url":"{{baseUrl}}/v1/organization/business-profile","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Save progress with revision protection; partial drafts are supported.\n\nUse revision 0 for the first save, then the revision returned by the API. VAT ID and commercial-register references are optional. Required: legalName, addressLine1, postalCode, city, country (ISO 3166-1 alpha-2), contactName, contactEmail and businessUseConfirmed. Activated organizations must keep required data complete. Requires Idempotency-Key.\n\nRequired user permissions: Administrator role required · Live only. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"revision\": \"{{businessRevision}}\",\n  \"details\": {\n    \"legalName\": \"Example GmbH\",\n    \"addressLine1\": \"Teststraße 1\",\n    \"addressLine2\": \"\",\n    \"postalCode\": \"10115\",\n    \"city\": \"Berlin\",\n    \"country\": \"DE\",\n    \"contactName\": \"Alex Example\",\n    \"contactEmail\": \"operations@example.test\",\n    \"vatId\": \"\",\n    \"registerNumber\": \"\",\n    \"businessUseConfirmed\": true\n  }\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"save-business-profile\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","const revision=Number(pm.environment.get('businessRevision'));if(!Number.isInteger(revision)||revision<0||topic==='activate-live'&&revision<1)stop('Read and save the business profile first.');data.revision=revision;","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","save('businessRevision',data.revision);","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Activate Live workflows","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/activate-live","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Activate production starts after saving and reviewing complete business details.\n\nAdministrator-only explicit confirmation. Uses the current saved revision and Idempotency-Key. Incomplete details return 400; stale revisions return 409. This does not purchase a subscription or change process quotas. Configuration completeness is checked; no identity or tax-register verification is performed.\n\nRequired user permissions: Administrator role required · Live only. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"revision\": \"{{businessRevision}}\",\n  \"confirm\": true\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"activate-live\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","const revision=Number(pm.environment.get('businessRevision'));if(!Number.isInteger(revision)||revision<0||topic==='activate-live'&&revision<1)stop('Read and save the business profile first.');data.revision=revision;","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","save('businessRevision',data.revision);","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Your organizations","request":{"method":"GET","url":"{{baseUrl}}/v1/workspaces","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[],"description":"List active organization memberships for the signed-in person.\n\nRequired user permissions: Flowg8 sign-in required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"workspaces\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Invite a user","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/invitations","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Invite a person with a login, organization role and optional approval groups.\n\nUse a Live administrator token, a Sandbox administrator/developer token, or a service-account key with users:invite. Service keys may invite requester members with no approvalGroupIds; admin invitations and approval-group grants require the administrator user token. In Sandbox, the same request creates a simulated invitation (delivery=simulated), with no email or real account. POST /v1/sandbox/invitations/{id}/accept simulates first sign-in and links its personId to a Sandbox-only identity. A new Flowg8 account receives an email with a temporary password and must set a personal password on first sign-in. Existing eligible accounts keep their password and accept by signing in again; ask them directly to sign in. Flowg8 returns no passwords.\n\nThe API checks active workspace access and either administrator user rights or a service-account users:invite scope before reserving or retrying an invitation. role describes the invited person, not the caller: role=admin cannot grant permission to send the request. Missing/invalid access tokens return 401; non-admin user tokens, inactive or foreign memberships, keys without users:invite and privileged service-key invitations return 403. Invitation validity: 7 days. Membership and direct approval-group grants activate only for the matching authenticated subject. Requester is the default role; admin must be explicit. Directory profiles remain independently editable. Reuse the same Idempotency-Key and input after uncertain results.\n\nService accounts require users:invite and can list/retry only invitations created by that same service account, including after key rotation. They cannot create admin invitations, assign approval groups or delegate credentials. Live invitations create real accounts; Sandbox invitations simulate provisioning and acceptance without sending emails.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"displayName\": \"{{inviteName}}\",\n  \"email\": \"{{inviteEmail}}\",\n  \"role\": \"requester\",\n  \"approvalGroupIds\": []\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"invite-user\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","if(!pm.environment.get('inviteEmail')||!pm.environment.get('inviteName'))stop('Set inviteEmail and inviteName before sending this invitation.');","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","save('invitationId',data.id);","","","","","}else{","","}","}());"]}}]},{"name":"Simulate invitation acceptance","request":{"method":"POST","url":"{{baseUrl}}/v1/sandbox/invitations/{{invitationId}}/accept","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Link the invited test person to a simulated Sandbox account.\n\nSandbox only. Requires a Sandbox administrator/developer session, or the same service account with users:invite that created the invitation. Repeating acceptance returns the same result. No password, access token or real account is issued. The linked identity belongs only to this Sandbox.\n\nRequired user permissions: Administrator or Sandbox developer required · Sandbox only. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"accept-sandbox-invitation\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","if(mode!=='sandbox')stop('Simulated acceptance is available only in Sandbox.');","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Validate user import","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/user-imports/validate","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Validate up to 100 people without creating profiles, accounts or emails.\n\nUse an administrator session in Live or an administrator/developer session in Sandbox. Integration access requires a service-account key with BOTH organization:write and users:invite. Keys can access/retry only imports owned by the same service account. Access is rechecked during background processing.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"people\": [\n    {\n      \"ref\": \"ceo\",\n      \"externalId\": \"employee-1\",\n      \"displayName\": \"Alex Example\",\n      \"email\": \"alex@example.com\",\n      \"jobTitle\": \"CEO\",\n      \"managerRef\": null\n    },\n    {\n      \"ref\": \"lead\",\n      \"externalId\": \"employee-2\",\n      \"displayName\": \"Kim Example\",\n      \"email\": \"kim@example.com\",\n      \"jobTitle\": \"Team Lead\",\n      \"managerRef\": \"ceo\"\n    }\n  ]\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"validate-user-import\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Start user import","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/user-imports","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Atomically save the validated directory and queue invitations.\n\nReturns HTTP 202 with a job ID and person IDs. One active import per organization; reuse the same Idempotency-Key after an uncertain response. Required fields: displayName, email and externalId or ref. managerRef resolves within this import; managerExternalId can also resolve an existing active person in the same organization. Order is irrelevant. personId may explicitly select an existing profile. Omitting jobTitle, unitId or manager fields preserves existing values. Explicit null clears a unit/manager. No administrators or approval grants are imported.\n\nUse an administrator session in Live or an administrator/developer session in Sandbox. Integration access requires a service-account key with BOTH organization:write and users:invite. Keys can access/retry only imports owned by the same service account. Access is rechecked during background processing.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"people\": [\n    {\n      \"ref\": \"ceo\",\n      \"externalId\": \"employee-1\",\n      \"displayName\": \"Alex Example\",\n      \"email\": \"alex@example.com\",\n      \"jobTitle\": \"CEO\",\n      \"managerRef\": null\n    },\n    {\n      \"ref\": \"lead\",\n      \"externalId\": \"employee-2\",\n      \"displayName\": \"Kim Example\",\n      \"email\": \"kim@example.com\",\n      \"jobTitle\": \"Team Lead\",\n      \"managerRef\": \"ceo\"\n    }\n  ]\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-user-import\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","save('importId',data.id);","","","","}else{","","}","}());"]}}]},{"name":"User import progress","request":{"method":"GET","url":"{{baseUrl}}/v1/organization/user-imports/{{importId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read durable per-person results and invitation errors.\n\nQueued work survives API restarts. Live invitations are processed globally at most once every two seconds, with retry/backoff and global cooldown after provider limits. Sandbox simulates provisioning and acceptance without Cognito or email. completed means all provisioning requests completed, not inbox delivery or first login. Profile IDs are available immediately; identityId can remain null until a real invitation is accepted.\n\nUse an administrator session in Live or an administrator/developer session in Sandbox. Integration access requires a service-account key with BOTH organization:write and users:invite. Keys can access/retry only imports owned by the same service account. Access is rechecked during background processing.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"get-user-import\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Retry failed import invitations","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/user-imports/{{importId}}/retry","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Retry only failed invitations without duplicating people.\n\nUse an administrator session in Live or an administrator/developer session in Sandbox. Integration access requires a service-account key with BOTH organization:write and users:invite. Keys can access/retry only imports owned by the same service account. Access is rechecked during background processing.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"retry-user-import\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Invitation status","request":{"method":"GET","url":"{{baseUrl}}/v1/organization/invitations","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List pending, invited and accepted users.\n\nService accounts require users:invite and can list/retry only invitations created by that same service account, including after key rotation. They cannot create admin invitations, assign approval groups or delegate credentials. Live invitations create real accounts; Sandbox invitations simulate provisioning and acceptance without sending emails.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"invitations\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Retry provisioning","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/invitations/{{invitationId}}/retry","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Retry a pending invitation after a technical failure.\n\nReturns the existing invitation after successful provisioning, without resetting an existing account password. It retries pending provisioning; this is not a password-reset or renewal endpoint. No new person is created.\n\nService accounts require users:invite and can list/retry only invitations created by that same service account, including after key rotation. They cannot create admin invitations, assign approval groups or delegate credentials. Live invitations create real accounts; Sandbox invitations simulate provisioning and acceptance without sending emails.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"retry-invitation\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Organization directory","request":{"method":"GET","url":"{{baseUrl}}/v1/organization/directory","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read people, units, reporting lines and HR contacts.\n\nThe founder is seeded automatically. Use Invite a user for login accounts; directory-only profiles create no logins and grant no approval rights. Manager and HR links are directory data; workflow gates do not yet resolve them dynamically.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"directory\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create a person","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/people","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Create a directory profile. Optional links default to null.\n\nidentityId explicitly links an existing active Flowg8 member, never automatically by email. Administrators list eligible members with GET /v1/organization/members.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"displayName\": \"Alex Example\",\n  \"email\": null,\n  \"jobTitle\": \"Engineer\",\n  \"externalId\": \"employee-example\",\n  \"unitId\": null,\n  \"managerId\": null,\n  \"hrPersonId\": null,\n  \"identityId\": null,\n  \"active\": true\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-person\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Update a person","request":{"method":"PUT","url":"{{baseUrl}}/v1/organization/people/{{personId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Replace all editable person fields and send the current revision.\n\nSend full input fields, not id, createdAt or updatedAt. Cycles, inactive references, foreign workspace links and stale revisions are rejected.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"displayName\": \"Alex Example\",\n  \"email\": null,\n  \"jobTitle\": \"Senior engineer\",\n  \"externalId\": \"employee-example\",\n  \"unitId\": null,\n  \"managerId\": null,\n  \"hrPersonId\": null,\n  \"identityId\": null,\n  \"active\": true,\n  \"revision\": 1\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"update-person\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create a unit","request":{"method":"POST","url":"{{baseUrl}}/v1/organization/units","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Create an organizational unit, optionally beneath an active unit.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Engineering\",\n  \"externalId\": \"engineering\",\n  \"parentId\": null,\n  \"active\": true\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-unit\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Update a unit","request":{"method":"PUT","url":"{{baseUrl}}/v1/organization/units/{{unitId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Replace all editable unit fields using the current revision.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Platform engineering\",\n  \"externalId\": \"engineering\",\n  \"parentId\": null,\n  \"active\": true,\n  \"revision\": 1\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"update-unit\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Rename a workspace","request":{"method":"PUT","url":"{{baseUrl}}/v1/organization","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Use the organization revision from the directory.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Example workspace\",\n  \"revision\": 1\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"rename-workspace\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Read responsibilities","request":{"method":"GET","url":"{{baseUrl}}/v1/organization/people/{{personId}}/responsibilities","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read the recorded manager and HR contact for a person.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"responsibilities\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Sandbox developer access","request":{"method":"GET","url":"{{baseUrl}}/v1/sandbox/developers","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List existing active human members and their separate Sandbox developer grant.\n\nLive administrator user token and Live organization ID required. Invite and accept a member first, then select their identityId. Access changes affect neither Live roles nor approval-group membership. Sandbox still enforces normal quotas and retention.\n\nRequired user permissions: Administrator role required · Live only. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"sandbox-developers\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Set Sandbox developer access","request":{"method":"PUT","url":"{{baseUrl}}/v1/sandbox/developers/{{identityId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Grant or remove development access without granting Live administration.\n\nRemoving a grant immediately revokes personal Sandbox keys and disables service accounts created by that developer in Sandbox. It does not change independent Live service accounts.\n\nRequired user permissions: Administrator role required · Live only. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"enabled\": true\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"set-sandbox-developer\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]}]},{"name":"Executions & approvals","item":[{"name":"Action deliveries","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/actions","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read durable delivery state for email, Teams and HTTP steps.\n\nStatuses pending, delivered, failed, continued, test, cancelled; attempts and safe error code only. The flow waits for delivery. Success means the destination accepted the request, not that a human read it. At most five automatic attempts with backoff; delivery is at least once. Sandbox records test actions and never calls destinations.\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"run-actions\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","const failed=(data.items||[]).find(item=>item.status==='failed');if(failed)save('actionId',failed.id);else pm.environment.unset('actionId');","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Retry failed action","request":{"method":"POST","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/actions/{{actionId}}/retry","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Explicitly retry a failed step while its run is waiting.\n\nRequester who owns the run or workspace manager required. The current active connection revision is accepted on retry. HTTP receivers should deduplicate by the stable action id in Idempotency-Key and payload.id. Email/Teams may duplicate after ambiguous network failures.\n\nRequired user permissions: Requester role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"retry-action\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Personal notifications","request":{"method":"GET","url":"{{baseUrl}}/v1/notifications","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read notifications addressed to your signed-in user.\n\nUser token and active organization membership required. Only own entries are returned; administrator status grants no access to someone else’s inbox. Integration keys cannot use this endpoint. Supports cursor pagination (50 entries). Notification data includes id, runId, nodeId, title, message, flowName, referenceId, createdAt and emailStatus. It contains no attachment content or private URLs.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"notifications\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Start a process","request":{"method":"POST","url":"{{baseUrl}}/v1/flow-runs","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Start an execution of a published version. Data must match the version’s field definitions.\n\nOptional documentIds contains ready reservations from the same starting identity and published flow version. Required fields, per-field counts, expiry and tenant are checked atomically. Each document can be bound to one run only. No document URL is included in run data.\n\nflowVersionId: published version UUID, not a flow ID. referenceId: your system reference, 1–128 characters, unique per published version in the workspace. data: scalar values keyed by field key; unknown fields are rejected. Use idempotency to prevent duplicate starts.\n\nOne successfully started process consumes one request, regardless of API calls or gate count. Free includes 25 per monthly usage period. Existing processes can still complete after the start limit is reached.\n\nApproval nodes can use assignment=requester_manager with groupId=null. An integration with runs:start may pass requesterPersonId (directory person ID). The direct manager must have active user access; missing assignments return 409 MANAGER_UNAVAILABLE. The recipient is frozen when the step activates.\n\nReturns a receipt with data={} and an empty referenceId, including retries. Only assigned approvers/reviewers can subsequently retrieve submitted content.\n\nRequired user permissions: Requester role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"flowVersionId\": \"{{flowVersionId}}\",\n  \"referenceId\": \"deployment-example-001\",\n  \"data\": {\n    \"environment\": \"production\"\n  }\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"start-run\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","const ids=pm.environment.get('documentIds');if(ids){try{data.documentIds=JSON.parse(ids);}catch{stop('documentIds must be a JSON array of confirmed document IDs.');}}const runData=pm.environment.get('runData');if(runData){try{data.data=JSON.parse(runData);}catch{stop('runData must contain a JSON object matching the published flow fields.');}if(!data.data||Array.isArray(data.data)||typeof data.data!=='object')stop('runData must contain a JSON object.');}","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","save('runId',data.id);const pending=(data.gates||[]).find(g=>g.status==='pending');if(pending)save('taskId',pending.id);else pm.environment.unset('taskId');","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"List executions","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List executions. Optional query: status=waiting|approved|rejected|completed|expired and cursor=<nextCursor>.\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"list-runs\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Retrieve an execution","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read execution state, submitted data and gate tasks.\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"get-run\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","save('runId',data.id);const pending=(data.gates||[]).find(g=>g.status==='pending');if(pending)save('taskId',pending.id);else pm.environment.unset('taskId');","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Execution overview","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/overview","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Retrieve the run, published flow metadata, history and v2 definition together.\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"run-overview\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Audit history","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/history","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read ordered audit events for an execution.\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"history\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Approval inbox","request":{"method":"GET","url":"{{baseUrl}}/v1/approvals","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List pending tasks the signed-in person may decide. Integration keys cannot access the inbox.\n\nGET /v1/gate-tasks also lists permitted tasks. GET /v1/approvals includes both approvals and acknowledgments; filter with kind=approval|acknowledgment before cursor pagination. The signed-in Flowg8 user needs the gate’s assigned approval group. A directory person profile alone grants no approval permission.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"approvals\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Record a decision","request":{"method":"POST","url":"{{baseUrl}}/v1/gate-tasks/{{taskId}}/decisions","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Approve or reject a pending gate as its authorized person. The decision follows the gate’s approved or rejected route. Legacy flows end on rejection.\n\nFLOWG8_ACCESS_TOKEN for a user with the gate’s assigned group required. Only the current pending gate can be decided. outcome: approved|rejected for approval; acknowledged for acknowledgment; optional comment up to 2,000 characters.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"outcome\": \"approved\",\n  \"comment\": \"Deployment window confirmed.\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"decide\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","save('runId',data.id);const pending=(data.gates||[]).find(g=>g.status==='pending');if(pending)save('taskId',pending.id);else pm.environment.unset('taskId');","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Approval groups","request":{"method":"GET","url":"{{baseUrl}}/v1/approval-groups","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read organization approval teams and your current decision permissions.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"groups\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create an approval group","request":{"method":"POST","url":"{{baseUrl}}/v1/approval-groups","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Create a named approval team and select people from the organization directory.\n\nAdministrator user token required; Sandbox developers may manage Sandbox groups. memberIds are person IDs from GET /v1/organization/directory in the same organization/environment. Pending invitation profiles may be selected; decisions require a linked active user and active organization membership. Empty groups are allowed for preparation. Use the stable group ID in approval nodes. Requires Idempotency-Key.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Operations\",\n  \"memberIds\": [\n    \"{{personId}}\"\n  ]\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"link-group\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","save('groupId',data.id);save('groupRevision',data.revision);","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Update an approval group","request":{"method":"PUT","url":"{{baseUrl}}/v1/approval-groups/{{groupId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Rename a group or replace its member selection with revision protection.\n\nUse the latest revision and an Idempotency-Key. Member changes take effect on the next permission check, including gates already waiting. Removing a member does not undo an earlier decision. Group IDs and published flow definitions stay fixed. Integration keys cannot administer approval permissions. needsMemberReview signals a pre-existing assignment: saving replaces it with exactly the selected people.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Operations\",\n  \"memberIds\": [\n    \"10000000-0000-4000-8000-000000000006\"\n  ],\n  \"revision\": \"{{groupRevision}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"update-group\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","const revision=Number(pm.environment.get('groupRevision'));if(!Number.isInteger(revision)||revision<1)stop('Retrieve the current approval group revision first.');data.revision=revision;","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","save('groupId',data.id);save('groupRevision',data.revision);","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]}]},{"name":"Flows","item":[{"name":"Edit a flow with AI","request":{"method":"POST","url":"{{baseUrl}}/v1/ai/flow-edits","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Describe an incremental change to the current schema v2 draft.\n\nAdministrator or Sandbox developer with a user access token required; integration keys are excluded. Pass the current definition and optional selection {nodeId,output:next|yes|no|rejectedNext|null}. A blank two-node flow anchors after the trigger. Select a branch for multi-output steps; ambiguous placement returns questions and definition:null. Enter submits in the designer; Shift+Enter adds a line. The search icon retains node finding.\n\nReturns merged definition, summary, questions, assumptions, unresolvedGroups, model and changes {added,updated,removed,fields,documents,connections}. The API generates a suggestion without saving or executing it. Applying an email trigger change in the designer saves the draft to allocate or revoke its address. No publication or process start occurs. Preserve local geometry and reject a response if the draft changed while waiting. The designer retains existing positions, places only new nodes and supports undo of up to ten consecutive AI edits. Manual semantic changes disable the previous AI undo; manual movement survives undo.\n\nOnly design context and group names are sent to the EU-verified provider. Existing fixed guest emails are redacted; recipient settings cannot be AI-updated. No execution data, memberships, document bytes or URLs are loaded. Unknown groups remain unresolved. The existing AI draft budget applies; 3,000 prompt characters, 128 KiB body, at most 12 added/12 updated nodes and 40 connections per response, 40 total nodes. Invalid/cyclic changes are rejected atomically. No Idempotency-Key is needed; retries consume another AI reservation.\n\nAI is disabled by default per organization and environment. An administrator must explicitly enable external AI processing under Organization → Privacy. Never include credentials or confidential personal information. Local keyword search remains available with smart=false.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"prompt\": \"Entscheidung mehr oder weniger als 500 Euro\",\n  \"locale\": \"de\",\n  \"name\": \"Synthetic flow\",\n  \"definition\": {\n    \"schemaVersion\": 2,\n    \"fields\": [],\n    \"nodes\": [\n      {\n        \"id\": \"start\",\n        \"type\": \"start\",\n        \"label\": \"Request received\",\n        \"next\": \"end\"\n      },\n      {\n        \"id\": \"end\",\n        \"type\": \"end\",\n        \"label\": \"Approved\",\n        \"outcome\": \"approved\"\n      }\n    ]\n  },\n  \"selection\": {\n    \"nodeId\": \"start\",\n    \"output\": \"next\"\n  }\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"edit-flow\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"List flows","request":{"method":"GET","url":"{{baseUrl}}/v1/flows","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List workspace flows. Pass the returned nextCursor as the optional cursor query until it is null.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"list-flows\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Retrieve a flow","request":{"method":"GET","url":"{{baseUrl}}/v1/flows/{{flowId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read its editable draft and immutable versions. Starting a process uses a published version ID.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"get-flow\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","save('flowId',data.id);save('draftRevision',data.draft&&data.draft.revision);save('flowVersionId',data.draft&&data.draft.publishedVersionId);","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create a flow","request":{"method":"POST","url":"{{baseUrl}}/v1/designer-flows","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Create a named designer document with typed fields and a node graph. This saves a draft and does not start a process.\n\nReplace the example groupId with an existing workspace approval group. Up to 30 fields (text, number, boolean, ISO date, select) and 40 nodes (start, condition, approval, end).\n\nConditions reference field keys with all/any and eq, neq, gt, gte, lt, lte or contains. Internal approval nodes reference groupId. External nodes use groupId:null and externalApprover:{source:\"email\",email:\"reviewer@example.com\"} or {source:\"field\",field:\"recipientEmail\",allowedDomains:[\"example.com\"]}. The referenced field must be required text/email. sharedFields lists the request fields disclosed externally (default []). Connect all outputs before publishing. Loops and unreachable nodes are rejected.\n\nApproval outputs: next selects the approved route; rejectedNext selects the rejected route. Connect both for new flows. Each may lead to a condition, another approval, or an end. Omitting rejectedNext preserves historical immediate rejection; null is an unconnected draft output and blocks publishing. Only gates on the actual decision path become pending.\n\nDefinition-only alternative: POST /v1/flows {name, definition}; POST /v1/flows/{flowId}/versions {definition}; POST /v1/flow-versions/{versionId}/publish {}. Both schema versions are supported.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Deployment approval\",\n  \"definition\": {\n    \"schemaVersion\": 2,\n    \"fields\": [\n      {\n        \"key\": \"environment\",\n        \"label\": \"Environment\",\n        \"type\": \"select\",\n        \"required\": true,\n        \"options\": [\n          \"staging\",\n          \"production\"\n        ],\n        \"min\": null,\n        \"max\": null\n      }\n    ],\n    \"nodes\": [\n      {\n        \"id\": \"start\",\n        \"type\": \"start\",\n        \"label\": \"Request received\",\n        \"next\": \"approval\"\n      },\n      {\n        \"id\": \"approval\",\n        \"type\": \"approval\",\n        \"label\": \"Operations approval\",\n        \"groupId\": \"{{groupId}}\",\n        \"next\": \"end\"\n      },\n      {\n        \"id\": \"end\",\n        \"type\": \"end\",\n        \"label\": \"Approved\",\n        \"outcome\": \"approved\"\n      }\n    ]\n  },\n  \"presentation\": {\n    \"names\": {\n      \"api\": \"Request\",\n      \"amount\": \"Condition\",\n      \"end\": \"Complete\"\n    },\n    \"description\": \"Operations approves a deployment.\",\n    \"positions\": {}\n  }\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-flow\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","save('flowId',data.id);save('draftRevision',data.draft&&data.draft.revision);save('flowVersionId',data.draft&&data.draft.publishedVersionId);","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Update a draft","request":{"method":"POST","url":"{{baseUrl}}/v1/flows/{{flowId}}/draft","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Save the full designer document with its current revision. Stale writes return 409.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"revision\": 1,\n  \"document\": {\n    \"name\": \"Deployment approval\",\n    \"definition\": {\n      \"schemaVersion\": 2,\n      \"fields\": [\n        {\n          \"key\": \"environment\",\n          \"label\": \"Environment\",\n          \"type\": \"select\",\n          \"required\": true,\n          \"options\": [\n            \"staging\",\n            \"production\"\n          ],\n          \"min\": null,\n          \"max\": null\n        }\n      ],\n      \"nodes\": [\n        {\n          \"id\": \"start\",\n          \"type\": \"start\",\n          \"label\": \"Request received\",\n          \"next\": \"approval\"\n        },\n        {\n          \"id\": \"approval\",\n          \"type\": \"approval\",\n          \"label\": \"Operations approval\",\n          \"groupId\": \"{{groupId}}\",\n          \"next\": \"end\"\n        },\n        {\n          \"id\": \"end\",\n          \"type\": \"end\",\n          \"label\": \"Approved\",\n          \"outcome\": \"approved\"\n        }\n      ]\n    },\n    \"presentation\": {\n      \"names\": {\n        \"api\": \"Request\",\n        \"amount\": \"Condition\",\n        \"end\": \"Complete\"\n      },\n      \"description\": \"Operations approves a deployment.\",\n      \"positions\": {}\n    }\n  }\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"save-draft\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","const revision=Number(pm.environment.get('draftRevision'));if(!Number.isInteger(revision)||revision<1)stop('Retrieve the current flow draft revision first.');data.revision=revision;","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","save('flowId',data.id);save('draftRevision',data.draft&&data.draft.revision);save('flowVersionId',data.draft&&data.draft.publishedVersionId);","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Publish a flow","request":{"method":"POST","url":"{{baseUrl}}/v1/flows/{{flowId}}/publish","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Publish the saved draft revision. Existing executions keep their original version.\n\nUse draft.publishedVersionId for new runs. Live publication requires a complete business profile and explicit activation; otherwise 409 ORGANIZATION_NOT_LIVE. Both publication APIs enforce this rule. Sandbox publication stays available. Publishing consumes no process quota and starts no execution.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"revision\": 1\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"publish-flow\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","const revision=Number(pm.environment.get('draftRevision'));if(!Number.isInteger(revision)||revision<1)stop('Retrieve the current flow draft revision first.');data.revision=revision;","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","save('flowId',data.id);save('draftRevision',data.draft&&data.draft.revision);save('flowVersionId',data.draft&&data.draft.publishedVersionId);","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]}]},{"name":"Documents","item":[{"name":"Reserve a document upload","request":{"method":"POST","url":"{{baseUrl}}/v1/documents/uploads","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Request a five-minute upload capability for one immutable file.\n\nRequires runs:start or requester access and Idempotency-Key. Flow version must be published and document field/type/size configured. PUT the actual file bytes to upload.url, sending every upload.headers value exactly. Do not send your Flowg8 token to S3. Upload capability does not grant read access. SHA-256 is lowercase hexadecimal over the exact file bytes; S3 validates the signed checksum and a conditional write prevents overwrites. Retrying the same reservation may refresh its transient upload URL.\n\nRequired user permissions: Requester role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"flowVersionId\": \"{{flowVersionId}}\",\n  \"fieldKey\": \"contract\",\n  \"fileName\": \"contract.pdf\",\n  \"contentType\": \"application/pdf\",\n  \"size\": 1234,\n  \"sha256\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"document-upload\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","save('documentId',data.document&&data.document.id);","","","","","","}else{","","}","}());"]}}]},{"name":"Confirm document upload","request":{"method":"POST","url":"{{baseUrl}}/v1/documents/{{documentId}}/confirm","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Verify size, checksum, object version and a successful malware scan.\n\nOnly the same uploading identity can confirm. Requires runs:start or requester access and Idempotency-Key. 409 DOCUMENT_SCAN_PENDING: retry the same confirmation after a short delay. 422 DOCUMENT_SCAN_REJECTED: do not attach the file; choose another. Only a ready document can start a run. Failed checks never grant read access. The exact S3 version is pinned at confirmation.\n\nRequired user permissions: Requester role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"document-confirm\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","save('documentId',data.id);","","","","","","","}else{","","}","}());"]}}]},{"name":"Attach external document link","request":{"method":"POST","url":"{{baseUrl}}/v1/documents/links","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: Requester role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"flowVersionId\": \"{{flowVersionId}}\",\n  \"fieldKey\": \"contract\",\n  \"fileName\": \"contract.pdf\",\n  \"contentType\": \"application/pdf\",\n  \"url\": \"https://documents.example.com/contracts/123/versions/1\",\n  \"version\": \"1\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"document-link\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","save('documentId',data.id);","","","","","","","}else{","","}","}());"]}}]},{"name":"Read incoming email","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/email","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read the complete private message and attachment metadata as an assigned approver.\n\nReturns sender, recipient, complete subject and plain text, textOrigin (plain or html), receivedAt, expiresAt and attachment metadata. Private no-store response. Assigned active approval group required; blocked/future tasks, administrators without assignment, requesters, service keys, other tenants and expired runs are denied. Message content is never copied to general run.data, history or webhook payloads. GET run/document APIs do not grant email access. SDK: getRunEmail(runId).\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"received-email\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Read shared incoming email","request":{"method":"POST","url":"{{baseUrl}}/v1/external-approvals/email","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"token\": \"{{FLOWG8_APPROVAL_TOKEN}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"external-received-email\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","if(!pm.environment.get('FLOWG8_APPROVAL_TOKEN'))stop('Set FLOWG8_APPROVAL_TOKEN locally from the approval email fragment. Keep it private.');","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"List review documents","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/documents","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Read document metadata for an execution you may approve.\n\nAssigned approver user tokens only; runs:read keys, administrators and requesters without a matching activated approval gate receive 403. No upload URLs, storage keys or external URLs in this response. Empty list means no available documents.\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"document-list\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Open a review document","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/documents/{{documentId}}/content","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Stream the pinned document after a fresh approval permission check.\n\nAssigned approver user tokens only. S3 source: binary response with Content-Type/Content-Disposition, no redirect or signed download URL. External source: JSON {kind:\"external\",url:\"https://…\"}; open with no referrer. Every access is private/no-store and audited by document ID. Downloaded bytes cannot be remotely revoked; keep them confidential.\n\nOnly active signed-in members of an assigned approval or acknowledgment group with a pending or completed task can read private content. Blocked/cancelled tasks, unassigned administrators, requesters and all API keys grant no content access. Current membership is checked on every request and replay. Lists and cursors obey the same boundary. New Live executions retain evidence for three calendar months on Free or twelve on paid plans after final completion; open Live executions do not expire by age. Existing longer deadlines remain protected. Sandbox content expires after 30 days from creation.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"document-content\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"External review documents","request":{"method":"POST","url":"{{baseUrl}}/v1/external-approvals/documents","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"token\": \"{{FLOWG8_APPROVAL_TOKEN}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"external-document-list\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","if(!pm.environment.get('FLOWG8_APPROVAL_TOKEN'))stop('Set FLOWG8_APPROVAL_TOKEN locally from the approval email fragment. Keep it private.');","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Open external review document","request":{"method":"POST","url":"{{baseUrl}}/v1/external-approvals/documents/{{documentId}}/content","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"token\": \"{{FLOWG8_APPROVAL_TOKEN}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"external-document-content\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","if(!pm.environment.get('FLOWG8_APPROVAL_TOKEN'))stop('Set FLOWG8_APPROVAL_TOKEN locally from the approval email fragment. Keep it private.');","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]}]},{"name":"Developer tools","item":[{"name":"Workflow webhooks","request":{"method":"GET","url":"{{baseUrl}}/v1/webhook-endpoints","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Receive selected workflow lifecycle events at your signed HTTPS endpoint.\n\nManage destinations in Organization → Webhooks using an administrator user token (Sandbox developers may manage their Sandbox). Configuration and secrets are separate per environment. Sandbox destinations make real HTTPS requests to your test receiver. Integration API keys cannot manage webhook destinations.\n\nEvents: run.started, gate.activated, gate.approved, gate.rejected, acknowledgment.requested, acknowledgment.completed, notification.created, notification.delivered, notification.failed, run.approved, run.rejected, run.completed, run.expired. Each payload has id, type, apiVersion, createdAt, sequence, organizationId, environment and data.run/data.gate/data.notification/data.outcome. The run includes id, referenceId, flowId and flowVersionId. Request fields and comments are not embedded; fetch details using the run API.\n\nVerify Flowg8-Signature: t=<Unix seconds>,v1=<HMAC-SHA256 hex> over timestamp + \".\" + the unchanged raw HTTP body, using your fg_whsec_ secret. The SDK exports verifyWebhookSignature(rawBody, header, secret), enforcing a five-minute timestamp tolerance. A retry uses a fresh signature timestamp but the same event ID and payload. Deduplicate by event.id, accept out-of-order events, return 2xx promptly and process asynchronously.\n\nDelivery is at least once, with up to ten automatic attempts within 72 hours. HTTPS/public destinations on port 443 only; private addresses and redirects are rejected. Delivery history is retained for up to 30 days, bounded by Sandbox data retention. Pausing prevents new messages and pauses queued messages; changing URL cancels pending deliveries rather than redirecting old events.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"webhooks\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create webhook destination","request":{"method":"POST","url":"{{baseUrl}}/v1/webhook-endpoints","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Select a public destination and lifecycle events; receive its signing secret.\n\nRequires an Idempotency-Key. The signing secret is returned only on creation or rotation, including a safe replay of that exact command. Keep it on your server; it is not an API access token. No real message is sent until a subscribed workflow event occurs.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"ERP approvals\",\n  \"url\": \"https://api.example.com/webhooks/flowg8\",\n  \"events\": [\n    \"gate.activated\",\n    \"gate.approved\",\n    \"gate.rejected\",\n    \"run.approved\",\n    \"run.rejected\"\n  ],\n  \"active\": true\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-webhook\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","save('endpointId',data.endpoint&&data.endpoint.id);save('endpointRevision',data.endpoint&&data.endpoint.revision);save('FLOWG8_WEBHOOK_SECRET',data.signingSecret);","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Edit webhook destination","request":{"method":"PUT","url":"{{baseUrl}}/v1/webhook-endpoints/{{endpointId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Change the destination, event selection or enabled state with revision protection.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"ERP approvals\",\n  \"url\": \"https://api.example.com/webhooks/flowg8\",\n  \"events\": [\n    \"run.approved\",\n    \"run.rejected\"\n  ],\n  \"active\": true,\n  \"revision\": \"{{endpointRevision}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"update-webhook\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","const revision=Number(pm.environment.get('endpointRevision'));if(!Number.isInteger(revision)||revision<1)stop('Retrieve the current webhook endpoint revision first.');data.revision=revision;","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","save('endpointId',data.id);save('endpointRevision',data.revision);","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Rotate signing secret","request":{"method":"POST","url":"{{baseUrl}}/v1/webhook-endpoints/{{endpointId}}/rotate-secret","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Generate a new secret; the old secret stops being used immediately.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"revision\": \"{{endpointRevision}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"rotate-webhook-secret\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","const revision=Number(pm.environment.get('endpointRevision'));if(!Number.isInteger(revision)||revision<1)stop('Retrieve the current webhook endpoint revision first.');data.revision=revision;","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","save('endpointId',data.endpoint&&data.endpoint.id);save('endpointRevision',data.endpoint&&data.endpoint.revision);save('FLOWG8_WEBHOOK_SECRET',data.signingSecret);","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Webhook delivery history","request":{"method":"GET","url":"{{baseUrl}}/v1/webhook-endpoints/{{endpointId}}/deliveries","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Inspect the latest 50 deliveries, attempts and HTTP status codes.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"webhook-deliveries\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","const failed=(data.items||[]).find(item=>item.status==='failed');if(failed)save('deliveryId',failed.id);else pm.environment.unset('deliveryId');","","","","","","","","}else{","","}","}());"]}}]},{"name":"Retry a failed delivery","request":{"method":"POST","url":"{{baseUrl}}/v1/webhook-deliveries/{{deliveryId}}/retry","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Queue a failed message again within its original retry window, keeping its event ID.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"retry-webhook-delivery\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"API keys","request":{"method":"GET","url":"{{baseUrl}}/v1/api-keys","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List key metadata as a signed-in administrator. Listing never returns secrets.\n\nScopes: flows:read, flows:write, runs:read, runs:start, organization:read, organization:write. Write also includes read for the same resource. A start-only key cannot read flows or runs without additional scopes.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"api-keys\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create an API key","request":{"method":"POST","url":"{{baseUrl}}/v1/api-keys","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Create a restricted server credential with an expiry or an explicit service-account exception. Store the secret from the first response securely.\n\nExpiry: 1–365 days, default 30. Set expiresInDays to null only with an active serviceAccountId to issue a key without expiration. Such keys remain valid until revoked; restrict their permissions and replace them regularly. Maximum 200 records per workspace including revoked keys. Secrets are never replayed. Revoke and replace lost keys.\n\nSet serviceAccountId for organization-owned keys. Every requested scope must fit the active account permission ceiling; users:invite always requires a service account. Secrets are shown once. Create a second key and revoke the first for rotation.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"Deployment integration\",\n  \"scopes\": [\n    \"runs:start\",\n    \"runs:read\",\n    \"flows:read\"\n  ],\n  \"expiresInDays\": 30,\n  \"serviceAccountId\": \"{{serviceAccountId}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-key\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","save('keyId',data.key&&data.key.id);if(data.secret)save('FLOWG8_API_KEY',data.secret);","","","}else{","","}","}());"]}}]},{"name":"Revoke an API key","request":{"method":"POST","url":"{{baseUrl}}/v1/api-keys/{{keyId}}/revoke","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Revoke a key as an administrator. Subsequent calls using it are rejected.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"revoke-key\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","pm.environment.set('FLOWG8_API_KEY','');","","}else{","","}","}());"]}}]},{"name":"Generate a draft with AI","request":{"method":"POST","url":"{{baseUrl}}/v1/ai/flow-suggestions","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Suggest a validated document. An administrator must review and save it explicitly.\n\nDeutschlandGPT uses a verified EU-hosted configured model. Supports approval, acknowledgment, notification, document fields and approved/rejected/completed ends. This does not publish or execute anything.\n\nAI is disabled by default per organization and environment. An administrator must explicitly enable external AI processing under Organization → Privacy. Never include credentials or confidential personal information. Local keyword search remains available with smart=false.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"prompt\": \"Operations approves every production deployment. Ask for environment and release version.\",\n  \"locale\": \"en\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"generate-flow\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Search flows","request":{"method":"POST","url":"{{baseUrl}}/v1/flows/search","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Find flows by keywords or optional AI query expansion.\n\nIf AI is unavailable or limited, search falls back to keywords and returns degraded: true. Keys use GET /v1/flows instead.\n\nAI is disabled by default per organization and environment. An administrator must explicitly enable external AI processing under Organization → Privacy. Never include credentials or confidential personal information. Local keyword search remains available with smart=false.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"query\": \"production deployment approval\",\n  \"smart\": true\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"search-flows\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Ask the docs","request":{"method":"POST","url":"{{baseUrl}}/v1/ai/docs-questions","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Ask implementation questions grounded in this reference. Sign in to use the assistant.\n\nOnly your question and public docs go to DeutschlandGPT. No workspace records, session tokens or API keys are supplied as context. Never include secrets or personal data. Known credential formats are blocked before sending. Answers are suggestions with sources, not executed commands.\n\nAI is disabled by default per organization and environment. An administrator must explicitly enable external AI processing under Organization → Privacy. Never include credentials or confidential personal information. Local keyword search remains available with smart=false.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"question\": \"How do I start a published flow safely?\",\n  \"topic\": \"start-run\",\n  \"locale\": \"en\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"ask-docs\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Service accounts","request":{"method":"GET","url":"{{baseUrl}}/v1/service-accounts","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"List organization-owned integration identities in the selected environment.\n\nLive administrators manage Live accounts. Administrators and explicitly granted Sandbox developers manage Sandbox accounts. Service keys cannot manage accounts, grant access, create keys or approve gates. An account belongs to exactly one workspace and environment.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"service-accounts\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create a service account","request":{"method":"POST","url":"{{baseUrl}}/v1/service-accounts","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Create an integration identity with an explicit permission ceiling.\n\nCreate the account with a user token, then issue API keys with serviceAccountId using Create an API key. Account creation returns metadata, never a credential. Each key may request a subset of the normalized account scopes. flows:write includes flows:read; organization:write includes organization:read. Up to 100 accounts per workspace.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"ERP onboarding\",\n  \"scopes\": [\n    \"users:invite\"\n  ]\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-service-account\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","save('serviceAccountId',data.id);save('serviceAccountRevision',data.revision);","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Update a service account","request":{"method":"PUT","url":"{{baseUrl}}/v1/service-accounts/{{serviceAccountId}}","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Rename, restrict, disable or re-enable an integration identity.\n\nSend the current revision. Disabling an account invalidates every attached key on subsequent requests. Reducing its scopes invalidates keys exceeding the new ceiling. Re-enabling or widening permissions can make non-revoked, unexpired keys usable again. Explicitly revoke individual keys to prevent reuse. Creator membership is audit metadata: service keys continue when the human creator leaves. Legacy keys without serviceAccountId retain their creator-bound behavior.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"name\": \"ERP onboarding\",\n  \"scopes\": [\n    \"users:invite\"\n  ],\n  \"active\": false,\n  \"revision\": \"{{serviceAccountRevision}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"update-service-account\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","const revision=Number(pm.environment.get('serviceAccountRevision'));if(!Number.isInteger(revision)||revision<1)stop('Retrieve the current service account revision first.');data.revision=revision;","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","save('serviceAccountId',data.id);save('serviceAccountRevision',data.revision);","","","","","","","","","","","","}else{","","}","}());"]}}]}]},{"name":"External approvals","item":[{"name":"Review an external approval","request":{"method":"POST","url":"{{baseUrl}}/v1/external-approvals/resolve","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"token\": \"{{FLOWG8_APPROVAL_TOKEN}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"external-resolve\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","if(!pm.environment.get('FLOWG8_APPROVAL_TOKEN'))stop('Set FLOWG8_APPROVAL_TOKEN locally from the approval email fragment. Keep it private.');","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Record an external decision","request":{"method":"POST","url":"{{baseUrl}}/v1/external-approvals/decisions","auth":{"type":"noauth"},"header":[{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{\n  \"token\": \"{{FLOWG8_APPROVAL_TOKEN}}\",\n  \"outcome\": \"approved\",\n  \"comment\": \"Reviewed.\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"external-decide\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","if(!pm.environment.get('FLOWG8_APPROVAL_TOKEN'))stop('Set FLOWG8_APPROVAL_TOKEN locally from the approval email fragment. Keep it private.');","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"External delivery status","request":{"method":"GET","url":"{{baseUrl}}/v1/flow-runs/{{runId}}/external-approvals","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: Matching approval group required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"external-status\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Send a new approval link","request":{"method":"POST","url":"{{baseUrl}}/v1/gate-tasks/{{taskId}}/external-approval/resend","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"},{"key":"Idempotency-Key","value":"{{requestIdempotencyKey}}"},{"key":"Content-Type","value":"application/json"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request.\n\nA new idempotency key is generated for each Send. To retry an uncertain request, copy LAST_IDEMPOTENCY_KEY into IDEMPOTENCY_KEY and send identical input. Clear IDEMPOTENCY_KEY before a different operation.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"external-resend\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","","const retryKey=pm.environment.get('IDEMPOTENCY_KEY')||pm.variables.replaceIn('{{$guid}}');pm.variables.set('requestIdempotencyKey',retryKey);pm.environment.set('LAST_IDEMPOTENCY_KEY',retryKey);","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Sandbox test mailbox","request":{"method":"GET","url":"{{baseUrl}}/v1/sandbox/mailbox","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Disabled: authenticated accounts assigned to the active approval or reviewer group are required.\n\nThis compatibility endpoint denies content access and decisions. Existing guest links cannot authorize access. Assign an internal group and upload files to private storage instead.\n\nRequired user permissions: Administrator or Sandbox developer required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"sandbox-mailbox\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]}]},{"name":"Get started","item":[{"name":"Get an access token","request":{"method":"POST","url":"{{baseUrl}}/v1/auth/token","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Sign in through the API without opening the web application.\n\nSend your Flowg8 email and password privately over HTTPS. No AWS account, client ID, client secret, API key or prior browser session is required. This is the Flowg8 JSON sign-in API, not an OAuth password-grant endpoint. Never paste passwords or returned tokens into LLM prompts, logs or source control.\n\nWhen status=authenticated, use accessToken as FLOWG8_ACCESS_TOKEN in Authorization: Bearer. expiresAt and expiresIn describe its lifetime. Keep refreshToken on your backend for renewal; tokens grant only the authenticated user’s current organization permissions. Resolve your organization with POST /v1/workspace {}, then send its ID in X-Organization-Id. A Live administrator can invite users including admins; a users:invite service key can invite ordinary members only.\n\nA temporary password or MFA returns status=challenge_required with challenge and a short-lived opaque challengeToken. Complete POST /v1/auth/challenge before any access token is issued. Invalid credentials return 401, required email verification/password recovery 409, throttling 429. Per-instance protection allows 20 token/challenge requests per IP per minute; do not retry login in a tight loop.\n\nWorkspace access requires an enrolled authenticator. Complete /security in the browser first. Every API request validates the token online and refreshes group membership. Sign-out revokes all current Cognito sessions. API sign-in may return a standard MFA challenge.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"grantType\": \"password\",\n  \"email\": \"{{email}}\",\n  \"password\": \"{{password}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"obtain-token\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_REFRESH_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","if(!pm.environment.get('email'))stop('Set email locally in the selected environment.');","","if(!pm.environment.get('password'))stop('Set password locally in the selected environment.');","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","if(data.status==='authenticated'){"," save('FLOWG8_ACCESS_TOKEN',data.accessToken);save('FLOWG8_TOKEN_EXPIRES_AT',data.expiresAt);if(data.refreshToken)save('FLOWG8_REFRESH_TOKEN',data.refreshToken);"," pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');pm.environment.set('verificationCode','');","}else if(data.status==='challenge_required'){"," pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');save('FLOWG8_CHALLENGE_TOKEN',data.challengeToken);save('FLOWG8_CHALLENGE',data.challenge);","}","","","","","","","","","","","","","","","","","","","","","","}else{","pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');if(pm.response.code===401){pm.environment.set('FLOWG8_REFRESH_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');}","}","}());"]}}]},{"name":"Refresh an access token","request":{"method":"POST","url":"{{baseUrl}}/v1/auth/token","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Renew access without sending your password again.\n\nUse the refresh token returned by sign-in. No bearer token or organization header is required. Store any returned replacement refreshToken atomically; if none is returned, keep the previous one. Access-token expiry never extends organization membership or administrator rights. If renewal fails with 401, authenticate again. Flowg8 does not store these tokens.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"grantType\": \"refresh_token\",\n  \"refreshToken\": \"{{FLOWG8_REFRESH_TOKEN}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"refresh-token\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","if(!pm.environment.get('FLOWG8_REFRESH_TOKEN'))stop('Sign in first to obtain a refresh token.');","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","if(data.status==='authenticated'){"," save('FLOWG8_ACCESS_TOKEN',data.accessToken);save('FLOWG8_TOKEN_EXPIRES_AT',data.expiresAt);if(data.refreshToken)save('FLOWG8_REFRESH_TOKEN',data.refreshToken);"," pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');pm.environment.set('verificationCode','');","}else if(data.status==='challenge_required'){"," pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');save('FLOWG8_CHALLENGE_TOKEN',data.challengeToken);save('FLOWG8_CHALLENGE',data.challenge);","}","","","","","","","","","","","","","","","","","","","","","","}else{","pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');if(pm.response.code===401){pm.environment.set('FLOWG8_REFRESH_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');}","}","}());"]}}]},{"name":"Complete sign-in · New password","request":{"method":"POST","url":"{{baseUrl}}/v1/auth/challenge","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Complete the first-login password change or an MFA challenge through the API.\n\nCopy challengeToken from the last challenge_required response; it expires after 180 seconds. For NEW_PASSWORD_REQUIRED send newPassword (14+ characters, mixed case, number and symbol, no spaces). For SMS_MFA, SOFTWARE_TOKEN_MFA or EMAIL_OTP send code instead. Never send both. Continue if a further challenge is returned. No token is issued before all mandatory challenges succeed.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"challengeToken\": \"{{FLOWG8_CHALLENGE_TOKEN}}\",\n  \"newPassword\": \"{{newPassword}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"auth-challenge\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","if(!pm.environment.get('FLOWG8_CHALLENGE_TOKEN'))stop('No pending authentication challenge. Send Get an access token first.');","if(pm.environment.get('FLOWG8_CHALLENGE')!=='NEW_PASSWORD_REQUIRED')stop('This request is only for a first-login password change.');if(!pm.environment.get('newPassword'))stop('Set newPassword locally.');","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","if(data.status==='authenticated'){"," save('FLOWG8_ACCESS_TOKEN',data.accessToken);save('FLOWG8_TOKEN_EXPIRES_AT',data.expiresAt);if(data.refreshToken)save('FLOWG8_REFRESH_TOKEN',data.refreshToken);"," pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');pm.environment.set('verificationCode','');","}else if(data.status==='challenge_required'){"," pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');save('FLOWG8_CHALLENGE_TOKEN',data.challengeToken);save('FLOWG8_CHALLENGE',data.challenge);","}","","","","","","","","","","","","","","","","","","","","","","}else{","pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');if(pm.response.code===401){pm.environment.set('FLOWG8_REFRESH_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');}","}","}());"]}}]},{"name":"Complete sign-in · MFA code","request":{"method":"POST","url":"{{baseUrl}}/v1/auth/challenge","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Complete the first-login password change or an MFA challenge through the API.\n\nCopy challengeToken from the last challenge_required response; it expires after 180 seconds. For NEW_PASSWORD_REQUIRED send newPassword (14+ characters, mixed case, number and symbol, no spaces). For SMS_MFA, SOFTWARE_TOKEN_MFA or EMAIL_OTP send code instead. Never send both. Continue if a further challenge is returned. No token is issued before all mandatory challenges succeed.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"challengeToken\": \"{{FLOWG8_CHALLENGE_TOKEN}}\",\n  \"code\": \"{{verificationCode}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"auth-challenge\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","if(!pm.environment.get('FLOWG8_CHALLENGE_TOKEN'))stop('No pending authentication challenge. Send Get an access token first.');","if(!['SMS_MFA','SOFTWARE_TOKEN_MFA','EMAIL_OTP'].includes(pm.environment.get('FLOWG8_CHALLENGE')))stop('This request is only for an MFA challenge.');if(!pm.environment.get('verificationCode'))stop('Set verificationCode locally.');","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","if(data.status==='authenticated'){"," save('FLOWG8_ACCESS_TOKEN',data.accessToken);save('FLOWG8_TOKEN_EXPIRES_AT',data.expiresAt);if(data.refreshToken)save('FLOWG8_REFRESH_TOKEN',data.refreshToken);"," pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');pm.environment.set('verificationCode','');","}else if(data.status==='challenge_required'){"," pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');save('FLOWG8_CHALLENGE_TOKEN',data.challengeToken);save('FLOWG8_CHALLENGE',data.challenge);","}","","","","","","","","","","","","","","","","","","","","","","}else{","pm.environment.set('FLOWG8_ACCESS_TOKEN','');pm.environment.set('FLOWG8_TOKEN_EXPIRES_AT','');if(pm.response.code===401){pm.environment.set('FLOWG8_REFRESH_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE_TOKEN','');pm.environment.set('FLOWG8_CHALLENGE','');}","}","}());"]}}]},{"name":"Create an account","request":{"method":"POST","url":"{{baseUrl}}/v1/registration","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Register a Flowg8 account with your name, email and password.\n\nRegistration is closed in production before launch. Registration, confirmation and code resend return 403 REGISTRATION_DISABLED without creating accounts or sending mail.\n\nPublic account endpoint. Replace YOUR_NEW_PASSWORD privately with a password of at least 14 characters, uppercase/lowercase, a number and a symbol, without spaces. Never put passwords in logs or LLM prompts. No organization exists until email verification succeeds.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"displayName\": \"{{displayName}}\",\n  \"email\": \"{{email}}\",\n  \"password\": \"{{newPassword}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"register-account\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","if(!pm.environment.get('email'))stop('Set email locally in the selected environment.');","","","","","if(!pm.environment.get('newPassword')||!pm.environment.get('displayName'))stop('Set newPassword and displayName locally.');","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Verify email","request":{"method":"POST","url":"{{baseUrl}}/v1/registration/confirm","auth":{"type":"noauth"},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Verify the emailed code and initialize your organization automatically.\n\nRegistration is closed in production before launch. Registration, confirmation and code resend return 403 REGISTRATION_DISABLED without creating accounts or sending mail.\n\nAfter a valid code, Flowg8 creates one Live organization, one Sandbox and the founder profile in both environments. The founder receives administrator and requester access. Sign in to retrieve organization IDs through POST /v1/workspace. A failed initialization is repaired on the next authenticated login. POST /v1/registration/resend accepts {email} to request another code.\n\nRequired user permissions: No account role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{\n  \"email\": \"{{email}}\",\n  \"code\": \"{{verificationCode}}\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"confirm-account\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","if(!pm.environment.get('email'))stop('Set email locally in the selected environment.');","","","","","","if(!pm.environment.get('verificationCode'))stop('Set verificationCode locally.');","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","pm.environment.set('verificationCode','');","}else{","","}","}());"]}}]},{"name":"Your organization","request":{"method":"POST","url":"{{baseUrl}}/v1/workspace","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"Content-Type","value":"application/json"}],"description":"Resolve your organization after Flowg8 sign-in.\n\nUse FLOWG8_ACCESS_TOKEN issued by your normal Flowg8 sign-in. Flowg8 manages authentication; no separate identity-provider setup is required. Invitations are matched to the verified user identity and join the existing organization, without creating a personal one. Empty requests reuse the active organization. To switch, send {organizationId} for an active membership returned by GET /v1/workspaces. Removing membership prevents access.\n\nRequired user permissions: Flowg8 sign-in required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"workspace\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","save('liveOrganizationId',data.organization&&data.organization.id);"," if(pm.environment.get('mode')==='live')save('organizationId',data.organization&&data.organization.id);else pm.environment.unset('organizationId');","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Sandbox environments","request":{"method":"GET","url":"{{baseUrl}}/v1/sandbox","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{liveOrganizationId}}"}],"description":"Develop against isolated test data without affecting Live.\n\nUse your Live organization ID with GET /v1/sandbox to discover the Sandbox workspace ID. All normal endpoints use that returned workspace ID in X-Organization-Id. Both modes use the same API base URL. API keys cannot discover or create environments.\n\nSandbox flows, versions, executions, decisions, groups, directory profiles, keys, audit history, AI budgets and idempotency records are separate from Live. Nothing is copied automatically. Live keys start with fg_sk_; Sandbox keys start with fg_test_. Keys cannot cross environments, even when supplied with a foreign workspace ID.\n\nEach organization currently has one Sandbox. It includes 100 process starts per UTC calendar month, counted independently of the Live plan. Billing changes are only available in Live. Signed-in members retain their organizational permissions; removing their parent membership also removes Sandbox access and disables their Sandbox keys.\n\nSandbox policy: 100 successful starts per UTC calendar month, maximum 10 simultaneously open processes. Only starts that would wait for approval need an open slot. Open requests expire 7 days after creation (status expired; remaining gates cancelled). Process data is deleted 30 days after creation, including decisions, history and cached command responses. decisionExpiresAt and expiresAt expose fixed, non-extendable deadlines. Flow definitions, configuration and keys are retained. The Worker cleans in bounded batches every minute and at startup; expired data is inaccessible immediately even if cleanup is delayed.\n\nUsage counters and minimal idempotency tombstones contain no execution payload and survive deletion. Expired command replays return 410 RUN_DATA_EXPIRED and cannot recreate the execution. Replayed retained Sandbox commands return current execution state, not an obsolete waiting snapshot. Completing, expiring or deleting processes does not refund monthly usage. Concurrent starts enforce both limits atomically.\n\nUse synthetic data: Sandbox uses the real approval engine and approval groups. A Sandbox does not anonymize data or simulate every external service. Configured Sandbox lifecycle webhooks send real HTTPS requests to your test destination; approval emails stay in the test mailbox. AI remains a real DeutschlandGPT call subject to its normal limits.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"sandbox\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"liveOrganizationId\"))stop(\"Send Your organization first to discover the Live organization.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","save('sandboxOrganizationId',data.organization&&data.organization.id);if(pm.environment.get('mode')==='sandbox')save('organizationId',data.organization&&data.organization.id);","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Create a Sandbox","request":{"method":"POST","url":"{{baseUrl}}/v1/sandbox","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{liveOrganizationId}}"},{"key":"Content-Type","value":"application/json"}],"description":"Ensure the automatically created Sandbox exists. Repeated and concurrent requests return the same environment.\n\nSend the Live organization ID. No data is cloned and nested Sandboxes are rejected. Discover the returned environment.mode and environment.organizationId (the parent organization); organization.id is the isolated Sandbox workspace ID. This endpoint is naturally idempotent per organization and does not require Idempotency-Key.\n\nRequired user permissions: Administrator role required. API authorization is enforced on every request.","body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"create-sandbox\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey='';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"liveOrganizationId\"))stop(\"Send Your organization first to discover the Live organization.\");","","","","let data=JSON.parse(pm.request.body.raw);","function resolve(value){if(typeof value==='string')return pm.variables.replaceIn(value);if(Array.isArray(value))return value.map(resolve);if(value&&typeof value==='object')return Object.fromEntries(Object.entries(value).map(([k,v])=>[k,resolve(v)]));return value;}","data=resolve(data);","","","","","","","","","","","","","","","pm.request.body.update(JSON.stringify(data,null,2));","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","save('sandboxOrganizationId',data.organization&&data.organization.id);if(pm.environment.get('mode')==='sandbox')save('organizationId',data.organization&&data.organization.id);","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]},{"name":"Authentication","request":{"method":"GET","url":"{{baseUrl}}/v1/access","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{flowg8RequestToken}}","type":"string"}]},"header":[{"key":"X-Organization-Id","value":"{{organizationId}}"}],"description":"Use a restricted integration key on your server. Every workspace operation also requires X-Organization-Id.\n\nSend Authorization: Bearer $FLOWG8_API_KEY. Administrators create expiring keys under API keys. Secrets are shown once, stored only as SHA-256 hashes and cannot be recovered. Keep them on your server.\n\nUse POST /v1/auth/token to sign in without a browser, or use your normal Flowg8 web sign-in. Both issue FLOWG8_ACCESS_TOKEN. Flowg8 manages authentication; no separate identity-provider setup is required. Interactive actions use this access token, not an ID token. Key management, group linking, AI, billing, inbox and decisions require a signed-in Flowg8 user. Integration keys can never approve requests.\n\nKeys are workspace-bound, expire after 1–365 days and can be revoked for subsequent requests. Keys with serviceAccountId are organization-owned and stay valid when the creator leaves; disabling the service account invalidates all its keys. Legacy keys without serviceAccountId are invalidated when their creator membership is deactivated. Revoke keys explicitly during offboarding.\n\nWorkspace access requires an enrolled authenticator. Complete /security in the browser first. Every API request validates the token online and refreshes group membership. Sign-out revokes all current Cognito sessions. API sign-in may return a standard MFA challenge.\n\nRequired user permissions: Active workspace membership required. API authorization is enforced on every request."},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["(function(){","const topic=\"authentication\", mode=pm.environment.get('mode');","function stop(message){pm.execution.skipRequest();throw new Error(message);}","if(!['live','sandbox'].includes(mode))stop('Select the Flowg8 Live or Sandbox environment.');","const base=pm.environment.get('baseUrl')||'';","const local=['http://localhost','http://127.0.0.1'].some(origin=>base===origin||base.startsWith(origin+':')&&/^[0-9]+$/.test(base.slice(origin.length+1)));","if(!base.startsWith('https://')&&!local)stop('Use HTTPS, or an HTTP localhost API for local development.');","const apiKey=pm.environment.get('FLOWG8_API_KEY')||'';","if(apiKey&&!new RegExp(mode==='sandbox'?'^fg_test_[a-f0-9]{64}$':'^fg_sk_[a-f0-9]{64}$').test(apiKey))stop('The integration key does not match this environment.');","const credential=apiKey||pm.environment.get('FLOWG8_ACCESS_TOKEN');","if(!credential)stop('Send Get an access token first, or supply a compatible integration key for this operation.');","pm.variables.set('flowg8RequestToken',credential);","if(!pm.environment.get(\"organizationId\"))stop(\"Resolve the organization first; in Sandbox also send Sandbox environments. Do not use the Live ID for Sandbox requests.\");","}());"]}},{"listen":"test","script":{"type":"text/javascript","exec":["(function(){","pm.test('Successful response',()=>pm.expect(pm.response.code).to.be.within(200,299));","let data;try{data=pm.response.json();}catch{data=null;}","if(pm.response.code>=200&&pm.response.code<300&&data){"," const save=(key,value)=>{if(typeof value==='string'||typeof value==='number')pm.environment.set(key,String(value));};","","","","","","","","","","","","","","","","","","","","","","","}else{","","}","}());"]}}]}]}]}